# @univerjs/docs

- Human documentation: [https://docs.univer.ai/reference/packages/plugins/univerjs/docs](https://docs.univer.ai/reference/packages/plugins/univerjs/docs)

- Agent Markdown: [https://docs.univer.ai/reference/packages/plugins/univerjs/docs.md](https://docs.univer.ai/reference/packages/plugins/univerjs/docs.md)

- Requested language: `en-US`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

- Source: [packages/plugins/univerjs/docs.mdx](https://github.com/dream-num/documentation/blob/dev/content/reference/packages/plugins/univerjs/docs.mdx)

---

Core document model and rich-text operations for Univer Docs.

```typescript
// [!code word:UniverDocsPlugin]
// [!code word:IUniverDocsConfig]
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

```ts
export interface IUniverDocsConfig {
  hasScroll?: boolean
}
```
