univerAPI
| Packages | @univerjs/core, @univerjs/ui, @univerjs/watermark, @univerjs-labs/mcp, @univerjs/network, @univerjs/sheets-find-replace, @univerjs/docs-ui, @univerjs/sheets, @univerjs/sheets-ui, @univerjs-pro/exchange-client, @univerjs-pro/collaboration-client, @univerjs/sheets-crosshair-highlight, @univerjs/engine-formula, @univerjs-labs/sheets-mcp, @univerjs-pro/live-share, @univerjs-labs/local-snapshot-manager, @univerjs/sheets-data-validation, @univerjs/sheets-thread-comment, @univerjs/sheets-formula, @univerjs/sheets-drawing-ui, @univerjs-pro/collaboration-client-ui, @univerjs/sheets-formula-ui |
|---|
The root Facade API object to interact with Univer. Please use newAPI static method
to create a new instance.
This class should not be instantiated directly. Use factory methods on
univerAPIinstead.
Overview
@univerjs/core
| Method | Description |
|---|---|
addEvent | Add an event listener |
disposeUnit | Dispose the UniverSheet by the unitId |
executeCommand | Execute a command with the given id and parameters |
extend | - |
fireEvent | Fire an event, used in internal only |
getCurrentLifecycleStage | Get the current lifecycle stage |
getHooks | Get hooks |
getUserManager | - |
loadLocales | Load locales for the given locale |
newAPI | Create an FUniver instance, if the injector is not provided, it will create a new Univer instance |
newBlob | Create a new blob |
newParagraphStyle | Create a new paragraph style |
newParagraphStyleValue | Create a new paragraph style value |
newRichText | Create a new rich text |
newRichTextValue | Create a new rich text value |
newTextDecoration | Create a new text decoration |
newTextStyle | Create a new text style |
newTextStyleValue | Create a new text style value |
onBeforeCommandExecute | Register a callback that will be triggered before invoking a command |
onCommandExecuted | Register a callback that will be triggered when a command is invoked |
redo | Redo an editing on the currently focused document |
registerEventHandler | - |
setLocale | Set the current locale |
syncExecuteCommand | Execute a command with the given id and parameters synchronously |
toggleDarkMode | Toggle dark mode on or off |
undo | Undo an editing on the currently focused document |
@univerjs/docs-ui
| Method | Description |
|---|---|
createUniverDoc | - |
getActiveDocument | - |
getUniverDoc | - |
@univerjs/engine-formula
| Method | Description |
|---|---|
getFormula | - |
@univerjs/network
| Method | Description |
|---|---|
createSocket | - |
getNetwork | - |
@univerjs/sheets
@univerjs/sheets-crosshair-highlight
| Method | Description |
|---|---|
getCrosshairHighlightColor | - |
getCrosshairHighlightEnabled | - |
setCrosshairHighlightColor | - |
setCrosshairHighlightEnabled | - |
@univerjs/sheets-data-validation
| Method | Description |
|---|---|
newDataValidation | - |
@univerjs/sheets-drawing-ui
| Method | Description |
|---|---|
registerURLImageDownloader | - |
@univerjs/sheets-find-replace
| Method | Description |
|---|---|
createTextFinderAsync | - |
@univerjs/sheets-formula
| Method | Description |
|---|---|
registerFunction | - |
@univerjs/sheets-formula-ui
| Method | Description |
|---|---|
showRangeSelectorDialog | - |
@univerjs/sheets-thread-comment
| Method | Description |
|---|---|
newTheadComment | - |
@univerjs/sheets-ui
@univerjs/ui
@univerjs/watermark
| Method | Description |
|---|---|
addWatermark | - |
deleteWatermark | - |
@univerjs-pro/collaboration-client
| Method | Description |
|---|---|
getCollaboration | - |
loadServerUnit | - |
loadServerUnitOfRevision | - |
@univerjs-pro/collaboration-client-ui
| Method | Description |
|---|---|
runOnServer | - |
@univerjs-pro/exchange-client
| Method | Description |
|---|---|
exportDOCXBySnapshotAsync | - |
exportDOCXByUnitIdAsync | - |
exportXLSXBySnapshotAsync | Export XLSX file by workbook data |
exportXLSXByUnitIdAsync | Export XLSX file by unit id |
importDOCXToSnapshotAsync | Import DOCX file to document data |
importDOCXToUnitIdAsync | Import DOCX file to unit id |
importXLSXToSnapshotAsync | Import XLSX file to workbook data |
importXLSXToUnitIdAsync | Import XLSX file to unit id |
@univerjs-pro/live-share
| Method | Description |
|---|---|
getLiveShareStatus | - |
startFollowing | - |
startPresenting | - |
stopFollowing | - |
stopPresenting | - |
@univerjs-labs/local-snapshot-manager
| Method | Description |
|---|---|
getLocalSnapshotManager | - |
@univerjs-labs/mcp
| Method | Description |
|---|---|
callMCPTool | - |
connectMCP | - |
disconnectMCP | - |
getAllMCPTools | - |
getMCPConnectionStatus | - |
validateMCPToolCall | - |
@univerjs-labs/sheets-mcp
| Method | Description |
|---|---|
getLintErrors | - |
APIs
Creation & Bootstrap
createMenu
Signature
createMenu(menuItem: IFacadeMenuItem): FMenuParameters
menuItemIFacadeMenuItem— No description
Returns
FMenu— See signature above.
@univerjs/ui
createSocket
Signature
createSocket(url: string): ISocketParameters
urlstring— No description
Returns
ISocket— See signature above.
@univerjs/network
createSubmenu
Signature
createSubmenu(submenuItem: IFacadeSubmenuItem): FSubmenuParameters
submenuItemIFacadeSubmenuItem— No description
Returns
FSubmenu— See signature above.
@univerjs/ui
createTextFinderAsync
Signature
async createTextFinderAsync(text: string): Promise<FTextFinder | null>Parameters
textstring— No description
Returns
Promise<FTextFinder>— See signature above.
@univerjs/sheets-find-replace
createUniverDoc
Signature
createUniverDoc(data: Partial<IDocumentData>): FDocumentParameters
dataPartial<IDocumentData>— No description
Returns
FDocument— See signature above.
@univerjs/docs-ui
createUniverSheet
Signature
createUniverSheet(data: Partial<IWorkbookData>, options?: ICreateUnitOptions): FWorkbookParameters
dataPartial<IWorkbookData>— No descriptionoptionsICreateUnitOptions(optional) — No description
Returns
FWorkbook— See signature above.
@univerjs/sheets
createWorkbook
Signature
createWorkbook(data: Partial<IWorkbookData>, options?: ICreateUnitOptions): FWorkbookParameters
dataPartial<IWorkbookData>— No descriptionoptionsICreateUnitOptions(optional) — No description
Returns
FWorkbook— See signature above.
@univerjs/sheets
disposeUnit
Dispose the UniverSheet by the unitId. The UniverSheet would be unload from the application.
Signature
disposeUnit(unitId: string): booleanParameters
unitIdstring— No description
Returns
boolean— Whether the Univer instance is disposed successfully.
Examples
const fWorkbook = univerAPI.getActiveWorkbook();
const unitId = fWorkbook?.getId();
if (unitId) {
univerAPI.disposeUnit(unitId);
}@univerjs/core
newAPI
Create an FUniver instance, if the injector is not provided, it will create a new Univer instance.
Signature
static newAPI(wrapped: Univer | Injector): FUniverParameters
wrappedany— No description
Returns
FUniver— - The FUniver instance.
Tags
@static— *
Examples
const univerAPI = FUniver.newAPI(univer);@univerjs/core
Unit & Workbook
getActiveWorkbook
Signature
getActiveWorkbook(): FWorkbook | nullReturns
FWorkbook— See signature above.
@univerjs/sheets
Commands
executeCommand
Execute a command with the given id and parameters.
Signature
executeCommand<P extends object = object, R = boolean>(id: string, params?: P, options?: IExecutionOptions): Promise<R>Parameters
idstring— No descriptionparamsP(optional) — No descriptionoptionsIExecutionOptions(optional) — No description
Returns
Promise<R>— The result of the execution. It is a boolean value by default which indicates the command is executed.
Examples
univerAPI.executeCommand('sheet.command.set-range-values', {
value: { v: "Hello, Univer!" },
range: { startRow: 0, startColumn: 0, endRow: 0, endColumn: 0 }
});@univerjs/core
redo
Redo an editing on the currently focused document.
Signature
redo(): Promise<boolean>Returns
Promise<boolean>— redo result
Examples
await univerAPI.redo();@univerjs/core
syncExecuteCommand
Execute a command with the given id and parameters synchronously.
Signature
syncExecuteCommand<P extends object = object, R = boolean>(id: string, params?: P, options?: IExecutionOptions): RParameters
idstring— No descriptionparamsP(optional) — No descriptionoptionsIExecutionOptions(optional) — No description
Returns
R— The result of the execution. It is a boolean value by default which indicates the command is executed.
Examples
univerAPI.syncExecuteCommand('sheet.command.set-range-values', {
value: { v: "Hello, Univer!" },
range: { startRow: 0, startColumn: 0, endRow: 0, endColumn: 0 }
});@univerjs/core
undo
Undo an editing on the currently focused document.
Signature
undo(): Promise<boolean>Returns
Promise<boolean>— undo result
Examples
await univerAPI.undo();@univerjs/core
Events
addEvent
Add an event listener
Signature
addEvent<T extends keyof IEventParamConfig>(event: T, callback: (params: IEventParamConfig[T]) => void): IDisposableParameters
eventT— No descriptioncallback(params: IEventParamConfig[T]) => void— when event triggered
Returns
IDisposable— The Disposable instance, for remove the listener
Examples
// Add life cycle changed event listener
const disposable = univerAPI.addEvent(univerAPI.Event.LifeCycleChanged, (params) => {
const { stage } = params;
console.log('life cycle changed', params);
});
// Remove the event listener, use `disposable.dispose()`@univerjs/core
fireEvent
Fire an event, used in internal only.
Signature
fireEvent<T extends keyof IEventParamConfig>(event: T, params: IEventParamConfig[T]): boolean | undefinedParameters
eventT— No descriptionparamsIEventParamConfig[T]— of event
Returns
boolean— should cancel
Examples
this.fireEvent(univerAPI.Event.LifeCycleChanged, params);@univerjs/core
registerEventHandler
Signature
registerEventHandler: (event: string, handler: () => any) => IDisposableReturns
(event: string, handler: () => any) => IDisposable— See signature above.
@univerjs/core
Factories
newBlob
Create a new blob.
Signature
newBlob(): FBlobReturns
FBlob— The new blob instance
Examples
const blob = univerAPI.newBlob();@univerjs/core
newDataValidation
univerAPI.newDataValidation() as instead.Signature
static newDataValidation(): FDataValidationBuilderReturns
FDataValidationBuilder— A new instance of the FDataValidationBuilder class
@univerjs/sheets-data-validation
newDefinedName
Signature
newDefinedName(): FDefinedNameBuilderReturns
FDefinedNameBuilder— See signature above.
@univerjs/sheets
newParagraphStyle
Create a new paragraph style.
Signature
newParagraphStyle(style?: IParagraphStyle): ParagraphStyleBuilderParameters
styleIParagraphStyle(optional) — No description
Returns
ParagraphStyleBuilder— The new paragraph style instance
Examples
const richText = univerAPI.newRichText({ body: { dataStream: 'Hello World\r\n' } });
const paragraphStyle = univerAPI.newParagraphStyle({ textStyle: { ff: 'Arial', fs: 12, it: univerAPI.Enum.BooleanNumber.TRUE, bl: univerAPI.Enum.BooleanNumber.TRUE } });
richText.insertParagraph(paragraphStyle);
const range = univerAPI.getActiveWorkbook().getActiveSheet().getRange('A1');
range.setRichTextValueForCell(richText);@univerjs/core
newParagraphStyleValue
Create a new paragraph style value.
Signature
newParagraphStyleValue(style?: IParagraphStyle): ParagraphStyleValueParameters
styleIParagraphStyle(optional) — No description
Returns
ParagraphStyleValue— The new paragraph style value instance
Examples
const paragraphStyleValue = univerAPI.newParagraphStyleValue();@univerjs/core
newRichText
Create a new rich text.
Signature
newRichText(data?: IDocumentData): RichTextBuilderParameters
dataIDocumentData(optional) — No description
Returns
RichTextBuilder— The new rich text instance
Examples
const richText = univerAPI.newRichText({ body: { dataStream: 'Hello World\r\n' } });
const range = univerAPI.getActiveWorkbook().getActiveSheet().getRange('A1');
range.setRichTextValueForCell(richText);@univerjs/core
newRichTextValue
Create a new rich text value.
Signature
newRichTextValue(data: IDocumentData): RichTextValueParameters
dataIDocumentData— No description
Returns
RichTextValue— The new rich text value instance
Examples
const richTextValue = univerAPI.newRichTextValue({ body: { dataStream: 'Hello World\r\n' } });
const range = univerAPI.getActiveWorkbook().getActiveSheet().getRange('A1');
range.setRichTextValueForCell(richTextValue);@univerjs/core
newTextDecoration
Create a new text decoration.
Signature
newTextDecoration(decoration?: ITextDecoration): TextDecorationBuilderParameters
decorationITextDecoration(optional) — No description
Returns
TextDecorationBuilder— The new text decoration instance
Examples
const decoration = univerAPI.newTextDecoration();@univerjs/core
newTextStyle
Create a new text style.
Signature
newTextStyle(style?: ITextStyle): TextStyleBuilderParameters
styleITextStyle(optional) — No description
Returns
TextStyleBuilder— The new text style instance
Examples
const textStyle = univerAPI.newTextStyle();@univerjs/core
newTextStyleValue
Create a new text style value.
Signature
newTextStyleValue(style?: ITextStyle): TextStyleValueParameters
styleITextStyle(optional) — No description
Returns
TextStyleValue— The new text style value instance
Examples
const textStyleValue = univerAPI.newTextStyleValue();@univerjs/core
newTheadComment
Signature
newTheadComment(comment?: IThreadComment): FTheadCommentBuilderParameters
commentIThreadComment(optional) — No description
Returns
FTheadCommentBuilder— See signature above.
@univerjs/sheets-thread-comment
Environment
setLocale
Set the current locale.
Signature
setLocale(locale: string): voidParameters
localestring— No description
Examples
univerAPI.setLocale('esES');@univerjs/core
toggleDarkMode
Toggle dark mode on or off.
Signature
toggleDarkMode(isDarkMode: boolean): voidParameters
isDarkModeboolean— No description
Examples
univerAPI.toggleDarkMode(true);@univerjs/core
Miscellaneous
addFonts
Signature
addFonts(fonts: IFontConfig[]): voidParameters
fontsIFontConfig[]— No description
@univerjs/ui
addWatermark
Signature
addWatermark(type: IWatermarkTypeEnum.Text | IWatermarkTypeEnum.Image, config: ITextWatermarkConfig | IImageWatermarkConfig): FUniverParameters
typeIWatermarkTypeEnum.Text | IWatermarkTypeEnum.Image— No descriptionconfigITextWatermarkConfig | IImageWatermarkConfig— No description
Returns
FUniver— See signature above.
@univerjs/watermark
callMCPTool
Signature
callMCPTool(toolName: string, params: unknown): Promise<any>Parameters
toolNamestring— No descriptionparamsunknown— No description
Returns
Promise<any>— See signature above.
@univerjs-labs/mcp
connectMCP
Signature
connectMCP(): void@univerjs-labs/mcp
copy
Signature
copy(): Promise<boolean>Returns
Promise<boolean>— See signature above.
@univerjs/ui
customizeColumnHeader
Signature
customizeColumnHeader(cfg: IColumnsHeaderCfgParam): voidParameters
cfgIColumnsHeaderCfgParam— No description
@univerjs/sheets-ui
customizeRowHeader
Signature
customizeRowHeader(cfg: IRowsHeaderCfgParam): voidParameters
cfgIRowsHeaderCfgParam— No description
@univerjs/sheets-ui
deleteWatermark
Signature
deleteWatermark(): FUniverReturns
FUniver— See signature above.
@univerjs/watermark
disconnectMCP
Signature
disconnectMCP(): void@univerjs-labs/mcp
exportDOCXBySnapshotAsync
Signature
async exportDOCXBySnapshotAsync(snapshot: IDocumentData): Promise<File | undefined>Parameters
snapshotIDocumentData— No description
Returns
Promise<File>— See signature above.
@univerjs-pro/exchange-client
exportDOCXByUnitIdAsync
Signature
async exportDOCXByUnitIdAsync(unitId: string): Promise<File | undefined>Parameters
unitIdstring— No description
Returns
Promise<File>— See signature above.
@univerjs-pro/exchange-client
exportXLSXBySnapshotAsync
Export XLSX file by workbook data
Signature
async exportXLSXBySnapshotAsync(snapshot: IWorkbookData): Promise<File | undefined>Parameters
snapshotIWorkbookData— No description
Returns
Promise<File>— See signature above.
@univerjs-pro/exchange-client
exportXLSXByUnitIdAsync
Export XLSX file by unit id
Signature
async exportXLSXByUnitIdAsync(unitId: string): Promise<File | undefined>Parameters
unitIdstring— No description
Returns
Promise<File>— See signature above.
@univerjs-pro/exchange-client
extend
Signature
static extend(source: any): voidParameters
sourceany— No description
@univerjs/core
getActiveDocument
Signature
getActiveDocument(): FDocument | nullReturns
FDocument— See signature above.
@univerjs/docs-ui
getActiveSheet
Signature
getActiveSheet(): Nullable<{ workbook: FWorkbook; worksheet: FWorksheet }>Returns
Nullable<{ workbook: FWorkbook; worksheet: FWorksheet; }>— See signature above.
@univerjs/sheets
getActiveUniverSheet
Signature
getActiveUniverSheet(): FWorkbook | nullReturns
FWorkbook— See signature above.
@univerjs/sheets
getAllMCPTools
Signature
getAllMCPTools(): IMCPTool[]Returns
IMCPTool[]— See signature above.
@univerjs-labs/mcp
getCollaboration
Signature
getCollaboration(): FCollaborationReturns
FCollaboration— See signature above.
@univerjs-pro/collaboration-client
getCommandSheetTarget
Signature
getCommandSheetTarget(commandInfo: ICommandInfo<object>): Nullable<{ workbook: FWorkbook; worksheet: FWorksheet }>Parameters
commandInfoICommandInfo<object>— No description
Returns
Nullable<{ workbook: FWorkbook; worksheet: FWorksheet; }>— See signature above.
@univerjs/sheets
getComponentManager
Signature
getComponentManager(): ComponentManagerReturns
ComponentManager— See signature above.
@univerjs/ui
getCrosshairHighlightColor
Signature
getCrosshairHighlightColor(): stringReturns
string— See signature above.
@univerjs/sheets-crosshair-highlight
getCrosshairHighlightEnabled
Signature
getCrosshairHighlightEnabled(): booleanReturns
boolean— See signature above.
@univerjs/sheets-crosshair-highlight
getCurrentLifecycleStage
Get the current lifecycle stage.
Signature
getCurrentLifecycleStage(): LifecycleStagesReturns
LifecycleStages— - The current lifecycle stage.
Examples
const stage = univerAPI.getCurrentLifecycleStage();
console.log(stage);@univerjs/core
getFormula
Signature
getFormula(): FFormulaReturns
FFormula— See signature above.
@univerjs/engine-formula
getHooks
addEvent instead.Get hooks.
Signature
getHooks(): FHooksReturns
FHooks— FHooks instance
@univerjs/core
getLintErrors
Signature
async getLintErrors(): Promise<ILintErrorReport>Returns
Promise<ILintErrorReport>— See signature above.
@univerjs-labs/sheets-mcp
getLiveShareStatus
Signature
getLiveShareStatus(): LiveShareStatusReturns
LiveShareStatus— See signature above.
@univerjs-pro/live-share
getLocalSnapshotManager
Signature
getLocalSnapshotManager(): FLocalSnapshotManagerReturns
FLocalSnapshotManager— See signature above.
@univerjs-labs/local-snapshot-manager
getMCPConnectionStatus
Signature
getMCPConnectionStatus(): stringReturns
string— See signature above.
@univerjs-labs/mcp
getNetwork
Signature
getNetwork(): FNetworkReturns
FNetwork— See signature above.
@univerjs/network
getProtectedRangeShadowStrategy
Signature
getProtectedRangeShadowStrategy(): 'always' | 'non-editable' | 'non-viewable' | 'none'Returns
"always" | "non-editable" | "non-viewable" | "none"— See signature above.
@univerjs/sheets-ui
getProtectedRangeShadowStrategy$
Signature
getProtectedRangeShadowStrategy$(): Observable<'always' | 'non-editable' | 'non-viewable' | 'none'>Returns
Observable<"always" | "non-editable" | "non-viewable" | "none">— See signature above.
@univerjs/sheets-ui
getSheetHooks
Get sheet hooks.
Signature
getSheetHooks(): FSheetHooksReturns
FSheetHooks— FSheetHooks instance
@univerjs/sheets-ui
getSheetTarget
Signature
getSheetTarget(unitId: string, subUnitId: string): Nullable<{ workbook: FWorkbook; worksheet: FWorksheet }>Parameters
unitIdstring— No descriptionsubUnitIdstring— No description
Returns
Nullable<{ workbook: FWorkbook; worksheet: FWorksheet; }>— See signature above.
@univerjs/sheets
getShortcut
Signature
getShortcut(): FShortcutReturns
FShortcut— See signature above.
@univerjs/ui
getUniverDoc
Signature
getUniverDoc(id: string): FDocument | nullParameters
idstring— No description
Returns
FDocument— See signature above.
@univerjs/docs-ui
getUniverSheet
Signature
getUniverSheet(id: string): FWorkbook | nullParameters
idstring— No description
Returns
FWorkbook— See signature above.
@univerjs/sheets
getURL
Signature
getURL(): URLReturns
URL— See signature above.
@univerjs/ui
getUserManager
Signature
getUserManager(): FUserManagerReturns
FUserManager— See signature above.
@univerjs/core
getWorkbook
Signature
getWorkbook(id: string): FWorkbook | nullParameters
idstring— No description
Returns
FWorkbook— See signature above.
@univerjs/sheets
importDOCXToSnapshotAsync
Import DOCX file to document data
Signature
async importDOCXToSnapshotAsync(file: string | File): Promise<IDocumentData | undefined>Parameters
filestring | File— No description
Returns
Promise<any>— See signature above.
@univerjs-pro/exchange-client
importDOCXToUnitIdAsync
Import DOCX file to unit id
Signature
async importDOCXToUnitIdAsync(file: string | File): Promise<string | undefined>Parameters
filestring | File— No description
Returns
Promise<string>— See signature above.
@univerjs-pro/exchange-client
importXLSXToSnapshotAsync
Import XLSX file to workbook data
Signature
async importXLSXToSnapshotAsync(file: string | File): Promise<IWorkbookData | undefined>Parameters
filestring | File— No description
Returns
Promise<any>— See signature above.
@univerjs-pro/exchange-client
importXLSXToUnitIdAsync
Import XLSX file to unit id
Signature
async importXLSXToUnitIdAsync(file: string | File): Promise<string | undefined>Parameters
filestring | File— No description
Returns
Promise<string>— See signature above.
@univerjs-pro/exchange-client
isUIVisible
Signature
isUIVisible(ui: BuiltInUIPart): booleanParameters
uiBuiltInUIPart— No description
Returns
boolean— See signature above.
@univerjs/ui
loadLocales
Load locales for the given locale.
Signature
loadLocales(locale: string, locales: ILanguagePack): voidParameters
localestring— No descriptionlocalesILanguagePack— No description
Examples
univerAPI.loadLocales('esES', {
'Hello World': 'Hola Mundo',
});@univerjs/core
loadServerUnit
Signature
loadServerUnit(unitId: string, unitType: UniverInstanceType, subUnitId?: string): Promise<UnitModel | null>Parameters
unitIdstring— No descriptionunitTypeUniverInstanceType— No descriptionsubUnitIdstring(optional) — No description
Returns
Promise<any>— See signature above.
@univerjs-pro/collaboration-client
loadServerUnitOfRevision
Signature
loadServerUnitOfRevision(unitId: string, unitType: UniverInstanceType, rev: number): Promise<UnitModel | null>Parameters
unitIdstring— No descriptionunitTypeUniverInstanceType— No descriptionrevnumber— No description
Returns
Promise<any>— See signature above.
@univerjs-pro/collaboration-client
onAfterCellEdit
Signature
onAfterCellEdit(callback: (params: IEditorBridgeServiceVisibleParam) => void): IDisposableParameters
callback(params: IEditorBridgeServiceVisibleParam) => void— No description
Returns
IDisposable— See signature above.
@univerjs/sheets-ui
onBeforeCellEdit
Signature
onBeforeCellEdit(callback: (params: IEditorBridgeServiceVisibleParam) => void): IDisposableParameters
callback(params: IEditorBridgeServiceVisibleParam) => void— No description
Returns
IDisposable— See signature above.
@univerjs/sheets-ui
onBeforeCommandExecute
univerAPI.addEvent(univerAPI.Event.BeforeCommandExecute, (event) => {}) instead.Register a callback that will be triggered before invoking a command.
Signature
onBeforeCommandExecute(callback: CommandListener): IDisposableParameters
callbackCommandListener— No description
Returns
IDisposable— The disposable instance.
@univerjs/core
onBeforeCopy
Signature
onBeforeCopy(callback: () => void): IDisposableParameters
callback() => void— No description
Returns
IDisposable— See signature above.
@univerjs/ui
onBeforePaste
Signature
onBeforePaste(callback: () => void): IDisposableParameters
callback() => void— No description
Returns
IDisposable— See signature above.
@univerjs/ui
onCellDragOver
Signature
onCellDragOver(callback: (cellPos: Nullable<IDragCellPosition>) => void): IDisposableParameters
callback(cellPos: any) => void— No description
Returns
IDisposable— See signature above.
@univerjs/sheets-ui
onCellDrop
Signature
onCellDrop(callback: (cellPos: Nullable<IDragCellPosition>) => void): IDisposableParameters
callback(cellPos: any) => void— No description
Returns
IDisposable— See signature above.
@univerjs/sheets-ui
onCellPointerMove
Signature
onCellPointerMove(callback: (cellPos: Nullable<IHoverCellPosition>) => void): IDisposableParameters
callback(cellPos: any) => void— No description
Returns
IDisposable— See signature above.
@univerjs/sheets-ui
onCellPointerOver
Signature
onCellPointerOver(callback: (cellPos: Nullable<IHoverCellPosition>) => void): IDisposableParameters
callback(cellPos: any) => void— No description
Returns
IDisposable— See signature above.
@univerjs/sheets-ui
onCellRender
Signature
onCellRender(customRender: Nullable<ICellCustomRender[]>, effect: InterceptorEffectEnum = InterceptorEffectEnum.Style, priority: number = InterceptCellContentPriority.DATA_VALIDATION): IDisposableParameters
customRenderNullable<ICellCustomRender[]>— No descriptioneffectInterceptorEffectEnum(optional) — No descriptionprioritynumber(optional) — No description
Returns
IDisposable— See signature above.
@univerjs/sheets-ui
onCommandExecuted
univerAPI.addEvent(univerAPI.Event.CommandExecuted, (event) => {}) instead.Register a callback that will be triggered when a command is invoked.
Signature
onCommandExecuted(callback: CommandListener): IDisposableParameters
callbackCommandListener— No description
Returns
IDisposable— The disposable instance.
@univerjs/core
onCopy
Signature
onCopy(callback: () => void): IDisposableParameters
callback() => void— No description
Returns
IDisposable— See signature above.
@univerjs/ui
onPaste
Signature
onPaste(callback: () => void): IDisposableParameters
callback() => void— No description
Returns
IDisposable— See signature above.
@univerjs/ui
onUniverSheetCreated
Signature
onUniverSheetCreated(callback: (workbook: FWorkbook) => void): IDisposableParameters
callback(workbook: FWorkbook) => void— No description
Returns
IDisposable— See signature above.
@univerjs/sheets
openDialog
Signature
openDialog(dialog: IDialogPartMethodOptions): IDisposableParameters
dialogIDialogPartMethodOptions— No description
Returns
IDisposable— See signature above.
@univerjs/ui
openSidebar
Signature
openSidebar(params: ISidebarMethodOptions): IDisposableParameters
paramsISidebarMethodOptions— No description
Returns
IDisposable— See signature above.
@univerjs/ui
openSiderbar
Signature
openSiderbar(params: ISidebarMethodOptions): IDisposableParameters
paramsISidebarMethodOptions— No description
Returns
IDisposable— See signature above.
@univerjs/ui
paste
Signature
paste(): Promise<boolean>Returns
Promise<boolean>— See signature above.
@univerjs/ui
pasteIntoSheet
Signature
pasteIntoSheet(htmlContent?: string, textContent?: string, files?: File[]): Promise<boolean>Parameters
htmlContentstring(optional) — No descriptiontextContentstring(optional) — No descriptionfilesFile[](optional) — No description
Returns
Promise<boolean>— See signature above.
@univerjs/sheets-ui
registerComponent
Signature
registerComponent(name: string, component: any, options?: IComponentOptions): IDisposableParameters
namestring— No descriptioncomponentany— No descriptionoptionsIComponentOptions(optional) — No description
Returns
IDisposable— See signature above.
@univerjs/ui
registerFunction
Signature
registerFunction(config: IRegisterFunctionParams): IDisposableParameters
configIRegisterFunctionParams— No description
Returns
IDisposable— See signature above.
@univerjs/sheets-formula
registerSheetColumnHeaderExtension
Signature
registerSheetColumnHeaderExtension(unitId: string, ...extensions: SheetExtension[]): IDisposableParameters
unitIdstring— No descriptionextensionsSheetExtension[]— No description
Returns
IDisposable— See signature above.
@univerjs/sheets-ui
registerSheetMainExtension
Signature
registerSheetMainExtension(unitId: string, ...extensions: SheetExtension[]): IDisposableParameters
unitIdstring— No descriptionextensionsSheetExtension[]— No description
Returns
IDisposable— See signature above.
@univerjs/sheets-ui
registerSheetRowHeaderExtension
Signature
registerSheetRowHeaderExtension(unitId: string, ...extensions: SheetExtension[]): IDisposableParameters
unitIdstring— No descriptionextensionsSheetExtension[]— No description
Returns
IDisposable— See signature above.
@univerjs/sheets-ui
registerUIPart
Signature
registerUIPart(key: BuiltInUIPart, component: any): IDisposableParameters
keyBuiltInUIPart— No descriptioncomponentany— No description
Returns
IDisposable— See signature above.
@univerjs/ui
registerURLImageDownloader
Signature
registerURLImageDownloader(downloader: (url: string) => Promise<string>): IDisposableParameters
downloader(url: string) => Promise<string>— No description
Returns
IDisposable— See signature above.
@univerjs/sheets-drawing-ui
runOnServer
Signature
runOnServer(scriptNameOrId: string, func: string, ...params: any[]): Promise<string>Parameters
scriptNameOrIdstring— No descriptionfuncstring— No descriptionparamsany[]— No description
Returns
Promise<string>— See signature above.
@univerjs-pro/collaboration-client-ui
setCrosshairHighlightColor
Signature
setCrosshairHighlightColor(color: string): FUniverParameters
colorstring— No description
Returns
FUniver— See signature above.
@univerjs/sheets-crosshair-highlight
setCrosshairHighlightEnabled
Signature
setCrosshairHighlightEnabled(enabled: boolean): FUniverParameters
enabledboolean— No description
Returns
FUniver— See signature above.
@univerjs/sheets-crosshair-highlight
setCurrent
Signature
setCurrent(unitId: string): voidParameters
unitIdstring— No description
@univerjs/ui
setFreezeSync
Signature
setFreezeSync(enabled: boolean): voidParameters
enabledboolean— No description
@univerjs/sheets
setPermissionDialogVisible
Signature
setPermissionDialogVisible(visible: boolean): voidParameters
visibleboolean— No description
@univerjs/sheets-ui
setProtectedRangeShadowStrategy
Signature
setProtectedRangeShadowStrategy(strategy: 'always' | 'non-editable' | 'non-viewable' | 'none'): voidParameters
strategy"always" | "non-editable" | "non-viewable" | "none"— No description
@univerjs/sheets-ui
setUIVisible
Signature
setUIVisible(ui: BuiltInUIPart, visible: boolean): FUniverParameters
uiBuiltInUIPart— No descriptionvisibleboolean— No description
Returns
FUniver— See signature above.
@univerjs/ui
showMessage
Signature
showMessage(options: IMessageProps): FUniverParameters
optionsIMessageProps— No description
Returns
FUniver— See signature above.
@univerjs/ui
showRangeSelectorDialog
Signature
showRangeSelectorDialog(opts: IShowRangeSelectorDialogOptions): Promise<IUnitRangeName[]>Parameters
optsIShowRangeSelectorDialogOptions— No description
Returns
Promise<IUnitRangeName[]>— See signature above.
@univerjs/sheets-formula-ui
startFollowing
Signature
startFollowing(): void@univerjs-pro/live-share
startPresenting
Signature
startPresenting(): void@univerjs-pro/live-share
stopFollowing
Signature
stopFollowing(): void@univerjs-pro/live-share
stopPresenting
Signature
stopPresenting(): void@univerjs-pro/live-share
validateMCPToolCall
Signature
validateMCPToolCall(toolName: string, params: unknown): { isValid: boolean; error?: string; validatedParams?: any }Parameters
toolNamestring— No descriptionparamsunknown— No description
Returns
{ isValid: boolean; error?: string; validatedParams?: any; }— See signature above.
@univerjs-labs/mcp