API Reference
@univerjs
@univerjs/core
classes
Refalias

@univerjs/core v0.4.2Docs


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

submodules/univer/packages/core/src/shared/ref-alias.ts:22 (opens in a new tab)

Methods

_initKeyMap()

_initKeyMap(item): void

Parameters

ParameterType
itemT

Returns

void

Defined in

submodules/univer/packages/core/src/shared/ref-alias.ts:30 (opens in a new tab)


addValue()

addValue(item): void

Parameters

ParameterType
itemT

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

ParameterType
keystring

Returns

void

Defined in

submodules/univer/packages/core/src/shared/ref-alias.ts:81 (opens in a new tab)


getKeyMap()

getKeyMap(key): unknown[]

Parameters

ParameterType
keyK

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

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

ParameterType
keystring

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

ParameterType
keystring
attrkeyof T
valueunknown

Returns

void

Defined in

submodules/univer/packages/core/src/shared/ref-alias.ts:72 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.