@univerjs-pro/exchange-client v0.5.1 • Docs
Class: FUniverExchangeClientMixin
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
Implements
Constructors
new FUniverExchangeClientMixin()
new FUniverExchangeClientMixin(
_injector,
_commandService,
_univerInstanceService): FUniverExchangeClientMixin
Parameters
Parameter | Type |
---|---|
_injector | Injector |
_commandService | ICommandService |
_univerInstanceService | IUniverInstanceService |
Returns
Inherited from
Defined in
submodules/univer/packages/core/src/facade/f-univer.ts:43
Properties
Property | Modifier | Type | Inherited from | Defined in |
---|---|---|---|---|
_commandService | readonly | ICommandService | FUniver ._commandService | submodules/univer/packages/core/src/facade/f-univer.ts:45 |
_injector | readonly | Injector | FUniver ._injector | submodules/univer/packages/core/src/facade/f-univer.ts:44 |
_univerInstanceService | readonly | IUniverInstanceService | FUniver ._univerInstanceService | submodules/univer/packages/core/src/facade/f-univer.ts:46 |
Methods
_initialize()
_initialize(): void
Returns
void
Inherited from
Defined in
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
Parameter | Type | Description |
---|---|---|
unitId | string | The unit id of the UniverSheet. |
Returns
boolean
Whether the Univer instance is disposed successfully.
Inherited from
Defined in
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 Parameter | Default type |
---|---|
P extends object | object |
R | boolean |
Parameters
Parameter | Type | Description |
---|---|---|
id | string | Identifier of the command. |
params ? | P | Parameters of this execution. |
options ? | IExecutionOptions | Options of this execution. |
Returns
Promise
<R
>
The result of the execution. It is a boolean value by default which indicates the command is executed.
Inherited from
Defined in
submodules/univer/packages/core/src/facade/f-univer.ts:120
exportXLSXBySnapshot()
exportXLSXBySnapshot(snapshot): Promise<undefined | File>
Export XLSX file by workbook data
Parameters
Parameter | Type |
---|---|
snapshot | IWorkbookData |
Returns
Promise
<undefined
| File
>
Implementation of
IFUniverExchangeClientMixin
.exportXLSXBySnapshot
Overrides
FUniver.exportXLSXBySnapshot
Defined in
packages/exchange-client/src/facade/f-univer.ts:80
exportXLSXByUnitId()
exportXLSXByUnitId(unitId): Promise<undefined | File>
Export XLSX file by unit id
Parameters
Parameter | Type |
---|---|
unitId | string |
Returns
Promise
<undefined
| File
>
Implementation of
IFUniverExchangeClientMixin
.exportXLSXByUnitId
Overrides
FUniver.exportXLSXByUnitId
Defined in
packages/exchange-client/src/facade/f-univer.ts:69
getCurrentLifecycleStage()
getCurrentLifecycleStage(): LifecycleStages
Get the current lifecycle stage.
Returns
- The current lifecycle stage.
Inherited from
FUniver
.getCurrentLifecycleStage
Defined in
submodules/univer/packages/core/src/facade/f-univer.ts:66
getHooks()
getHooks(): FHooks
Get hooks.
Returns
FHooks instance
Inherited from
Defined in
submodules/univer/packages/core/src/facade/f-univer.ts:148
importDOCXToSnapshot()
importDOCXToSnapshot(file): Promise<undefined | IDocumentData>
Import DOCX file to document data
Parameters
Parameter | Type | Description |
---|---|---|
file | string | File | File path or file object |
Returns
Promise
<undefined
| IDocumentData
>
Implementation of
IFUniverExchangeClientMixin
.importDOCXToSnapshot
Overrides
FUniver.importDOCXToSnapshot
Defined in
packages/exchange-client/src/facade/f-univer.ts:104
importDOCXToUnitId()
importDOCXToUnitId(file): Promise<undefined | string>
Import DOCX file to unit id
Parameters
Parameter | Type | Description |
---|---|---|
file | string | File | File path or file object |
Returns
Promise
<undefined
| string
>
Implementation of
IFUniverExchangeClientMixin
.importDOCXToUnitId
Overrides
FUniver.importDOCXToUnitId
Defined in
packages/exchange-client/src/facade/f-univer.ts:92
importXLSXToSnapshot()
importXLSXToSnapshot(file): Promise<undefined | IWorkbookData>
Import XLSX file to workbook data
Parameters
Parameter | Type | Description |
---|---|---|
file | string | File | File path or file object |
Returns
Promise
<undefined
| IWorkbookData
>
Implementation of
IFUniverExchangeClientMixin
.importXLSXToSnapshot
Overrides
FUniver.importXLSXToSnapshot
Defined in
packages/exchange-client/src/facade/f-univer.ts:58
importXLSXToUnitId()
importXLSXToUnitId(file): Promise<undefined | string>
Import XLSX file to unit id
Parameters
Parameter | Type | Description |
---|---|---|
file | string | File | File path or file object |
Returns
Promise
<undefined
| string
>
Implementation of
IFUniverExchangeClientMixin
.importXLSXToUnitId
Overrides
FUniver.importXLSXToUnitId
Defined in
packages/exchange-client/src/facade/f-univer.ts:46
onBeforeCommandExecute()
onBeforeCommandExecute(callback): IDisposable
Register a callback that will be triggered before invoking a command.
Parameters
Parameter | Type | Description |
---|---|---|
callback | CommandListener | The callback. |
Returns
The disposable instance.
Inherited from
FUniver
.onBeforeCommandExecute
Defined in
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
Parameter | Type | Description |
---|---|---|
callback | CommandListener | The callback. |
Returns
The disposable instance.
Inherited from
Defined in
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
Inherited from
Defined in
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 Parameter | Default type |
---|---|
P extends object | object |
R | boolean |
Parameters
Parameter | Type | Description |
---|---|---|
id | string | Identifier of the command. |
params ? | P | Parameters of this execution. |
options ? | IExecutionOptions | Options of this execution. |
Returns
R
The result of the execution. It is a boolean value by default which indicates the command is executed.
Inherited from
Defined in
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
Inherited from
Defined in
submodules/univer/packages/core/src/facade/f-univer.ts:76
extend()
static extend(source): void
Parameters
Parameter | Type |
---|---|
source | any |
Returns
void
Inherited from
Defined in
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
Parameter | Type | Description |
---|---|---|
wrapped | Injector | Univer | The Univer instance or injector instance. |
Returns
- The FUniver instance.
Static
Inherited from
Defined in
submodules/univer/packages/core/src/facade/f-univer.ts:38