Class: FUniver
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:43
Extends
Extended by
FUniverDocsMixin
FUniverEngineFormulaMixin
FUniverSheetsMixin
FUniverCrosshairHighlightMixin
FUnvierDataValidationMixin
FUniverDrawingMixin
FUniverFindReplaceMixin
FUniverSheetsFormulaMixin
FUniverSheetsUIMixin
FUniverSheetsZenEditorMixin
FUniverUIMixin
FUniverWatermarkMixin
FUniverEngineFormulaMixin
FUniverExchangeClientMixin
FSheetUniver
Constructors
new FUniver()
new FUniver(
_injector,
_commandService,
_univerInstanceService,
_lifecycleService): FUniver
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:65
Parameters
Parameter | Type |
---|---|
_injector | Injector |
_commandService | ICommandService |
_univerInstanceService | IUniverInstanceService |
_lifecycleService | LifecycleService |
Returns
Overrides
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_commandService | readonly | ICommandService | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:67 |
_disposed | protected | boolean | false | FBaseInitialable ._disposed | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:96 |
_eventRegistry | protected | Map <string , Registry <(param ) => void >> | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:55 |
_injector | readonly | Injector | undefined | FBaseInitialable ._injector | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:66 |
_lifecycleService | readonly | LifecycleService | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:69 |
_univerInstanceService | readonly | IUniverInstanceService | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:68 |
Accessors
Enum
Get Signature
get Enum(): FEnum
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:281
Returns
Event
Get Signature
get Event(): FEventName
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:285
Returns
Util
Get Signature
get Util(): FUtil
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:289
Returns
Methods
_ensureEventRegistry()
protected _ensureEventRegistry(event): Registry<(param) => void>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:57
Parameters
Parameter | Type |
---|---|
event | string |
Returns
Registry
<(param
) => void
>
_eventListend()
protected _eventListend(key): undefined | Registry<(param) => void>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:180
Parameters
Parameter | Type |
---|---|
key | string |
Returns
undefined
| Registry
<(param
) => void
>
_initialize()
_initialize(injector): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-base.ts:66
Parameters
Parameter | Type |
---|---|
injector | Injector |
Returns
void
Inherited from
addEvent()
addEvent(event, callback): IDisposable
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:305
Add an event listener
Parameters
Parameter | Type | Description |
---|---|---|
event | keyof IEventParamConfig | key of event |
callback | (params ) => void | callback when event triggered |
Returns
The Disposable instance, for remove the listener
Example
univerAPI.addEvent(univerAPI.event.UnitCreated, (params) => {
console.log('unit created', params);
});
dispose()
dispose(): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:109
Returns
void
Inherited from
disposeUnit()
disposeUnit(unitId): boolean
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:189
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.
disposeWithMe()
disposeWithMe(disposable): IDisposable
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:99
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
FBaseInitialable
.disposeWithMe
ensureNotDisposed()
protected ensureNotDisposed(): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:103
Returns
void
Inherited from
FBaseInitialable
.ensureNotDisposed
executeCommand()
executeCommand<P, R>(
id,
params?,
options?): Promise<R>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:249
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.
fireEvent()
protected fireEvent<T>(event, params): undefined | boolean
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:320
Fire an event, used in internal only.
Type Parameters
Type Parameter |
---|
T extends keyof IEventParamConfig |
Parameters
Parameter | Type | Description |
---|---|---|
event | T | {string} key of event |
params | IEventParamConfig [T ] | {any} params of event |
Returns
undefined
| boolean
should cancel
Example
this.fireEvent(univerAPI.event.UnitCreated, params);
getCurrentLifecycleStage()
getCurrentLifecycleStage(): LifecycleStages
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:197
Get the current lifecycle stage.
Returns
- The current lifecycle stage.
getHooks()
getHooks(): FHooks
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:277
Get hooks.
Returns
FHooks instance
Deprecated
use addEvent
instead.
getUserManager()
getUserManager(): FUserManager
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:338
Returns
FUserManager
hasEventCallback()
protected hasEventCallback(event): boolean
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:333
Get the callback map corresponding to the event
Parameters
Parameter | Type |
---|---|
event | keyof IEventParamConfig |
Returns
boolean
The number of callbacks
newBlob()
newBlob(): FBlob
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:350
Create a new blob.
Returns
The new blob instance
Example
const blob = univerApi.newBlob();
newColor()
newColor(): ColorBuilder
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:362
Create a new color.
Returns
The new color instance
Example
const color = univerApi.newColor();
newParagraphStyle()
newParagraphStyle(style?): ParagraphStyleBuilder
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:401
Create a new paragraph style.
Parameters
Parameter | Type | Description |
---|---|---|
style ? | IParagraphStyle | The paragraph style |
Returns
The new paragraph style instance
Example
const paragraphStyle = univerApi.newParagraphStyle();
newParagraphStyleValue()
newParagraphStyleValue(style?): ParagraphStyleValue
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:414
Create a new paragraph style value.
Parameters
Parameter | Type | Description |
---|---|---|
style ? | IParagraphStyle | The paragraph style |
Returns
The new paragraph style value instance
Example
const paragraphStyleValue = univerApi.newParagraphStyleValue();
newRichText()
newRichText(data?): RichTextBuilder
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:375
Create a new rich text.
Parameters
Parameter | Type |
---|---|
data ? | IDocumentData |
Returns
The new rich text instance
Example
const richText = univerApi.newRichText();
newRichTextValue()
newRichTextValue(data): RichTextValue
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:388
Create a new rich text value.
Parameters
Parameter | Type | Description |
---|---|---|
data | IDocumentData | The rich text data |
Returns
The new rich text value instance
Example
const richTextValue = univerApi.newRichTextValue();
newTextDecoration()
newTextDecoration(decoration?): TextDecorationBuilder
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:444
Parameters
Parameter | Type |
---|---|
decoration ? | ITextDecoration |
Returns
newTextStyle()
newTextStyle(style?): TextStyleBuilder
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:427
Create a new text style.
Parameters
Parameter | Type | Description |
---|---|---|
style ? | ITextStyle | The text style |
Returns
The new text style instance
Example
const textStyle = univerApi.newTextStyle();
newTextStyleValue()
newTextStyleValue(style?): TextStyleValue
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:440
Create a new text style value.
Parameters
Parameter | Type | Description |
---|---|---|
style ? | ITextStyle | The text style |
Returns
The new text style value instance
Example
const textStyleValue = univerApi.newTextStyleValue();
onBeforeCommandExecute()
onBeforeCommandExecute(callback): IDisposable
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:224
Register a callback that will be triggered before invoking a command.
Parameters
Parameter | Type | Description |
---|---|---|
callback | CommandListener | The callback. |
Returns
The disposable instance.
Deprecated
use addEvent(univerAPI.event.BeforeCommandExecute, () => {})
instead.
onCommandExecuted()
onCommandExecuted(callback): IDisposable
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:236
Register a callback that will be triggered when a command is invoked.
Parameters
Parameter | Type | Description |
---|---|---|
callback | CommandListener | The callback. |
Returns
The disposable instance.
Deprecated
use addEvent(univerAPI.event.CommandExecuted, () => {})
instead.
redo()
redo(): Promise<boolean>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:214
Redo an editing on the currently focused document.
Returns
Promise
<boolean
>
redo result
syncExecuteCommand()
syncExecuteCommand<P, R>(
id,
params?,
options?): R
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:264
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.
undo()
undo(): Promise<boolean>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:206
Undo an editing on the currently focused document.
Returns
Promise
<boolean
>
undo result
extend()
static extend(source): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-base.ts:68
Parameters
Parameter | Type |
---|---|
source | any |
Returns
void
Inherited from
newAPI()
static newAPI(wrapped): FUniver
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/facade/f-univer.ts:50
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.