# OfficialDocument

Provides composeOfficialDocument, which validates official-document data and replaces the whole document in one undoable edit.

Provides composeOfficialDocument, which validates official-document data and replaces the whole document in one undoable edit.

`@quirekit/official-document/classic` · **Commercial**

## Editor compatibility
Layer：**Classic product integration**
| Editor | Status | Assembly and boundaries |
| --- | --- | --- |
| Classic | Supported | Add this optional Classic extension to createClassicEditor extensions. The host still owns assets, persistence and required styles; this is not a product plugin for plugins. |
| Block | Unsupported | Block does not consume Classic product contributions, plugins or paginated assembly. Use shared capabilities and Block adapters instead of copying this entry's Classic configuration. |

“Supported” means the product assembly above exists; interaction, host services and file formats retain their own conditions. See [status and integration rules](/en/plugins/compatibility). Licensing is shown separately.

## Installation

The current `@quirekit/official-document/classic` manifest is private. This site uses workspace source; external projects need the relevant distribution package rather than assuming public npm availability.

This entry is a commercial component. Obtain distribution access and authorization first; installation commands require that distribution source.

Use the [Classic kit](/en/plugins/reference/classic-editor-kit). Individual adapters support custom assembly or replacement without duplicate names.

```ts
import { OfficialDocument } from '@quirekit/official-document/classic'
```

Use compatible versions available from your distribution source. This site uses the Alpha workspace. License labels come from package metadata; see [support and licensing](/en/support).

## Integration by editor

These snippets use an existing host element named element. The host owns container sizing and persistence; call instance.destroy() on teardown. Avoid duplicating preset capabilities and supply required host ports before installation.

### Classic

Add this optional Classic extension to createClassicEditor extensions. The host still owns assets, persistence and required styles; this is not a product plugin for plugins.

```ts
import { createClassicEditor } from '@quirekit/classic-editor'
import '@quirekit/classic-editor/styles.css'
import { OfficialDocument } from '@quirekit/official-document/classic'

const instance = createClassicEditor({
  element,
  extensions: [OfficialDocument],
})
```

### Block

Block does not consume Classic product contributions, plugins or paginated assembly. Use shared capabilities and Block adapters instead of copying this entry's Classic configuration.

## Configuration

This entry has no independent configuration fields. Set document attributes through domain commands; presets may install other configurable children.

## Commands and runtime

These commands are supplied directly by this extension. Availability depends on the installed schema, selection and protection policy; query editor.can() first.

| Command | Parameter signature |
| --- | --- |
| `composeOfficialDocument` | `composeOfficialDocument(data: { version?: 1; title?: string; format?: "letter"; copyNumber?: string; secrecy?: { term?: string; level: "秘密" \| "机密" \| "绝密"; }; urgency?: "特急" \| "加急" \| "特提" \| "平急"; documentNumber?: string; signers?: string[]; adoption?: string; recipients?: string[]; attachments?: string[]; signature?: { type: "agency"; } \| { seals?: string[]; diameter?: number; type: "sealed"; } \| { height?: number; type: "stamp"; stamps: { image?: string; position: string; }[]; } \| { name: string; type: "leader"; position: string; } \| { type: "none"; }; date?: string; note?: string; attendees?: { label: "出席" \| "请假" \| "列席"; names: string[]; }[]; imprint?: { date?: string; cc?: string[]; office?: string; }; kind: "resolution" \| "decision" \| "order" \| "communique" \| "announcement" \| "public-notice" \| "opinion" \| "notice" \| "circular" \| "report" \| "request" \| "reply" \| "proposal" \| "letter" \| "minutes"; issuer: { joint?: string[]; mark?: string; agency: string; }; body: ({ type: "paragraph"; text: string; } \| { text?: string; title: string; type: "heading"; level: number; } \| { title?: string; header?: string[][]; columns?: { width?: number; align?: "start" \| "center" \| "end"; }[]; fontSize?: 16 \| 14 \| 12; type: "table"; rows: string[][]; } \| { width?: number; caption?: string; type: "image"; src: string; })[]; })` |

These are parameter signatures. See [commands and controls](/en/build/commands) to connect UI while retaining one transaction/history authority.

## Next steps

Return to [all plugins](/en/plugins), or read [configuration](/en/plugins/configuration) to distinguish options, attributes and commands.

Continue with [Classic quick start](/en/classic/quick-start) and [configuration/lifetime](/en/classic/configuration). See [product plugin development](/en/build/product-plugin) for your own UI and services.
