@univerjs/docs
Core document model and rich-text operations for Univer Docs.
TypeScript
import { UniverDocsPlugin } from '@univerjs/docs'univer.registerPlugin(UniverDocsPlugin, config)Document Layout Worker
Move document layout work to a Web Worker by registering the Worker plugin after UniverDocsPlugin:
TypeScript
import { UniverDocsLayoutWorkerPlugin } from '@univerjs/docs'univer.registerPlugin(UniverDocsLayoutWorkerPlugin, { workerFactory: () => new Worker(new URL('./docs-layout.worker.ts', import.meta.url), { type: 'module', }), requestTimeoutMs: 15_000,})Initialize the Worker entry:
TypeScript
import { startDocsLayoutWorker } from '@univerjs/docs'startDocsLayoutWorker()workerFactory is required. requestTimeoutMs is optional and defaults to 15 seconds.
Entry Points
- Facade:
@univerjs/docs/facade
The root entry exports SetDocumentNameCommand and ISetDocumentNameCommandParams. The Facade exposes the same behavior through FDocument.setName(name).
IUniverDocsConfig
TypeScript
export interface IUniverDocsConfig { hasScroll?: boolean}How is this guide?