@univerjs/core v0.5.0-beta.1 • Docs
Class: RefAlias<T, K>
Copyright 2023-present DreamNum Inc.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Type Parameters
Type Parameter | Default type |
---|---|
T extends Record <string , unknown > | - |
K extends keyof T | keyof T |
Constructors
new RefAlias()
new RefAlias<T, K>(values, keys): RefAlias<T, K>
Parameters
Parameter | Type |
---|---|
values | T [] |
keys | K [] |
Returns
RefAlias
<T
, K
>
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:22
Methods
_initKeyMap()
_initKeyMap(item): void
Parameters
Parameter | Type |
---|---|
item | T |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:30
addValue()
addValue(item): void
Parameters
Parameter | Type |
---|---|
item | T |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:67
clear()
clear(): void
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:102
deleteValue()
deleteValue(key, keyGroup?): void
Parameters
Parameter | Type |
---|---|
key | string |
keyGroup ? | K [] |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:81
getKeyMap()
getKeyMap(key): unknown[]
Parameters
Parameter | Type |
---|---|
key | K |
Returns
unknown
[]
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:98
getValue()
getValue(key, keyGroup?): undefined | null | T
If a key group is specified, the order of values is determined by the key group, otherwise it depends on the keys at initialization
Parameters
Parameter | Type |
---|---|
key | string |
keyGroup ? | K [] |
Returns
undefined
| null
| T
Memberof
RefAlias
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:46
getValues()
getValues(): T[]
Returns
T
[]
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:94
hasValue()
hasValue(key): boolean
Parameters
Parameter | Type |
---|---|
key | string |
Returns
boolean
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:57
setValue()
setValue(
key,
attr,
value): void
Parameters
Parameter | Type |
---|---|
key | string |
attr | keyof T |
value | unknown |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:72