@univerjscoreclassesFuniver

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


Class: FUniver

FBase is a base class for all facade classes. It provides a way to extend classes with static and instance methods. The _initialize as a special method that will be called after the constructor. You should never call it directly.

Extends

Constructors

new FUniver()

new FUniver(
   _injector, 
   _commandService, 
   _univerInstanceService): FUniver

Parameters

ParameterType
_injectorInjector
_commandServiceICommandService
_univerInstanceServiceIUniverInstanceService

Returns

FUniver

Overrides

FBase.constructor

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:43

Properties

PropertyModifierTypeDefined in
_commandServicereadonlyICommandServicepackages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:45
_injectorreadonlyInjectorpackages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:44
_univerInstanceServicereadonlyIUniverInstanceServicepackages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:46

Methods

_initialize()

_initialize(): void

Returns

void

Inherited from

FBase._initialize

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-base.ts:33


disposeUnit()

disposeUnit(unitId): boolean

Dispose the UniverSheet by the unitId. The UniverSheet would be unload from the application.

Parameters

ParameterTypeDescription
unitIdstringThe unit id of the UniverSheet.

Returns

boolean

Whether the Univer instance is disposed successfully.

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:57


executeCommand()

executeCommand<P, R>(
   id, 
   params?, 
options?): Promise<R>

Execute a command with the given id and parameters.

Type Parameters

Type ParameterDefault type
P extends objectobject
Rboolean

Parameters

ParameterTypeDescription
idstringIdentifier of the command.
params?PParameters of this execution.
options?IExecutionOptionsOptions of this execution.

Returns

Promise<R>

The result of the execution. It is a boolean value by default which indicates the command is executed.

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:120


getCurrentLifecycleStage()

getCurrentLifecycleStage(): LifecycleStages

Get the current lifecycle stage.

Returns

LifecycleStages

  • The current lifecycle stage.

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:66


getHooks()

getHooks(): FHooks

Get hooks.

Returns

FHooks

FHooks instance

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:148


onBeforeCommandExecute()

onBeforeCommandExecute(callback): IDisposable

Register a callback that will be triggered before invoking a command.

Parameters

ParameterTypeDescription
callbackCommandListenerThe callback.

Returns

IDisposable

The disposable instance.

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:95


onCommandExecuted()

onCommandExecuted(callback): IDisposable

Register a callback that will be triggered when a command is invoked.

Parameters

ParameterTypeDescription
callbackCommandListenerThe callback.

Returns

IDisposable

The disposable instance.

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:107


redo()

redo(): Promise<boolean>

Redo an editing on the currently focused document.

Returns

Promise<boolean>

redo result

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:85


syncExecuteCommand()

syncExecuteCommand<P, R>(
   id, 
   params?, 
   options?): R

Execute a command with the given id and parameters synchronously.

Type Parameters

Type ParameterDefault type
P extends objectobject
Rboolean

Parameters

ParameterTypeDescription
idstringIdentifier of the command.
params?PParameters of this execution.
options?IExecutionOptionsOptions of this execution.

Returns

R

The result of the execution. It is a boolean value by default which indicates the command is executed.

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:135


undo()

undo(): Promise<boolean>

Undo an editing on the currently focused document.

Returns

Promise<boolean>

undo result

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:76


extend()

static extend(source): void

Parameters

ParameterType
sourceany

Returns

void

Inherited from

FBase.extend

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-base.ts:35


newAPI()

static newAPI(wrapped): FUniver

Create an FUniver instance, if the injector is not provided, it will create a new Univer instance.

Parameters

ParameterTypeDescription
wrappedInjector | UniverThe Univer instance or injector instance.

Returns

FUniver

  • The FUniver instance.

Static

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:38