@univerjscoreclassesRefalias

@univerjs/core v0.5.0-beta.1Docs


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

Constructors

new RefAlias()

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

Parameters

ParameterType
valuesT[]
keysK[]

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

ParameterType
itemT

Returns

void

Defined in

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


addValue()

addValue(item): void

Parameters

ParameterType
itemT

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

ParameterType
keystring
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

ParameterType
keyK

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

ParameterType
keystring
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

ParameterType
keystring

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

ParameterType
keystring
attrkeyof T
valueunknown

Returns

void

Defined in

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