@univerjs-pro/docs-exchange-client
Document import and export client integration for Web SDK.
TypeScript
import { UniverDocsExchangeClientPlugin } from '@univerjs-pro/docs-exchange-client'univer.registerPlugin(UniverDocsExchangeClientPlugin)Entry Points
- Facade:
@univerjs-pro/docs-exchange-client/facade - Locale:
@univerjs-pro/docs-exchange-client/locale/*
Facade API
TypeScript
import '@univerjs-pro/docs-exchange-client/facade'importDocToUnitIdAsync(file: File | string, options?: IExchangeDocImportOption): Promise<string | undefined>importDocToSnapshotAsync(file: File | string, options?: IExchangeDocImportOption): Promise<IDocumentData | undefined>exportDocByUnitIdAsync(unitId: string): Promise<File | undefined>exportDocBySnapshotAsync(snapshot: IDocumentData): Promise<File | undefined>transformSnapshotJsonToDocumentDataAsync(json: ISnapshotBlockJsonResponse): Promise<IDocumentData>transformDocumentDataToSnapshotJsonAsync(documentData: IDocumentData): Promise<ISnapshotBlockJson>Use IExchangeDocImportOption.docType to select the document flavor:
TypeScript
import { ExchangeDocType } from '@univerjs-pro/exchange-client'const unitId = await univerAPI.importDocToUnitIdAsync(file, { docType: ExchangeDocType.MODERN,})IUniverDocsExchangeClientConfig
TypeScript
import type { MenuConfig } from '@univerjs/ui'export interface IUniverDocsExchangeClientConfig { menu?: MenuConfig}How is this guide?