@univerjs/core v0.4.2 • 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
submodules/univer/packages/core/src/shared/ref-alias.ts:22 (opens in a new tab)
Methods
_initKeyMap()
_initKeyMap(item): void
Parameters
Parameter | Type |
---|---|
item | T |
Returns
void
Defined in
submodules/univer/packages/core/src/shared/ref-alias.ts:30 (opens in a new tab)
addValue()
addValue(item): void
Parameters
Parameter | Type |
---|---|
item | T |
Returns
void
Defined in
submodules/univer/packages/core/src/shared/ref-alias.ts:67 (opens in a new tab)
clear()
clear(): void
Returns
void
Defined in
submodules/univer/packages/core/src/shared/ref-alias.ts:102 (opens in a new tab)
deleteValue()
deleteValue(key): void
Parameters
Parameter | Type |
---|---|
key | string |
Returns
void
Defined in
submodules/univer/packages/core/src/shared/ref-alias.ts:81 (opens in a new tab)
getKeyMap()
getKeyMap(key): unknown[]
Parameters
Parameter | Type |
---|---|
key | K |
Returns
unknown
[]
Defined in
submodules/univer/packages/core/src/shared/ref-alias.ts:98 (opens in a new tab)
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
submodules/univer/packages/core/src/shared/ref-alias.ts:46 (opens in a new tab)
getValues()
getValues(): T[]
Returns
T
[]
Defined in
submodules/univer/packages/core/src/shared/ref-alias.ts:94 (opens in a new tab)
hasValue()
hasValue(key): boolean
Parameters
Parameter | Type |
---|---|
key | string |
Returns
boolean
Defined in
submodules/univer/packages/core/src/shared/ref-alias.ts:57 (opens in a new tab)
setValue()
setValue(
key,
attr,
value): void
Parameters
Parameter | Type |
---|---|
key | string |
attr | keyof T |
value | unknown |
Returns
void
Defined in
submodules/univer/packages/core/src/shared/ref-alias.ts:72 (opens in a new tab)