API Reference

univerAPI

Packages@univerjs/core, @univerjs/ui, @univerjs/watermark, @univerjs/network, @univerjs/sheets-find-replace, @univerjs/docs, @univerjs/sheets, @univerjs/sheets-ui, @univerjs/thread-comment, @univerjs-pro/exchange-client, @univerjs-pro/bases-exchange-client, @univerjs-pro/boards-exchange-client, @univerjs-pro/docs-exchange-client, @univerjs-pro/pdfs-exchange-client, @univerjs-pro/sheets-exchange-client, @univerjs-pro/slides-exchange-client, @univerjs-pro/collaboration-client, @univerjs/sheets-crosshair-highlight, @univerjs/engine-formula, @univerjs-pro/live-share, @univerjs/sheets-data-validation, @univerjs/sheets-thread-comment, @univerjs/sheets-formula, @univerjs/sheets-drawing-ui, @univerjs-pro/collaboration-client-ui, @univerjs/sheets-formula-ui, @univerjs-pro/edit-history

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 univerAPI instead.

Overview

@univerjs/core

MethodDescription
addEventAdd an event listener
disposeUnitDispose the UniverSheet by the unitId
executeCommandExecute a command with the given id and parameters
extend-
fireEventFire an event, used in internal only
getCurrentLifecycleStageGet the current lifecycle stage
getCurrentLocaleGet the current locale
getCurrentRegionGet the current region used by locale-sensitive behavior
getCurrentThemeGet the active theme
getLocalesGet loaded locale messages
isDarkModeCheck whether the active theme is dark
getUserManager-
loadLocalesLoad locales for the given locale
newAPICreate an FUniver instance, if the injector is not provided, it will create a new Univer instance
newBlobCreate a new blob
newParagraphStyleCreate a new paragraph style
newParagraphStyleValueCreate a new paragraph style value
newRichTextCreate a new rich text
newRichTextValueCreate a new rich text value
newTextDecorationCreate a new text decoration
newTextStyleCreate a new text style
newTextStyleValueCreate a new text style value
redoRedo an editing on the currently focused document
registerEventHandler-
setLocaleSet the current locale
setRegionSet the current region independently of the message locale
setDirectionSet the runtime layout direction to ltr or rtl
setThemeReplace the active theme at runtime
syncExecuteCommandExecute a command with the given id and parameters synchronously
toggleDarkModeToggle dark mode on or off
undoUndo an editing on the currently focused document

@univerjs/docs

MethodDescription
createDocumentCreate a new document and return its facade wrapper
getActiveDocument-
getDocument-

@univerjs/engine-formula

MethodDescription
getFormula-

@univerjs/network

MethodDescription
createSocket-
getNetwork-

@univerjs/sheets

@univerjs/sheets-crosshair-highlight

@univerjs/sheets-data-validation

MethodDescription
newDataValidation-

@univerjs/sheets-drawing-ui

MethodDescription
registerURLImageDownloader-

@univerjs/sheets-find-replace

MethodDescription
createTextFinderAsync-

@univerjs/sheets-formula-ui

MethodDescription
showRangeSelectorDialog-

@univerjs/sheets-thread-comment

MethodDescription
newTheadComment-

@univerjs/thread-comment

MethodDescription
createCommentAsyncCreate a root thread on a serialized product anchor
replyCommentAsyncAdd a reply to a loaded thread
updateCommentAsyncUpdate root or reply content and attachments
deleteCommentAsyncDelete one comment or a complete thread
resolveCommentAsyncResolve or reopen a thread
getCommentsQuery locally loaded threads
listCommentsAsyncSynchronize known threads and query them

@univerjs/sheets-ui

@univerjs/ui

@univerjs/watermark

MethodDescription
addWatermark-
deleteWatermark-

@univerjs-pro/collaboration-client

@univerjs-pro/collaboration-client-ui

MethodDescription
runOnServer-

@univerjs-pro/exchange-client

MethodDescription
downloadFileTrigger a browser download for a file or blob

@univerjs-pro/edit-history

MethodDescription
compareUnitDataSemantically compare two fully materialized unit snapshots with the registered product adapter
prepareUnitComparisonPrepare a comparison once for repeated filtering, scopes, and pagination

Import and export methods are registered by their host Facade entries:

PackageMethods
@univerjs-pro/bases-exchange-clientimportBaseToUnitIdAsync, importBaseToSnapshotAsync, exportBaseByUnitIdAsync, exportBaseBySnapshotAsync, transformSnapshotJsonToBaseDataAsync, transformBaseDataToSnapshotJsonAsync
@univerjs-pro/boards-exchange-clientexportBoardByUnitIdAsync, exportBoardBySnapshotAsync, transformSnapshotJsonToBoardDataAsync, transformBoardDataToSnapshotJsonAsync
@univerjs-pro/docs-exchange-clientimportDocToUnitIdAsync, importDocToSnapshotAsync, exportDocByUnitIdAsync, exportDocBySnapshotAsync, transformSnapshotJsonToDocumentDataAsync, transformDocumentDataToSnapshotJsonAsync
@univerjs-pro/pdfs-exchange-clientimportPdfToUnitIdAsync, importPdfToSnapshotAsync, exportPdfByUnitIdAsync, exportPdfBySnapshotAsync, transformSnapshotJsonToPdfDataAsync, transformPdfDataToSnapshotJsonAsync
@univerjs-pro/sheets-exchange-clientimportSheetToUnitIdAsync, importSheetToSnapshotAsync, exportSheetByUnitIdAsync, exportSheetBySnapshotAsync, transformSnapshotJsonToWorkbookDataAsync, transformWorkbookDataToSnapshotJsonAsync
@univerjs-pro/slides-exchange-clientimportSlideToUnitIdAsync, importSlideToSnapshotAsync, exportSlideByUnitIdAsync, exportSlideBySnapshotAsync, transformSnapshotJsonToSlideDataAsync, transformSlideDataToSnapshotJsonAsync

@univerjs-pro/live-share

Cross-product extensions

Locale, region, and direction

setLocale() switches loaded messages. Region and layout direction can be controlled independently:

TypeScript
univerAPI.setRegion('SG')univerAPI.setDirection('rtl')console.log(univerAPI.getCurrentRegion())

Thread comments

Import the shared Facade entry once, then import the matching product Facade for anchor-specific helpers.

TypeScript
import '@univerjs/thread-comment/facade'const openComments = univerAPI.getComments({ resolved: false })await univerAPI.listCommentsAsync({  anchorKinds: [univerAPI.Enum.ThreadCommentAnchorKind.DOC_TEXT_RANGE],})

listCommentsAsync() synchronizes thread IDs already known to the configured datasource; it is not a server-wide discovery API.

Semantic unit comparison

TypeScript
import { UnitComparisonFidelity } from '@univerjs-pro/edit-history'import '@univerjs-pro/edit-history/facade'const result = univerAPI.compareUnitData({  comparisonId: 'review-42',  unitId: 'doc-1',  type: univerAPI.Enum.UniverInstanceType.UNIVER_DOC,  fidelity: UnitComparisonFidelity.SNAPSHOT,  leftData,  rightData,})

Register the matching product History plugin before calling these methods. prepareUnitComparison(input) returns an FUnitComparison; its query() method accepts scope, filters, detail, and pagination without recomputing the comparison. The scopes array identifies product views. These APIs compare semantic content without merging snapshots or replaying mutations. See prepared and headless comparisons for limits, diagnostics, and Node.js usage.

APIs

Creation & Bootstrap

createMenu

Signature

TypeScript
createMenu(menuItem: IFacadeMenuItem): FMenu

Parameters

  • menuItem IFacadeMenuItemNo description

Returns

  • FMenu — See signature above.
Source: @univerjs/ui

createSocket

Signature

TypeScript
createSocket(url: string): ISocket

Parameters

  • url stringNo description

Returns

  • ISocket — See signature above.
Source: @univerjs/network

createSubmenu

Signature

TypeScript
createSubmenu(submenuItem: IFacadeSubmenuItem): FSubmenu

Parameters

  • submenuItem IFacadeSubmenuItemNo description

Returns

  • FSubmenu — See signature above.
Source: @univerjs/ui

createTextFinderAsync

Signature

TypeScript
async createTextFinderAsync(text: string): Promise<FTextFinder | null>

Parameters

  • text stringNo description

Returns

  • Promise<FTextFinder> — See signature above.
Source: @univerjs/sheets-find-replace

createDocument

Signature

TypeScript
createDocument(data: Partial<IDocumentData>): FDocument

Parameters

  • data Partial<IDocumentData> — Initial document data. Pass {} to create an empty document.

Returns

  • FDocument — The created document facade wrapper.
Source: @univerjs/docs

createWorkbook

Signature

TypeScript
createWorkbook(data: Partial<IWorkbookData>, options?: ICreateUnitOptions): FWorkbook

Parameters

  • data Partial<IWorkbookData>No description
  • options ICreateUnitOptions (optional)No description

Returns

  • FWorkbook — See signature above.
Source: @univerjs/sheets

disposeUnit

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

Signature

TypeScript
disposeUnit(unitId: string): boolean

Parameters

  • unitId stringNo description

Returns

  • boolean — Whether the Univer instance is disposed successfully.

Examples

TypeScript
const fWorkbook = univerAPI.getActiveWorkbook()const unitId = fWorkbook?.getId()if (unitId) {  univerAPI.disposeUnit(unitId)}
Source: @univerjs/core

newAPI

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

Signature

TypeScript
static newAPI(wrapped: Univer | Injector): FUniver

Parameters

  • wrapped anyNo description

Returns

  • FUniver — - The FUniver instance.

Tags

  • @static — *

Examples

TypeScript
const univerAPI = FUniver.newAPI(univer)
Source: @univerjs/core

Unit & Workbook

getActiveWorkbook

Signature

TypeScript
getActiveWorkbook(): FWorkbook | null

Returns

  • FWorkbook — See signature above.
Source: @univerjs/sheets

Commands

executeCommand

Execute a command with the given id and parameters.

Signature

TypeScript
executeCommand<P extends object = object, R = boolean>(id: string, params?: P, options?: IExecutionOptions): Promise<R>

Parameters

  • id stringNo description
  • params P (optional)No description
  • options IExecutionOptions (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

TypeScript
univerAPI.executeCommand('sheet.command.set-range-values', {  value: { v: 'Hello, Univer!' },  range: { startRow: 0, startColumn: 0, endRow: 0, endColumn: 0 },})
Source: @univerjs/core

redo

Redo an editing on the currently focused document.

Signature

TypeScript
redo(): Promise<boolean>

Returns

  • Promise<boolean> — redo result

Examples

TypeScript
await univerAPI.redo()
Source: @univerjs/core

syncExecuteCommand

Execute a command with the given id and parameters synchronously.

Signature

TypeScript
syncExecuteCommand<P extends object = object, R = boolean>(id: string, params?: P, options?: IExecutionOptions): R

Parameters

  • id stringNo description
  • params P (optional)No description
  • options IExecutionOptions (optional)No description

Returns

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

Examples

TypeScript
univerAPI.syncExecuteCommand('sheet.command.set-range-values', {  value: { v: 'Hello, Univer!' },  range: { startRow: 0, startColumn: 0, endRow: 0, endColumn: 0 },})
Source: @univerjs/core

undo

Undo an editing on the currently focused document.

Signature

TypeScript
undo(): Promise<boolean>

Returns

  • Promise<boolean> — undo result

Examples

TypeScript
await univerAPI.undo()
Source: @univerjs/core

Events

addEvent

Add an event listener

Signature

TypeScript
addEvent<T extends keyof IEventParamConfig>(event: T, callback: (params: IEventParamConfig[T]) => void): IDisposable

Parameters

  • event TNo description
  • callback (params: IEventParamConfig[T]) => void — when event triggered

Returns

  • IDisposable — The Disposable instance, for remove the listener

Examples

TypeScript
// Add life cycle changed event listenerconst disposable = univerAPI.addEvent(univerAPI.Event.LifeCycleChanged, (params) => {  const { stage } = params  console.log('life cycle changed', params)})// Remove the event listener, use `disposable.dispose()`
Source: @univerjs/core

fireEvent

Fire an event, used in internal only.

Signature

TypeScript
fireEvent<T extends keyof IEventParamConfig>(event: T, params: IEventParamConfig[T]): boolean | undefined

Parameters

  • event TNo description
  • params IEventParamConfig[T] — of event

Returns

  • boolean — should cancel

Examples

TypeScript
this.fireEvent(univerAPI.Event.LifeCycleChanged, params)
Source: @univerjs/core

registerEventHandler

Signature

TypeScript
registerEventHandler: (event: string, handler: () => any) => IDisposable

Returns

  • (event: string, handler: () => any) => IDisposable — See signature above.
Source: @univerjs/core

Factories

newBlob

Create a new blob.

Signature

TypeScript
newBlob(): FBlob

Returns

  • FBlob — The new blob instance

Examples

TypeScript
const blob = univerAPI.newBlob()
Source: @univerjs/core

newDataValidation

Deprecated — use univerAPI.newDataValidation() as instead.

Signature

TypeScript
static newDataValidation(): FDataValidationBuilder

Returns

  • FDataValidationBuilder — A new instance of the FDataValidationBuilder class
Source: @univerjs/sheets-data-validation

newParagraphStyle

Create a new paragraph style.

Signature

TypeScript
newParagraphStyle(style?: IParagraphStyle): ParagraphStyleBuilder

Parameters

  • style IParagraphStyle (optional)No description

Returns

  • ParagraphStyleBuilder — The new paragraph style instance

Examples

TypeScript
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)
Source: @univerjs/core

newParagraphStyleValue

Create a new paragraph style value.

Signature

TypeScript
newParagraphStyleValue(style?: IParagraphStyle): ParagraphStyleValue

Parameters

  • style IParagraphStyle (optional)No description

Returns

  • ParagraphStyleValue — The new paragraph style value instance

Examples

TypeScript
const paragraphStyleValue = univerAPI.newParagraphStyleValue()
Source: @univerjs/core

newRichText

Create a new rich text.

Signature

TypeScript
newRichText(data?: IDocumentData): RichTextBuilder

Parameters

  • data IDocumentData (optional)No description

Returns

  • RichTextBuilder — The new rich text instance

Examples

TypeScript
const richText = univerAPI.newRichText({ body: { dataStream: 'Hello World\r\n' } })const range = univerAPI.getActiveWorkbook().getActiveSheet().getRange('A1')range.setRichTextValueForCell(richText)

RichTextBuilder.link(text, url) appends linked text without offsets. Use getLinks() to obtain the link's range id and change its destination later.

TypeScript
const richText = univerAPI.newRichText().text('Read ').link('the guide', 'https://docs.univer.ai')const [link] = richText.getLinks()if (!link) throw new Error('Link was not created')richText.updateLink(link.rangeId, 'https://docs.univer.ai/guides')

removeLink(id) removes the link destination but preserves its visible text.

Source: @univerjs/core

newRichTextValue

Create a new rich text value.

Signature

TypeScript
newRichTextValue(data: IDocumentData): RichTextValue

Parameters

  • data IDocumentDataNo description

Returns

  • RichTextValue — The new rich text value instance

Examples

TypeScript
const richTextValue = univerAPI.newRichTextValue({ body: { dataStream: 'Hello World\r\n' } })const range = univerAPI.getActiveWorkbook().getActiveSheet().getRange('A1')range.setRichTextValueForCell(richTextValue)
Source: @univerjs/core

newTextDecoration

Create a new text decoration.

Signature

TypeScript
newTextDecoration(decoration?: ITextDecoration): TextDecorationBuilder

Parameters

  • decoration ITextDecoration (optional)No description

Returns

  • TextDecorationBuilder — The new text decoration instance

Examples

TypeScript
const decoration = univerAPI.newTextDecoration()
Source: @univerjs/core

newTextStyle

Create a new text style.

Signature

TypeScript
newTextStyle(style?: ITextStyle): TextStyleBuilder

Parameters

  • style ITextStyle (optional)No description

Returns

  • TextStyleBuilder — The new text style instance

Examples

TypeScript
const textStyle = univerAPI.newTextStyle()
Source: @univerjs/core

newTextStyleValue

Create a new text style value.

Signature

TypeScript
newTextStyleValue(style?: ITextStyle): TextStyleValue

Parameters

  • style ITextStyle (optional)No description

Returns

  • TextStyleValue — The new text style value instance

Examples

TypeScript
const textStyleValue = univerAPI.newTextStyleValue()
Source: @univerjs/core

newTheadComment

Signature

TypeScript
newTheadComment(comment?: IThreadComment): FTheadCommentBuilder

Parameters

  • comment IThreadComment (optional)No description

Returns

  • FTheadCommentBuilder — See signature above.
Source: @univerjs/sheets-thread-comment

Environment

setLocale

Set the current locale.

Signature

TypeScript
setLocale(locale: string): void

Parameters

  • locale stringNo description

Examples

TypeScript
univerAPI.setLocale('esES')
Source: @univerjs/core

setTheme

Replace the active theme at runtime.

TypeScript
setTheme(theme: Theme): void

getCurrentTheme

TypeScript
getCurrentTheme(): Theme

isDarkMode

TypeScript
isDarkMode(): boolean
TypeScript
import { darkBlueTheme } from '@univerjs/themes'univerAPI.setTheme(darkBlueTheme)console.log(univerAPI.isDarkMode(), univerAPI.getCurrentTheme())
Source: @univerjs/core

toggleDarkMode

Toggle dark mode on or off.

Signature

TypeScript
toggleDarkMode(isDarkMode: boolean): void

Parameters

  • isDarkMode booleanNo description

Examples

TypeScript
univerAPI.toggleDarkMode(true)
Source: @univerjs/core

Miscellaneous

addFonts

Signature

TypeScript
addFonts(fonts: IFontConfig[]): void

Parameters

  • fonts IFontConfig[]No description
Source: @univerjs/ui

addWatermark

Signature

TypeScript
addWatermark(type: IWatermarkTypeEnum.Text | IWatermarkTypeEnum.Image, config: ITextWatermarkConfig | IImageWatermarkConfig): FUniver

Parameters

  • type IWatermarkTypeEnum.Text | IWatermarkTypeEnum.ImageNo description
  • config ITextWatermarkConfig | IImageWatermarkConfigNo description

Returns

  • FUniver — See signature above.
Source: @univerjs/watermark

copy

Signature

TypeScript
copy(): Promise<boolean>

Returns

  • Promise<boolean> — See signature above.
Source: @univerjs/ui

customizeColumnHeader

Signature

TypeScript
customizeColumnHeader(cfg: IColumnsHeaderCfgParam): void

Parameters

  • cfg IColumnsHeaderCfgParamNo description
Source: @univerjs/sheets-ui

customizeRowHeader

Signature

TypeScript
customizeRowHeader(cfg: IRowsHeaderCfgParam): void

Parameters

  • cfg IRowsHeaderCfgParamNo description
Source: @univerjs/sheets-ui

deleteWatermark

Signature

TypeScript
deleteWatermark(): FUniver

Returns

  • FUniver — See signature above.
Source: @univerjs/watermark

downloadFile

Trigger a browser download for a file or blob.

Signature

TypeScript
downloadFile(file: File | Blob, filename: string, fileExt: string): void

Parameters

  • file File | Blob — File or blob to download.
  • filename string — Filename without extension.
  • fileExt string — File extension without a leading dot.
Source: @univerjs-pro/exchange-client

exportDocBySnapshotAsync

Signature

TypeScript
exportDocBySnapshotAsync(snapshot: IDocumentData): Promise<File | undefined>

Parameters

  • snapshot IDocumentDataNo description

Returns

  • Promise<File> — See signature above.
Source: @univerjs-pro/docs-exchange-client

exportDocByUnitIdAsync

Signature

TypeScript
exportDocByUnitIdAsync(unitId: string): Promise<File | undefined>

Parameters

  • unitId stringNo description

Returns

  • Promise<File> — See signature above.
Source: @univerjs-pro/docs-exchange-client

exportSlideBySnapshotAsync

Export PPTX file by slide data

Signature

TypeScript
exportSlideBySnapshotAsync(snapshot: ISlideData): Promise<File | undefined>

Parameters

  • snapshot ISlideData — Slide data.

Returns

  • Promise<File> — See signature above.
Source: @univerjs-pro/slides-exchange-client

exportSlideByUnitIdAsync

Export PPTX file by unit id

Signature

TypeScript
exportSlideByUnitIdAsync(unitId: string): Promise<File | undefined>

Parameters

  • unitId string — The slide unit id.

Returns

  • Promise<File> — See signature above.
Source: @univerjs-pro/slides-exchange-client

exportSheetBySnapshotAsync

Export XLSX file by workbook data

Signature

TypeScript
exportSheetBySnapshotAsync(snapshot: IWorkbookData, format?: ExchangeFormat, sheetId?: string): Promise<File | undefined>

Parameters

  • snapshot IWorkbookDataNo description

Returns

  • Promise<File> — See signature above.
Source: @univerjs-pro/sheets-exchange-client

exportSheetByUnitIdAsync

Export XLSX file by unit id

Signature

TypeScript
exportSheetByUnitIdAsync(unitId: string, format?: ExchangeFormat, sheetId?: string): Promise<File | undefined>

Parameters

  • unitId stringNo description

Returns

  • Promise<File> — See signature above.
Source: @univerjs-pro/sheets-exchange-client

extend

Signature

TypeScript
static extend(source: any): void

Parameters

  • source anyNo description
Source: @univerjs/core

getActiveDocument

Signature

TypeScript
getActiveDocument(): FDocument | null

Returns

  • FDocument — See signature above.
Source: @univerjs/docs

getActiveSheet

Signature

TypeScript
getActiveSheet(): Nullable<{ workbook: FWorkbook; worksheet: FWorksheet }>

Returns

  • Nullable<{ workbook: FWorkbook; worksheet: FWorksheet; }> — See signature above.
Source: @univerjs/sheets

getCollaboration

Signature

TypeScript
getCollaboration(): FCollaboration

Returns

  • FCollaboration — See signature above.
Source: @univerjs-pro/collaboration-client

getSheetCommandTarget

Signature

TypeScript
getSheetCommandTarget(params?: { unitId?: string; subUnitId?: string; sheetId?: string }): { workbook: FWorkbook; worksheet: FWorksheet; unitId: string; subUnitId: string } | null

Parameters

  • params { unitId?: string; subUnitId?: string; sheetId?: string } (optional) — Target identifiers.

Returns

  • { workbook: FWorkbook; worksheet: FWorksheet; unitId: string; subUnitId: string } | null — See signature above.
Source: @univerjs/sheets

getComponentManager

Signature

TypeScript
getComponentManager(): ComponentManager

Returns

  • ComponentManager — See signature above.
Source: @univerjs/ui

getCrosshairHighlightEnabled

Signature

TypeScript
getCrosshairHighlightEnabled(): boolean

Returns

  • boolean — See signature above.
Source: @univerjs/sheets-crosshair-highlight

getCurrentLifecycleStage

Get the current lifecycle stage.

Signature

TypeScript
getCurrentLifecycleStage(): LifecycleStages

Returns

  • LifecycleStages — - The current lifecycle stage.

Examples

TypeScript
const stage = univerAPI.getCurrentLifecycleStage()console.log(stage)
Source: @univerjs/core

getCurrentLocale

Get the current locale.

Signature

TypeScript
getCurrentLocale(): string

Returns

  • string — The current locale.

Examples

TypeScript
const currentLocale = univerAPI.getCurrentLocale()
Source: @univerjs/core

getFormula

Signature

TypeScript
getFormula(): FFormula

Returns

  • FFormula — See signature above.
Source: @univerjs/engine-formula

getLocales

Get loaded locale messages.

Signature

TypeScript
getLocales(): ILanguagePack | undefined

Returns

  • ILanguagePack | undefined — Loaded locale messages.

Examples

TypeScript
const locales = univerAPI.getLocales()
Source: @univerjs/core

getLiveShareStatus

Signature

TypeScript
getLiveShareStatus(): LiveShareStatus

Returns

  • LiveShareStatus — See signature above.
Source: @univerjs-pro/live-share

getNetwork

Signature

TypeScript
getNetwork(): FNetwork

Returns

  • FNetwork — See signature above.
Source: @univerjs/network

getProtectedRangeShadowStrategy

Signature

TypeScript
getProtectedRangeShadowStrategy(): 'always' | 'non-editable' | 'non-viewable' | 'none'

Returns

  • "always" | "non-editable" | "non-viewable" | "none" — See signature above.
Source: @univerjs/sheets-ui

getProtectedRangeShadowStrategy$

Signature

TypeScript
getProtectedRangeShadowStrategy$(): Observable<'always' | 'non-editable' | 'non-viewable' | 'none'>

Returns

  • Observable<"always" | "non-editable" | "non-viewable" | "none"> — See signature above.
Source: @univerjs/sheets-ui

registerCellCustomRender

Register custom cell renderers. Dispose the returned handle to remove the interceptor.

Signature

TypeScript
registerCellCustomRender(customRender: Nullable<ICellCustomRender[]>, effect?: InterceptorEffectEnum, priority?: number): IDisposable
Source: @univerjs/sheets-ui

getShortcut

Signature

TypeScript
getShortcut(): FShortcut

Returns

  • FShortcut — See signature above.
Source: @univerjs/ui

getDocument

Signature

TypeScript
getDocument(id: string): FDocument | null

Parameters

  • id stringNo description

Returns

  • FDocument — See signature above.
Source: @univerjs/docs

getURL

Signature

TypeScript
getURL(): URL

Returns

  • URL — See signature above.
Source: @univerjs/ui

getUserManager

Signature

TypeScript
getUserManager(): FUserManager

Returns

  • FUserManager — See signature above.
Source: @univerjs/core

getWorkbook

Signature

TypeScript
getWorkbook(id: string): FWorkbook | null

Parameters

  • id stringNo description

Returns

  • FWorkbook — See signature above.
Source: @univerjs/sheets

importDocToSnapshotAsync

Import DOCX file to document data

Signature

TypeScript
importDocToSnapshotAsync(file: File | string): Promise<IDocumentData | undefined>

Parameters

  • file string | FileNo description

Returns

  • Promise<any> — See signature above.
Source: @univerjs-pro/docs-exchange-client

importDocToUnitIdAsync

Import DOCX file to unit id

Signature

TypeScript
importDocToUnitIdAsync(file: File | string): Promise<string | undefined>

Parameters

  • file string | FileNo description

Returns

  • Promise<string> — See signature above.
Source: @univerjs-pro/docs-exchange-client

importSlideToSnapshotAsync

Import PPTX file to slide data

Signature

TypeScript
importSlideToSnapshotAsync(file: File | string): Promise<ISlideData | undefined>

Parameters

  • file File | string — File object or URL.

Returns

  • Promise<ISlideData | undefined> — See signature above.
Source: @univerjs-pro/slides-exchange-client

importSlideToUnitIdAsync

Import PPTX file to unit id

Signature

TypeScript
importSlideToUnitIdAsync(file: File | string): Promise<string | undefined>

Parameters

  • file File | string — File object or URL.

Returns

  • Promise<string> — See signature above.
Source: @univerjs-pro/slides-exchange-client

importSheetToSnapshotAsync

Import XLSX file to workbook data

Signature

TypeScript
importSheetToSnapshotAsync(file: File | string): Promise<IWorkbookData | undefined>

Parameters

  • file string | FileNo description

Returns

  • Promise<any> — See signature above.
Source: @univerjs-pro/sheets-exchange-client

importSheetToUnitIdAsync

Import XLSX file to unit id

Signature

TypeScript
importSheetToUnitIdAsync(file: File | string): Promise<string | undefined>

Parameters

  • file string | FileNo description

Returns

  • Promise<string> — See signature above.
Source: @univerjs-pro/sheets-exchange-client

isUIVisible

Signature

TypeScript
isUIVisible(ui: BuiltInUIPart): boolean

Parameters

  • ui BuiltInUIPartNo description

Returns

  • boolean — See signature above.
Source: @univerjs/ui

loadLocales

Load locales for the given locale.

Signature

TypeScript
loadLocales(locale: string, locales: ILanguagePack): void

Parameters

  • locale stringNo description
  • locales ILanguagePackNo description

Examples

TypeScript
univerAPI.loadLocales('esES', {  'Hello World': 'Hola Mundo',})
Source: @univerjs/core

loadServerUnit

Signature

TypeScript
loadServerUnit(unitId: string, unitType: UniverInstanceType, subUnitId?: string): Promise<UnitModel | null>

Parameters

  • unitId stringNo description
  • unitType UniverInstanceTypeNo description
  • subUnitId string (optional)No description

Returns

  • Promise<any> — See signature above.
Source: @univerjs-pro/collaboration-client

loadServerUnitOfRevision

Signature

TypeScript
loadServerUnitOfRevision(unitId: string, unitType: UniverInstanceType, rev: number): Promise<UnitModel | null>

Parameters

  • unitId stringNo description
  • unitType UniverInstanceTypeNo description
  • rev numberNo description

Returns

  • Promise<any> — See signature above.
Source: @univerjs-pro/collaboration-client

onBeforeCopy

Signature

TypeScript
onBeforeCopy(callback: () => void): IDisposable

Parameters

  • callback () => voidNo description

Returns

  • IDisposable — See signature above.
Source: @univerjs/ui

onBeforePaste

Signature

TypeScript
onBeforePaste(callback: () => void): IDisposable

Parameters

  • callback () => voidNo description

Returns

  • IDisposable — See signature above.
Source: @univerjs/ui

onCopy

Signature

TypeScript
onCopy(callback: () => void): IDisposable

Parameters

  • callback () => voidNo description

Returns

  • IDisposable — See signature above.
Source: @univerjs/ui

onPaste

Signature

TypeScript
onPaste(callback: () => void): IDisposable

Parameters

  • callback () => voidNo description

Returns

  • IDisposable — See signature above.
Source: @univerjs/ui

openDialog

Signature

TypeScript
openDialog(dialog: IDialogPartMethodOptions): IDisposable

Parameters

  • dialog IDialogPartMethodOptionsNo description

Returns

  • IDisposable — See signature above.
Source: @univerjs/ui

openSidebar

Signature

TypeScript
openSidebar(params: ISidebarMethodOptions): IDisposable

Parameters

  • params ISidebarMethodOptionsNo description

Returns

  • IDisposable — See signature above.
Source: @univerjs/ui

paste

Signature

TypeScript
paste(): Promise<boolean>

Returns

  • Promise<boolean> — See signature above.
Source: @univerjs/ui

pasteIntoSheet

Signature

TypeScript
pasteIntoSheet(htmlContent?: string, textContent?: string, files?: File[]): Promise<boolean>

Parameters

  • htmlContent string (optional)No description
  • textContent string (optional)No description
  • files File[] (optional)No description

Returns

  • Promise<boolean> — See signature above.
Source: @univerjs/sheets-ui

registerComponent

Signature

TypeScript
registerComponent(name: string, component: ComponentType, options?: IComponentOptions): IDisposable

Parameters

  • name stringNo description
  • component ComponentTypeNo description
  • options IComponentOptions (optional)No description

Returns

  • IDisposable — See signature above.
Source: @univerjs/ui

registerSheetColumnHeaderExtension

Signature

TypeScript
registerSheetColumnHeaderExtension(unitId: string, ...extensions: SheetExtension[]): IDisposable

Parameters

  • unitId stringNo description
  • extensions SheetExtension[]No description

Returns

  • IDisposable — See signature above.
Source: @univerjs/sheets-ui

registerSheetMainExtension

Signature

TypeScript
registerSheetMainExtension(unitId: string, ...extensions: SheetExtension[]): IDisposable

Parameters

  • unitId stringNo description
  • extensions SheetExtension[]No description

Returns

  • IDisposable — See signature above.
Source: @univerjs/sheets-ui

registerSheetRowHeaderExtension

Signature

TypeScript
registerSheetRowHeaderExtension(unitId: string, ...extensions: SheetExtension[]): IDisposable

Parameters

  • unitId stringNo description
  • extensions SheetExtension[]No description

Returns

  • IDisposable — See signature above.
Source: @univerjs/sheets-ui

registerUIPart

Signature

TypeScript
registerUIPart(key: BuiltInUIPart, component: ComponentType): IDisposable

Parameters

  • key BuiltInUIPartNo description
  • component ComponentTypeNo description

Returns

  • IDisposable — See signature above.
Source: @univerjs/ui

registerURLImageDownloader

Signature

TypeScript
registerURLImageDownloader(downloader: (url: string) => Promise<string>): IDisposable

Parameters

  • downloader (url: string) => Promise<string>No description

Returns

  • IDisposable — See signature above.
Source: @univerjs/sheets-drawing-ui

runOnServer

Signature

TypeScript
runOnServer(scriptNameOrId: string, func: string, ...params: any[]): Promise<string>

Parameters

  • scriptNameOrId stringNo description
  • func stringNo description
  • params any[]No description

Returns

  • Promise<string> — See signature above.
Source: @univerjs-pro/collaboration-client-ui

setCrosshairHighlightEnabled

Signature

TypeScript
setCrosshairHighlightEnabled(enabled: boolean): FUniver

Parameters

  • enabled booleanNo description

Returns

  • FUniver — See signature above.
Source: @univerjs/sheets-crosshair-highlight

setCurrent

Signature

TypeScript
setCurrent(unitId: string): void

Parameters

  • unitId stringNo description
Source: @univerjs/ui

setFreezeSync

Signature

TypeScript
setFreezeSync(enabled: boolean): void

Parameters

  • enabled booleanNo description
Source: @univerjs/sheets

setPermissionDialogVisible

Signature

TypeScript
setPermissionDialogVisible(visible: boolean): void

Parameters

  • visible booleanNo description
Source: @univerjs/sheets-ui

setProtectedRangeShadowStrategy

Signature

TypeScript
setProtectedRangeShadowStrategy(strategy: 'always' | 'non-editable' | 'non-viewable' | 'none'): void

Parameters

  • strategy "always" | "non-editable" | "non-viewable" | "none"No description
Source: @univerjs/sheets-ui

setRibbonType

Signature

TypeScript
setRibbonType(ribbonType: 'collapsed' | 'simple' | 'classic' | 'grid'): FUniver

Changes the current ribbon layout while preserving the rest of the UI plugin configuration.

Returns

  • FUniver — The current Facade instance for chaining.
Source: @univerjs/ui

setUIVisible

Signature

TypeScript
setUIVisible(ui: BuiltInUIPart, visible: boolean): FUniver

Parameters

  • ui BuiltInUIPartNo description
  • visible booleanNo description

Returns

  • FUniver — See signature above.
Source: @univerjs/ui

showMessage

Signature

TypeScript
showMessage(options: IMessageProps): FUniver

Parameters

  • options IMessagePropsNo description

Returns

  • FUniver — See signature above.
Source: @univerjs/ui

showRangeSelectorDialog

Signature

TypeScript
showRangeSelectorDialog(opts: IShowRangeSelectorDialogOptions): Promise<IUnitRangeName[]>

Parameters

  • opts IShowRangeSelectorDialogOptionsNo description

Returns

  • Promise<IUnitRangeName[]> — See signature above.
Source: @univerjs/sheets-formula-ui

startFollowing

Signature

TypeScript
startFollowing(): void
Source: @univerjs-pro/live-share

startPresenting

Signature

TypeScript
startPresenting(): void
Source: @univerjs-pro/live-share

stopFollowing

Signature

TypeScript
stopFollowing(): void
Source: @univerjs-pro/live-share

stopPresenting

Signature

TypeScript
stopPresenting(): void
Source: @univerjs-pro/live-share

transformSnapshotJsonToWorkbookDataAsync

Transform snapshot JSON returned by the exchange service to workbook data.

Signature

TypeScript
transformSnapshotJsonToWorkbookDataAsync(json: ISnapshotBlockJsonResponse): Promise<IWorkbookData>

Parameters

  • json ISnapshotBlockJsonResponse — Snapshot JSON returned by the exchange service.

Returns

  • Promise<IWorkbookData> — Workbook data.
Source: @univerjs-pro/sheets-exchange-client

transformWorkbookDataToSnapshotJsonAsync

Transform workbook data to snapshot JSON accepted by the exchange service.

Signature

TypeScript
transformWorkbookDataToSnapshotJsonAsync(workbookData: IWorkbookData): Promise<ISnapshotBlockJson>

Parameters

  • workbookData IWorkbookData — Workbook data.

Returns

  • Promise<ISnapshotBlockJson> — Snapshot JSON accepted by the exchange service.
Source: @univerjs-pro/sheets-exchange-client

How is this guide?

© 2026 DreamNum Co., Ltd.