@univerjscoreclassesRefalias

@univerjs/core v0.5.4


Class: RefAlias<T, K>

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:17

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 ParameterDefault type
T extends Record<string, unknown>-
K extends keyof Tkeyof T

Constructors

new RefAlias()

new RefAlias<T, K>(values, keys): RefAlias<T, K>

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:22

Parameters

ParameterType
valuesT[]
keysK[]

Returns

RefAlias<T, K>

Methods

_initKeyMap()

_initKeyMap(item): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:30

Parameters

ParameterType
itemT

Returns

void


addValue()

addValue(item): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:67

Parameters

ParameterType
itemT

Returns

void


clear()

clear(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:102

Returns

void


deleteValue()

deleteValue(key, keyGroup?): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:81

Parameters

ParameterType
keystring
keyGroup?K[]

Returns

void


getKeyMap()

getKeyMap(key): unknown[]

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:98

Parameters

ParameterType
keyK

Returns

unknown[]


getValue()

getValue(key, keyGroup?): undefined | null | T

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:46

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

ParameterType
keystring
keyGroup?K[]

Returns

undefined | null | T

Memberof

RefAlias


getValues()

getValues(): T[]

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:94

Returns

T[]


hasValue()

hasValue(key): boolean

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:57

Parameters

ParameterType
keystring

Returns

boolean


setValue()

setValue(
   key, 
   attr, 
   value): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/ref-alias.ts:72

Parameters

ParameterType
keystring
attrkeyof T
valueunknown

Returns

void