API Reference
@univerjs
@univerjs/core
classes
Univer

@univerjs/core v0.4.2Docs


Class: Univer

Constructors

new Univer()

new Univer(config, parentInjector?): Univer

Create a Univer instance.

Parameters

ParameterTypeDescription
configPartial<IUniverConfig>Configuration data for Univer
parentInjector?InjectorAn optional parent injector of the Univer injector. For more information, see https://redi.wendell.fun/docs/hierarchy (opens in a new tab).

Returns

Univer

Defined in

submodules/univer/packages/core/src/univer.ts:83 (opens in a new tab)

Methods

__getInjector()

__getInjector(): Injector

Returns

Injector

Defined in

submodules/univer/packages/core/src/univer.ts:95 (opens in a new tab)


createUnit()

createUnit<T, U>(type, data): U

Type Parameters

Type Parameter
T
U extends UnitModel<object, number>

Parameters

ParameterType
typenumber
dataPartial<T>

Returns

U

Defined in

submodules/univer/packages/core/src/univer.ts:107 (opens in a new tab)


createUniverDoc()

createUniverDoc(data): DocumentDataModel

Parameters

ParameterType
dataPartial<IDocumentData>

Returns

DocumentDataModel

Deprecated

use createUnit instead

Defined in

submodules/univer/packages/core/src/univer.ts:124 (opens in a new tab)


createUniverSheet()

createUniverSheet(data): Workbook

Create a univer sheet instance with internal dependency injection.

Parameters

ParameterType
dataPartial<IWorkbookData>

Returns

Workbook

Deprecated

use createUnit instead

Defined in

submodules/univer/packages/core/src/univer.ts:116 (opens in a new tab)


createUniverSlide()

createUniverSlide(data): SlideDataModel

Parameters

ParameterType
dataPartial<ISlideData>

Returns

SlideDataModel

Deprecated

use createUnit instead

Defined in

submodules/univer/packages/core/src/univer.ts:132 (opens in a new tab)


dispose()

dispose(): void

Returns

void

Defined in

submodules/univer/packages/core/src/univer.ts:99 (opens in a new tab)


registerPlugin()

registerPlugin<T>(plugin, config?): void

Register a plugin into univer.

Type Parameters

Type Parameter
T extends PluginCtor<Plugin>

Parameters

ParameterType
pluginT
config?ConstructorParameters<T>[0]

Returns

void

Defined in

submodules/univer/packages/core/src/univer.ts:172 (opens in a new tab)


setLocale()

setLocale(locale): void

Parameters

ParameterType
localeLocaleType

Returns

void

Defined in

submodules/univer/packages/core/src/univer.ts:103 (opens in a new tab)


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