Birch UI v0.1
Pricing

@birchui/document

Document Editor: createDocumentEditor, the document JSON model, DOCX and PDF conversion, review and collaboration.

Open .md
npm install @birchui/documentLicense: Commercial

Key exports: createDocumentEditor, DocumentEditorOptions, DocumentEditorApi, DocumentEditorEvents

Guides: Accessibility conformance report, Accessibility, Document Editor API and events, Collaboration, Comments, Compare and version history

@birchui/document#

acceptAllRevisionsfunction#

function acceptAllRevisions(doc: DocNodeJSON): DocNodeJSON
ParameterTypeDescription
docDocNodeJSON—

Defined in packages/document/src/model/compare.ts:677

breakGapsfunction#

function breakGaps(breaks: readonly LayoutBreak[], pageStride: number): number[]
ParameterTypeDescription
breaksreadonly LayoutBreak[]—
pageStridenumber—

Defined in packages/document/src/layout/paginate.ts:630

buildDocxPartsfunction#

function buildDocxParts(input: DocumentData, options: DocxWriteOptions = {}): ZipInputFile[]
ParameterTypeDescription
inputDocumentData—
optionsoptionalDocxWriteOptions—

Defined in packages/document/src/docx/writer.ts:1505

checkAccessibilityfunction#

function checkAccessibility(doc: DocNodeJSON, options: { fontSize?: number; rules?: readonly AccessibilityRule[] } = {}): AccessibilityIssue[]
ParameterTypeDescription
docDocNodeJSON—
optionsoptional{ fontSize?: number; rules?: readonly AccessibilityRule[] }—

Defined in packages/document/src/model/accessibility.ts:238

clearRegisteredFontsfunction#

function clearRegisteredFonts(): void

Defined in packages/document/src/layout/pdf/font-substitution.ts:89

combineDocumentsfunction#

function combineDocuments(original: DocNodeJSON, first: DocNodeJSON, second: DocNodeJSON, options: CombineOptions = {}): DocNodeJSON
ParameterTypeDescription
originalDocNodeJSON—
firstDocNodeJSON—
secondDocNodeJSON—
optionsoptionalCombineOptions—

Defined in packages/document/src/model/combine.ts:78

compareDocumentsfunction#

function compareDocuments(original: DocNodeJSON, revised: DocNodeJSON, options: CompareOptions & { idPrefix?: string } = {}): DocNodeJSON
ParameterTypeDescription
originalDocNodeJSON—
revisedDocNodeJSON—
optionsoptionalCompareOptions & { idPrefix?: string }—

Defined in packages/document/src/model/compare.ts:593

contentBoxfunction#

function contentBox(setup: PageSetup): { width: number; height: number }
ParameterTypeDescription
setupPageSetup—

Defined in packages/document/src/model/page-setup.ts:45

contrastRatiofunction#

function contrastRatio(foreground: string, background: string): number | null
ParameterTypeDescription
foregroundstring—
backgroundstring—

Defined in packages/document/src/model/accessibility.ts:66

countRevisionsfunction#

function countRevisions(doc: DocNodeJSON): number
ParameterTypeDescription
docDocNodeJSON—

Defined in packages/document/src/model/compare.ts:656

createAuthorityBackendfunction#

function createAuthorityBackend(authority: CollabAuthority, start: CollabBackendStart = {}): CollabBackend
ParameterTypeDescription
authorityCollabAuthority—
startoptionalCollabBackendStart—

Defined in packages/document/src/editor/collab/backend.ts:146

createBroadcastChannelBackendfunction#

function createBroadcastChannelBackend(options: CollabBroadcastBackendOptions): CollabBackend
ParameterTypeDescription
optionsCollabBroadcastBackendOptions—

Defined in packages/document/src/editor/collab/broadcast-backend.ts:98

createCollabAuthorityfunction#

function createCollabAuthority(options: CollabAuthorityOptions = {}): CollabAuthority
ParameterTypeDescription
optionsoptionalCollabAuthorityOptions—

Defined in packages/document/src/editor/collab/authority.ts:409

createCollabDocumentfunction#

function createCollabDocument(document?: DocumentInput | null, limits?: Partial<CollabDocumentLimits>): CollabDocument
ParameterTypeDescription
documentoptionalDocumentInput | null—
limitsoptionalPartial<CollabDocumentLimits>—

Defined in packages/document/src/editor/collab/document-state.ts:291

createCollabIdfunction#

function createCollabId(prefix = '', random?: () => number): string
ParameterTypeDescription
prefixoptionalunknown—
randomoptional() => number—

Defined in packages/document/src/editor/collab/ids.ts:19

createCollabProviderfunction#

function createCollabProvider(backend: CollabBackend, options: CollabBackendProviderOptions = {}): CollabBackendProvider
ParameterTypeDescription
backendCollabBackend—
optionsoptionalCollabBackendProviderOptions—

Defined in packages/document/src/editor/collab/backend.ts:37

createDocumentEditorfunction#

function createDocumentEditor(container: HTMLElement, options: DocumentEditorOptions = {}): DocumentEditorApi
ParameterTypeDescription
containerHTMLElement—
optionsoptionalDocumentEditorOptions—

Defined in packages/document/src/editor/document-editor.ts:57

createIndexedDbOfflineStorefunction#

function createIndexedDbOfflineStore(options: { key: string; database?: string }): CollabOfflineStore

Keeps unsent edits in IndexedDB under key, which should name the document and the signed-in person, so a tab that closes while offline finds them again.

ParameterTypeDescription
options{ key: string; database?: string }—

Defined in packages/document/src/editor/collab/offline-store.ts:30

createLoopbackHubfunction#

function createLoopbackHub(options: LoopbackHubOptions = {}): LoopbackHub
ParameterTypeDescription
optionsoptionalLoopbackHubOptions—

Defined in packages/document/src/editor/collab/loopback.ts:283

createMemoryOfflineStorefunction#

function createMemoryOfflineStore(): CollabOfflineStore

Defined in packages/document/src/editor/collab/offline-store.ts:6

createSocketBackendfunction#

function createSocketBackend(options: CollabSocketBackendOptions): CollabBackend
ParameterTypeDescription
optionsCollabSocketBackendOptions—

Defined in packages/document/src/editor/collab/socket-backend.ts:131

createWireBackendfunction#

function createWireBackend(link: CollabWireLink, options: CollabWireBackendOptions = {}): CollabBackend
ParameterTypeDescription
linkCollabWireLink—
optionsoptionalCollabWireBackendOptions—

Defined in packages/document/src/editor/collab/wire.ts:37

createWireEndpointfunction#

function createWireEndpoint(authority: CollabAuthority, send: (message: CollabWireMessage) => void): CollabWireEndpoint
ParameterTypeDescription
authorityCollabAuthority—
send(message: CollabWireMessage) => void—

Defined in packages/document/src/editor/collab/wire.ts:167

describeChartfunction#

function describeChart(model: ChartModel): string
ParameterTypeDescription
modelChartModel—

Defined in packages/document/src/model/chart.ts:339

detectFileTypefunction#

function detectFileType(input: FileTypeInput): FileTypeInfo

The type of an embedded file. The ProgID is asked first, then the file name, then the content type and the extension of the part, and last the leading bytes.

ParameterTypeDescription
inputFileTypeInput—

Defined in packages/document/src/docx/file-type.ts:352

docToDocumentfunction#

function docToDocument(input: Uint8Array | ArrayBuffer, options: DocReadOptions = {}): DocumentData

Reads a Word 97–2003 binary document (.doc). Every failure is a DocFormatError; hostile or damaged input never reads outside the file and stays within limits.

ParameterTypeDescription
inputUint8Array | ArrayBuffer—
optionsoptionalDocReadOptions—

Defined in packages/document/src/doc/reader.ts:865

documentSectionsfunction#

function documentSections(data: Pick<DocumentData, 'content' | 'page'> & Partial<DocumentData>): DocumentSection[]
ParameterTypeDescription
dataPick<DocumentData, 'content' | 'page'> & Partial<DocumentData>—

Defined in packages/document/src/model/sections.ts:10

documentTextfunction#

function documentText(doc: DocNodeJSON, options: { skipDeleted?: boolean } = {}): string
ParameterTypeDescription
docDocNodeJSON—
optionsoptional{ skipDeleted?: boolean }—

Defined in packages/document/src/model/json.ts:257

documentToDocxfunction#

function documentToDocx(data: DocumentData, options: DocxWriteOptions = {}): Promise<Uint8Array>
ParameterTypeDescription
dataDocumentData—
optionsoptionalDocxWriteOptions—

Defined in packages/document/src/docx/writer.ts:1545

documentToHtmlfunction#

function documentToHtml(input: DocumentInput, options: HtmlDocumentOptions = {}): string
ParameterTypeDescription
inputDocumentInput—
optionsoptionalHtmlDocumentOptions—

Defined in packages/document/src/formats/html.ts:964

documentToMarkdownfunction#

function documentToMarkdown(input: DocumentInput, options: MarkdownOptions = {}): string
ParameterTypeDescription
inputDocumentInput—
optionsoptionalMarkdownOptions—

Defined in packages/document/src/formats/markdown.ts:261

documentToOdtfunction#

function documentToOdt(input: DocumentInput): Promise<Uint8Array>
ParameterTypeDescription
inputDocumentInput—

Defined in packages/document/src/formats/odt.ts:452

documentToPdffunction#

function documentToPdf(input: DocumentInput, options: DocumentPdfOptions = {}): Promise<Uint8Array>
ParameterTypeDescription
inputDocumentInput—
optionsoptionalDocumentPdfOptions—

Defined in packages/document/src/layout/pdf/document-layout.ts:471

docxToDocumentfunction#

function docxToDocument(input: Uint8Array | ArrayBuffer | Blob, options: DocxReadOptions = {}): Promise<DocumentData>
ParameterTypeDescription
inputUint8Array | ArrayBuffer | Blob—
optionsoptionalDocxReadOptions—

Defined in packages/document/src/docx/reader.ts:774

embeddedObjectFilefunction#

function embeddedObjectFile(attrs: Attrs): EmbeddedObjectFile
ParameterTypeDescription
attrsAttrs—

Defined in packages/document/src/docx/embedded.ts:107

embeddedObjectNodefunction#

function embeddedObjectNode(input: EmbeddedObjectInput): DocNodeJSON
ParameterTypeDescription
inputEmbeddedObjectInput—

Defined in packages/document/src/docx/embedded.ts:85

embeddedObjectTypefunction#

function embeddedObjectType(attrs: Attrs): FileTypeInfo

The file type of an embedded_object node, from its ProgID, file name, content type and bytes, in that order.

ParameterTypeDescription
attrsAttrs—

Defined in packages/document/src/docx/embedded.ts:63

emptyDocumentfunction#

function emptyDocument(): DocumentData

Defined in packages/document/src/model/json.ts:37

fileIconSvgfunction#

function fileIconSvg(type: Pick<FileTypeInfo, 'kind' | 'badge'>, options: FileIconSvgOptions = {}): string

A standalone SVG picture of the icon of a file type, with the badge as text.

ParameterTypeDescription
typePick<FileTypeInfo, 'kind' | 'badge'>—
optionsoptionalFileIconSvgOptions—

Defined in packages/document/src/docx/file-icon.ts:143

fileTypeLabelfunction#

function fileTypeLabel(label: FileTypeLabel, translate?: FileTypeTranslate): string

The name of a file type as it reads inside a sentence: "PDF document", "image".

ParameterTypeDescription
labelFileTypeLabel—
translateoptionalFileTypeTranslate—

Defined in packages/document/src/docx/file-type.ts:420

findMatchesfunction#

function findMatches(blocks: readonly SearchBlock[], query: string, options: FindOptions = {}): SearchMatch[]
ParameterTypeDescription
blocksreadonly SearchBlock[]—
querystring—
optionsoptionalFindOptions—

Defined in packages/document/src/model/search.ts:96

fontFamilyStackfunction#

function fontFamilyStack(fontFamily: string): string

A CSS font-family list that puts the metric-compatible substitutes right after each requested family.

ParameterTypeDescription
fontFamilystring—

Defined in packages/document/src/layout/pdf/font-substitution.ts:48

fontSubstitutesfunction#

function fontSubstitutes(family: string): readonly string[]
ParameterTypeDescription
familystring—

Defined in packages/document/src/layout/pdf/font-substitution.ts:36

formatBibliographyEntryfunction#

function formatBibliographyEntry(source: BibliographySource, style: CitationStyle): CitationRun[]
ParameterTypeDescription
sourceBibliographySource—
styleCitationStyle—

Defined in packages/document/src/model/citations.ts:453

formatCitationfunction#

function formatCitation(request: CitationRequest, sources: readonly BibliographySource[], style: CitationStyle): string | null
ParameterTypeDescription
requestCitationRequest—
sourcesreadonly BibliographySource[]—
styleCitationStyle—

Defined in packages/document/src/model/citations.ts:248

formatDatePicturefunction#

function formatDatePicture(date: Date, picture: string): string
ParameterTypeDescription
dateDate—
picturestring—

Defined in packages/document/src/model/fields.ts:186

formatNumberfunction#

function formatNumber(value: number, format: string): string
ParameterTypeDescription
valuenumber—
formatstring—

Defined in packages/document/src/model/numbering.ts:239

hostBroadcastChannelfunction#

function hostBroadcastChannel(authority: CollabAuthority, channel: CollabBroadcastPort | string, options: { hostTimeout?: number } = {}): { close(): void }
ParameterTypeDescription
authorityCollabAuthority—
channelCollabBroadcastPort | string—
optionsoptional{ hostTimeout?: number }—

Defined in packages/document/src/editor/collab/broadcast-backend.ts:102

htmlToDocumentfunction#

function htmlToDocument(html: string): DocumentData
ParameterTypeDescription
htmlstring—

Defined in packages/document/src/formats/html.ts:690

imageSourceKindfunction#

function imageSourceKind(value: unknown): ImageSourceKind
ParameterTypeDescription
valueunknown—

Defined in packages/document/src/model/url.ts:79

inkSvgfunction#

function inkSvg(stroke: InkStroke, width: number, height: number): string
ParameterTypeDescription
strokeInkStroke—
widthnumber—
heightnumber—

Defined in packages/document/src/model/ink.ts:105

layoutDocumentfunction#

function layoutDocument(input: DocumentInput, options: DocumentPdfOptions = {}): { layout: PdfDocumentLayout; warnings: string[]; missingFonts: string[] }
ParameterTypeDescription
inputDocumentInput—
optionsoptionalDocumentPdfOptions—

Defined in packages/document/src/layout/pdf/document-layout.ts:105

layoutToPdffunction#

function layoutToPdf(layout: PdfDocumentLayout, options: PdfWriteOptions = {}): Promise<Uint8Array>
ParameterTypeDescription
layoutPdfDocumentLayout—
optionsoptionalPdfWriteOptions—

Defined in packages/document/src/layout/pdf/writer.ts:722

markdownToDocumentfunction#

function markdownToDocument(markdown: string): DocumentData
ParameterTypeDescription
markdownstring—

Defined in packages/document/src/formats/markdown.ts:748

markMovesfunction#

function markMoves(doc: DocNodeJSON): DocNodeJSON
ParameterTypeDescription
docDocNodeJSON—

Defined in packages/document/src/model/compare.ts:652

mergeContentfunction#

function mergeContent(doc: DocNodeJSON, values: MergeValues, options: MergeOptions = {}): DocNodeJSON
ParameterTypeDescription
docDocNodeJSON—
valuesMergeValues—
optionsoptionalMergeOptions—

Defined in packages/document/src/model/merge.ts:520

mergeDocumentfunction#

function mergeDocument(data: DocumentData, values: MergeValues, options: MergeOptions = {}): DocumentData
ParameterTypeDescription
dataDocumentData—
valuesMergeValues—
optionsoptionalMergeOptions—

Defined in packages/document/src/model/merge.ts:525

mergeFieldNamesfunction#

function mergeFieldNames(doc: DocNodeJSON): string[]
ParameterTypeDescription
docDocNodeJSON—

Defined in packages/document/src/model/merge.ts:537

metafileToSvgfunction#

function metafileToSvg(bytes: Uint8Array, options: MetafileOptions = {}): string | null
ParameterTypeDescription
bytesUint8Array—
optionsoptionalMetafileOptions—

Defined in packages/document/src/docx/metafile.ts:584

multiplyMatrixfunction#

function multiplyMatrix(first: PdfMatrix, second: PdfMatrix): PdfMatrix
ParameterTypeDescription
firstPdfMatrix—
secondPdfMatrix—

Defined in packages/document/src/layout/pdf/layout-tree.ts:204

normalizeChartfunction#

function normalizeChart(value: unknown): ChartModel | null
ParameterTypeDescription
valueunknown—

Defined in packages/document/src/model/chart.ts:20

normalizeDocumentfunction#

function normalizeDocument(input: DocumentInput | null | undefined): DocumentData
ParameterTypeDescription
inputDocumentInput | null | undefined—

Defined in packages/document/src/model/json.ts:155

normalizePageSetupfunction#

function normalizePageSetup(input: Partial<PageSetup> | undefined, base: PageSetup = DEFAULT_PAGE_SETUP): PageSetup
ParameterTypeDescription
inputPartial<PageSetup> | undefined—
baseoptionalPageSetup—

Defined in packages/document/src/model/page-setup.ts:109

normalizeStrokefunction#

function normalizeStroke(value: unknown): InkStroke | null
ParameterTypeDescription
valueunknown—

Defined in packages/document/src/model/ink.ts:22

numberingLabelsfunction#

function numberingLabels(document: Pick<DocumentData, 'content'> & Partial<DocumentData>): NumberingLabel[]
ParameterTypeDescription
documentPick<DocumentData, 'content'> & Partial<DocumentData>—

Defined in packages/document/src/model/numbering.ts:639

odtToDocumentfunction#

function odtToDocument(input: Uint8Array | ArrayBuffer | Blob, options: { limits?: Partial<ZipLimits> } = {}): Promise<DocumentData>
ParameterTypeDescription
inputUint8Array | ArrayBuffer | Blob—
optionsoptional{ limits?: Partial<ZipLimits> }—

Defined in packages/document/src/formats/odt.ts:831

outlineOffunction#

function outlineOf(doc: DocNodeJSON): OutlineEntry[]
ParameterTypeDescription
docDocNodeJSON—

Defined in packages/document/src/model/json.ts:307

pageDimensionsfunction#

function pageDimensions(setup: PageSetup): { width: number; height: number }
ParameterTypeDescription
setupPageSetup—

Defined in packages/document/src/model/page-setup.ts:38

paginatefunction#

function paginate(blocks: readonly LayoutBlock[], options: PaginateOptions): PaginationResult
ParameterTypeDescription
blocksreadonly LayoutBlock[]—
optionsPaginateOptions—

Defined in packages/document/src/layout/paginate.ts:617

parseFieldInstructionfunction#

function parseFieldInstruction(instruction: string): ParsedField
ParameterTypeDescription
instructionstring—

Defined in packages/document/src/model/fields.ts:122

readDocxfunction#

function readDocx(input: Uint8Array | ArrayBuffer | Blob, options: DocxReadOptions = {}): Promise<DocxReadResult>
ParameterTypeDescription
inputUint8Array | ArrayBuffer | Blob—
optionsoptionalDocxReadOptions—

Defined in packages/document/src/docx/reader.ts:447

registeredFontsfunction#

function registeredFonts(): readonly PdfFontSource[]

Defined in packages/document/src/layout/pdf/font-substitution.ts:85

registerFontsfunction#

function registerFonts(fonts: readonly PdfFontSource[]): void

Makes font files available to every PDF written afterwards, in the browser and on a server, in addition to the fonts passed with a single call. Registering a face again replaces it.

ParameterTypeDescription
fontsreadonly PdfFontSource[]—

Defined in packages/document/src/layout/pdf/font-substitution.ts:70

rejectAllRevisionsfunction#

function rejectAllRevisions(doc: DocNodeJSON): DocNodeJSON
ParameterTypeDescription
docDocNodeJSON—

Defined in packages/document/src/model/compare.ts:681

renderChartSvgfunction#

function renderChartSvg(input: ChartModel, width: number, height: number): string
ParameterTypeDescription
inputChartModel—
widthnumber—
heightnumber—

Defined in packages/document/src/model/chart.ts:345

renderDocumentPdffunction#

function renderDocumentPdf(input: DocumentInput, options: DocumentPdfOptions = {}): Promise<DocumentPdfResult>
ParameterTypeDescription
inputDocumentInput—
optionsoptionalDocumentPdfOptions—

Defined in packages/document/src/layout/pdf/document-layout.ts:457

rotationMatrixfunction#

function rotationMatrix(degrees: number, centerX: number, centerY: number): PdfMatrix
ParameterTypeDescription
degreesnumber—
centerXnumber—
centerYnumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:197

rtfToDocumentfunction#

function rtfToDocument(input: string | Uint8Array | ArrayBuffer): DocumentData
ParameterTypeDescription
inputstring | Uint8Array | ArrayBuffer—

Defined in packages/document/src/formats/rtf.ts:700

sanitizeHreffunction#

function sanitizeHref(value: unknown, linkSchemes?: readonly string[]): string | null

The address when it may be followed, otherwise null. linkSchemes extends the allow-list.

ParameterTypeDescription
valueunknown—
linkSchemesoptionalreadonly string[]—

Defined in packages/document/src/model/url.ts:56

sanitizeImageSrcfunction#

function sanitizeImageSrc(value: unknown): string
ParameterTypeDescription
valueunknown—

Defined in packages/document/src/model/url.ts:92

updateFieldsfunction#

function updateFields(input: DocumentData, context: FieldContext = {}): DocumentData
ParameterTypeDescription
inputDocumentData—
contextoptionalFieldContext—

Defined in packages/document/src/model/fields.ts:419

validateDocxPackagefunction#

function validateDocxPackage(bytes: Uint8Array | ArrayBuffer, options: { limits?: Partial<ZipLimits> } = {}): Promise<DocxValidationResult>
ParameterTypeDescription
bytesUint8Array | ArrayBuffer—
optionsoptional{ limits?: Partial<ZipLimits> }—

Defined in packages/document/src/docx/validate.ts:940

validateDocxPartsfunction#

function validateDocxParts(files: Map<string, Uint8Array>): DocxValidationResult
ParameterTypeDescription
filesMap<string, Uint8Array>—

Defined in packages/document/src/docx/validate.ts:878

wordCountfunction#

function wordCount(doc: DocNodeJSON): WordCount
ParameterTypeDescription
docDocNodeJSON—

Defined in packages/document/src/model/json.ts:274

writePdffunction#

function writePdf(layout: PdfDocumentLayout, options: PdfWriteOptions = {}): Promise<PdfWriteResult>
ParameterTypeDescription
layoutPdfDocumentLayout—
optionsoptionalPdfWriteOptions—

Defined in packages/document/src/layout/pdf/writer.ts:613

DocFormatErrorclass#

class DocFormatError extends Error
new DocFormatError(readonly code: DocFormatCode, message: string)
MemberTypeDescription
namereadonly"DocFormatError"—
codereadonlyDocFormatCode—

Defined in packages/document/src/doc/errors.ts:4

DocumentFormatErrorclass#

class DocumentFormatError extends Error
new DocumentFormatError(readonly code: DocumentFormatCode, message: string)
MemberTypeDescription
namereadonly"DocumentFormatError"—
codereadonlyDocumentFormatCode—

Defined in packages/document/src/docx/errors.ts:42

FileOpenErrorclass#

class FileOpenError extends Error
new FileOpenError(readonly code: FileErrorCode, message: string)
MemberTypeDescription
namereadonly"FileOpenError"—
codereadonlyFileErrorCode—

Defined in packages/document/src/editor/file/formats.ts:5

PdfFontErrorclass#

class PdfFontError extends Error
new PdfFontError(readonly families: readonly string[])
MemberTypeDescription
codereadonly"pdfa-fonts-missing"—
familiesreadonlyreadonly string[]—

Defined in packages/document/src/layout/pdf/font-substitution.ts:97

ZipLimitErrorclass#

class ZipLimitError extends Error
new ZipLimitError(code: ZipLimitCode, message: string, detail: { limit: number; actual: number; entryName?: string })
MemberTypeDescription
codereadonlyZipLimitCode—
limitreadonlynumber—
actualreadonlynumber—
entryNamereadonlystring | undefined—

Defined in packages/document/src/docx/errors.ts:23

ACCESSIBILITY_RULESconst#

const ACCESSIBILITY_RULES: readonly AccessibilityRule[]

Defined in packages/document/src/model/accessibility.ts:6

CHART_PALETTEconst#

const CHART_PALETTE: string[]

Defined in packages/document/src/model/chart.ts:5

CHART_TYPESconst#

const CHART_TYPES: readonly ChartType[]

Defined in packages/document/src/model/chart.ts:3

CITATION_STYLESconst#

const CITATION_STYLES: readonly CitationStyle[]

Defined in packages/document/src/model/citations.ts:3

DEFAULT_COLLAB_LIMITSconst#

const DEFAULT_COLLAB_LIMITS: Readonly<CollabDocumentLimits>

Defined in packages/document/src/editor/collab/document-state.ts:20

DEFAULT_DOC_LIMITSconst#

const DEFAULT_DOC_LIMITS: Readonly<DocLimits>

Defined in packages/document/src/doc/errors.ts:28

DEFAULT_PAGE_SETUPconst#

const DEFAULT_PAGE_SETUP: PageSetup

Defined in packages/document/src/model/page-setup.ts:17

DEFAULT_TOOLBARconst#

const DEFAULT_TOOLBAR: readonly ToolbarItemId[]

Defined in packages/document/src/editor/toolbar-data.ts:3

DEFAULT_ZIP_LIMITSconst#

const DEFAULT_ZIP_LIMITS: Readonly<ZipLimits>

Defined in packages/document/src/docx/errors.ts:16

DOCUMENT_EVENT_NAMESconst#

const DOCUMENT_EVENT_NAMES: readonly (keyof DocumentEditorEvents)[]

Defined in packages/document/src/editor/document-editor.ts:34

documentEditorDefinitionconst#

const documentEditorDefinition: WidgetDefinition<DocumentEditorOptions | undefined, { ready: any; historyChange: any; selectionChange: any; embeddedObjectOpen: any; contentChange: any; pageCountChange: any; commentsChange: any; trackedChangesChange: any; readOnlyChange: any; transaction: any; focus: any; blur: any; autosaveStart: any; autosaveEnd: any; autosaveError: any; stylesChange: any; autocorrectChange: any; formChange: any; fieldsUpdate: any; revisionsChange: any; markupModeChange: any; snapshotsChange: any; collabStatus: any; collabConnection: any; collabRejected: any; collabRestored: any; presenceChange: any; locksChange: any; ribbonTabChange: any; viewModeChange: any; layoutComplete: any; fontsMissing: any; fileOpened: any; templateOpened: any; fileSaved: any; fileError: any; fileMenuChange: any; sourcesChange: any; drawToolChange: any; readAloudChange: any; }, DocumentEditorApi>

Defined in packages/document/src/editor/document-editor.ts:568

documentStylesconst#

const documentStyles: string

Defined in packages/document/src/styles.ts:564

DOCX_MIMEconst#

const DOCX_MIME: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'

Defined in packages/document/src/docx/write-parts.ts:74

FONT_SUBSTITUTIONSconst#

const FONT_SUBSTITUTIONS: Readonly<Record<string, readonly string[]>>

Fonts with the same advance widths as the font they replace, so text set in the substitute breaks at the same places. Carlito and Caladea match Calibri and Cambria; the Liberation and Croscore families match Arial, Times New Roman and Courier New; Gelasio matches Georgia and Selawik matches Segoe UI.

Defined in packages/document/src/layout/pdf/font-substitution.ts:8

INK_COLORSconst#

const INK_COLORS: string[]

Defined in packages/document/src/model/ink.ts:15

INK_WIDTHSconst#

const INK_WIDTHS: number[]

Defined in packages/document/src/model/ink.ts:16

ODT_MIMEconst#

const ODT_MIME: "application/vnd.oasis.opendocument.text" = 'application/vnd.oasis.opendocument.text'

Defined in packages/document/src/formats/odt.ts:26

PAGE_SIZESconst#

const PAGE_SIZES: Readonly<Record<PageSizeName, { width: number; height: number }>>

Defined in packages/document/src/model/page-setup.ts:3

PARAGRAPH_STYLESconst#

const PARAGRAPH_STYLES: readonly ParagraphStyleDefinition[]

Defined in packages/document/src/model/paragraph-styles.ts:24

SHORTCUTSconst#

const SHORTCUTS: readonly { keys: string; label: string }[]

Defined in packages/document/src/editor/keymap.ts:27

SOURCE_TYPESconst#

const SOURCE_TYPES: readonly ["Book", "BookSection", "JournalArticle", "ArticleInAPeriodical", "ConferenceProceedings", "Report", "InternetSite", "DocumentFromInternetSite", "Misc"]

Defined in packages/document/src/model/citations.ts:5

WORD_SHORTCUTSconst#

const WORD_SHORTCUTS: readonly { keys: string; label: string }[]

Defined in packages/document/src/editor/editing/shortcuts.ts:10

AbstractNumberinginterface#

interface AbstractNumbering
PropertyTypeDescription
idnumber—
nameoptionalstring—
multiLevelTypeoptionalstring—
levelsNumberingLevel[]—

Defined in packages/document/src/model/numbering.ts:31

AccessibilityApiinterface#

interface AccessibilityApi
MemberTypeDescription
checkAccessibility()(rules?: readonly AccessibilityRule[]) => AccessibilityIssue[]The accessibility issues of the document, in document order.

Defined in packages/document/src/editor/accessibility/index.ts:14

AccessibilityIssueinterface#

interface AccessibilityIssue
PropertyTypeDescription
idstring—
ruleAccessibilityRule—
fromnumberWhere the object, heading, table or text starts and ends in the document.
tonumber—
textstringThe text of the heading or run, the first cells of the table, or the kind of object.
leveloptionalnumberSkipped heading: the level found and the deepest level allowed there.
expectedoptionalnumber—
coloroptionalstringLow contrast: the two colours and their ratio.
backgroundoptionalstring—
ratiooptionalnumber—

Defined in packages/document/src/model/accessibility.ts:13

AddCommentOptionsinterface#

interface AddCommentOptions
PropertyTypeDescription
authoroptionalstring—
dateoptionalstring—
mentionsoptionalreadonly CommentMention[]—

Defined in packages/document/src/types.ts:877

AnnouncementOptionsinterface#

interface AnnouncementOptions
PropertyTypeDescription
formattingoptionalboolean—
positionoptionalboolean—
reviewoptionalboolean—

Defined in packages/document/src/types.ts:393

AuthorInfointerface#

interface AuthorInfo
PropertyTypeDescription
namestring—
coloroptionalstring—

Defined in packages/document/src/types.ts:799

AutocorrectOptionsinterface#

interface AutocorrectOptions
PropertyTypeDescription
smartQuotesoptionalboolean—
dashesoptionalboolean—
symbolsoptionalboolean—
fractionsoptionalboolean—
ordinalsoptionalboolean—
autoListsoptionalboolean—
autoCapitalizeoptionalboolean—
capitalizeTableCellsoptionalboolean—
replacementsoptionalReadonly<Record<string, string>>—
exceptionsoptionalreadonly string[]—

Defined in packages/document/src/editor/editing/types.ts:173

AutocorrectStorageinterface#

interface AutocorrectStorage
PropertyTypeDescription
load() => AutocorrectOptions | null | undefined | Promise<AutocorrectOptions | null | undefined>—
save(options: AutocorrectOptions) => void | Promise<void>—

Defined in packages/document/src/editor/editing/types.ts:187

AutosaveOptionsinterface#

interface AutosaveOptions
PropertyTypeDescription
delayoptionalnumber—
save(data: DocumentData) => void | Promise<void>—

Defined in packages/document/src/editor/editing/types.ts:203

BibliographySourceinterface#

interface BibliographySource
PropertyTypeDescription
tagstring—
typeSourceType—
authorsoptionalSourcePerson[]—
editorsoptionalSourcePerson[]—
corporateAuthoroptionalstring—
titleoptionalstring—
yearoptionalstring—
monthoptionalstring—
dayoptionalstring—
cityoptionalstring—
publisheroptionalstring—
editionoptionalstring—
bookTitleoptionalstring—
journalNameoptionalstring—
periodicalTitleoptionalstring—
conferenceNameoptionalstring—
institutionoptionalstring—
volumeoptionalstring—
issueoptionalstring—
pagesoptionalstring—
urloptionalstring—
yearAccessedoptionalstring—
monthAccessedoptionalstring—
dayAccessedoptionalstring—
guidoptionalstring—
docxoptional{ extra: string } | null—

Defined in packages/document/src/types.ts:493

BookmarkInfointerface#

interface BookmarkInfo
PropertyTypeDescription
namestring—
idstring—
fromnumber—
tonumber—
hiddenboolean—

Defined in packages/document/src/editor/objects/types.ts:174

BorderLineinterface#

interface BorderLine
PropertyTypeDescription
stylestring—
widthnumber—
colorstring | null—
spaceoptionalnumber—
shadowoptionalboolean—

Defined in packages/document/src/types.ts:349

CaptionValueinterface#

interface CaptionValue
PropertyTypeDescription
labeloptionalstring—
textoptionalstring—
positionoptional'above' | 'below'—

Defined in packages/document/src/editor/objects/types.ts:193

CellBordersValueinterface#

interface CellBordersValue
PropertyTypeDescription
edgeBorderEdge—
styleoptional'single' | 'dashed' | 'dotted' | 'double'—
widthoptionalnumber—
coloroptionalstring—

Defined in packages/document/src/editor/objects/types.ts:107

CellRevisionInfointerface#

interface CellRevisionInfo extends Omit<RevisionInfo, 'kind'>
PropertyTypeDescription
kind'insertion' | 'deletion' | 'merge'—
datestringInherited from RevisionInfo.
idstringInherited from RevisionInfo.
authorstringInherited from RevisionInfo.
moveIdoptionalstring | null | undefinedInherited from RevisionInfo.

Defined in packages/document/src/types.ts:304

ChartModelinterface#

interface ChartModel
PropertyTypeDescription
typeChartType—
titleoptionalstring—
categoriesstring[]Category names, or the x values of a scatter chart.
seriesChartSeries[]—
stackingoptional'stacked' | 'percent'—
legendoptional'none' | 'right' | 'top'Where the legend is drawn; the default is below the chart.
categoryTitleoptionalstring—
valueTitleoptionalstring—

Defined in packages/document/src/types.ts:460

ChartProviderinterface#

interface ChartProvider
PropertyTypeDescription
create() => ChartResult | null | Promise<ChartResult | null>—
editoptional(data: unknown) => ChartResult | null | Promise<ChartResult | null>—

Defined in packages/document/src/types.ts:399

ChartResultinterface#

interface ChartResult
PropertyTypeDescription
srcstring—
widthoptionalnumber—
heightoptionalnumber—
altoptionalstring—
dataoptionalunknown—

Defined in packages/document/src/types.ts:385

ChartSeriesinterface#

interface ChartSeries
PropertyTypeDescription
namestring—
values(number | null)[]—
coloroptionalstring—

Defined in packages/document/src/types.ts:454

CitationOptionsinterface#

interface CitationOptions
PropertyTypeDescription
tagsstring | readonly string[]One tag, or several for a citation that names more than one source.
pagesoptionalstring—
suppressAuthoroptionalboolean—
suppressYearoptionalboolean—

Defined in packages/document/src/editor/citations/types.ts:3

CitationRequestinterface#

interface CitationRequest
PropertyTypeDescription
tagsstring[]—
pagesoptionalstring—
suppressAuthoroptionalboolean—
suppressYearoptionalboolean—

Defined in packages/document/src/model/citations.ts:22

CitationRuninterface#

interface CitationRun
PropertyTypeDescription
textstring—
italicoptionalboolean—

Defined in packages/document/src/model/citations.ts:17

CitationsApiinterface#

interface CitationsApi
MemberTypeDescription
getSources()() => BibliographySource[]—
setSources()(sources: readonly BibliographySource[]) => void—
addSource()(source: Omit<BibliographySource, 'tag'> & { tag?: string }) => string | nullAdds a source, or replaces the one with the same tag, and returns its tag.
removeSource()(tag: string) => boolean—
getCitationStyle()() => CitationStyle—
setCitationStyle()(style: CitationStyle) => void—
insertCitation()(citation: string | CitationOptions) => boolean—
insertBibliography()() => boolean—
updateCitations()() => numberRewrites every citation and bibliography from the sources and returns how many changed.

Defined in packages/document/src/editor/citations/types.ts:11

CitationsEventsinterface#

interface CitationsEvents
PropertyTypeDescription
sourcesChange{ sources: BibliographySource[]; style: CitationStyle }—

Defined in packages/document/src/editor/citations/types.ts:27

CollabApiinterface#

interface CollabApi
MemberTypeDescription
getCollabVersion()() => number—
getCollabStatus()() => CollabStatus—
getCollabConnection()() => CollabConnectionStatus—
saveCollabVersion()(name: string) => Promise<CollabVersionInfo | null>—
listCollabVersions()() => Promise<CollabVersionInfo[]>—
restoreCollabVersion()(id: string) => Promise<boolean>—
diffCollabVersions()(fromId: string, toId: string | null, options?: CollabVersionDiffOptions) => Promise<DocNodeJSON | null>—
lockRange()(range?: { from: number; to: number }) => Promise<CollabLock | null>—
unlockRange()(id: string) => void—
getLocks()() => CollabLock[]—
sendableSteps()() => CollabStepsPayload | null—
receiveSteps()(payload: CollabRemotePayload) => boolean—
resetCollab()(snapshot: CollabSnapshot) => void—
getCollaborators()() => Collaborator[]—

Defined in packages/document/src/editor/collab/types.ts:410

CollabAuthorityinterface#

interface CollabAuthority
PropertyTypeDescription
join()(clientId: CollabClientId, emit: (event: CollabBackendEvent) => void) => CollabAuthorityPeer—
version()() => number—
metaVersion()() => number—
baseVersion()() => number—
steps()() => CollabLogEntry[]—
snapshot()() => CollabSnapshot | null—
document()() => DocumentData | nullThe authority's own document at its current version, or null when it runs with trustClients.
locks()() => CollabLockState—
clients()() => CollabClientId[]—
saveVersion()(input: CollabVersionInput, clientId: CollabClientId) => CollabVersionInfo—
listVersions()() => CollabVersionInfo[]—
loadVersion()(id: string) => CollabVersionRecord | null—
storedVersions()() => CollabStoredVersion[]The named versions as they are kept: a full document now and then, and the steps since the previous one otherwise.
destroy()() => void—

Defined in packages/document/src/editor/collab/types.ts:279

CollabAuthorityOptionsinterface#

interface CollabAuthorityOptions
PropertyTypeDescription
documentoptionalDocumentInput | nullThe document at version 0. Without it, and without snapshot, the authority starts from an empty document.
limitsoptionalPartial<CollabDocumentLimits>—
trustClientsoptionalbooleanRelay steps without applying them. Only for a process where every client is your own code, such as a unit test of a transport: a client can then store any document and move any lock.
snapshotoptionalCollabSnapshot | null—
snapshotEveryoptionalnumber—
retainStepsoptionalnumber—
versionsoptionalreadonly CollabStoredVersion[] | nullNamed versions saved earlier, as storedVersions() returned them.
nowoptional() => number—
createIdoptional() => string—

Defined in packages/document/src/editor/collab/types.ts:245

CollabAuthorityPeerinterface#

interface CollabAuthorityPeer
PropertyTypeDescription
clientIdreadonlyCollabClientId—
submit()(payload: CollabStepsPayload) => CollabSubmitResult—
pull()(sinceVersion: number, sinceMeta: number) => void—
setPresence()(state: PresenceState | null) => void—
sendSnapshot()(snapshot: CollabSnapshot) => boolean—
acquireLock()(request: CollabLockRequest) => CollabLock | null—
releaseLock()(id: string) => void—
leave()() => void—

Defined in packages/document/src/editor/collab/types.ts:268

CollabBackendinterface#

interface CollabBackend
PropertyTypeDescription
clientIdreadonlyCollabClientId—
open()(emit: (event: CollabBackendEvent) => void) => void—
version()() => number—
metaVersion()() => number—
submit()(payload: CollabStepsPayload) => Promise<CollabSubmitResult>—
pull()(sinceVersion: number, sinceMeta: number) => void—
setPresence()optional(state: PresenceState | null) => void—
sendSnapshot()optional(snapshot: CollabSnapshot) => void—
locksoptionalPick<CollabLockChannel, 'acquire' | 'release'>—
versionsoptionalCollabVersionChannel—
close()() => void—

Defined in packages/document/src/editor/collab/types.ts:197

CollabBackendProviderinterface#

interface CollabBackendProvider extends CollabProvider
PropertyTypeDescription
clientIdCollabClientId—
connection()() => CollabConnectionStatus—
close()() => void—
versionnumber | (() => number)Inherited from CollabProvider.
metaVersionoptionalnumber | (() => number) | undefinedInherited from CollabProvider.
sendSteps()(payload: CollabStepsPayload) => CollabSendResult | Promise<CollabSendResult>Inherited from CollabProvider.
onRemoteSteps()(handler: (payload: CollabRemotePayload) => void) => () => voidInherited from CollabProvider.
requestSteps()optional((sinceVersion: number, sinceMeta?: number) => void) | undefinedInherited from CollabProvider.
onStatus()optional((handler: (status: "online" | "offline") => void) => () => void) | undefinedInherited from CollabProvider.
onConnection()optional((handler: (status: CollabConnectionStatus) => void) => () => void) | undefinedInherited from CollabProvider.
onReset()optional((handler: (snapshot: CollabSnapshot) => void) => () => void) | undefinedInherited from CollabProvider.
presenceoptionalCollabPresenceChannel | undefinedInherited from CollabProvider.
presenceTimeoutoptionalnumber | undefinedInherited from CollabProvider.
commentsoptionalCollabCommentChannel | undefinedInherited from CollabProvider.
versionsoptionalCollabVersionChannel | undefinedInherited from CollabProvider.
locksoptionalCollabLockChannel | undefinedInherited from CollabProvider.
snapshotsoptionalCollabSnapshotChannel | undefinedInherited from CollabProvider.

Defined in packages/document/src/editor/collab/types.ts:215

CollabBackendProviderOptionsinterface#

interface CollabBackendProviderOptions
PropertyTypeDescription
presenceTimeoutoptionalnumber—

Defined in packages/document/src/editor/collab/types.ts:211

CollabBackendStartinterface#

interface CollabBackendStart
PropertyTypeDescription
clientIdoptionalCollabClientId—
versionoptionalnumber—
metaVersionoptionalnumber—

Defined in packages/document/src/editor/collab/types.ts:311

CollabBroadcastBackendOptionsinterface#

interface CollabBroadcastBackendOptions extends CollabWireBackendOptions
PropertyTypeDescription
channelCollabBroadcastPort | string—
hostTimeoutoptionalnumber—
roomoptionalstring | undefinedInherited from CollabWireBackendOptions.
requestTimeoutoptionalnumber | undefinedInherited from CollabWireBackendOptions.
clientIdoptionalCollabClientId | undefinedInherited from CollabBackendStart.
versionoptionalnumber | undefinedInherited from CollabBackendStart.
metaVersionoptionalnumber | undefinedInherited from CollabBackendStart.

Defined in packages/document/src/editor/collab/types.ts:347

CollabBroadcastPortinterface#

interface CollabBroadcastPort
PropertyTypeDescription
postMessage()(message: unknown) => void—
addEventListener()(type: 'message', listener: (event: { data: unknown }) => void) => void—
removeEventListener()(type: 'message', listener: (event: { data: unknown }) => void) => void—
close()optional() => void—

Defined in packages/document/src/editor/collab/types.ts:340

CollabCommentChannelinterface#

interface CollabCommentChannel
PropertyTypeDescription
send()(operation: CollabCommentOperation) => void—
subscribe()(handler: (operation: CollabCommentOperation) => void) => () => void—

Defined in packages/document/src/editor/collab/types.ts:164

CollabDocumentinterface#

interface CollabDocument
PropertyTypeDescription
apply()(steps: readonly unknown[]) => CollabDocumentResult—
prepare()(steps: readonly unknown[]) => CollabDocumentPreparedChecks the steps against the current document without changing it; commit() then makes them current.
checkMetaOperations()(operations: readonly CollabMetaOperation[]) => CollabDocumentResult—
applyMeta()(operations: readonly CollabMetaOperation[]) => CollabDocumentResult—
size()() => number—
snapshot()() => DocumentData—

Defined in packages/document/src/editor/collab/types.ts:235

CollabDocumentLimitsinterface#

interface CollabDocumentLimits
PropertyTypeDescription
maxStepsPerSubmitnumber—
maxSubmitBytesnumber—
maxDocumentSizenumber—
maxMetaPerSubmitnumber—
maxCommentLengthnumber—

Defined in packages/document/src/editor/collab/types.ts:221

CollabEventsinterface#

interface CollabEvents
PropertyTypeDescription
collabStatusCollabStatus—
collabConnection{ status: CollabConnectionStatus; previous: CollabConnectionStatus }—
collabRejected{ reason: CollabRejectReason; steps: number }—
collabRestored{ steps: number; version: number }—
presenceChange{ collaborators: Collaborator[] }—
locksChange{ locks: CollabLock[] }—

Defined in packages/document/src/editor/collab/types.ts:397

CollabLockinterface#

interface CollabLock
PropertyTypeDescription
idstring—
clientIdCollabClientId—
namestring—
fromnumber—
tonumber—

Defined in packages/document/src/editor/collab/types.ts:81

CollabLockChannelinterface#

interface CollabLockChannel
PropertyTypeDescription
acquire()(request: CollabLockRequest) => Promise<CollabLock | null>—
release()(id: string) => void—
subscribe()(handler: (state: CollabLockState) => void) => () => void—

Defined in packages/document/src/editor/collab/types.ts:102

CollabLockRequestinterface#

interface CollabLockRequest
PropertyTypeDescription
fromnumber—
tonumber—
versionnumber—
nameoptionalstring—

Defined in packages/document/src/editor/collab/types.ts:95

CollabLockStateinterface#

interface CollabLockState
PropertyTypeDescription
versionnumber—
locksCollabLock[]—
revisionoptionalnumber—

Defined in packages/document/src/editor/collab/types.ts:89

CollabLogEntryinterface#

interface CollabLogEntry
PropertyTypeDescription
stepunknown—
clientIdCollabClientId—

Defined in packages/document/src/editor/collab/types.ts:263

CollabOfflineRecordinterface#

interface CollabOfflineRecord
PropertyTypeDescription
versionnumberThe version the unsent steps start from.
documentDocNodeJSONThe document body at version, without the unsent steps.
stepsunknown[]—
clientIdCollabClientId—
savedAtnumber—

Defined in packages/document/src/editor/collab/types.ts:372

CollabOfflineStoreinterface#

interface CollabOfflineStore
PropertyTypeDescription
load()() => CollabOfflineRecord | null | Promise<CollabOfflineRecord | null>—
save()(record: CollabOfflineRecord) => void | Promise<void>—
clear()() => void | Promise<void>—

Defined in packages/document/src/editor/collab/types.ts:382

CollabOptionsinterface#

interface CollabOptions
PropertyTypeDescription
collaboptionalCollabProvider | null—
collabStorageoptionalCollabOfflineStore | nullWhere edits that have not reached the authority are kept. Without it they live in memory and are lost when the tab closes. createIndexedDbOfflineStore({ key }) keeps them across a reload.

Defined in packages/document/src/editor/collab/types.ts:388

Collaboratorinterface#

interface Collaborator
PropertyTypeDescription
clientIdCollabClientId—
namestring—
colorstring—
anchornumber | null—
headnumber | null—
focusedboolean—

Defined in packages/document/src/editor/collab/types.ts:363

CollabPresenceChannelinterface#

interface CollabPresenceChannel
PropertyTypeDescription
send()(state: PresenceState) => void—
subscribe()(handler: (states: Record<string, PresenceState>) => void) => () => void—

Defined in packages/document/src/editor/collab/types.ts:159

CollabProviderinterface#

interface CollabProvider
PropertyTypeDescription
versionnumber | (() => number)—
clientIdoptionalCollabClientId—
metaVersionoptionalnumber | (() => number)—
sendSteps()(payload: CollabStepsPayload) => CollabSendResult | Promise<CollabSendResult>—
onRemoteSteps()(handler: (payload: CollabRemotePayload) => void) => () => void—
requestSteps()optional(sinceVersion: number, sinceMeta?: number) => void—
onStatus()optional(handler: (status: 'online' | 'offline') => void) => () => void—
onConnection()optional(handler: (status: CollabConnectionStatus) => void) => () => void—
onReset()optional(handler: (snapshot: CollabSnapshot) => void) => () => void—
presenceoptionalCollabPresenceChannel—
presenceTimeoutoptionalnumber—
commentsoptionalCollabCommentChannel—
versionsoptionalCollabVersionChannel—
locksoptionalCollabLockChannel—
snapshotsoptionalCollabSnapshotChannel—

Defined in packages/document/src/editor/collab/types.ts:169

CollabRemotePayloadinterface#

interface CollabRemotePayload
PropertyTypeDescription
stepsunknown[]—
clientIdsCollabClientId[]—
versionoptionalnumber—
metaoptionalCollabMetaOperation[]—
metaClientIdoptionalCollabClientId—
metaVersionoptionalnumber—
metaClientIdsoptionalCollabClientId[]—

Defined in packages/document/src/editor/collab/types.ts:46

CollabSnapshotinterface#

interface CollabSnapshot
PropertyTypeDescription
documentDocumentInput—
versionnumber—
metaVersionoptionalnumber—

Defined in packages/document/src/editor/collab/types.ts:65

CollabSnapshotChannelinterface#

interface CollabSnapshotChannel
PropertyTypeDescription
send()(snapshot: CollabSnapshot) => void—
subscribe()(handler: () => void) => () => void—

Defined in packages/document/src/editor/collab/types.ts:154

CollabSocketBackendOptionsinterface#

interface CollabSocketBackendOptions extends CollabWireBackendOptions
PropertyTypeDescription
connect() => CollabSocketLike—
reconnectMinoptionalnumber—
reconnectMaxoptionalnumber—
maxAttemptsoptionalnumber—
heartbeatoptionalnumber—
roomoptionalstring | undefinedInherited from CollabWireBackendOptions.
requestTimeoutoptionalnumber | undefinedInherited from CollabWireBackendOptions.
clientIdoptionalCollabClientId | undefinedInherited from CollabBackendStart.
versionoptionalnumber | undefinedInherited from CollabBackendStart.
metaVersionoptionalnumber | undefinedInherited from CollabBackendStart.

Defined in packages/document/src/editor/collab/types.ts:332

CollabSocketLikeinterface#

interface CollabSocketLike
PropertyTypeDescription
readyStatenumber—
send()(data: string) => void—
close()(code?: number, reason?: string) => void—
addEventListener()(type: 'open' | 'message' | 'close' | 'error', listener: (event: { data?: unknown; type?: string }) => void) => void—

Defined in packages/document/src/editor/collab/types.ts:322

CollabStatusinterface#

interface CollabStatus
PropertyTypeDescription
stateCollabState—
versionnumber—
unconfirmednumber—
clientIdCollabClientId | null—
onlineboolean—
connectionCollabConnectionStatus—

Defined in packages/document/src/editor/collab/types.ts:354

CollabStepFootprintinterface#

interface CollabStepFootprint
PropertyTypeDescription
fromnumber—
tonumber—
mapnumber[]—

Defined in packages/document/src/editor/collab/types.ts:32

CollabStepsPayloadinterface#

interface CollabStepsPayload
PropertyTypeDescription
versionnumber—
stepsunknown[]—
clientIdCollabClientId—
metaoptionalCollabMetaOperation[]—
footprintoptionalCollabStepFootprint[]—

Defined in packages/document/src/editor/collab/types.ts:38

CollabSubmitResultinterface#

interface CollabSubmitResult
PropertyTypeDescription
acceptedboolean—
versionoptionalnumber—
reasonoptionalCollabRejectReason—
detailoptionalstring—

Defined in packages/document/src/editor/collab/types.ts:58

CollabVersionChannelinterface#

interface CollabVersionChannel
PropertyTypeDescription
save()(input: CollabVersionInput) => Promise<CollabVersionInfo>—
list()() => Promise<CollabVersionInfo[]>—
load()(id: string) => Promise<CollabVersionRecord | null>—

Defined in packages/document/src/editor/collab/types.ts:148

CollabVersionDeltainterface#

interface CollabVersionDelta extends CollabVersionInfo

A version kept as the steps and document updates made since the version named by parent.

PropertyTypeDescription
metaVersionnumber—
parentstring—
stepsunknown[]—
metaCollabVersionMetaEntry[]—
idstringInherited from CollabVersionInfo.
namestringInherited from CollabVersionInfo.
createdAtstringInherited from CollabVersionInfo.
authorstringInherited from CollabVersionInfo.
clientIdCollabClientIdInherited from CollabVersionInfo.
versionnumberInherited from CollabVersionInfo.

Defined in packages/document/src/editor/collab/types.ts:132

CollabVersionDiffOptionsinterface#

interface CollabVersionDiffOptions extends CompareOptions
PropertyTypeDescription
idPrefixoptionalstring—
authoroptionalstring | undefinedInherited from CompareOptions.
dateoptionalstring | undefinedInherited from CompareOptions.
granularityoptional"word" | "character" | undefinedInherited from CompareOptions.
movesoptionalboolean | undefinedInherited from CompareOptions.
formattingoptionalboolean | undefinedInherited from CompareOptions.

Defined in packages/document/src/editor/collab/types.ts:406

CollabVersionInfointerface#

interface CollabVersionInfo
PropertyTypeDescription
idstring—
namestring—
createdAtstring—
authorstring—
clientIdCollabClientId—
versionnumber—

Defined in packages/document/src/editor/collab/types.ts:108

CollabVersionInputinterface#

interface CollabVersionInput
PropertyTypeDescription
namestring—
authorstring—
versionnumber—
documentDocumentInput—

Defined in packages/document/src/editor/collab/types.ts:141

CollabVersionMetaEntryinterface#

interface CollabVersionMetaEntry
PropertyTypeDescription
atnumberThe step version the operation was applied at.
operationCollabMetaOperation—

Defined in packages/document/src/editor/collab/types.ts:125

CollabVersionRecordinterface#

interface CollabVersionRecord extends CollabVersionInfo
PropertyTypeDescription
documentDocumentInput—
idstringInherited from CollabVersionInfo.
namestringInherited from CollabVersionInfo.
createdAtstringInherited from CollabVersionInfo.
authorstringInherited from CollabVersionInfo.
clientIdCollabClientIdInherited from CollabVersionInfo.
versionnumberInherited from CollabVersionInfo.

Defined in packages/document/src/editor/collab/types.ts:117

CollabVersionSnapshotinterface#

interface CollabVersionSnapshot extends CollabVersionRecord
PropertyTypeDescription
metaVersionoptionalnumber—
documentDocumentInputInherited from CollabVersionRecord.
idstringInherited from CollabVersionInfo.
namestringInherited from CollabVersionInfo.
createdAtstringInherited from CollabVersionInfo.
authorstringInherited from CollabVersionInfo.
clientIdCollabClientIdInherited from CollabVersionInfo.
versionnumberInherited from CollabVersionInfo.

Defined in packages/document/src/editor/collab/types.ts:121

CollabWireBackendOptionsinterface#

interface CollabWireBackendOptions extends CollabBackendStart
PropertyTypeDescription
roomoptionalstring—
requestTimeoutoptionalnumber—
clientIdoptionalCollabClientId | undefinedInherited from CollabBackendStart.
versionoptionalnumber | undefinedInherited from CollabBackendStart.
metaVersionoptionalnumber | undefinedInherited from CollabBackendStart.

Defined in packages/document/src/editor/collab/types.ts:317

CollabWireEndpointinterface#

interface CollabWireEndpoint
PropertyTypeDescription
receive()(message: CollabWireMessage) => void—
close()() => void—

Defined in packages/document/src/editor/collab/types.ts:306

interface CollabWireLink
PropertyTypeDescription

Defined in packages/document/src/editor/collab/types.ts:300

ColumnSettingsinterface#

interface ColumnSettings
PropertyTypeDescription
countnumber—
gapoptionalnumber—
separatoroptionalboolean—
widthsoptional{ width: number; gap: number }[]—

Defined in packages/document/src/editor/editing/types.ts:252

CombineOptionsinterface#

interface CombineOptions extends Pick<CompareOptions, 'date' | 'granularity' | 'formatting'>
PropertyTypeDescription
firstAuthoroptionalstring—
secondAuthoroptionalstring—
movesoptionalboolean—
dateoptionalstring | undefinedInherited from CompareOptions.
granularityoptional"word" | "character" | undefinedInherited from CompareOptions.
formattingoptionalboolean | undefinedInherited from CompareOptions.

Defined in packages/document/src/model/combine.ts:5

CommentMentioninterface#

interface CommentMention
PropertyTypeDescription
startnumber—
lengthnumber—
namestring—
emailoptionalstring—

Defined in packages/document/src/types.ts:119

CommentReplyinterface#

interface CommentReply
PropertyTypeDescription
idstring—
authorstring—
datestring—
textstring—
mentionsoptionalCommentMention[]—
durableIdoptionalstringWord's lasting identifier of the comment (commentsIds), kept so commentsExtensible can be written back.
dateUtcoptionalstringThe time of the comment in UTC, from Word's commentsExtensible part.

Defined in packages/document/src/types.ts:126

CommentThreadinterface#

interface CommentThread
PropertyTypeDescription
idstring—
authorstring—
datestring—
textstring—
resolvedboolean—
repliesCommentReply[]—
mentionsoptionalCommentMention[]—
durableIdoptionalstringWord's lasting identifier of the comment (commentsIds), kept so commentsExtensible can be written back.
dateUtcoptionalstringThe time of the comment in UTC, from Word's commentsExtensible part.

Defined in packages/document/src/types.ts:138

CompareOptionsinterface#

interface CompareOptions
PropertyTypeDescription
authoroptionalstring—
dateoptionalstring—
granularityoptional'word' | 'character'—
movesoptionalboolean—
formattingoptionalboolean—

Defined in packages/document/src/types.ts:889

CompatibilitySettingsinterface#

interface CompatibilitySettings
PropertyTypeDescription
flagsRecord<string, boolean>—
settingsRecord<string, string>—

Defined in packages/document/src/types.ts:189

ContentControlinterface#

interface ContentControl
PropertyTypeDescription
kindContentControlKind—
idoptionalstring—
tagoptionalstring—
titleoptionalstring—
lockoptional'sdtLocked' | 'contentLocked' | 'sdtContentLocked' | 'unlocked'—
isPlaceholderoptionalboolean—
bindingoptional{ xpath: string; storeItemId?: string; prefixMappings?: string } | null—
itemsoptional{ text: string; value: string }[]—
checkedoptionalboolean—
dateoptional{ value?: string; format?: string }—
multiLineoptionalboolean—

Defined in packages/document/src/types.ts:282

ContentControlValueinterface#

interface ContentControlValue
PropertyTypeDescription
kindFormControlKind—
titleoptionalstring—
tagoptionalstring—
placeholderoptionalstring—
itemsoptional{ text: string; value: string }[]—
dateFormatoptionalstring—
lockContentoptionalboolean—
lockControloptionalboolean—
requiredoptionalboolean—
checkedoptionalboolean—

Defined in packages/document/src/editor/objects/types.ts:209

CrossReferenceValueinterface#

interface CrossReferenceValue
PropertyTypeDescription
targetCrossReferenceTarget—
indexoptionalnumber—
nameoptionalstring—
displayoptionalCrossReferenceDisplay—

Defined in packages/document/src/editor/objects/types.ts:185

DetailedWordCountinterface#

interface DetailedWordCount
PropertyTypeDescription
pagesnumber—
wordsnumber—
charactersnumber—
charactersNoSpacesnumber—
paragraphsnumber—
linesnumber—
isSelectionboolean—

Defined in packages/document/src/editor/editing/types.ts:208

DocLimitsinterface#

interface DocLimits
PropertyTypeDescription
maxBytesnumberLargest file that is read at all, in bytes.
maxCharactersnumberLargest number of characters in the body of the document.
maxPictureBytesnumberTotal size of the pictures that are kept, in bytes. Pictures past it are left out.
maxTableCellsnumberLargest number of cells in one table. A table past it is read as paragraphs.

Defined in packages/document/src/doc/errors.ts:15

DocMarkJSONinterface#

interface DocMarkJSON
PropertyTypeDescription
typestring—
attrsoptionalRecord<string, unknown>—

Defined in packages/document/src/types.ts:29

DocNodeJSONinterface#

interface DocNodeJSON
PropertyTypeDescription
typestring—
attrsoptionalRecord<string, unknown>—
contentoptionalDocNodeJSON[]—
marksoptionalDocMarkJSON[]—
textoptionalstring—

Defined in packages/document/src/types.ts:34

DocReadOptionsinterface#

interface DocReadOptions
PropertyTypeDescription
limitsoptionalPartial<DocLimits>—

Defined in packages/document/src/doc/reader.ts:43

DocumentDatainterface#

interface DocumentData extends HeaderFooterContent

Defined in packages/document/src/types.ts:522

DocumentDefaultsinterface#

interface DocumentDefaults
PropertyTypeDescription
fontFamilystring—
fontSizenumber—

Defined in packages/document/src/types.ts:429

DocumentEditorApiinterface#

interface DocumentEditorApi extends Widget<DocumentEditorOptions, DocumentEditorEvents>, EditingApi, ObjectsApi, ReviewApi, CollabApi, RibbonApi, LayoutApi, FileApi, CitationsApi, AccessibilityApi, DrawApi, ReadAloudApi, SpellingApi
MemberTypeDescription
getJSON()() => DocumentData—
setJSON()(data: DocumentInput) => void—
getText()() => string—
importDocx()(input: ArrayBuffer | Uint8Array | Blob, options?: { limits?: Partial<ZipLimits> }) => Promise<void>—
exportDocx()() => Promise<Blob>—
downloadDocx()(fileName?: string) => Promise<void>—
exportHtml()(options?: HtmlExportOptions) => string—
importHtml()(html: string) => void—
print()() => void—
exec()(command: DocumentCommand, value?: unknown) => boolean—
canExec()(command: DocumentCommand, value?: unknown) => boolean—
getFormatState()() => FormatState—
getSelection()() => { from: number; to: number; text: string }—
setSelection()(from: number, to?: number) => void—
undo()() => boolean—
redo()() => boolean—
canUndo()() => boolean—
canRedo()() => boolean—
find()(query: string, options?: FindOptions) => FindResult—
findNext()() => FindResult—
findPrevious()() => FindResult—
replace()(replacement: string) => FindResult—
replaceAll()(query: string, replacement: string, options?: FindOptions) => number—
clearFind()() => void—
openFindPanel()(mode?: 'find' | 'replace') => void—
setTrackChanges()(enabled: boolean) => void—
isTrackingChanges()() => boolean—
setShowMarkup()(visible: boolean) => void—
getTrackedChanges()() => TrackedChange[]—
acceptChange()(id: string) => boolean—
rejectChange()(id: string) => boolean—
acceptAllChanges()() => number—
rejectAllChanges()() => number—
addComment()(text: string, options?: AddCommentOptions) => string | null—
getComments()() => CommentThread[]—
replyToComment()(id: string, text: string, options?: AddCommentOptions) => string | null—
editComment()(id: string, text: string) => boolean—
resolveComment()(id: string, resolved?: boolean) => boolean—
deleteComment()(id: string) => boolean—
selectComment()(id: string) => boolean—
compareWith()(revised: DocumentInput, options?: CompareOptions) => number—
proposeChange()(change: ProposedChange) => string[]—
applySteps()(steps: readonly unknown[]) => boolean—
insertField()(name: string) => boolean—
getFieldNames()() => string[]—
merge()(values: MergeValues, options?: MergeOptions) => DocumentData—
applyMerge()(values: MergeValues, options?: MergeOptions) => void—
insertImage()(src: string, options?: InsertImageOptions) => boolean—
insertTable()(rows: number, columns: number) => boolean—
getWordCount()() => WordCount—
getPageCount()() => number—
getCurrentPage()() => number—
getPageSetup()() => PageSetup—
setPageSetup()(setup: Partial<PageSetup>) => void—
setLayout()(layout: DocumentLayout) => void—
getLayout()() => DocumentLayout—
setZoom()(zoom: number) => void—
getZoom()() => number—
getOutline()() => OutlineEntry[]—
scrollToHeading()(index: number) => boolean—
setReadOnly()(readOnly: boolean) => void—
isReadOnly()() => boolean—
setAuthor()(author: AuthorInfo | string) => void—
editHeaderFooter()(part: 'header' | 'footer') => void—
relayout()() => void—
focus()() => void—
elementreadonlyHTMLElementInherited from Widget.
update()(options: Partial<DocumentEditorOptions>) => voidInherited from Widget.
on()<K extends keyof TEvents & string>(event: K, listener: Listener<TEvents[K]>) => () => voidInherited from Widget.
destroy()() => voidInherited from Widget.
openPane()(id: string) => booleanInherited from EditingApi.
closePane()(id: string) => booleanInherited from EditingApi.
isPaneOpen()(id: string) => booleanInherited from EditingApi.
getStyles()() => ParagraphStyleInfo[]Inherited from EditingApi.
applyStyle()(id: string) => booleanInherited from EditingApi.
createStyle()(name: string, format?: StyleFormat, basedOn?: string) => string | nullInherited from EditingApi.
createStyleFromSelection()(name: string) => string | nullInherited from EditingApi.
modifyStyle()(id: string, format: StyleFormat, name?: string) => booleanInherited from EditingApi.
updateStyleToMatchSelection()(id: string) => booleanInherited from EditingApi.
deleteStyle()(id: string) => booleanInherited from EditingApi.
getFontFormat()() => Required<FontFormat>Inherited from EditingApi.
setFontFormat()(format: FontFormat) => booleanInherited from EditingApi.
getDocumentProperties()() => DocumentPropertiesInherited from EditingApi.
setDocumentProperties()(properties: { [K in keyof DocumentProperties]?: DocumentProperties[K] | null; }) => booleanInherited from EditingApi.
getAutocorrectOptions()() => Required<AutocorrectOptions> | nullInherited from EditingApi.
setAutocorrectOptions()(options: AutocorrectOptions) => booleanInherited from EditingApi.
setParagraphFormat()(format: ParagraphFormat) => booleanInherited from EditingApi.
setParagraphBorders()(borders: ParagraphBorders | null, shading?: string | null) => booleanInherited from EditingApi.
changeCase()(mode: CaseMode) => booleanInherited from EditingApi.
setDropCap()(mode: "none" | "drop" | "margin", lines?: number) => booleanInherited from EditingApi.
collapseHeading()(index: number, collapsed: boolean) => booleanInherited from EditingApi.
isHeadingCollapsed()(index: number) => booleanInherited from EditingApi.
moveSection()(index: number, targetIndex: number) => booleanInherited from EditingApi.
getDetailedWordCount()() => DetailedWordCountInherited from EditingApi.
getFindResults()(query: string, options?: FindOptions) => FindPaneResult[]Inherited from EditingApi.
getListDefinitions()() => MultilevelListDefinition[]Inherited from EditingApi.
getListLevels()() => ListLevelFormat[] | nullThe levels of the Word list that holds the cursor, or null when the cursor is not in a list from a Word file. Inherited from EditingApi.
setListLevels()(levels: readonly ListLevelFormat[]) => booleanChanges the levels of the Word list that holds the cursor; every list that uses the same definition follows. Inherited from EditingApi.
defineMultilevelList()(definition: Omit<MultilevelListDefinition, "id"> & { id?: string; }) => stringInherited from EditingApi.
pasteHtml()(html: string, mode?: PasteMode) => booleanInherited from EditingApi.
saveNow()() => Promise<void>Inherited from EditingApi.
isSaving()() => booleanInherited from EditingApi.
getWatermark()() => Watermark | nullInherited from EditingApi.
setWatermark()(watermark: Watermark | string | null) => booleanInherited from EditingApi.
getLineNumbers()() => LineNumbering | nullInherited from EditingApi.
setLineNumbers()(numbering: LineNumbering | boolean | null) => booleanInherited from EditingApi.
getColumns()() => ColumnSettingsInherited from EditingApi.
setColumns()(columns: ColumnSettings | number) => booleanInherited from EditingApi.
insertBreak()(kind: BreakKind) => booleanInherited from EditingApi.
getFootnotes()(kind?: NoteKind) => FootnoteInfo[]Inherited from ObjectsApi.
getBookmarks()(includeHidden?: boolean) => BookmarkInfo[]Inherited from ObjectsApi.
goToBookmark()(name: string) => booleanInherited from ObjectsApi.
updateFields()() => numberInherited from ObjectsApi.
setFormMode()(enabled: boolean) => voidInherited from ObjectsApi.
isFormMode()() => booleanInherited from ObjectsApi.
getFormData()() => Record<string, unknown>Inherited from ObjectsApi.
setFormData()(data: Record<string, unknown>) => numberInherited from ObjectsApi.
validateForm()() => FormFieldError[]Inherited from ObjectsApi.
openObjectDialog()(name: ObjectDialogName) => booleanInherited from ObjectsApi.
evaluateTableFormula()(formula: string) => string | nullInherited from ObjectsApi.
getProtection()() => DocumentProtection | nullInherited from ObjectsApi.
protectDocument()(mode: ProtectionMode, password?: string) => Promise<boolean>Inherited from ObjectsApi.
unprotectDocument()(password?: string) => Promise<boolean>Inherited from ObjectsApi.
isPasswordProtected()() => booleanInherited from ObjectsApi.
insertEmbeddedObject()(options: InsertEmbeddedObjectOptions) => booleanInherited from ObjectsApi.
getEmbeddedObjects()() => EmbeddedObjectInfo[]Inherited from ObjectsApi.
openEmbeddedObject()(pos?: number) => booleanInherited from ObjectsApi.
downloadEmbeddedObject()(pos?: number) => booleanInherited from ObjectsApi.
getMarkupMode()() => MarkupModeInherited from ReviewApi.
setMarkupMode()(mode: MarkupMode) => voidInherited from ReviewApi.
getMarkupVisibility()() => MarkupVisibilityInherited from ReviewApi.
setMarkupVisibility()(visibility: Partial<MarkupVisibility>) => voidInherited from ReviewApi.
getRevisions()(filter?: RevisionFilter) => RevisionChange[]Inherited from ReviewApi.
acceptChanges()(filter?: RevisionFilter) => numberInherited from ReviewApi.
rejectChanges()(filter?: RevisionFilter) => numberInherited from ReviewApi.
nextChange()() => RevisionChange | nullInherited from ReviewApi.
previousChange()() => RevisionChange | nullInherited from ReviewApi.
goToChange()(id: string) => booleanInherited from ReviewApi.
editReply()(threadId: string, replyId: string, text: string) => booleanInherited from ReviewApi.
deleteReply()(threadId: string, replyId: string) => booleanInherited from ReviewApi.
saveSnapshot()(label?: string) => SnapshotInfo | nullInherited from ReviewApi.
getSnapshots()() => SnapshotInfo[]Inherited from ReviewApi.
restoreSnapshot()(id: string) => booleanInherited from ReviewApi.
compareWithSnapshot()(id: string, options?: CompareOptions) => numberInherited from ReviewApi.
deleteSnapshot()(id: string) => booleanInherited from ReviewApi.
getSnapshotDocument()(id: string) => DocumentData | nullInherited from ReviewApi.
compareWithDocx()(input: ArrayBuffer | Uint8Array | Blob, options?: CompareOptions) => Promise<number>Inherited from ReviewApi.
compareSideBySide()(revised: DocumentInput, options?: SideBySideOptions) => booleanInherited from ReviewApi.
closeSideBySide()() => booleanInherited from ReviewApi.
isSideBySideOpen()() => booleanInherited from ReviewApi.
combineWith()(first: DocumentInput, second: DocumentInput, options?: CombineOptions) => numberInherited from ReviewApi.
combineWithDocx()(first: ArrayBuffer | Uint8Array | Blob, second: ArrayBuffer | Uint8Array | Blob, options?: CombineOptions) => Promise<number>Inherited from ReviewApi.
getCollabVersion()() => numberInherited from CollabApi.
getCollabStatus()() => CollabStatusInherited from CollabApi.
getCollabConnection()() => CollabConnectionStatusInherited from CollabApi.
saveCollabVersion()(name: string) => Promise<CollabVersionInfo | null>Inherited from CollabApi.
listCollabVersions()() => Promise<CollabVersionInfo[]>Inherited from CollabApi.
restoreCollabVersion()(id: string) => Promise<boolean>Inherited from CollabApi.
diffCollabVersions()(fromId: string, toId: string | null, options?: CollabVersionDiffOptions) => Promise<DocNodeJSON | null>Inherited from CollabApi.
lockRange()(range?: { from: number; to: number; }) => Promise<CollabLock | null>Inherited from CollabApi.
unlockRange()(id: string) => voidInherited from CollabApi.
getLocks()() => CollabLock[]Inherited from CollabApi.
sendableSteps()() => CollabStepsPayload | nullInherited from CollabApi.
receiveSteps()(payload: CollabRemotePayload) => booleanInherited from CollabApi.
resetCollab()(snapshot: CollabSnapshot) => voidInherited from CollabApi.
getCollaborators()() => Collaborator[]Inherited from CollabApi.
getRibbonTab()() => string | nullInherited from RibbonApi.
setRibbonTab()(tab: RibbonTabName) => booleanInherited from RibbonApi.
isRibbonCollapsed()() => booleanInherited from RibbonApi.
setRibbonCollapsed()(collapsed: boolean) => voidInherited from RibbonApi.
getViewMode()() => DocumentViewModeInherited from RibbonApi.
setViewMode()(mode: DocumentViewMode) => voidInherited from RibbonApi.
fitZoom()(mode: "width" | "page") => numberInherited from RibbonApi.
getTabStops()() => TabStop[]Inherited from RibbonApi.
setTabStops()(stops: readonly TabStop[]) => booleanInherited from RibbonApi.
whenLayoutReady()() => Promise<void>Inherited from LayoutApi.
isLayoutComplete()() => booleanInherited from LayoutApi.
getPageInfo()(page: number) => PageInfo | nullInherited from LayoutApi.
getPageText()(page: number) => stringInherited from LayoutApi.
getLayoutStats()() => LayoutStatsInherited from LayoutApi.
getPrintHtml()() => stringInherited from LayoutApi.
exportPdf()(options?: PdfExportOptions) => Promise<Blob>Inherited from LayoutApi.
newDocument()() => voidReplaces the document with an empty one. Does not ask first. Inherited from FileApi.
getTemplates()() => TemplateInfo[]The templates of New from template: yours first, then the built-in ones. Inherited from FileApi.
newFromTemplate()(id: string) => Promise<boolean>Replaces the document with a copy of a template. Does not ask first. Inherited from FileApi.
openFile()(input: Blob | ArrayBuffer | Uint8Array, options?: FileOpenOptions) => Promise<FileImportFormat>Reads a file in any format the editor imports and shows it. The format is detected from the bytes, then the name. Inherited from FileApi.
exportFile()(format: FileExportFormat, options?: FileExportOptions) => Promise<Blob>A Word file is encrypted with the password of the document, or with password; null writes it without one. Inherited from FileApi.
setFilePassword()(password: string | null) => voidSets or, with null, removes the password that Word files are saved and downloaded with. Inherited from FileApi.
hasFilePassword()() => booleanInherited from FileApi.
downloadFile()(format: FileExportFormat, fileName?: string) => Promise<void>Inherited from FileApi.
saveFile()() => Promise<boolean>Saves through file.onSaveRequest, or downloads a .docx file when there is none. Inherited from FileApi.
getFileName()() => stringInherited from FileApi.
setFileName()(name: string) => voidInherited from FileApi.
isModified()() => booleanTrue when the document changed since it was opened, created, saved or downloaded. Inherited from FileApi.
openFileMenu()() => booleanInherited from FileApi.
closeFileMenu()() => voidInherited from FileApi.
isFileMenuOpen()() => booleanInherited from FileApi.
getSources()() => BibliographySource[]Inherited from CitationsApi.
setSources()(sources: readonly BibliographySource[]) => voidInherited from CitationsApi.
addSource()(source: Omit<BibliographySource, "tag"> & { tag?: string; }) => string | nullAdds a source, or replaces the one with the same tag, and returns its tag. Inherited from CitationsApi.
removeSource()(tag: string) => booleanInherited from CitationsApi.
getCitationStyle()() => CitationStyleInherited from CitationsApi.
setCitationStyle()(style: CitationStyle) => voidInherited from CitationsApi.
insertCitation()(citation: string | CitationOptions) => booleanInherited from CitationsApi.
insertBibliography()() => booleanInherited from CitationsApi.
updateCitations()() => numberRewrites every citation and bibliography from the sources and returns how many changed. Inherited from CitationsApi.
checkAccessibility()(rules?: readonly AccessibilityRule[]) => AccessibilityIssue[]The accessibility issues of the document, in document order. Inherited from AccessibilityApi.
getDrawTool()() => DrawTool | nullInherited from DrawApi.
setDrawTool()(tool: DrawTool | null) => voidInherited from DrawApi.
insertInk()(stroke: Partial<InkStroke> & { points: [number, number][]; }) => booleanAdds a stroke to the paragraph of the selection; its points are measured from the top left of that paragraph. Inherited from DrawApi.
getInk()() => InkInfo[]Inherited from DrawApi.
eraseInk()(pos?: number) => numberRemoves the ink stroke at a document position, or every stroke without one. Inherited from DrawApi.
readAloud()(options?: ReadAloudOptions) => ReadAloudHandleInherited from ReadAloudApi.
stopReadAloud()() => voidInherited from ReadAloudApi.
isReadingAloud()() => booleanInherited from ReadAloudApi.
getSpellingIssues()() => SpellingMatch[]Inherited from SpellingApi.
checkSpelling()() => Promise<void>Inherited from SpellingApi.
ignoreSpelling()(word: string) => voidInherited from SpellingApi.
replaceSpelling()(from: number, text: string) => booleanInherited from SpellingApi.

Defined in packages/document/src/types.ts:939

DocumentEditorEventsinterface#

interface DocumentEditorEvents extends EditingEvents, ObjectsEvents, ReviewEvents, CollabEvents, RibbonEvents, LayoutEvents, FileEvents, CitationsEvents, DrawEvents, ReadAloudEvents
PropertyTypeDescription
ready{ api: DocumentEditorApi }—
contentChange{ source: 'user' | 'api'; wordCount: number }—
selectionChange{ from: number; to: number; format: FormatState }—
pageCountChange{ pageCount: number }—
commentsChange{ comments: CommentThread[] }—
trackedChangesChange{ changes: TrackedChange[] }—
historyChange{ canUndo: boolean; canRedo: boolean }—
readOnlyChange{ readOnly: boolean }—
transaction{ steps: unknown[]; origin: 'local' | 'remote'; docChanged: boolean }—
focus{ editor: DocumentEditorApi }—
blur{ editor: DocumentEditorApi }—
autosaveStart{ reason: "change" | "manual" | "destroy"; }Inherited from EditingEvents.
autosaveEnd{ savedAt: string; }Inherited from EditingEvents.
autosaveError{ error: unknown; }Inherited from EditingEvents.
stylesChange{ styles: ParagraphStyleInfo[]; }Inherited from EditingEvents.
autocorrectChange{ options: AutocorrectOptions; }Inherited from EditingEvents.
formChange{ tag: string; value: unknown; data: Record<string, unknown>; }Inherited from ObjectsEvents.
fieldsUpdate{ count: number; }Inherited from ObjectsEvents.
embeddedObjectOpenEmbeddedObjectOpenEventInherited from ObjectsEvents.
revisionsChange{ revisions: RevisionChange[]; }Inherited from ReviewEvents.
markupModeChange{ mode: MarkupMode; }Inherited from ReviewEvents.
snapshotsChange{ snapshots: SnapshotInfo[]; }Inherited from ReviewEvents.
collabStatusCollabStatusInherited from CollabEvents.
collabConnection{ status: CollabConnectionStatus; previous: CollabConnectionStatus; }Inherited from CollabEvents.
collabRejected{ reason: CollabRejectReason; steps: number; }Inherited from CollabEvents.
collabRestored{ steps: number; version: number; }Inherited from CollabEvents.
presenceChange{ collaborators: Collaborator[]; }Inherited from CollabEvents.
locksChange{ locks: CollabLock[]; }Inherited from CollabEvents.
ribbonTabChange{ tab: string; }Inherited from RibbonEvents.
viewModeChange{ mode: DocumentViewMode; }Inherited from RibbonEvents.
layoutComplete{ pageCount: number; durationMs: number; }Inherited from LayoutEvents.
fontsMissing{ fonts: MissingFont[]; }A font the document uses is not installed. Page breaks match Word only when substitute is not null. Inherited from LayoutEvents.
fileOpened{ fileName: string; format: FileImportFormat; }Inherited from FileEvents.
templateOpened{ id: string; name: string; }Inherited from FileEvents.
fileSaved{ fileName: string; format: FileExportFormat | null; target: "download" | "host"; }Inherited from FileEvents.
fileError{ action: "open" | "save" | "new"; error: unknown; fileName: string; }Inherited from FileEvents.
fileMenuChange{ open: boolean; }Inherited from FileEvents.
sourcesChange{ sources: BibliographySource[]; style: CitationStyle; }Inherited from CitationsEvents.
drawToolChange{ tool: DrawTool | null; }Inherited from DrawEvents.
readAloudChange{ reading: boolean; paused: boolean; }Inherited from ReadAloudEvents.

Defined in packages/document/src/types.ts:852

DocumentEditorOptionsinterface#

interface DocumentEditorOptions extends EditingOptions, ObjectsOptions, ReviewOptions, CollabOptions, RibbonOptions, LayoutOptions
PropertyTypeDescription
licenseKeyoptionalstring—
injectStylesoptionalboolean—
contentoptionalDocumentInput—
pageoptionalPartial<PageSetup>—
layoutoptionalDocumentLayout—
zoomoptionalnumber—
readOnlyoptionalboolean—
authoroptionalAuthorInfo | string—
trackChangesoptionalboolean—
showMarkupoptionalboolean—
toolbaroptionalboolean | readonly ToolbarItemId[]—
statusBaroptionalboolean—
ruleroptionalboolean—
outlineoptionalboolean—
commentsPaneloptionalboolean—
spellcheckoptionalboolean | SpellChecker—
limitsoptionalPartial<ZipLimits>Caps applied to every DOCX archive the editor opens. Defaults: 10,000 entries, 512 MiB per entry, 1 GiB in total, 200:1.
linkSchemesoptionalreadonly string[]Schemes whose links may be followed, besides http, https, mailto and tel: for example ['file', 'ftp', 'sms', 'msteams']. Links with any other scheme stay in the document and in saved files but are shown as blocked addresses. javascript, vbscript and data can never be enabled. Read when the editor is created.
allowRemoteImagesoptionalbooleanDraw pictures whose source is an http(s) or relative URL. Off by default, so opening a document makes no request.
resolveImageoptional(url: string) => string | null | Promise<string | null>Returns a data:image/… URL for a remote picture, fetched by your application. Used when allowRemoteImages is off.
placeholderoptionalstring—
fontsoptionalreadonly string[]—
fontSizesoptionalreadonly number[]—
mergeFieldsoptionalreadonly MergeFieldDefinition[]—
heightoptionalnumber | string—
ariaLabeloptionalstring—
announcementsoptionalboolean | AnnouncementOptions—
localeTextoptionalLocaleTextInput—
rtloptionalboolean—
uploadImageoptional(file: File) => Promise<string>—
chartProvideroptionalChartProvider—
readAloudoptionalReadAloudOptionsDefaults for Read aloud: a callback that speaks each sentence, a language and a rate.
fileoptionalboolean | FileOptionsThe File tab: false removes it, an object hides entries or routes New, Open and Save to your application.
autocorrectoptionalboolean | AutocorrectOptions | undefinedInherited from EditingOptions.
autocorrectStorageoptionalAutocorrectStorage | undefinedInherited from EditingOptions.
autosaveoptionalAutosaveOptions | undefinedInherited from EditingOptions.
pasteOptionsoptionalboolean | undefinedInherited from EditingOptions.
clickAndTypeoptionalboolean | undefinedInherited from EditingOptions.
defaultPasteModeoptionalPasteMode | undefinedInherited from EditingOptions.
resolvePastedImageoptional((src: string, context: PastedImageContext) => string | null | Promise<string | null>) | undefinedInherited from EditingOptions.
showFormattingMarksoptionalboolean | undefinedInherited from EditingOptions.
hyphenationoptionalboolean | undefinedInherited from EditingOptions.
formModeoptionalboolean | undefinedInherited from ObjectsOptions.
showBookmarksoptionalboolean | undefinedInherited from ObjectsOptions.
noteNumberFormatoptionalPartial<Record<NoteKind, NoteNumberFormat>> | undefinedInherited from ObjectsOptions.
mergeRecordsoptionalreadonly Record<string, unknown>[] | undefinedInherited from ObjectsOptions.
markupModeoptionalMarkupMode | undefinedInherited from ReviewOptions.
changeBarsoptionalboolean | undefinedInherited from ReviewOptions.
changeBalloonsoptionalboolean | undefinedInherited from ReviewOptions.
commentsLayoutoptional"margin" | "panel" | undefinedInherited from ReviewOptions.
mentionsoptionalMentionOptions | undefinedInherited from ReviewOptions.
snapshotsoptionalSnapshotStorage | undefinedInherited from ReviewOptions.
collaboptionalCollabProvider | null | undefinedInherited from CollabOptions.
collabStorageoptionalCollabOfflineStore | null | undefinedWhere edits that have not reached the authority are kept. Without it they live in memory and are lost when the tab closes. createIndexedDbOfflineStore({ key }) keeps them across a reload. Inherited from CollabOptions.
ribbonoptionalboolean | RibbonConfig | undefinedInherited from RibbonOptions.
miniToolbaroptionalboolean | undefinedInherited from RibbonOptions.
viewModeoptionalDocumentViewMode | undefinedInherited from RibbonOptions.
themeoptional"auto" | "light" | "dark" | undefinedInherited from RibbonOptions.
darkPageoptional"dark" | "white" | undefinedInherited from RibbonOptions.
verticalRuleroptionalboolean | undefinedInherited from RibbonOptions.
commandSearchoptionalboolean | undefinedThe Search commands box of the tab row and its Alt+Q shortcut. On by default. Inherited from RibbonOptions.
layoutCompatibilityoptionalLayoutCompatibility | undefinedInherited from LayoutOptions.
virtualizeoptionalboolean | "auto" | undefinedInherited from LayoutOptions.
pdfFontsoptionalreadonly PdfFontSource[] | undefinedInherited from LayoutOptions.
isFontAvailableoptional((family: string) => boolean) | undefinedReplaces the built-in check of whether a font family can be drawn on this device. Inherited from LayoutOptions.

Defined in packages/document/src/types.ts:804

DocumentPdfOptionsinterface#

interface DocumentPdfOptions extends PdfWriteOptions
PropertyTypeDescription
fontsoptionalreadonly PdfFontSource[]—
titleoptionalstring—
authoroptionalstring—
subjectoptionalstring—
keywordsoptionalstring—
languageoptionalstring—
outlineoptionalboolean—
compressoptionalboolean | undefinedInherited from PdfWriteOptions.
creationDateoptionalDate | undefinedInherited from PdfWriteOptions.
produceroptionalstring | undefinedInherited from PdfWriteOptions.
pdfAoptionalboolean | undefinedInherited from PdfWriteOptions.
taggedoptionalboolean | undefinedInherited from PdfWriteOptions.

Defined in packages/document/src/layout/pdf/document-layout.ts:28

DocumentPdfResultinterface#

interface DocumentPdfResult
PropertyTypeDescription
bytesUint8Array—
warningsstring[]—
pageCountnumber—
missingFontsstring[]Font families the document asks for that had no font file and no metric-compatible substitute.

Defined in packages/document/src/layout/pdf/document-layout.ts:38

DocumentPersoninterface#

interface DocumentPerson
PropertyTypeDescription
authorstring—
providerIdoptionalstring—
userIdoptionalstring—

Defined in packages/document/src/types.ts:152

DocumentPropertiesinterface#

interface DocumentProperties
PropertyTypeDescription
titleoptionalstring—
subjectoptionalstring—
authoroptionalstring—
keywordsoptionalstring—
descriptionoptionalstring—
createdoptionalstring—
modifiedoptionalstring—
categoryoptionalstring—
lastModifiedByoptionalstring—
revisionoptionalstring—
companyoptionalstring—
manageroptionalstring—
customoptionalRecord<string, string | number | boolean>—

Defined in packages/document/src/types.ts:158

DocumentProtectioninterface#

interface DocumentProtection
PropertyTypeDescription
modeProtectionMode—
enforcedboolean—
attrsoptionalRecord<string, string>—

Defined in packages/document/src/types.ts:176

DocumentSectioninterface#

interface DocumentSection
PropertyTypeDescription
indexnumber—
pagePageSetup—
headersRequired<SectionHeaders>—
fromnumber—
tonumber—

Defined in packages/document/src/types.ts:111

DocumentSettingsinterface#

interface DocumentSettings
PropertyTypeDescription
evenAndOddHeadersoptionalboolean—
mirrorMarginsoptionalboolean—
trackRevisionsoptionalboolean—
defaultTabStopoptionalnumber—
protectionoptionalDocumentProtection | null—
footnotesoptionalNoteSettings—
endnotesoptionalNoteSettings—
compatibilityModeoptionalnumber—
compatoptionalCompatibilitySettings—
kerningoptionalbooleanFalse when the document's default text has Word's "Kerning for fonts" switched off, which is the case for most Word documents. Text is then laid out without pair kerning, as Word does, unless a run switches it on.

Defined in packages/document/src/types.ts:194

DocumentSnapshotinterface#

interface DocumentSnapshot
PropertyTypeDescription
idstring—
labelstring—
authorstring—
datestring—
datastring—

Defined in packages/document/src/editor/review/types.ts:73

DocumentStyleinterface#

interface DocumentStyle
PropertyTypeDescription
idstring—
namestring—
typeDocumentStyleType—
basedOnoptionalstring—
nextoptionalstring—
isDefaultoptionalboolean—
isHiddenoptionalboolean—
isQuickStyleoptionalboolean—
builtinoptionalParagraphStyleId—
outlineLeveloptionalnumber—
numberingoptional{ numId: number; level: number }—
paragraphoptionalRecord<string, unknown>—
runoptionalRecord<string, unknown>—
tableoptionalRecord<string, unknown>—

Defined in packages/document/src/types.ts:213

DocumentTemplateinterface#

interface DocumentTemplate
PropertyTypeDescription
idstring—
namestring—
descriptionoptionalstring—
iconoptionalstringThe name of an icon of the editor; a page icon when left out.
contentDocumentInput | (() => DocumentInput | Promise<DocumentInput>)The document, or a function that returns it or a promise of it, for templates that are fetched when chosen.

Defined in packages/document/src/editor/file/types.ts:34

DocxImportFeatureinterface#

interface DocxImportFeature
PropertyTypeDescription
featurestring—
countnumber—
noteoptionalstring—

Defined in packages/document/src/docx/report.ts:1

DocxImportReportinterface#

interface DocxImportReport

Defined in packages/document/src/docx/report.ts:7

DocxPackageinterface#

interface DocxPackage
PropertyTypeDescription
partsRecord<string, PreservedPart>—
contentTypes{ defaults: Record<string, string>; overrides: Record<string, string> }—
namespacesRecord<string, string>—
ignorablestring[]—
mainPartstring—
relationshipsoptionalPreservedRelationship[]—
sourceoptionalDocxSource | null—

Defined in packages/document/src/types.ts:240

DocxPageMapinterface#

interface DocxPageMap
PropertyTypeDescription
bookmarksoptionalReadonly<Record<string, number>>—
headingsoptionalreadonly number[]—
headerFooteroptionalReadonly<Partial<Record<'default' | 'first' | 'even', number>>>—

Defined in packages/document/src/docx/writer.ts:84

DocxReadOptionsinterface#

interface DocxReadOptions
PropertyTypeDescription
limitsoptionalPartial<ZipLimits>Caps on the archive: entry count, inflated size of one entry, total inflated size and compression ratio.

Defined in packages/document/src/docx/reader.ts:442

DocxReadResultinterface#

interface DocxReadResult
PropertyTypeDescription
documentDocumentData—
warningsstring[]—
reportDocxImportReport—

Defined in packages/document/src/docx/reader.ts:367

DocxValidationIssueinterface#

interface DocxValidationIssue
PropertyTypeDescription
severity'error' | 'warning'—
codestring—
partstring—
messagestring—

Defined in packages/document/src/docx/validate.ts:7

DocxValidationResultinterface#

interface DocxValidationResult
PropertyTypeDescription
okboolean—
issuesDocxValidationIssue[]—

Defined in packages/document/src/docx/validate.ts:14

DocxWriteOptionsinterface#

interface DocxWriteOptions
PropertyTypeDescription
trackRevisionsoptionalboolean—
zoomoptionalnumber—
pageCountoptionalnumber—
pagesoptionalDocxPageMap—
compressoptionalboolean—
nowoptionalDate—
preserveSourceoptionalboolean | 'exact'—

Defined in packages/document/src/docx/writer.ts:90

DrawApiinterface#

interface DrawApi
MemberTypeDescription
getDrawTool()() => DrawTool | null—
setDrawTool()(tool: DrawTool | null) => void—
insertInk()(stroke: Partial<InkStroke> & { points: [number, number][] }) => booleanAdds a stroke to the paragraph of the selection; its points are measured from the top left of that paragraph.
getInk()() => InkInfo[]—
eraseInk()(pos?: number) => numberRemoves the ink stroke at a document position, or every stroke without one.

Defined in packages/document/src/editor/draw/index.ts:31

DrawEventsinterface#

interface DrawEvents
PropertyTypeDescription
drawToolChange{ tool: DrawTool | null }—

Defined in packages/document/src/editor/draw/index.ts:43

EditingApiinterface#

interface EditingApi
MemberTypeDescription
openPane()(id: string) => boolean—
closePane()(id: string) => boolean—
isPaneOpen()(id: string) => boolean—
getStyles()() => ParagraphStyleInfo[]—
applyStyle()(id: string) => boolean—
createStyle()(name: string, format?: StyleFormat, basedOn?: string) => string | null—
createStyleFromSelection()(name: string) => string | null—
modifyStyle()(id: string, format: StyleFormat, name?: string) => boolean—
updateStyleToMatchSelection()(id: string) => boolean—
deleteStyle()(id: string) => boolean—
getFontFormat()() => Required<FontFormat>—
setFontFormat()(format: FontFormat) => boolean—
getDocumentProperties()() => DocumentProperties—
setDocumentProperties()(properties: { [K in keyof DocumentProperties]?: DocumentProperties[K] | null }) => boolean—
getAutocorrectOptions()() => Required<AutocorrectOptions> | null—
setAutocorrectOptions()(options: AutocorrectOptions) => boolean—
setParagraphFormat()(format: ParagraphFormat) => boolean—
setParagraphBorders()(borders: ParagraphBorders | null, shading?: string | null) => boolean—
changeCase()(mode: CaseMode) => boolean—
setDropCap()(mode: 'none' | 'drop' | 'margin', lines?: number) => boolean—
collapseHeading()(index: number, collapsed: boolean) => boolean—
isHeadingCollapsed()(index: number) => boolean—
moveSection()(index: number, targetIndex: number) => boolean—
getDetailedWordCount()() => DetailedWordCount—
getFindResults()(query: string, options?: FindOptions) => FindPaneResult[]—
getListDefinitions()() => MultilevelListDefinition[]—
getListLevels()() => ListLevelFormat[] | nullThe levels of the Word list that holds the cursor, or null when the cursor is not in a list from a Word file.
setListLevels()(levels: readonly ListLevelFormat[]) => booleanChanges the levels of the Word list that holds the cursor; every list that uses the same definition follows.
defineMultilevelList()(definition: Omit<MultilevelListDefinition, 'id'> & { id?: string }) => string—
pasteHtml()(html: string, mode?: PasteMode) => boolean—
saveNow()() => Promise<void>—
isSaving()() => boolean—
getWatermark()() => Watermark | null—
setWatermark()(watermark: Watermark | string | null) => boolean—
getLineNumbers()() => LineNumbering | null—
setLineNumbers()(numbering: LineNumbering | boolean | null) => boolean—
getColumns()() => ColumnSettings—
setColumns()(columns: ColumnSettings | number) => boolean—
insertBreak()(kind: BreakKind) => boolean—

Defined in packages/document/src/editor/editing/types.ts:279

EditingEventsinterface#

interface EditingEvents
PropertyTypeDescription
autosaveStart{ reason: 'change' | 'manual' | 'destroy' }—
autosaveEnd{ savedAt: string }—
autosaveError{ error: unknown }—
stylesChange{ styles: ParagraphStyleInfo[] }—
autocorrectChange{ options: AutocorrectOptions }—

Defined in packages/document/src/editor/editing/types.ts:271

EditingOptionsinterface#

interface EditingOptions
PropertyTypeDescription
autocorrectoptionalboolean | AutocorrectOptions—
autocorrectStorageoptionalAutocorrectStorage—
autosaveoptionalAutosaveOptions—
pasteOptionsoptionalboolean—
clickAndTypeoptionalboolean—
defaultPasteModeoptionalPasteMode—
resolvePastedImageoptional(src: string, context: PastedImageContext) => string | null | Promise<string | null>—
showFormattingMarksoptionalboolean—
hyphenationoptionalboolean—

Defined in packages/document/src/editor/editing/types.ts:259

EmbeddedObjectFileinterface#

interface EmbeddedObjectFile
PropertyTypeDescription
fileNamestring—
mimeTypestring—
progIdstring—
dataUint8Array—

Defined in packages/document/src/docx/embedded.ts:30

EmbeddedObjectInfointerface#

interface EmbeddedObjectInfo extends EmbeddedObjectOpenEvent
PropertyTypeDescription
posnumber—
asIconboolean—
kindFileKind—
fileNamestringInherited from EmbeddedObjectOpenEvent.
mimeTypestringInherited from EmbeddedObjectOpenEvent.
progIdstringInherited from EmbeddedObjectOpenEvent.
dataUint8Array<ArrayBufferLike>Inherited from EmbeddedObjectOpenEvent.

Defined in packages/document/src/editor/objects/types.ts:252

EmbeddedObjectInputinterface#

interface EmbeddedObjectInput
PropertyTypeDescription
dataUint8Array | ArrayBuffer—
fileNamestring—
mimeTypeoptionalstring—
asIconoptionalboolean—
iconoptionalstring—
widthoptionalnumber—
heightoptionalnumber—

Defined in packages/document/src/docx/embedded.ts:20

EmbeddedObjectOpenEventinterface#

interface EmbeddedObjectOpenEvent
PropertyTypeDescription
fileNamestring—
mimeTypestring—
progIdstring—
dataUint8Array—

Defined in packages/document/src/editor/objects/types.ts:245

FieldContextinterface#

interface FieldContext
PropertyTypeDescription
nowoptionalDate—
valuesoptionalRecord<string, unknown>—
pagesoptionalRecord<string, number>—
pageCountoptionalnumber—

Defined in packages/document/src/model/fields.ts:37

FileApiinterface#

interface FileApi
MemberTypeDescription
newDocument()() => voidReplaces the document with an empty one. Does not ask first.
getTemplates()() => TemplateInfo[]The templates of New from template: yours first, then the built-in ones.
newFromTemplate()(id: string) => Promise<boolean>Replaces the document with a copy of a template. Does not ask first.
openFile()(input: Blob | ArrayBuffer | Uint8Array, options?: FileOpenOptions) => Promise<FileImportFormat>Reads a file in any format the editor imports and shows it. The format is detected from the bytes, then the name.
exportFile()(format: FileExportFormat, options?: FileExportOptions) => Promise<Blob>A Word file is encrypted with the password of the document, or with password; null writes it without one.
setFilePassword()(password: string | null) => voidSets or, with null, removes the password that Word files are saved and downloaded with.
hasFilePassword()() => boolean—
downloadFile()(format: FileExportFormat, fileName?: string) => Promise<void>—
saveFile()() => Promise<boolean>Saves through file.onSaveRequest, or downloads a .docx file when there is none.
getFileName()() => string—
setFileName()(name: string) => void—
isModified()() => booleanTrue when the document changed since it was opened, created, saved or downloaded.
openFileMenu()() => boolean—
closeFileMenu()() => void—
isFileMenuOpen()() => boolean—

Defined in packages/document/src/editor/file/types.ts:98

FileEventsinterface#

interface FileEvents
PropertyTypeDescription
fileOpened{ fileName: string; format: FileImportFormat }—
templateOpened{ id: string; name: string }—
fileSaved{ fileName: string; format: FileExportFormat | null; target: 'download' | 'host' }—
fileError{ action: 'open' | 'save' | 'new'; error: unknown; fileName: string }—
fileMenuChange{ open: boolean }—

Defined in packages/document/src/editor/file/types.ts:86

FileExportOptionsinterface#

interface FileExportOptions
PropertyTypeDescription
passwordoptionalstring | null—

Defined in packages/document/src/editor/file/types.ts:94

FileIconSvgOptionsinterface#

interface FileIconSvgOptions
PropertyTypeDescription
widthoptionalnumber—
heightoptionalnumber—
titleoptionalstring—

Defined in packages/document/src/docx/file-icon.ts:136

FileOpenOptionsinterface#

interface FileOpenOptions
PropertyTypeDescription
fileNameoptionalstring—
passwordoptionalstringThe password of a password-protected Word file.
formatoptionalFileImportFormatSkips detection and reads the file as this format.

Defined in packages/document/src/editor/file/types.ts:76

FileOptionsinterface#

interface FileOptions
PropertyTypeDescription
hiddenoptionalreadonly FileItemId[]Entries of the File tab to leave out. A hidden entry also loses its keyboard shortcut.
templatesoptionalreadonly DocumentTemplate[]Templates of your own for New from template, listed before the built-in ones.
builtinTemplatesoptionalbooleanfalse leaves out the four built-in templates (letter, report, meeting notes, résumé).
fileNameoptionalstringThe name used for downloads, without an extension. Defaults to the title of the document.
onNewRequestoptional(request: FileRequest) => FileRequestResultRuns instead of emptying the editor when the user asks for a new document. Return false to let the editor do it.
onOpenRequestoptional(request: FileRequest) => FileRequestResultRuns instead of the browser's file chooser when the user asks to open a file. Return false to show the chooser.
onSaveRequestoptional(request: FileRequest) => FileRequestResultRuns on Save and Ctrl+S instead of downloading a .docx file. Return false to download.

Defined in packages/document/src/editor/file/types.ts:59

FileRequestinterface#

interface FileRequest
PropertyTypeDescription
editorDocumentEditorApi—
fileNamestringThe name of the document without an extension.

Defined in packages/document/src/editor/file/types.ts:51

FileTypeInfointerface#

interface FileTypeInfo
PropertyTypeDescription
kindFileKind—
labelFileTypeLabel—
extensionstringLower-case extension without the dot; empty when nothing is known.
badgestringUp to four upper-case characters for the icon.
mimeTypestring—
sourceFileTypeSource—

Defined in packages/document/src/docx/file-type.ts:28

FileTypeInputinterface#

interface FileTypeInput
PropertyTypeDescription
progIdoptionalstring | null—
fileNameoptionalstring | null—
mimeTypeoptionalstring | null—
partNameoptionalstring | null—
dataoptionalUint8Array | null—

Defined in packages/document/src/docx/file-type.ts:39

FindOptionsinterface#

interface FindOptions
PropertyTypeDescription
matchCaseoptionalboolean—
wholeWordoptionalboolean—
regexoptionalboolean—
wildcardsoptionalboolean—
formatoptionalFindFormat—

Defined in packages/document/src/types.ts:628

FindPaneResultinterface#

interface FindPaneResult
PropertyTypeDescription
indexnumber—
fromnumber—
tonumber—
beforestring—
matchstring—
afterstring—

Defined in packages/document/src/editor/editing/types.ts:218

FindResultinterface#

interface FindResult
PropertyTypeDescription
countnumber—
currentnumber—

Defined in packages/document/src/types.ts:636

FontFormatinterface#

interface FontFormat
PropertyTypeDescription
fontFamilyoptionalstring | null—
fontSizeoptionalnumber | null—
boldoptionalboolean—
italicoptionalboolean—
coloroptionalstring | null—
underlineoptionalUnderlineStyle | 'none' | null—
underlineColoroptionalstring | null—
strikeoptionalboolean—
doubleStrikeoptionalboolean—
superscriptoptionalboolean—
subscriptoptionalboolean—
smallCapsoptionalboolean—
allCapsoptionalboolean—
hiddenoptionalboolean—
spacingoptionalnumber | null—
scaleoptionalnumber | null—
positionoptionalnumber | null—
kerningoptionalnumber | null—

Defined in packages/document/src/editor/editing/types.ts:99

FootnoteInfointerface#

interface FootnoteInfo
PropertyTypeDescription
idstring—
kindNoteKind—
numbernumber—
labelstring—
posnumber—
contentDocNodeJSON[]—

Defined in packages/document/src/editor/objects/types.ts:165

FormatStateinterface#

interface FormatState
PropertyTypeDescription
boldboolean—
italicboolean—
underlineboolean—
strikeboolean—
superscriptboolean—
subscriptboolean—
fontFamilystring | null—
fontSizenumber | null—
textColorstring | null—
highlightstring | null—
paragraphStylestring—
alignTextAlignment—
lineSpacingnumber | null—
bulletListboolean—
orderedListboolean—
inTableboolean—
imageSelectedboolean—
direction'ltr' | 'rtl'—

Defined in packages/document/src/types.ts:733

FormFieldErrorinterface#

interface FormFieldError
PropertyTypeDescription
tagstring—
titlestring—
messagestring—

Defined in packages/document/src/editor/objects/types.ts:222

HeaderFooterContentinterface#

interface HeaderFooterContent
PropertyTypeDescription
headerDocNodeJSON | null—
firstHeaderDocNodeJSON | null—
firstFooterDocNodeJSON | null—

Defined in packages/document/src/types.ts:434

HtmlDocumentOptionsinterface#

interface HtmlDocumentOptions
PropertyTypeDescription
fullDocumentoptionalboolean—
titleoptionalstring—
includeDeletedoptionalboolean—
linkSchemesoptionalreadonly string[]Schemes written as links that can be followed, besides http, https, mailto and tel.

Defined in packages/document/src/formats/html.ts:23

HtmlExportOptionsinterface#

interface HtmlExportOptions
PropertyTypeDescription
fullDocumentoptionalboolean—
titleoptionalstring—

Defined in packages/document/src/types.ts:907

HyperlinkOptionsinterface#

interface HyperlinkOptions
PropertyTypeDescription
hrefstring—
textoptionalstring—
titleoptionalstring | null—
headingPosoptionalnumber—

Defined in packages/document/src/editor/editing/types.ts:120

ImageAnchorinterface#

interface ImageAnchor
PropertyTypeDescription
xnumber—
ynumber—
horizontalRelativestring—
verticalRelativestring—
horizontalAlignoptionalstring | null—
verticalAlignoptionalstring | null—
wrapSideoptionalstring | null—
wrapPolygonoptional[number, number][] | null—
distanceoptional{ top: number; right: number; bottom: number; left: number }—
allowOverlapoptionalboolean—
layoutInCelloptionalboolean—
lockedoptionalboolean—
zIndexoptionalnumber—

Defined in packages/document/src/types.ts:369

ImageBorderinterface#

interface ImageBorder
PropertyTypeDescription
widthnumber—
colorstring—
styleoptional'solid' | 'dashed' | 'dotted'—
shadowoptionalboolean—

Defined in packages/document/src/types.ts:404

ImageCropinterface#

interface ImageCrop
PropertyTypeDescription
topnumber—
rightnumber—
bottomnumber—
leftnumber—

Defined in packages/document/src/types.ts:422

ImageEffectsinterface#

interface ImageEffects
PropertyTypeDescription
brightnessoptionalnumberFrom -100 to 100; 0 leaves the picture as it is.
contrastoptionalnumber—
recoloroptionalImageRecolor—
shapeoptionalImageShapePreset—

Defined in packages/document/src/types.ts:414

InkInfointerface#

interface InkInfo
PropertyTypeDescription
posnumber—
strokeInkStroke—
widthnumber—
heightnumber—

Defined in packages/document/src/editor/draw/index.ts:24

InkStrokeinterface#

interface InkStroke
PropertyTypeDescription
toolInkTool—
colorstring—
widthnumberLine width in pixels at 100% zoom.
points[number, number][]Points in pixels, relative to the top left corner of the drawing.

Defined in packages/document/src/types.ts:443

InsertEmbeddedObjectOptionsinterface#

interface InsertEmbeddedObjectOptions
PropertyTypeDescription
dataUint8Array | ArrayBuffer—
fileNamestring—
mimeTypeoptionalstring—
asIconoptionalboolean—
iconoptionalstring—
widthoptionalnumber—
heightoptionalnumber—

Defined in packages/document/src/editor/objects/types.ts:235

InsertImageOptionsinterface#

interface InsertImageOptions
PropertyTypeDescription
altoptionalstring—
widthoptionalnumber—
heightoptionalnumber—

Defined in packages/document/src/types.ts:883

InsertShapeValueinterface#

interface InsertShapeValue
PropertyTypeDescription
shapeShapeKind—
widthoptionalnumber—
heightoptionalnumber—
filloptionalstring | null—
strokeoptionalstring | null—
strokeWidthoptionalnumber—
textoptionalstring—

Defined in packages/document/src/editor/objects/types.ts:152

LayoutApiinterface#

interface LayoutApi
MemberTypeDescription
whenLayoutReady()() => Promise<void>—
isLayoutComplete()() => boolean—
getPageInfo()(page: number) => PageInfo | null—
getPageText()(page: number) => string—
getLayoutStats()() => LayoutStats—
getPrintHtml()() => string—
exportPdf()(options?: PdfExportOptions) => Promise<Blob>—

Defined in packages/document/src/layout/types.ts:69

LayoutBlockinterface#

interface LayoutBlock
PropertyTypeDescription
kindLayoutBlockKind—
heightnumber—
paddingTopoptionalnumber—
paddingBottomoptionalnumber—
partsoptionalreadonly number[]—
repeatHeaderoptionalnumber—
headerRowsoptionalnumberHow many leading rows repeatHeader covers. One when absent.
keepWithNextoptionalboolean—
pageBreakBeforeoptionalboolean—
keepLinesoptionalboolean—
widowControloptionalboolean—
extentoptionalnumber—
topSpaceoptionalnumber—
trimTopoptionalnumber—
lineSlackoptionalnumber—
tailoptionalnumber—
needsoptionalnumber—
rowSlackoptionalreadonly number[]—
keepRowsoptionalreadonly boolean[]—
rowsoptionalreadonly (LayoutRow | undefined)[]—
notesoptionalreadonly LayoutNote[]—
sectionoptionalnumber—

Defined in packages/document/src/layout/paginate-cursor.ts:23

LayoutBreakinterface#

interface LayoutBreak
PropertyTypeDescription
blocknumber—
partnumber—
pagenumber—
flowYnumber—
extranumber—
kindLayoutBreakKind—
fromPagenumber—
fromOffsetnumber—
targetnumber—
columnnumber—
cellsoptionalreadonly number[]—
slackoptionalreadonly number[]—
trimoptionalnumber—

Defined in packages/document/src/layout/paginate-cursor.ts:79

LayoutEventsinterface#

interface LayoutEvents
PropertyTypeDescription
layoutComplete{ pageCount: number; durationMs: number }—
fontsMissing{ fonts: MissingFont[] }A font the document uses is not installed. Page breaks match Word only when substitute is not null.

Defined in packages/document/src/layout/types.ts:37

LayoutOptionsinterface#

interface LayoutOptions
PropertyTypeDescription
layoutCompatibilityoptionalLayoutCompatibility—
virtualizeoptionalboolean | 'auto'—
pdfFontsoptionalreadonly PdfFontSource[]—
isFontAvailableoptional(family: string) => booleanReplaces the built-in check of whether a font family can be drawn on this device.

Defined in packages/document/src/layout/types.ts:29

LayoutStatsinterface#

interface LayoutStats
PropertyTypeDescription
pagesnumber—
blocksnumber—
measurednumber—
cacheHitsnumber—
lastLayoutMsnumber—
passesnumber—
completeboolean—
virtualizedboolean—
reuseoptional{ resumedPage: number; convergedPage: number }—

Defined in packages/document/src/layout/types.ts:57

LineNumberinginterface#

interface LineNumbering
PropertyTypeDescription
countByoptionalnumber—
startoptionalnumber—
restartoptional'continuous' | 'newPage'—
distanceoptionalnumber—

Defined in packages/document/src/editor/editing/types.ts:245

ListLevelFormatinterface#

interface ListLevelFormat
PropertyTypeDescription
numberStyle'decimal' | 'lowerAlpha' | 'upperAlpha' | 'lowerRoman' | 'upperRoman' | 'bullet'—
formatstring—
bulletoptionalstring—
indentnumber—
startoptionalnumber—
restartAfteroptionalnumber—
linkedStyleoptionalstring—
alignoptional'left' | 'center' | 'right'—
alignedAtoptionalnumber—
textIndentoptionalnumber—
followoptional'tab' | 'space' | 'nothing'—

Defined in packages/document/src/editor/editing/types.ts:152

LoopbackConnectioninterface#

interface LoopbackConnection extends CollabProvider
PropertyTypeDescription
clientIdCollabClientId—
version() => number—
metaVersion() => number—
requestSteps()(sinceVersion: number, sinceMeta?: number) => void—
presenceCollabPresenceChannel—
commentsCollabCommentChannel—
versionsCollabVersionChannel—
locksCollabLockChannel—
snapshotsCollabSnapshotChannel—
setOnline()(online: boolean) => void—
setConnection()(status: CollabConnectionStatus) => void—
isOnline()() => boolean—
reset()(snapshot: CollabSnapshot) => void—
disconnect()() => void—
sendSteps()(payload: CollabStepsPayload) => CollabSendResult | Promise<CollabSendResult>Inherited from CollabProvider.
onRemoteSteps()(handler: (payload: CollabRemotePayload) => void) => () => voidInherited from CollabProvider.
onStatus()optional((handler: (status: "online" | "offline") => void) => () => void) | undefinedInherited from CollabProvider.
onConnection()optional((handler: (status: CollabConnectionStatus) => void) => () => void) | undefinedInherited from CollabProvider.
onReset()optional((handler: (snapshot: CollabSnapshot) => void) => () => void) | undefinedInherited from CollabProvider.
presenceTimeoutoptionalnumber | undefinedInherited from CollabProvider.

Defined in packages/document/src/editor/collab/types.ts:439

LoopbackHubinterface#

interface LoopbackHub
PropertyTypeDescription
connect()(clientId: CollabClientId) => LoopbackConnection—
version()() => number—
getDocumentSteps()() => { step: unknown; clientId: CollabClientId }[]—
authority()() => CollabAuthority—
pending()() => number—
step()() => boolean—
flush()(limit?: number) => number—
destroy()() => void—

Defined in packages/document/src/editor/collab/types.ts:456

LoopbackHubOptionsinterface#

interface LoopbackHubOptions extends CollabAuthorityOptions
PropertyTypeDescription
latencyoptionalnumber—
jitteroptionalnumber—
dropRateoptionalnumber—
manualoptionalboolean—
randomoptional() => number—
documentoptionalDocumentInput | null | undefinedThe document at version 0. Without it, and without snapshot, the authority starts from an empty document. Inherited from CollabAuthorityOptions.
limitsoptionalPartial<CollabDocumentLimits> | undefinedInherited from CollabAuthorityOptions.
trustClientsoptionalboolean | undefinedRelay steps without applying them. Only for a process where every client is your own code, such as a unit test of a transport: a client can then store any document and move any lock. Inherited from CollabAuthorityOptions.
snapshotoptionalCollabSnapshot | null | undefinedInherited from CollabAuthorityOptions.
snapshotEveryoptionalnumber | undefinedInherited from CollabAuthorityOptions.
retainStepsoptionalnumber | undefinedInherited from CollabAuthorityOptions.
versionsoptionalreadonly CollabStoredVersion[] | null | undefinedNamed versions saved earlier, as storedVersions() returned them. Inherited from CollabAuthorityOptions.
nowoptional(() => number) | undefinedInherited from CollabAuthorityOptions.
createIdoptional(() => string) | undefinedInherited from CollabAuthorityOptions.

Defined in packages/document/src/editor/collab/types.ts:431

MarkdownOptionsinterface#

interface MarkdownOptions
PropertyTypeDescription
includeDeletedoptionalboolean—

Defined in packages/document/src/formats/markdown.ts:21

MarkupVisibilityinterface#

interface MarkupVisibility
PropertyTypeDescription
insertionsAndDeletionsboolean—
formattingboolean—
commentsboolean—
hiddenAuthorsstring[]—

Defined in packages/document/src/editor/review/types.ts:49

MentionEventinterface#

interface MentionEvent
PropertyTypeDescription
personPerson—
threadIdstring—
textstring—

Defined in packages/document/src/editor/review/types.ts:62

MentionOptionsinterface#

interface MentionOptions
PropertyTypeDescription
onMention()optional(event: MentionEvent) => void—

Defined in packages/document/src/editor/review/types.ts:68

MergeFieldDefinitioninterface#

interface MergeFieldDefinition
PropertyTypeDescription
namestring—
labeloptionalstring—

Defined in packages/document/src/types.ts:649

MergeOptionsinterface#

interface MergeOptions
PropertyTypeDescription
missingoptional'empty' | 'keep' | 'placeholder'—
localeoptionalstring—
currencyoptionalstring—

Defined in packages/document/src/types.ts:643

MetafileOptionsinterface#

interface MetafileOptions
PropertyTypeDescription
embeddedEmfoptionalboolean—

Defined in packages/document/src/docx/metafile.ts:580

MissingFontinterface#

interface MissingFont
PropertyTypeDescription
familystring—
substitutestring | nullThe metric-compatible font that is installed and drawn instead, or null when there is none.

Defined in packages/document/src/layout/types.ts:23

MultilevelListDefinitioninterface#

interface MultilevelListDefinition
PropertyTypeDescription
idstring—
namestring—
levelsListLevelFormat[]—

Defined in packages/document/src/editor/editing/types.ts:167

NoteSettingsinterface#

interface NoteSettings
PropertyTypeDescription
positionoptionalstring—
formatoptionalPageNumberFormat—
startoptionalnumber—
restartoptionalstring—

Defined in packages/document/src/types.ts:182

NumberingChangeinterface#

interface NumberingChange
PropertyTypeDescription
idstring—
authorstring—
datestring—
originalstring—

Defined in packages/document/src/types.ts:329

NumberingDefinitionsinterface#

interface NumberingDefinitions

Defined in packages/document/src/model/numbering.ts:52

NumberingInstanceinterface#

interface NumberingInstance
PropertyTypeDescription
idnumber—
abstractIdnumber—
overridesoptionalNumberingOverride[]—

Defined in packages/document/src/model/numbering.ts:46

NumberingLabelinterface#

interface NumberingLabel
PropertyTypeDescription
pathnumber[]—
labelstring—
levelnumber—
numIdnumber | null—
formatstring—
suffix'tab' | 'space' | 'nothing'—
textstring—

Defined in packages/document/src/model/numbering.ts:57

NumberingLevelinterface#

interface NumberingLevel
PropertyTypeDescription
levelnumber—
startnumber—
formatstring—
textstring—
suffixoptional'tab' | 'space' | 'nothing'—
restartoptionalnumber—
paragraphStyleoptionalstring—
isLegaloptionalboolean—
alignoptionalstring—
indentLeftoptionalnumber—
hangingoptionalnumber—
fontoptionalstring—
runoptionalNumberingRun—

Defined in packages/document/src/model/numbering.ts:15

NumberingOverrideinterface#

interface NumberingOverride
PropertyTypeDescription
levelnumber—
startoptionalnumber—
definitionoptionalNumberingLevel—

Defined in packages/document/src/model/numbering.ts:40

ObjectsApiinterface#

interface ObjectsApi
MemberTypeDescription
getFootnotes()(kind?: NoteKind) => FootnoteInfo[]—
getBookmarks()(includeHidden?: boolean) => BookmarkInfo[]—
goToBookmark()(name: string) => boolean—
updateFields()() => number—
setFormMode()(enabled: boolean) => void—
isFormMode()() => boolean—
getFormData()() => Record<string, unknown>—
setFormData()(data: Record<string, unknown>) => number—
validateForm()() => FormFieldError[]—
openObjectDialog()(name: ObjectDialogName) => boolean—
evaluateTableFormula()(formula: string) => string | null—
getProtection()() => DocumentProtection | null—
protectDocument()(mode: ProtectionMode, password?: string) => Promise<boolean>—
unprotectDocument()(password?: string) => Promise<boolean>—
isPasswordProtected()() => boolean—
insertEmbeddedObject()(options: InsertEmbeddedObjectOptions) => boolean—
getEmbeddedObjects()() => EmbeddedObjectInfo[]—
openEmbeddedObject()(pos?: number) => boolean—
downloadEmbeddedObject()(pos?: number) => boolean—

Defined in packages/document/src/editor/objects/types.ts:264

ObjectsEventsinterface#

interface ObjectsEvents
PropertyTypeDescription
formChange{ tag: string; value: unknown; data: Record<string, unknown> }—
fieldsUpdate{ count: number }—
embeddedObjectOpenEmbeddedObjectOpenEvent—

Defined in packages/document/src/editor/objects/types.ts:258

ObjectsOptionsinterface#

interface ObjectsOptions
PropertyTypeDescription
formModeoptionalboolean—
showBookmarksoptionalboolean—
noteNumberFormatoptionalPartial<Record<NoteKind, NoteNumberFormat>>—
mergeRecordsoptionalreadonly Record<string, unknown>[]—

Defined in packages/document/src/editor/objects/types.ts:228

OutlineEntryinterface#

interface OutlineEntry
PropertyTypeDescription
levelnumber—
textstring—
posnumber—
indexnumber—

Defined in packages/document/src/types.ts:612

PageInfointerface#

interface PageInfo
PropertyTypeDescription
indexnumber—
numbernumber—
labelstring—
sectionnumber—
widthnumber—
heightnumber—
topnumber—
orientation'portrait' | 'landscape'—
columnsnumber—
blankboolean—
footnotesnumber—

Defined in packages/document/src/layout/types.ts:43

PageMarginsinterface#

interface PageMargins
PropertyTypeDescription
topnumber—
rightnumber—
bottomnumber—
leftnumber—

Defined in packages/document/src/types.ts:45

PageNumberinginterface#

interface PageNumbering
PropertyTypeDescription
formatoptionalPageNumberFormat—
startoptionalnumber | null—

Defined in packages/document/src/types.ts:83

PageSetupinterface#

interface PageSetup
PropertyTypeDescription
sizePageSizeName | { width: number; height: number }—
orientationPageOrientation—
marginsPageMargins—
headerDistancenumber—
footerDistancenumber—
differentFirstPageboolean—
gutteroptionalnumber—
columnsoptionalSectionColumns | null—
sectionTypeoptionalSectionBreakType | null—
pageNumbersoptionalPageNumbering | null—
verticalAlignoptional'top' | 'center' | 'bottom' | 'justify' | null—
rtloptionalboolean—
lineNumbersoptionalLineNumbering | null—
pageBordersoptionalPageBorders | null—
docxoptionalPreservedXml | null—
changeoptionalSectionFormatChange | null—

Defined in packages/document/src/types.ts:52

PageSliceinterface#

interface PageSlice
PropertyTypeDescription
indexnumber—
startBlocknumber—
startPartnumber—
usednumber—
sectionnumber—
numbernumber—
blankboolean—
cleanboolean—
flowYnumber—
noteHeightnumber—
notesPageNote[]—
columnsnumber—

Defined in packages/document/src/layout/paginate-cursor.ts:102

PaginateOptionsinterface#

interface PaginateOptions
PropertyTypeDescription
pageHeightnumber—
widowControloptionalboolean—
minLinesoptionalnumber—
sectionsoptionalreadonly LayoutSection[]—
noteSeparatoroptionalnumber—
balanceLastPageoptionalboolean—
resolvePartsoptional(index: number, block: LayoutBlock) => readonly number[] | ResolvedParts | undefined—
resolveRowoptional(index: number, row: number, block: LayoutBlock) => LayoutRow | undefined—

Defined in packages/document/src/layout/paginate-cursor.ts:58

PaginationResultinterface#

interface PaginationResult
PropertyTypeDescription
pagesPageSlice[]—
breaksLayoutBreak[]—
pageCountnumber—
blockPagesnumber[]—
reuseoptionalPaginationReuse—

Defined in packages/document/src/layout/paginate-cursor.ts:122

ParagraphBorderinterface#

interface ParagraphBorder
PropertyTypeDescription
styleBorderLineStyle—
widthnumber—
colorstring—
shadowoptionalboolean—

Defined in packages/document/src/editor/editing/types.ts:67

ParagraphBordersinterface#

interface ParagraphBorders
PropertyTypeDescription
topoptionalParagraphBorder | null—
rightoptionalParagraphBorder | null—
bottomoptionalParagraphBorder | null—
leftoptionalParagraphBorder | null—

Defined in packages/document/src/editor/editing/types.ts:74

ParagraphFormatinterface#

interface ParagraphFormat
PropertyTypeDescription
alignoptional'left' | 'center' | 'right' | 'justify' | null—
indentLeftoptionalnumber—
indentRightoptionalnumber—
indentFirstLineoptionalnumber—
spaceBeforeoptionalnumber | null—
spaceAfteroptionalnumber | null—
lineRuleoptionalLineRule—
lineHeightoptionalnumber | null—
lineHeightPtoptionalnumber | null—
keepWithNextoptionalboolean—
keepLinesoptionalboolean—
widowControloptionalboolean | null—
pageBreakBeforeoptionalboolean—
contextualSpacingoptionalboolean—
outlineLeveloptionalnumber | null—

Defined in packages/document/src/editor/editing/types.ts:81

ParagraphFormatChangeinterface#

interface ParagraphFormatChange
PropertyTypeDescription
idstring—
authorstring—
datestring—
before{ attrs: Record<string, unknown>; pPr?: string | null }—

Defined in packages/document/src/types.ts:308

ParagraphStyleDefinitioninterface#

interface ParagraphStyleDefinition
PropertyTypeDescription
idParagraphStyleId—
wordNamestring—
labelstring—
tag'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'blockquote' | 'pre'—
fontSizeoptionalnumber—
fontFamilyoptionalstring—
boldoptionalboolean—
italicoptionalboolean—
coloroptionalstring—
spaceBeforeoptionalnumber—
spaceAfteroptionalnumber—
lineHeightoptionalnumber—
alignoptionalTextAlignment—
indentLeftoptionalnumber—
indentRightoptionalnumber—
outlineLeveloptionalnumber—
keepWithNextoptionalboolean—
shadingoptionalstring—

Defined in packages/document/src/model/paragraph-styles.ts:3

ParagraphStyleInfointerface#

interface ParagraphStyleInfo
PropertyTypeDescription
idstring—
namestring—
basedOnstring—
isBuiltinboolean—
isModifiedboolean—
isActiveboolean—
formatStyleFormat—

Defined in packages/document/src/editor/editing/types.ts:142

ParsedFieldinterface#

interface ParsedField
PropertyTypeDescription
keywordstring—
kindFieldKind | 'link'—
namestring—
argsstring[]—
switchesRecord<string, string | true>—
hrefstring | null—
titlestring | null—
canonicalstring—
placeholderstring | null—

Defined in packages/document/src/model/fields.ts:25

PastedImageContextinterface#

interface PastedImageContext
PropertyTypeDescription
source'word' | 'googleDocs' | 'editor' | 'other'—
indexnumber—
altstring—
htmlstring—
rtfstring—
filesreadonly File[]—

Defined in packages/document/src/editor/editing/types.ts:194

PdfClusterinterface#

interface PdfCluster
PropertyTypeDescription
xnumber—
widthnumber—
lengthnumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:47

PdfColorinterface#

interface PdfColor
PropertyTypeDescription
rnumber—
gnumber—
bnumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:1

PdfDestinationinterface#

interface PdfDestination
PropertyTypeDescription
kind'destination'—
namestring—
ynumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:144

PdfDocumentLayoutinterface#

interface PdfDocumentLayout
PropertyTypeDescription
pagesPdfPage[]—
outlineoptionalPdfOutlineEntry[]—
titleoptionalstring—
authoroptionalstring—
subjectoptionalstring—
keywordsoptionalstring—
languageoptionalstring—
fontsoptionalreadonly PdfFontSource[]—
structureoptionalreadonly PdfStructNode[]—
pdfAoptionalboolean—
createdoptionalDate—
modifiedoptionalDate—

Defined in packages/document/src/layout/pdf/layout-tree.ts:182

PdfExportOptionsinterface#

interface PdfExportOptions
PropertyTypeDescription
titleoptionalstring—
authoroptionalstring—
subjectoptionalstring—
keywordsoptionalstring—
fontsoptionalreadonly PdfFontSource[]—
compressoptionalboolean—
outlineoptionalboolean—
onProgressoptional(page: number, pages: number) => void—
fontLoaderoptionalPdfFontLoader—
localFontsoptionalboolean—
taggedoptionalboolean—
pdfAoptionalboolean—

Defined in packages/document/src/layout/types.ts:6

PdfFontSourceinterface#

interface PdfFontSource
PropertyTypeDescription
familystring—
boldoptionalboolean—
italicoptionalboolean—
dataUint8Array—

Defined in packages/document/src/layout/pdf/layout-tree.ts:175

PdfGroupinterface#

interface PdfGroup extends PdfTagging
PropertyTypeDescription
kind'group'—
itemsPdfItem[]—
matrixoptionalPdfMatrix—
clipoptional{ x: number; y: number; width: number; height: number }—
opacityoptionalnumber—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:152

PdfImageinterface#

interface PdfImage extends PdfTagging
PropertyTypeDescription
kind'image'—
xnumber—
ynumber—
widthnumber—
heightnumber—
dataUint8Array—
mime'image/jpeg' | 'image/png'—
altoptionalstring—
rotationoptionalnumber—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:121

PdfLineinterface#

interface PdfLine extends PdfTagging
PropertyTypeDescription
kind'line'—
x1number—
y1number—
x2number—
y2number—
coloroptionalPdfColor—
widthoptionalnumber—
dashoptionalreadonly number[]—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:93

PdfLinkAreainterface#

interface PdfLinkArea
PropertyTypeDescription
kind'link'—
xnumber—
ynumber—
widthnumber—
heightnumber—
hrefoptionalstring—
destinationoptionalstring—
structoptionalnumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:133

PdfOutlineEntryinterface#

interface PdfOutlineEntry
PropertyTypeDescription
titlestring—
levelnumber—
pagenumber—
ynumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:168

PdfPageinterface#

interface PdfPage
PropertyTypeDescription
widthnumber—
heightnumber—
itemsPdfItem[]—

Defined in packages/document/src/layout/pdf/layout-tree.ts:162

PdfPathinterface#

interface PdfPath extends PdfTagging
PropertyTypeDescription
kind'path'—
commandsreadonly PdfPathCommand[]—
filloptionalPdfColor—
strokeoptionalPdfColor—
strokeWidthoptionalnumber—
dashoptionalreadonly number[]—
roundCapsoptionalboolean—
roundJoinsoptionalboolean—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:110

PdfRectinterface#

interface PdfRect extends PdfTagging
PropertyTypeDescription
kind'rect'—
xnumber—
ynumber—
widthnumber—
heightnumber—
filloptionalPdfColor—
strokeoptionalPdfColor—
strokeWidthoptionalnumber—
dashoptionalreadonly number[]—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:81

PdfStructNodeinterface#

interface PdfStructNode
PropertyTypeDescription
typePdfStructType—
parentnumber—
altoptionalstring—
languageoptionalstring—

Defined in packages/document/src/layout/pdf/layout-tree.ts:35

PdfTagginginterface#

interface PdfTagging
PropertyTypeDescription
structoptionalnumber—
artifactoptionalPdfArtifactType—

Defined in packages/document/src/layout/pdf/layout-tree.ts:42

PdfTextRuninterface#

interface PdfTextRun extends PdfTagging
PropertyTypeDescription
kind'text'—
xnumber—
baselinenumber—
widthnumber—
textstring—
fontFamilystring—
fontSizenumber—
boldoptionalboolean—
italicoptionalboolean—
coloroptionalPdfColor—
underlineoptionalboolean—
underlineStyleoptionalPdfUnderlineStyleThe line drawn for underline; a single line when left out.
underlineColoroptionalPdfColorThe colour of the underline; the colour of the text when left out.
strikeoptionalboolean—
doubleStrikeoptionalboolean—
backgroundoptionalPdfColor—
directionoptional'ltr' | 'rtl'—
clustersoptionalreadonly PdfCluster[]—
trailingSpaceoptionalboolean—
decorationoptional{ x: number; width: number }—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:55

PdfWriteOptionsinterface#

interface PdfWriteOptions
PropertyTypeDescription
compressoptionalboolean—
creationDateoptionalDate—
produceroptionalstring—
pdfAoptionalboolean—
taggedoptionalboolean—

Defined in packages/document/src/layout/pdf/writer.ts:29

PdfWriteResultinterface#

interface PdfWriteResult
PropertyTypeDescription
bytesUint8Array—
warningsstring[]—

Defined in packages/document/src/layout/pdf/writer.ts:37

Personinterface#

interface Person
PropertyTypeDescription
idstring—
namestring—
emailoptionalstring—

Defined in packages/document/src/editor/review/types.ts:56

PresenceStateinterface#

interface PresenceState
PropertyTypeDescription
clientIdCollabClientId—
namestring—
coloroptionalstring—
anchornumber | null—
headnumber | null—
focusedboolean—
clockoptionalnumber—

Defined in packages/document/src/editor/collab/types.ts:71

PreservedPartinterface#

interface PreservedPart
PropertyTypeDescription
textoptionalstring—
base64optionalstring—
deflateoptionalstringA large text part, kept as the base64 of its raw DEFLATE data exactly as it was stored in the source file.
sizeoptionalnumberThe length in bytes of the part once deflate is inflated.

Defined in packages/document/src/types.ts:231

PreservedRelationshipinterface#

interface PreservedRelationship
PropertyTypeDescription
idstring—
typestring—
targetstring—
externaloptionalboolean—

Defined in packages/document/src/types.ts:88

PreservedXmlinterface#

interface PreservedXml
[key: string]: unknown
PropertyTypeDescription
xmlstring—
sigoptionalstring—
relsoptionalPreservedRelationship[]—

Defined in packages/document/src/types.ts:95

ProposedChangeinterface#

interface ProposedChange
PropertyTypeDescription
fromoptionalnumber—
tooptionalnumber—
findoptionalstring—
occurrenceoptionalnumber—
textstring—
authoroptionalstring—
dateoptionalstring—

Defined in packages/document/src/types.ts:897

ReadAloudApiinterface#

interface ReadAloudApi
MemberTypeDescription
readAloud()(options?: ReadAloudOptions) => ReadAloudHandle—
stopReadAloud()() => void—
isReadingAloud()() => boolean—

Defined in packages/document/src/editor/read-aloud.ts:35

ReadAloudChunkinterface#

interface ReadAloudChunk
PropertyTypeDescription
pageIndexnumberThe page the sentence starts on, from 0.
textstring—
fromnumberWhere the sentence starts and ends in the document.
tonumber—

Defined in packages/document/src/editor/read-aloud.ts:8

ReadAloudEventsinterface#

interface ReadAloudEvents
PropertyTypeDescription
readAloudChange{ reading: boolean; paused: boolean }—

Defined in packages/document/src/editor/read-aloud.ts:43

ReadAloudHandleinterface#

interface ReadAloudHandle
PropertyTypeDescription
isPausedreadonlyboolean—
isStoppedreadonlyboolean—
finishedreadonlyPromise<void>—
pause()() => void—
resume()() => void—
stop()() => void—

Defined in packages/document/src/editor/read-aloud.ts:26

ReadAloudOptionsinterface#

interface ReadAloudOptions
PropertyTypeDescription
fromPageoptionalnumberThe page to start on, from 0. Without it reading starts at the cursor.
onTextoptional(chunk: ReadAloudChunk) => void | Promise<void>Speaks one sentence yourself; the next one follows when the promise settles. Without it the browser speaks.
langoptionalstring—
rateoptionalnumber—

Defined in packages/document/src/editor/read-aloud.ts:17

ReviewApiinterface#

interface ReviewApi
MemberTypeDescription
getMarkupMode()() => MarkupMode—
setMarkupMode()(mode: MarkupMode) => void—
getMarkupVisibility()() => MarkupVisibility—
setMarkupVisibility()(visibility: Partial<MarkupVisibility>) => void—
getRevisions()(filter?: RevisionFilter) => RevisionChange[]—
acceptChanges()(filter?: RevisionFilter) => number—
rejectChanges()(filter?: RevisionFilter) => number—
nextChange()() => RevisionChange | null—
previousChange()() => RevisionChange | null—
goToChange()(id: string) => boolean—
editReply()(threadId: string, replyId: string, text: string) => boolean—
deleteReply()(threadId: string, replyId: string) => boolean—
saveSnapshot()(label?: string) => SnapshotInfo | null—
getSnapshots()() => SnapshotInfo[]—
restoreSnapshot()(id: string) => boolean—
compareWithSnapshot()(id: string, options?: CompareOptions) => number—
deleteSnapshot()(id: string) => boolean—
getSnapshotDocument()(id: string) => DocumentData | null—
compareWithDocx()(input: ArrayBuffer | Uint8Array | Blob, options?: CompareOptions) => Promise<number>—
compareSideBySide()(revised: DocumentInput, options?: SideBySideOptions) => boolean—
closeSideBySide()() => boolean—
isSideBySideOpen()() => boolean—
combineWith()(first: DocumentInput, second: DocumentInput, options?: CombineOptions) => number—
combineWithDocx()(first: ArrayBuffer | Uint8Array | Blob, second: ArrayBuffer | Uint8Array | Blob, options?: CombineOptions) => Promise<number>—

Defined in packages/document/src/editor/review/types.ts:126

ReviewEventsinterface#

interface ReviewEvents
PropertyTypeDescription
revisionsChange{ revisions: RevisionChange[] }—
markupModeChange{ mode: MarkupMode }—
snapshotsChange{ snapshots: SnapshotInfo[] }—

Defined in packages/document/src/editor/review/types.ts:120

ReviewOptionsinterface#

interface ReviewOptions
PropertyTypeDescription
markupModeoptionalMarkupMode—
changeBarsoptionalboolean—
changeBalloonsoptionalboolean—
commentsLayoutoptional'margin' | 'panel'—
mentionsoptionalMentionOptions—
snapshotsoptionalSnapshotStorage—

Defined in packages/document/src/editor/review/types.ts:111

RevisionChangeinterface#

interface RevisionChange
PropertyTypeDescription
idstring—
idsstring[]—
kindRevisionChangeKind—
authorstring—
datestring—
textstring—
deletedTextoptionalstring—
summarystring—
fromnumber—
tonumber—

Defined in packages/document/src/editor/review/types.ts:19

RevisionFilterinterface#

interface RevisionFilter
PropertyTypeDescription
idsoptionalreadonly string[]—
authoroptionalstring—
authorsoptionalreadonly string[]—
kindsoptionalreadonly RevisionChangeKind[]—
fromoptionalnumber—
tooptionalnumber—
afteroptionalstring | Date—
beforeoptionalstring | Date—

Defined in packages/document/src/editor/review/types.ts:32

RevisionInfointerface#

interface RevisionInfo
PropertyTypeDescription
kind'insertion' | 'deletion'—
idstring—
authorstring—
datestring—
moveIdoptionalstring | null—

Defined in packages/document/src/types.ts:296

RibbonApiinterface#

interface RibbonApi
MemberTypeDescription
getRibbonTab()() => string | null—
setRibbonTab()(tab: RibbonTabName) => boolean—
isRibbonCollapsed()() => boolean—
setRibbonCollapsed()(collapsed: boolean) => void—
getViewMode()() => DocumentViewMode—
setViewMode()(mode: DocumentViewMode) => void—
fitZoom()(mode: 'width' | 'page') => number—
getTabStops()() => TabStop[]—
setTabStops()(stops: readonly TabStop[]) => boolean—

Defined in packages/document/src/editor/ribbon/types.ts:85

RibbonConfiginterface#

interface RibbonConfig
PropertyTypeDescription
tabsoptionalreadonly RibbonTabName[]—
hiddenTabsoptionalreadonly RibbonTabName[]—
hiddenGroupsoptionalreadonly string[]—
hiddenControlsoptionalreadonly string[]—
groupOrderoptionalReadonly<Record<string, readonly string[]>>—
tabLabelsoptionalReadonly<Record<string, string>>—
customoptionalreadonly RibbonCustomGroup[]—
activeTaboptionalRibbonTabName—
collapsedoptionalboolean—
keyTipsoptionalboolean—

Defined in packages/document/src/editor/ribbon/types.ts:56

RibbonCustomControlinterface#

interface RibbonCustomControl
PropertyTypeDescription
idstring—
labelstring—
iconoptionalstring—
kindoptional'button' | 'toggle'—
sizeoptional'large' | 'small'—
keyTipoptionalstring—
shortcutoptionalstring—
readOnlySafeoptionalboolean—
run(api: DocumentEditorApi) => void—
isPressedoptional(api: DocumentEditorApi) => boolean—
isDisabledoptional(api: DocumentEditorApi) => boolean—

Defined in packages/document/src/editor/ribbon/types.ts:33

RibbonCustomGroupinterface#

interface RibbonCustomGroup
PropertyTypeDescription
tabRibbonTabName—
tabLabeloptionalstring—
groupstring—
labelstring—
orderoptionalnumber—
controlsreadonly RibbonCustomControl[]—

Defined in packages/document/src/editor/ribbon/types.ts:47

RibbonEventsinterface#

interface RibbonEvents
PropertyTypeDescription
ribbonTabChange{ tab: string }—
viewModeChange{ mode: DocumentViewMode }—

Defined in packages/document/src/editor/ribbon/types.ts:80

RibbonOptionsinterface#

interface RibbonOptions
PropertyTypeDescription
ribbonoptionalboolean | RibbonConfig—
miniToolbaroptionalboolean—
viewModeoptionalDocumentViewMode—
themeoptional'auto' | 'light' | 'dark'—
darkPageoptional'white' | 'dark'—
verticalRuleroptionalboolean—
commandSearchoptionalbooleanThe Search commands box of the tab row and its Alt+Q shortcut. On by default.

Defined in packages/document/src/editor/ribbon/types.ts:69

RunFormatChangeinterface#

interface RunFormatChange
PropertyTypeDescription
idstring—
authorstring—
datestring—
before{ marks: DocMarkJSON[]; rPr?: string | null }—

Defined in packages/document/src/types.ts:336

SearchBlockinterface#

interface SearchBlock
PropertyTypeDescription
textstring—
startnumber—

Defined in packages/document/src/model/search.ts:3

SearchMatchinterface#

interface SearchMatch
PropertyTypeDescription
fromnumber—
tonumber—
groupsstring[]—

Defined in packages/document/src/model/search.ts:8

SectionColumnsinterface#

interface SectionColumns
PropertyTypeDescription
countnumber—
gapnumber—
separatoroptionalboolean—
widthsoptional{ width: number; gap: number }[]—

Defined in packages/document/src/types.ts:73

SectionFormatChangeinterface#

interface SectionFormatChange
PropertyTypeDescription
idstring—
authorstring—
datestring—
before{ page: PageSetup; sectPr?: string | null }—

Defined in packages/document/src/types.ts:322

SectionHeadersinterface#

interface SectionHeaders
PropertyTypeDescription
headeroptionalDocNodeJSON | null—
firstHeaderoptionalDocNodeJSON | null—
firstFooteroptionalDocNodeJSON | null—
evenHeaderoptionalDocNodeJSON | null—
evenFooteroptionalDocNodeJSON | null—

Defined in packages/document/src/types.ts:102

SideBySideOptionsinterface#

interface SideBySideOptions extends CompareOptions
PropertyTypeDescription
originaloptionalDocumentInput—
originalLabeloptionalstring—
revisedLabeloptionalstring—
authoroptionalstring | undefinedInherited from CompareOptions.
dateoptionalstring | undefinedInherited from CompareOptions.
granularityoptional"word" | "character" | undefinedInherited from CompareOptions.
movesoptionalboolean | undefinedInherited from CompareOptions.
formattingoptionalboolean | undefinedInherited from CompareOptions.

Defined in packages/document/src/editor/review/types.ts:43

SnapshotInfointerface#

interface SnapshotInfo
PropertyTypeDescription
idstring—
labelstring—
authorstring—
datestring—

Defined in packages/document/src/editor/review/types.ts:81

SnapshotStorageinterface#

interface SnapshotStorage
PropertyTypeDescription
load()() => Promise<DocumentSnapshot[]> | DocumentSnapshot[]—
save()(snapshots: DocumentSnapshot[]) => Promise<void> | void—

Defined in packages/document/src/editor/review/types.ts:88

SortTableValueinterface#

interface SortTableValue
PropertyTypeDescription
columnnumber—
typeoptional'text' | 'number' | 'date'—
descendingoptionalboolean—
hasHeaderoptionalboolean—

Defined in packages/document/src/editor/objects/types.ts:116

SourcePersoninterface#

interface SourcePerson
PropertyTypeDescription
laststring—
firstoptionalstring—
middleoptionalstring—

Defined in packages/document/src/types.ts:475

SpellingApiinterface#

interface SpellingApi
MemberTypeDescription
getSpellingIssues()() => SpellingMatch[]—
checkSpelling()() => Promise<void>—
ignoreSpelling()(word: string) => void—
replaceSpelling()(from: number, text: string) => boolean—

Defined in packages/document/src/types.ts:932

SpellingIssueinterface#

interface SpellingIssue
PropertyTypeDescription
fromnumber—
tonumber—
messageoptionalstring—
suggestionsoptionalreadonly string[]—

Defined in packages/document/src/types.ts:912

SpellingMatchinterface#

interface SpellingMatch
PropertyTypeDescription
fromnumber—
tonumber—
textstring—
messageoptionalstring—
suggestionsstring[]—

Defined in packages/document/src/types.ts:924

StyleFormatinterface#

interface StyleFormat
PropertyTypeDescription
fontFamilyoptionalstring—
fontSizeoptionalnumber—
boldoptionalboolean—
italicoptionalboolean—
underlineoptionalboolean—
coloroptionalstring—
alignoptional'left' | 'center' | 'right' | 'justify'—
lineHeightoptionalnumber—
spaceBeforeoptionalnumber—
spaceAfteroptionalnumber—
indentLeftoptionalnumber—
indentFirstLineoptionalnumber—

Defined in packages/document/src/editor/editing/types.ts:127

TableFormatChangeinterface#

interface TableFormatChange
PropertyTypeDescription
idstring—
authorstring—
datestring—
before{ attrs: Record<string, unknown>; tblPr?: string | null }—

Defined in packages/document/src/types.ts:315

TableLookinterface#

interface TableLook
PropertyTypeDescription
firstRowoptionalboolean—
lastRowoptionalboolean—
firstColumnoptionalboolean—
lastColumnoptionalboolean—
bandedRowsoptionalboolean—
bandedColumnsoptionalboolean—

Defined in packages/document/src/editor/objects/types.ts:128

TableOfContentsOptionsinterface#

interface TableOfContentsOptions
PropertyTypeDescription
maxLeveloptionalnumber—
showPagesoptionalboolean—
leaderoptional'dot' | 'hyphen' | 'underscore' | 'none'—

Defined in packages/document/src/editor/objects/types.ts:199

TablePropertiesValueinterface#

interface TablePropertiesValue
PropertyTypeDescription
alignoptional'left' | 'center' | 'right' | null—
indentoptionalnumber | null—
widthoptionalnumber | string | null—
cellMarginsoptional{ top: number; right: number; bottom: number; left: number } | null—
repeatHeaderoptionalboolean—
cantSplitoptionalboolean—
captionoptionalstring—
descriptionoptionalstring—

Defined in packages/document/src/editor/objects/types.ts:137

TabStopinterface#

interface TabStop
PropertyTypeDescription
positionnumber—
align'left' | 'center' | 'right' | 'decimal' | 'bar' | 'clear'—
leaderoptional'none' | 'dot' | 'hyphen' | 'underscore' | 'middleDot' | 'heavy'—

Defined in packages/document/src/types.ts:343

TemplateInfointerface#

interface TemplateInfo
PropertyTypeDescription
idstring—
namestring—
descriptionstring—
isBuiltinboolean—

Defined in packages/document/src/editor/file/types.ts:44

TextToTableValueinterface#

interface TextToTableValue
PropertyTypeDescription
separatoroptional'tab' | 'comma' | 'paragraph' | string—
columnsoptionalnumber—

Defined in packages/document/src/editor/objects/types.ts:123

TrackedChangeinterface#

interface TrackedChange
PropertyTypeDescription
idstring—
kindTrackedChangeKind—
authorstring—
datestring—
textstring—
fromnumber—
tonumber—

Defined in packages/document/src/types.ts:595

UnzipOptionsinterface#

interface UnzipOptions
PropertyTypeDescription
limitsoptionalPartial<ZipLimits>—

Defined in packages/document/src/docx/errors.ts:10

Watermarkinterface#

interface Watermark
PropertyTypeDescription
textstringThe text of a text watermark; empty for a picture watermark.
imageoptionalstringA picture watermark: a data:image/… URL. It takes the place of the text.
scaleoptionalnumberSize of the picture as a multiple of its own size; without it the picture fits the text area.
washoutoptionalbooleanfalse draws the picture at full strength instead of washed out.
rotationoptionalnumber—
opacityoptionalnumber—
coloroptionalstring—
fontFamilyoptionalstring—
fontSizeoptionalnumber—

Defined in packages/document/src/editor/editing/types.ts:229

WordCountinterface#

interface WordCount
PropertyTypeDescription
wordsnumber—
charactersnumber—
charactersNoSpacesnumber—
paragraphsnumber—

Defined in packages/document/src/types.ts:605

ZipLimitsinterface#

interface ZipLimits
PropertyTypeDescription
maxEntriesnumber—
maxEntryBytesnumber—
maxTotalBytesnumber—
maxRationumber—

Defined in packages/document/src/docx/errors.ts:1

AccessibilityCommandtype#

type AccessibilityCommand = 'accessibilityPane';

Defined in packages/document/src/editor/accessibility/index.ts:19

AccessibilityRuletype#

type AccessibilityRule = 'missingAltText' | 'skippedHeading' | 'tableHeader' | 'lowContrast';

Defined in packages/document/src/model/accessibility.ts:4

BorderEdgetype#

type BorderEdge = 'all' | 'outer' | 'inner' | 'none' | 'top' | 'bottom' | 'left' | 'right';

Defined in packages/document/src/editor/objects/types.ts:105

BorderLineStyletype#

type BorderLineStyle = 'none' | 'single' | 'double' | 'dashed' | 'dotted';

Defined in packages/document/src/editor/editing/types.ts:65

BorderSettype#

type BorderSet = Partial<Record<'top' | 'right' | 'bottom' | 'left' | 'between' | 'bar', BorderLine>>;

Defined in packages/document/src/types.ts:365

BreakKindtype#

type BreakKind = 'page' | 'column' | 'sectionNextPage' | 'sectionContinuous';

Defined in packages/document/src/editor/editing/types.ts:227

BulletListStyletype#

type BulletListStyle = 'disc' | 'circle' | 'square';

Defined in packages/document/src/types.ts:561

CaseModetype#

type CaseMode = 'sentence' | 'lower' | 'upper' | 'capitalize' | 'toggle';

Defined in packages/document/src/editor/editing/types.ts:61

ChartTypetype#

type ChartType = 'column' | 'bar' | 'line' | 'area' | 'pie' | 'doughnut' | 'scatter';

Defined in packages/document/src/types.ts:452

CitationsCommandtype#

type CitationsCommand = 'insertCitation' | 'insertBibliography' | 'citationStyle' | 'manageSources';

Defined in packages/document/src/editor/citations/types.ts:25

CitationStyletype#

type CitationStyle = 'apa' | 'mla' | 'chicago';

Defined in packages/document/src/types.ts:473

CollabBackendEventtype#

type CollabBackendEvent =
  | { type: 'connection'; status: CollabConnectionStatus }
  | { type: 'steps'; payload: CollabRemotePayload }
  | { type: 'reset'; snapshot: CollabSnapshot }
  | { type: 'presence'; states: Record<string, PresenceState> }
  | { type: 'locks'; state: CollabLockState }
  | { type: 'snapshotRequest' };

Defined in packages/document/src/editor/collab/types.ts:189

CollabClientIdtype#

type CollabClientId = string | number;

Defined in packages/document/src/editor/collab/types.ts:14

CollabCommandtype#

type CollabCommand = never;

Defined in packages/document/src/editor/collab/types.ts:12

CollabCommentOperationtype#

type CollabCommentOperation =
  | { type: 'add'; thread: CommentThread }
  | { type: 'reply'; id: string; reply: CommentReply }
  | { type: 'edit'; id: string; text: string }
  | { type: 'resolve'; id: string; resolved: boolean }
  | { type: 'delete'; id: string }
  | { type: 'editReply'; id: string; replyId: string; text: string }
  | { type: 'deleteReply'; id: string; replyId: string };

Defined in packages/document/src/editor/collab/types.ts:16

CollabConnectionStatustype#

type CollabConnectionStatus = 'connected' | 'reconnecting' | 'offline';

Defined in packages/document/src/editor/collab/types.ts:30

CollabDocumentPreparedtype#

type CollabDocumentPrepared =
  { ok: true; footprint: CollabStepFootprint[]; commit(): void } | { ok: false; reason: string };

The authority's own copy of the document. Steps are applied to it, and a step that does not apply is refused.

Defined in packages/document/src/editor/collab/types.ts:232

CollabDocumentResulttype#

type CollabDocumentResult = { ok: true; footprint: CollabStepFootprint[] } | { ok: false; reason: string };

Defined in packages/document/src/editor/collab/types.ts:229

CollabMetaOperationtype#

type CollabMetaOperation =
  | { type: 'pageSetup'; page: PageSetup }
  | { type: 'headerFooter'; parts: HeaderFooterContent }
  | { type: 'comment'; operation: CollabCommentOperation };

Defined in packages/document/src/editor/collab/types.ts:25

CollabRejectReasontype#

type CollabRejectReason = 'stale' | 'locked' | 'offline' | 'invalid';

Defined in packages/document/src/editor/collab/types.ts:56

CollabSendResulttype#

type CollabSendResult = void | boolean | CollabSubmitResult;

Defined in packages/document/src/editor/collab/types.ts:187

CollabStatetype#

type CollabState = 'disabled' | 'synced' | 'pending' | 'offline' | 'desynced';

Defined in packages/document/src/editor/collab/types.ts:352

CollabStoredVersiontype#

type CollabStoredVersion = CollabVersionSnapshot | CollabVersionDelta;

Defined in packages/document/src/editor/collab/types.ts:139

CollabWireMessagetype#

type CollabWireMessage = { type: string } & Record<string, unknown>;

Defined in packages/document/src/editor/collab/types.ts:298

ContentControlKindtype#

type ContentControlKind =
  | 'richText'
  | 'plainText'
  | 'dropdown'
  | 'comboBox'
  | 'date'
  | 'checkbox'
  | 'picture'
  | 'repeatingSection'
  | 'repeatingSectionItem'
  | 'group'
  | 'buildingBlock'
  | 'citation'
  | 'bibliography'
  | 'unknown';

Defined in packages/document/src/types.ts:266

CrossReferenceDisplaytype#

type CrossReferenceDisplay = 'text' | 'page' | 'aboveBelow' | 'number';

Defined in packages/document/src/editor/objects/types.ts:183

CrossReferenceTargettype#

type CrossReferenceTarget = 'heading' | 'bookmark' | 'figure' | 'table' | 'equation' | 'footnote';

Defined in packages/document/src/editor/objects/types.ts:182

DocFormatCodetype#

type DocFormatCode =
  'not-a-doc' | 'encrypted' | 'unsupported-version' | 'too-large' | 'too-many-characters' | 'corrupt';

Defined in packages/document/src/doc/errors.ts:1

DocumentCommandtype#

type DocumentCommand =
  | CoreDocumentCommand
  | EditingCommand
  | ObjectsCommand
  | ReviewCommand
  | CollabCommand
  | RibbonCommand
  | LayoutCommand
  | FileCommand
  | CitationsCommand
  | AccessibilityCommand
  | DrawCommand
  | ReadAloudCommand
  | 'spellingSuggestions';

Defined in packages/document/src/types.ts:656

DocumentFormatCodetype#

type DocumentFormatCode =
  'encrypted-or-legacy-doc' | 'encrypted-entry' | 'not-a-zip' | 'not-a-word-document' | 'xml-too-deep';

Defined in packages/document/src/docx/errors.ts:39

DocumentInputtype#

type DocumentInput = Partial<DocumentData> | DocNodeJSON;

Defined in packages/document/src/types.ts:544

DocumentLayouttype#

type DocumentLayout = 'page' | 'web';

Defined in packages/document/src/types.ts:654

DocumentStyleTypetype#

type DocumentStyleType = 'paragraph' | 'character' | 'table' | 'numbering';

Defined in packages/document/src/types.ts:211

DocumentViewModetype#

type DocumentViewMode = 'edit' | 'read' | 'focus';

Defined in packages/document/src/editor/ribbon/types.ts:31

DrawCommandtype#

type DrawCommand = 'drawTool' | 'inkColor' | 'inkWidth' | 'insertInk' | 'eraseInk';

Defined in packages/document/src/editor/draw/index.ts:41

DrawTooltype#

type DrawTool = InkTool | 'eraser';

Defined in packages/document/src/editor/draw/index.ts:22

EditingCommandtype#

type EditingCommand =
  | 'fontDialog'
  | 'fontFormat'
  | 'paragraphDialog'
  | 'paragraphFormat'
  | 'bordersDialog'
  | 'paragraphBorders'
  | 'paragraphShading'
  | 'listLibrary'
  | 'applyListFormat'
  | 'defineMultilevelList'
  | 'applyMultilevelList'
  | 'applyStyle'
  | 'stylesPane'
  | 'revealFormatting'
  | 'clearParagraphFormatting'
  | 'clearCharacterFormatting'
  | 'clearCharacterStyle'
  | 'formatPainterLock'
  | 'findPane'
  | 'replacePane'
  | 'navigationPane'
  | 'moveSectionUp'
  | 'moveSectionDown'
  | 'promoteHeading'
  | 'demoteHeading'
  | 'changeCase'
  | 'cycleCase'
  | 'dropCap'
  | 'symbolDialog'
  | 'dateTimeDialog'
  | 'insertDateTime'
  | 'wordCountDialog'
  | 'pasteText'
  | 'pasteMode'
  | 'pasteSpecialDialog'
  | 'autocorrectDialog'
  | 'defaultTabStop'
  | 'documentPropertiesDialog'
  | 'documentProperties'
  | 'hyperlinkDialog'
  | 'hyperlink'
  | 'insertBreak'
  | 'pageSetupDialog'
  | 'columns'
  | 'columnsDialog'
  | 'noteOptionsDialog'
  | 'lineNumbers'
  | 'watermark'
  | 'watermarkDialog'
  | 'multilevelDialog'
  | 'numberFormatDialog'
  | 'formattingMarks'
  | 'insertSpecialCharacter';

Defined in packages/document/src/editor/editing/types.ts:6

FieldKindtype#

type FieldKind =
  | 'merge'
  | 'page'
  | 'pages'
  | 'date'
  | 'time'
  | 'ref'
  | 'pageref'
  | 'noteref'
  | 'seq'
  | 'if'
  | 'toc'
  | 'styleref'
  | 'property'
  | 'form'
  | 'citation'
  | 'bibliography'
  | 'other';

Defined in packages/document/src/model/fields.ts:6

FileCommandtype#

type FileCommand =
  | 'fileMenu'
  | 'newDocument'
  | 'newFromTemplate'
  | 'openFile'
  | 'saveFile'
  | 'downloadFile'
  | 'printDocument';

Defined in packages/document/src/editor/file/types.ts:25

FileErrorCodetype#

type FileErrorCode = 'unsupported-format' | 'too-large' | 'unreadable' | 'password-required' | 'wrong-password';

Defined in packages/document/src/editor/file/types.ts:84

FileExportFormattype#

type FileExportFormat = 'docx' | 'pdf' | 'odt' | 'html' | 'markdown' | 'text';

Defined in packages/document/src/editor/file/types.ts:5

FileImportFormattype#

type FileImportFormat = 'docx' | 'doc' | 'odt' | 'rtf' | 'html' | 'markdown' | 'text';

Defined in packages/document/src/editor/file/types.ts:3

FileItemIdtype#

type FileItemId =
  | 'new'
  | 'templates'
  | 'open'
  | 'save'
  | 'downloadDocx'
  | 'downloadPdf'
  | 'downloadOdt'
  | 'downloadHtml'
  | 'downloadMarkdown'
  | 'downloadText'
  | 'print'
  | 'pageSetup'
  | 'properties'
  | 'versionHistory'
  | 'password'
  | 'shortcuts';

Defined in packages/document/src/editor/file/types.ts:7

FileKindtype#

type FileKind =
  'word' | 'excel' | 'powerpoint' | 'pdf' | 'email' | 'image' | 'text' | 'archive' | 'media' | 'file';

Defined in packages/document/src/docx/file-type.ts:5

FileRequestResulttype#

type FileRequestResult = boolean | void | Promise<boolean | void>;

Defined in packages/document/src/editor/file/types.ts:57

FileTypeLabeltype#

type FileTypeLabel =
  | 'word'
  | 'excel'
  | 'powerpoint'
  | 'document'
  | 'spreadsheet'
  | 'presentation'
  | 'pdf'
  | 'outlook'
  | 'email'
  | 'image'
  | 'text'
  | 'csv'
  | 'archive'
  | 'audio'
  | 'video'
  | 'file';

Defined in packages/document/src/docx/file-type.ts:8

FileTypeSourcetype#

type FileTypeSource = 'progId' | 'fileName' | 'contentType' | 'content' | 'none';

Defined in packages/document/src/docx/file-type.ts:26

FormControlKindtype#

type FormControlKind =
  'plainText' | 'richText' | 'dropdown' | 'comboBox' | 'date' | 'checkbox' | 'picture' | 'repeatingSection';

Defined in packages/document/src/editor/objects/types.ts:206

ImageRecolortype#

type ImageRecolor = 'grayscale' | 'sepia' | 'washout' | 'blackWhite';

Defined in packages/document/src/types.ts:411

ImageShapePresettype#

type ImageShapePreset = 'rounded' | 'oval' | 'softEdge';

Defined in packages/document/src/types.ts:412

ImageSourceKindtype#

type ImageSourceKind = 'embedded' | 'remote' | 'none';

Defined in packages/document/src/model/url.ts:7

ImageWraptype#

type ImageWrap = 'inline' | 'square' | 'tight' | 'through' | 'topBottom' | 'behind' | 'inFront';

Defined in packages/document/src/types.ts:367

InkTooltype#

type InkTool = 'pen' | 'highlighter';

Defined in packages/document/src/types.ts:441

LayoutBlockKindtype#

type LayoutBlockKind = 'atomic' | 'lines' | 'rows' | 'pageBreak' | 'columnBreak' | 'sectionBreak';

Defined in packages/document/src/layout/paginate-cursor.ts:3

LayoutCommandtype#

type LayoutCommand = never;

Defined in packages/document/src/layout/types.ts:4

LayoutCompatibilitytype#

type LayoutCompatibility = 'word' | 'legacy';

Defined in packages/document/src/layout/types.ts:21

LineRuletype#

type LineRule = 'auto' | 'exact' | 'atLeast';

Defined in packages/document/src/editor/editing/types.ts:63

MarkupModetype#

type MarkupMode = 'all' | 'simple' | 'none' | 'original';

Defined in packages/document/src/editor/review/types.ts:4

MergeValuestype#

type MergeValues = Record<string, unknown>;

Defined in packages/document/src/types.ts:641

NoteKindtype#

type NoteKind = 'footnote' | 'endnote';

Defined in packages/document/src/editor/objects/types.ts:162

NoteNumberFormattype#

type NoteNumberFormat = 'decimal' | 'lowerRoman' | 'upperRoman' | 'lowerLetter' | 'upperLetter' | 'chicago';

Defined in packages/document/src/editor/objects/types.ts:163

ObjectDialogNametype#

type ObjectDialogName =
  | 'insertTable'
  | 'tableProperties'
  | 'splitCells'
  | 'sortTable'
  | 'formula'
  | 'textToTable'
  | 'tableToText'
  | 'borders'
  | 'imageSize'
  | 'imageLayout'
  | 'imageAltText'
  | 'imageCompress'
  | 'shapeFormat'
  | 'equation'
  | 'bookmark'
  | 'crossReference'
  | 'caption'
  | 'tableOfContents'
  | 'tableOfFigures'
  | 'footnote'
  | 'noteOptions'
  | 'contentControl';

Defined in packages/document/src/editor/objects/types.ts:81

ObjectsCommandtype#

type ObjectsCommand =
  | 'objectDialog'
  | 'updateFields'
  | 'cellBorders'
  | 'cellShading'
  | 'cellVerticalAlign'
  | 'cellTextDirection'
  | 'cellMargins'
  | 'distributeRows'
  | 'distributeColumns'
  | 'autofitTable'
  | 'rowHeight'
  | 'columnWidth'
  | 'sortTable'
  | 'insertFormula'
  | 'textToTable'
  | 'tableToText'
  | 'tableStyle'
  | 'tableStyleOptions'
  | 'tableProperties'
  | 'splitCells'
  | 'selectRow'
  | 'selectColumn'
  | 'selectTable'
  | 'deleteCells'
  | 'drawBorders'
  | 'tableTool'
  | 'paintCellEdges'
  | 'imageWrap'
  | 'imagePosition'
  | 'imageRotate'
  | 'imageFlip'
  | 'imageCrop'
  | 'imageCropMode'
  | 'imageReset'
  | 'imageReplace'
  | 'imageCompress'
  | 'imageDecorative'
  | 'imageBorder'
  | 'imageEffects'
  | 'insertChart'
  | 'editChart'
  | 'imageNudge'
  | 'insertShape'
  | 'insertTextBox'
  | 'shapeStyle'
  | 'insertEquation'
  | 'insertEmbeddedObject'
  | 'openEmbeddedObject'
  | 'downloadEmbeddedObject'
  | 'insertBookmark'
  | 'deleteBookmark'
  | 'goToBookmark'
  | 'showBookmarks'
  | 'insertCrossReference'
  | 'insertCaption'
  | 'insertTableOfFigures'
  | 'tableOfContentsOptions'
  | 'insertFootnote'
  | 'insertEndnote'
  | 'nextFootnote'
  | 'previousFootnote'
  | 'convertNotes'
  | 'deleteNote'
  | 'noteFormat'
  | 'noteSettings'
  | 'insertContentControl'
  | 'contentControlProperties'
  | 'removeContentControl'
  | 'formMode'
  | 'insertDateField'
  | 'insertCells'
  | 'shapeEditText'
  | 'restrictEditing'
  | 'toggleFieldCodes'
  | 'mergePreview';

Defined in packages/document/src/editor/objects/types.ts:4

ObjectWraptype#

type ObjectWrap = 'inline' | 'square' | 'tight' | 'topBottom' | 'behind' | 'inFront';

Defined in packages/document/src/editor/objects/types.ts:150

OrderedListStyletype#

type OrderedListStyle = 'decimal' | 'lowerAlpha' | 'upperAlpha' | 'lowerRoman' | 'upperRoman';

Defined in packages/document/src/types.ts:560

PageNumberFormattype#

type PageNumberFormat =
  'decimal' | 'upperRoman' | 'lowerRoman' | 'upperLetter' | 'lowerLetter' | 'numberInDash' | (string & {});

Defined in packages/document/src/types.ts:80

PageOrientationtype#

type PageOrientation = 'portrait' | 'landscape';

Defined in packages/document/src/types.ts:43

PageSizeNametype#

type PageSizeName = 'A3' | 'A4' | 'A5' | 'Letter' | 'Legal' | 'Executive';

Defined in packages/document/src/types.ts:42

ParagraphStyleIdtype#

type ParagraphStyleId =
  | 'Normal'
  | 'Title'
  | 'Subtitle'
  | 'Heading1'
  | 'Heading2'
  | 'Heading3'
  | 'Heading4'
  | 'Heading5'
  | 'Heading6'
  | 'Quote'
  | 'Code';

Defined in packages/document/src/types.ts:546

PasteModetype#

type PasteMode = 'keepSource' | 'mergeFormatting' | 'textOnly' | 'picture';

Defined in packages/document/src/editor/editing/types.ts:192

PdfArtifactTypetype#

type PdfArtifactType = 'header' | 'footer' | 'watermark' | 'pagination' | 'layout';

Defined in packages/document/src/layout/pdf/layout-tree.ts:7

PdfFontLoadertype#

type PdfFontLoader = (
  family: string,
  style: { bold: boolean; italic: boolean },
) => Promise<ArrayBuffer | Uint8Array | null>;

Defined in packages/document/src/layout/pdf/font-loading.ts:5

PdfItemtype#

type PdfItem = PdfTextRun | PdfRect | PdfLine | PdfPath | PdfImage | PdfLinkArea | PdfDestination | PdfGroup;

Defined in packages/document/src/layout/pdf/layout-tree.ts:160

PdfMatrixtype#

type PdfMatrix = readonly [number, number, number, number, number, number];

Defined in packages/document/src/layout/pdf/layout-tree.ts:150

PdfPathCommandtype#

type PdfPathCommand =
  | readonly ['M', number, number]
  | readonly ['L', number, number]
  | readonly ['C', number, number, number, number, number, number]
  | readonly ['Z'];

Defined in packages/document/src/layout/pdf/layout-tree.ts:104

PdfStructTypetype#

type PdfStructType =
  | 'P'
  | 'H1'
  | 'H2'
  | 'H3'
  | 'H4'
  | 'H5'
  | 'H6'
  | 'L'
  | 'LI'
  | 'Lbl'
  | 'LBody'
  | 'Table'
  | 'TR'
  | 'TH'
  | 'TD'
  | 'Figure'
  | 'Link'
  | 'Note'
  | 'Span'
  | 'TOC'
  | 'TOCI'
  | 'Sect'
  | 'BlockQuote'
  | 'Code';

Defined in packages/document/src/layout/pdf/layout-tree.ts:9

PdfUnderlineStyletype#

type PdfUnderlineStyle = 'single' | 'double' | 'thick' | 'dotted' | 'dash' | 'dotDash' | 'wave';

Defined in packages/document/src/layout/pdf/layout-tree.ts:53

ProtectionModetype#

type ProtectionMode = 'readOnly' | 'comments' | 'trackedChanges' | 'forms';

Defined in packages/document/src/types.ts:174

ReadAloudCommandtype#

type ReadAloudCommand = 'readAloud';

Defined in packages/document/src/editor/read-aloud.ts:41

ReviewCommandtype#

type ReviewCommand =
  | 'markupMode'
  | 'acceptChange'
  | 'rejectChange'
  | 'acceptAndNext'
  | 'rejectAndNext'
  | 'acceptShownChanges'
  | 'rejectShownChanges'
  | 'nextChange'
  | 'previousChange'
  | 'revisionsPane'
  | 'compareDialog'
  | 'compareSideBySide'
  | 'closeSideBySide'
  | 'combineDialog'
  | 'saveSnapshot'
  | 'versionHistoryPane';

Defined in packages/document/src/editor/review/types.ts:93

RevisionChangeKindtype#

type RevisionChangeKind =
  | 'insert'
  | 'delete'
  | 'replace'
  | 'format'
  | 'paragraph'
  | 'move'
  | 'tableRow'
  | 'tableCell'
  | 'tableFormat'
  | 'sectionFormat'
  | 'numbering';

Defined in packages/document/src/editor/review/types.ts:6

RibbonCommandtype#

type RibbonCommand =
  | 'cut'
  | 'copy'
  | 'paste'
  | 'toggleRibbon'
  | 'readMode'
  | 'focusMode'
  | 'fitWidth'
  | 'fitPage'
  | 'setTabStops'
  | 'clearTabStops'
  | 'tabsDialog'
  | 'toggleGridlines'
  | 'commandSearch'
  | 'keyboardShortcuts';

Defined in packages/document/src/editor/ribbon/types.ts:3

RibbonTabNametype#

type RibbonTabName = 'home' | 'insert' | 'draw' | 'layout' | 'references' | 'review' | 'view' | (string & {});

Defined in packages/document/src/editor/ribbon/types.ts:19

SectionBreakTypetype#

type SectionBreakType = 'nextPage' | 'continuous' | 'evenPage' | 'oddPage' | 'nextColumn';

Defined in packages/document/src/types.ts:71

ShapeKindtype#

type ShapeKind = 'rect' | 'roundRect' | 'ellipse' | 'line' | 'arrow' | 'callout';

Defined in packages/document/src/editor/objects/types.ts:148

SourceTypetype#

type SourceType =
  | 'Book'
  | 'BookSection'
  | 'JournalArticle'
  | 'ArticleInAPeriodical'
  | 'ConferenceProceedings'
  | 'Report'
  | 'InternetSite'
  | 'DocumentFromInternetSite'
  | 'Misc'
  | (string & {});

Defined in packages/document/src/types.ts:481

SpellCheckertype#

type SpellChecker = (
  text: string,
  language: string,
) => Promise<readonly SpellingIssue[]> | readonly SpellingIssue[];

Defined in packages/document/src/types.ts:919

TableDirectiontype#

type TableDirection = 'ABOVE' | 'BELOW' | 'LEFT' | 'RIGHT';

Defined in packages/document/src/editor/objects/types.ts:114

TabStopAlignmenttype#

type TabStopAlignment = 'left' | 'center' | 'right' | 'decimal' | 'bar';

Defined in packages/document/src/editor/ribbon/types.ts:21

TabStopLeadertype#

type TabStopLeader = 'none' | 'dot' | 'hyphen' | 'underscore';

Defined in packages/document/src/editor/ribbon/types.ts:23

TextAlignmenttype#

type TextAlignment = 'left' | 'center' | 'right' | 'justify';

Defined in packages/document/src/types.ts:559

ToolbarItemIdtype#

type ToolbarItemId =
  | 'undo'
  | 'redo'
  | 'formatPainter'
  | 'paragraphStyle'
  | 'fontFamily'
  | 'fontSize'
  | 'bold'
  | 'italic'
  | 'underline'
  | 'strike'
  | 'superscript'
  | 'subscript'
  | 'textColor'
  | 'highlight'
  | 'clearFormatting'
  | 'alignLeft'
  | 'alignCenter'
  | 'alignRight'
  | 'alignJustify'
  | 'lineSpacing'
  | 'bulletList'
  | 'orderedList'
  | 'outdent'
  | 'indent'
  | 'link'
  | 'image'
  | 'table'
  | 'pageBreak'
  | 'horizontalRule'
  | 'symbol'
  | 'field'
  | 'tableOfContents'
  | 'comment'
  | 'trackChanges'
  | 'showMarkup'
  | 'find'
  | 'pageSetup'
  | 'layout'
  | 'outline'
  | 'zoom'
  | 'print'
  | 'separator';

Defined in packages/document/src/types.ts:755

TrackedChangeKindtype#

type TrackedChangeKind = 'insertion' | 'deletion';

Defined in packages/document/src/types.ts:563

UnderlineStyletype#

type UnderlineStyle = (typeof UNDERLINE_STYLES)[number];

Defined in packages/document/src/model/text-effects.ts:3

ZipLimitCodetype#

type ZipLimitCode = 'too-many-entries' | 'entry-too-large' | 'archive-too-large' | 'ratio-too-high';

Defined in packages/document/src/docx/errors.ts:8

@birchui/document/collab#

createAuthorityBackendfunction#

function createAuthorityBackend(authority: CollabAuthority, start: CollabBackendStart = {}): CollabBackend
ParameterTypeDescription
authorityCollabAuthority—
startoptionalCollabBackendStart—

Defined in packages/document/src/editor/collab/backend.ts:146

createBroadcastChannelBackendfunction#

function createBroadcastChannelBackend(options: CollabBroadcastBackendOptions): CollabBackend
ParameterTypeDescription
optionsCollabBroadcastBackendOptions—

Defined in packages/document/src/editor/collab/broadcast-backend.ts:98

createCollabAuthorityfunction#

function createCollabAuthority(options: CollabAuthorityOptions = {}): CollabAuthority
ParameterTypeDescription
optionsoptionalCollabAuthorityOptions—

Defined in packages/document/src/editor/collab/authority.ts:409

createCollabDocumentfunction#

function createCollabDocument(document?: DocumentInput | null, limits?: Partial<CollabDocumentLimits>): CollabDocument
ParameterTypeDescription
documentoptionalDocumentInput | null—
limitsoptionalPartial<CollabDocumentLimits>—

Defined in packages/document/src/editor/collab/document-state.ts:291

createCollabIdfunction#

function createCollabId(prefix = '', random?: () => number): string
ParameterTypeDescription
prefixoptionalunknown—
randomoptional() => number—

Defined in packages/document/src/editor/collab/ids.ts:19

createCollabProviderfunction#

function createCollabProvider(backend: CollabBackend, options: CollabBackendProviderOptions = {}): CollabBackendProvider
ParameterTypeDescription
backendCollabBackend—
optionsoptionalCollabBackendProviderOptions—

Defined in packages/document/src/editor/collab/backend.ts:37

createIndexedDbOfflineStorefunction#

function createIndexedDbOfflineStore(options: { key: string; database?: string }): CollabOfflineStore

Keeps unsent edits in IndexedDB under key, which should name the document and the signed-in person, so a tab that closes while offline finds them again.

ParameterTypeDescription
options{ key: string; database?: string }—

Defined in packages/document/src/editor/collab/offline-store.ts:30

createLoopbackHubfunction#

function createLoopbackHub(options: LoopbackHubOptions = {}): LoopbackHub
ParameterTypeDescription
optionsoptionalLoopbackHubOptions—

Defined in packages/document/src/editor/collab/loopback.ts:283

createMemoryOfflineStorefunction#

function createMemoryOfflineStore(): CollabOfflineStore

Defined in packages/document/src/editor/collab/offline-store.ts:6

createSocketBackendfunction#

function createSocketBackend(options: CollabSocketBackendOptions): CollabBackend
ParameterTypeDescription
optionsCollabSocketBackendOptions—

Defined in packages/document/src/editor/collab/socket-backend.ts:131

createWireBackendfunction#

function createWireBackend(link: CollabWireLink, options: CollabWireBackendOptions = {}): CollabBackend
ParameterTypeDescription
linkCollabWireLink—
optionsoptionalCollabWireBackendOptions—

Defined in packages/document/src/editor/collab/wire.ts:37

createWireEndpointfunction#

function createWireEndpoint(authority: CollabAuthority, send: (message: CollabWireMessage) => void): CollabWireEndpoint
ParameterTypeDescription
authorityCollabAuthority—
send(message: CollabWireMessage) => void—

Defined in packages/document/src/editor/collab/wire.ts:167

hostBroadcastChannelfunction#

function hostBroadcastChannel(authority: CollabAuthority, channel: CollabBroadcastPort | string, options: { hostTimeout?: number } = {}): { close(): void }
ParameterTypeDescription
authorityCollabAuthority—
channelCollabBroadcastPort | string—
optionsoptional{ hostTimeout?: number }—

Defined in packages/document/src/editor/collab/broadcast-backend.ts:102

DEFAULT_COLLAB_LIMITSconst#

const DEFAULT_COLLAB_LIMITS: Readonly<CollabDocumentLimits>

Defined in packages/document/src/editor/collab/document-state.ts:20

CollabApiinterface#

interface CollabApi
MemberTypeDescription
getCollabVersion()() => number—
getCollabStatus()() => CollabStatus—
getCollabConnection()() => CollabConnectionStatus—
saveCollabVersion()(name: string) => Promise<CollabVersionInfo | null>—
listCollabVersions()() => Promise<CollabVersionInfo[]>—
restoreCollabVersion()(id: string) => Promise<boolean>—
diffCollabVersions()(fromId: string, toId: string | null, options?: CollabVersionDiffOptions) => Promise<DocNodeJSON | null>—
lockRange()(range?: { from: number; to: number }) => Promise<CollabLock | null>—
unlockRange()(id: string) => void—
getLocks()() => CollabLock[]—
sendableSteps()() => CollabStepsPayload | null—
receiveSteps()(payload: CollabRemotePayload) => boolean—
resetCollab()(snapshot: CollabSnapshot) => void—
getCollaborators()() => Collaborator[]—

Defined in packages/document/src/editor/collab/types.ts:410

CollabAuthorityinterface#

interface CollabAuthority
PropertyTypeDescription
join()(clientId: CollabClientId, emit: (event: CollabBackendEvent) => void) => CollabAuthorityPeer—
version()() => number—
metaVersion()() => number—
baseVersion()() => number—
steps()() => CollabLogEntry[]—
snapshot()() => CollabSnapshot | null—
document()() => DocumentData | nullThe authority's own document at its current version, or null when it runs with trustClients.
locks()() => CollabLockState—
clients()() => CollabClientId[]—
saveVersion()(input: CollabVersionInput, clientId: CollabClientId) => CollabVersionInfo—
listVersions()() => CollabVersionInfo[]—
loadVersion()(id: string) => CollabVersionRecord | null—
storedVersions()() => CollabStoredVersion[]The named versions as they are kept: a full document now and then, and the steps since the previous one otherwise.
destroy()() => void—

Defined in packages/document/src/editor/collab/types.ts:279

CollabAuthorityOptionsinterface#

interface CollabAuthorityOptions
PropertyTypeDescription
documentoptionalDocumentInput | nullThe document at version 0. Without it, and without snapshot, the authority starts from an empty document.
limitsoptionalPartial<CollabDocumentLimits>—
trustClientsoptionalbooleanRelay steps without applying them. Only for a process where every client is your own code, such as a unit test of a transport: a client can then store any document and move any lock.
snapshotoptionalCollabSnapshot | null—
snapshotEveryoptionalnumber—
retainStepsoptionalnumber—
versionsoptionalreadonly CollabStoredVersion[] | nullNamed versions saved earlier, as storedVersions() returned them.
nowoptional() => number—
createIdoptional() => string—

Defined in packages/document/src/editor/collab/types.ts:245

CollabAuthorityPeerinterface#

interface CollabAuthorityPeer
PropertyTypeDescription
clientIdreadonlyCollabClientId—
submit()(payload: CollabStepsPayload) => CollabSubmitResult—
pull()(sinceVersion: number, sinceMeta: number) => void—
setPresence()(state: PresenceState | null) => void—
sendSnapshot()(snapshot: CollabSnapshot) => boolean—
acquireLock()(request: CollabLockRequest) => CollabLock | null—
releaseLock()(id: string) => void—
leave()() => void—

Defined in packages/document/src/editor/collab/types.ts:268

CollabBackendinterface#

interface CollabBackend
PropertyTypeDescription
clientIdreadonlyCollabClientId—
open()(emit: (event: CollabBackendEvent) => void) => void—
version()() => number—
metaVersion()() => number—
submit()(payload: CollabStepsPayload) => Promise<CollabSubmitResult>—
pull()(sinceVersion: number, sinceMeta: number) => void—
setPresence()optional(state: PresenceState | null) => void—
sendSnapshot()optional(snapshot: CollabSnapshot) => void—
locksoptionalPick<CollabLockChannel, 'acquire' | 'release'>—
versionsoptionalCollabVersionChannel—
close()() => void—

Defined in packages/document/src/editor/collab/types.ts:197

CollabBackendProviderinterface#

interface CollabBackendProvider extends CollabProvider
PropertyTypeDescription
clientIdCollabClientId—
connection()() => CollabConnectionStatus—
close()() => void—
versionnumber | (() => number)Inherited from CollabProvider.
metaVersionoptionalnumber | (() => number) | undefinedInherited from CollabProvider.
sendSteps()(payload: CollabStepsPayload) => CollabSendResult | Promise<CollabSendResult>Inherited from CollabProvider.
onRemoteSteps()(handler: (payload: CollabRemotePayload) => void) => () => voidInherited from CollabProvider.
requestSteps()optional((sinceVersion: number, sinceMeta?: number) => void) | undefinedInherited from CollabProvider.
onStatus()optional((handler: (status: "online" | "offline") => void) => () => void) | undefinedInherited from CollabProvider.
onConnection()optional((handler: (status: CollabConnectionStatus) => void) => () => void) | undefinedInherited from CollabProvider.
onReset()optional((handler: (snapshot: CollabSnapshot) => void) => () => void) | undefinedInherited from CollabProvider.
presenceoptionalCollabPresenceChannel | undefinedInherited from CollabProvider.
presenceTimeoutoptionalnumber | undefinedInherited from CollabProvider.
commentsoptionalCollabCommentChannel | undefinedInherited from CollabProvider.
versionsoptionalCollabVersionChannel | undefinedInherited from CollabProvider.
locksoptionalCollabLockChannel | undefinedInherited from CollabProvider.
snapshotsoptionalCollabSnapshotChannel | undefinedInherited from CollabProvider.

Defined in packages/document/src/editor/collab/types.ts:215

CollabBackendProviderOptionsinterface#

interface CollabBackendProviderOptions
PropertyTypeDescription
presenceTimeoutoptionalnumber—

Defined in packages/document/src/editor/collab/types.ts:211

CollabBackendStartinterface#

interface CollabBackendStart
PropertyTypeDescription
clientIdoptionalCollabClientId—
versionoptionalnumber—
metaVersionoptionalnumber—

Defined in packages/document/src/editor/collab/types.ts:311

CollabBroadcastBackendOptionsinterface#

interface CollabBroadcastBackendOptions extends CollabWireBackendOptions
PropertyTypeDescription
channelCollabBroadcastPort | string—
hostTimeoutoptionalnumber—
roomoptionalstring | undefinedInherited from CollabWireBackendOptions.
requestTimeoutoptionalnumber | undefinedInherited from CollabWireBackendOptions.
clientIdoptionalCollabClientId | undefinedInherited from CollabBackendStart.
versionoptionalnumber | undefinedInherited from CollabBackendStart.
metaVersionoptionalnumber | undefinedInherited from CollabBackendStart.

Defined in packages/document/src/editor/collab/types.ts:347

CollabBroadcastPortinterface#

interface CollabBroadcastPort
PropertyTypeDescription
postMessage()(message: unknown) => void—
addEventListener()(type: 'message', listener: (event: { data: unknown }) => void) => void—
removeEventListener()(type: 'message', listener: (event: { data: unknown }) => void) => void—
close()optional() => void—

Defined in packages/document/src/editor/collab/types.ts:340

CollabCommentChannelinterface#

interface CollabCommentChannel
PropertyTypeDescription
send()(operation: CollabCommentOperation) => void—
subscribe()(handler: (operation: CollabCommentOperation) => void) => () => void—

Defined in packages/document/src/editor/collab/types.ts:164

CollabDocumentinterface#

interface CollabDocument
PropertyTypeDescription
apply()(steps: readonly unknown[]) => CollabDocumentResult—
prepare()(steps: readonly unknown[]) => CollabDocumentPreparedChecks the steps against the current document without changing it; commit() then makes them current.
checkMetaOperations()(operations: readonly CollabMetaOperation[]) => CollabDocumentResult—
applyMeta()(operations: readonly CollabMetaOperation[]) => CollabDocumentResult—
size()() => number—
snapshot()() => DocumentData—

Defined in packages/document/src/editor/collab/types.ts:235

CollabDocumentLimitsinterface#

interface CollabDocumentLimits
PropertyTypeDescription
maxStepsPerSubmitnumber—
maxSubmitBytesnumber—
maxDocumentSizenumber—
maxMetaPerSubmitnumber—
maxCommentLengthnumber—

Defined in packages/document/src/editor/collab/types.ts:221

CollabEventsinterface#

interface CollabEvents
PropertyTypeDescription
collabStatusCollabStatus—
collabConnection{ status: CollabConnectionStatus; previous: CollabConnectionStatus }—
collabRejected{ reason: CollabRejectReason; steps: number }—
collabRestored{ steps: number; version: number }—
presenceChange{ collaborators: Collaborator[] }—
locksChange{ locks: CollabLock[] }—

Defined in packages/document/src/editor/collab/types.ts:397

CollabLockinterface#

interface CollabLock
PropertyTypeDescription
idstring—
clientIdCollabClientId—
namestring—
fromnumber—
tonumber—

Defined in packages/document/src/editor/collab/types.ts:81

CollabLockChannelinterface#

interface CollabLockChannel
PropertyTypeDescription
acquire()(request: CollabLockRequest) => Promise<CollabLock | null>—
release()(id: string) => void—
subscribe()(handler: (state: CollabLockState) => void) => () => void—

Defined in packages/document/src/editor/collab/types.ts:102

CollabLockRequestinterface#

interface CollabLockRequest
PropertyTypeDescription
fromnumber—
tonumber—
versionnumber—
nameoptionalstring—

Defined in packages/document/src/editor/collab/types.ts:95

CollabLockStateinterface#

interface CollabLockState
PropertyTypeDescription
versionnumber—
locksCollabLock[]—
revisionoptionalnumber—

Defined in packages/document/src/editor/collab/types.ts:89

CollabLogEntryinterface#

interface CollabLogEntry
PropertyTypeDescription
stepunknown—
clientIdCollabClientId—

Defined in packages/document/src/editor/collab/types.ts:263

CollabOfflineRecordinterface#

interface CollabOfflineRecord
PropertyTypeDescription
versionnumberThe version the unsent steps start from.
documentDocNodeJSONThe document body at version, without the unsent steps.
stepsunknown[]—
clientIdCollabClientId—
savedAtnumber—

Defined in packages/document/src/editor/collab/types.ts:372

CollabOfflineStoreinterface#

interface CollabOfflineStore
PropertyTypeDescription
load()() => CollabOfflineRecord | null | Promise<CollabOfflineRecord | null>—
save()(record: CollabOfflineRecord) => void | Promise<void>—
clear()() => void | Promise<void>—

Defined in packages/document/src/editor/collab/types.ts:382

CollabOptionsinterface#

interface CollabOptions
PropertyTypeDescription
collaboptionalCollabProvider | null—
collabStorageoptionalCollabOfflineStore | nullWhere edits that have not reached the authority are kept. Without it they live in memory and are lost when the tab closes. createIndexedDbOfflineStore({ key }) keeps them across a reload.

Defined in packages/document/src/editor/collab/types.ts:388

Collaboratorinterface#

interface Collaborator
PropertyTypeDescription
clientIdCollabClientId—
namestring—
colorstring—
anchornumber | null—
headnumber | null—
focusedboolean—

Defined in packages/document/src/editor/collab/types.ts:363

CollabPresenceChannelinterface#

interface CollabPresenceChannel
PropertyTypeDescription
send()(state: PresenceState) => void—
subscribe()(handler: (states: Record<string, PresenceState>) => void) => () => void—

Defined in packages/document/src/editor/collab/types.ts:159

CollabProviderinterface#

interface CollabProvider
PropertyTypeDescription
versionnumber | (() => number)—
clientIdoptionalCollabClientId—
metaVersionoptionalnumber | (() => number)—
sendSteps()(payload: CollabStepsPayload) => CollabSendResult | Promise<CollabSendResult>—
onRemoteSteps()(handler: (payload: CollabRemotePayload) => void) => () => void—
requestSteps()optional(sinceVersion: number, sinceMeta?: number) => void—
onStatus()optional(handler: (status: 'online' | 'offline') => void) => () => void—
onConnection()optional(handler: (status: CollabConnectionStatus) => void) => () => void—
onReset()optional(handler: (snapshot: CollabSnapshot) => void) => () => void—
presenceoptionalCollabPresenceChannel—
presenceTimeoutoptionalnumber—
commentsoptionalCollabCommentChannel—
versionsoptionalCollabVersionChannel—
locksoptionalCollabLockChannel—
snapshotsoptionalCollabSnapshotChannel—

Defined in packages/document/src/editor/collab/types.ts:169

CollabRemotePayloadinterface#

interface CollabRemotePayload
PropertyTypeDescription
stepsunknown[]—
clientIdsCollabClientId[]—
versionoptionalnumber—
metaoptionalCollabMetaOperation[]—
metaClientIdoptionalCollabClientId—
metaVersionoptionalnumber—
metaClientIdsoptionalCollabClientId[]—

Defined in packages/document/src/editor/collab/types.ts:46

CollabSnapshotinterface#

interface CollabSnapshot
PropertyTypeDescription
documentDocumentInput—
versionnumber—
metaVersionoptionalnumber—

Defined in packages/document/src/editor/collab/types.ts:65

CollabSnapshotChannelinterface#

interface CollabSnapshotChannel
PropertyTypeDescription
send()(snapshot: CollabSnapshot) => void—
subscribe()(handler: () => void) => () => void—

Defined in packages/document/src/editor/collab/types.ts:154

CollabSocketBackendOptionsinterface#

interface CollabSocketBackendOptions extends CollabWireBackendOptions
PropertyTypeDescription
connect() => CollabSocketLike—
reconnectMinoptionalnumber—
reconnectMaxoptionalnumber—
maxAttemptsoptionalnumber—
heartbeatoptionalnumber—
roomoptionalstring | undefinedInherited from CollabWireBackendOptions.
requestTimeoutoptionalnumber | undefinedInherited from CollabWireBackendOptions.
clientIdoptionalCollabClientId | undefinedInherited from CollabBackendStart.
versionoptionalnumber | undefinedInherited from CollabBackendStart.
metaVersionoptionalnumber | undefinedInherited from CollabBackendStart.

Defined in packages/document/src/editor/collab/types.ts:332

CollabSocketLikeinterface#

interface CollabSocketLike
PropertyTypeDescription
readyStatenumber—
send()(data: string) => void—
close()(code?: number, reason?: string) => void—
addEventListener()(type: 'open' | 'message' | 'close' | 'error', listener: (event: { data?: unknown; type?: string }) => void) => void—

Defined in packages/document/src/editor/collab/types.ts:322

CollabStatusinterface#

interface CollabStatus
PropertyTypeDescription
stateCollabState—
versionnumber—
unconfirmednumber—
clientIdCollabClientId | null—
onlineboolean—
connectionCollabConnectionStatus—

Defined in packages/document/src/editor/collab/types.ts:354

CollabStepFootprintinterface#

interface CollabStepFootprint
PropertyTypeDescription
fromnumber—
tonumber—
mapnumber[]—

Defined in packages/document/src/editor/collab/types.ts:32

CollabStepsPayloadinterface#

interface CollabStepsPayload
PropertyTypeDescription
versionnumber—
stepsunknown[]—
clientIdCollabClientId—
metaoptionalCollabMetaOperation[]—
footprintoptionalCollabStepFootprint[]—

Defined in packages/document/src/editor/collab/types.ts:38

CollabSubmitResultinterface#

interface CollabSubmitResult
PropertyTypeDescription
acceptedboolean—
versionoptionalnumber—
reasonoptionalCollabRejectReason—
detailoptionalstring—

Defined in packages/document/src/editor/collab/types.ts:58

CollabVersionChannelinterface#

interface CollabVersionChannel
PropertyTypeDescription
save()(input: CollabVersionInput) => Promise<CollabVersionInfo>—
list()() => Promise<CollabVersionInfo[]>—
load()(id: string) => Promise<CollabVersionRecord | null>—

Defined in packages/document/src/editor/collab/types.ts:148

CollabVersionDeltainterface#

interface CollabVersionDelta extends CollabVersionInfo

A version kept as the steps and document updates made since the version named by parent.

PropertyTypeDescription
metaVersionnumber—
parentstring—
stepsunknown[]—
metaCollabVersionMetaEntry[]—
idstringInherited from CollabVersionInfo.
namestringInherited from CollabVersionInfo.
createdAtstringInherited from CollabVersionInfo.
authorstringInherited from CollabVersionInfo.
clientIdCollabClientIdInherited from CollabVersionInfo.
versionnumberInherited from CollabVersionInfo.

Defined in packages/document/src/editor/collab/types.ts:132

CollabVersionDiffOptionsinterface#

interface CollabVersionDiffOptions extends CompareOptions
PropertyTypeDescription
idPrefixoptionalstring—
authoroptionalstring | undefinedInherited from CompareOptions.
dateoptionalstring | undefinedInherited from CompareOptions.
granularityoptional"word" | "character" | undefinedInherited from CompareOptions.
movesoptionalboolean | undefinedInherited from CompareOptions.
formattingoptionalboolean | undefinedInherited from CompareOptions.

Defined in packages/document/src/editor/collab/types.ts:406

CollabVersionInfointerface#

interface CollabVersionInfo
PropertyTypeDescription
idstring—
namestring—
createdAtstring—
authorstring—
clientIdCollabClientId—
versionnumber—

Defined in packages/document/src/editor/collab/types.ts:108

CollabVersionInputinterface#

interface CollabVersionInput
PropertyTypeDescription
namestring—
authorstring—
versionnumber—
documentDocumentInput—

Defined in packages/document/src/editor/collab/types.ts:141

CollabVersionMetaEntryinterface#

interface CollabVersionMetaEntry
PropertyTypeDescription
atnumberThe step version the operation was applied at.
operationCollabMetaOperation—

Defined in packages/document/src/editor/collab/types.ts:125

CollabVersionRecordinterface#

interface CollabVersionRecord extends CollabVersionInfo
PropertyTypeDescription
documentDocumentInput—
idstringInherited from CollabVersionInfo.
namestringInherited from CollabVersionInfo.
createdAtstringInherited from CollabVersionInfo.
authorstringInherited from CollabVersionInfo.
clientIdCollabClientIdInherited from CollabVersionInfo.
versionnumberInherited from CollabVersionInfo.

Defined in packages/document/src/editor/collab/types.ts:117

CollabVersionSnapshotinterface#

interface CollabVersionSnapshot extends CollabVersionRecord
PropertyTypeDescription
metaVersionoptionalnumber—
documentDocumentInputInherited from CollabVersionRecord.
idstringInherited from CollabVersionInfo.
namestringInherited from CollabVersionInfo.
createdAtstringInherited from CollabVersionInfo.
authorstringInherited from CollabVersionInfo.
clientIdCollabClientIdInherited from CollabVersionInfo.
versionnumberInherited from CollabVersionInfo.

Defined in packages/document/src/editor/collab/types.ts:121

CollabWireBackendOptionsinterface#

interface CollabWireBackendOptions extends CollabBackendStart
PropertyTypeDescription
roomoptionalstring—
requestTimeoutoptionalnumber—
clientIdoptionalCollabClientId | undefinedInherited from CollabBackendStart.
versionoptionalnumber | undefinedInherited from CollabBackendStart.
metaVersionoptionalnumber | undefinedInherited from CollabBackendStart.

Defined in packages/document/src/editor/collab/types.ts:317

CollabWireEndpointinterface#

interface CollabWireEndpoint
PropertyTypeDescription
receive()(message: CollabWireMessage) => void—
close()() => void—

Defined in packages/document/src/editor/collab/types.ts:306

interface CollabWireLink
PropertyTypeDescription

Defined in packages/document/src/editor/collab/types.ts:300

LoopbackConnectioninterface#

interface LoopbackConnection extends CollabProvider
PropertyTypeDescription
clientIdCollabClientId—
version() => number—
metaVersion() => number—
requestSteps()(sinceVersion: number, sinceMeta?: number) => void—
presenceCollabPresenceChannel—
commentsCollabCommentChannel—
versionsCollabVersionChannel—
locksCollabLockChannel—
snapshotsCollabSnapshotChannel—
setOnline()(online: boolean) => void—
setConnection()(status: CollabConnectionStatus) => void—
isOnline()() => boolean—
reset()(snapshot: CollabSnapshot) => void—
disconnect()() => void—
sendSteps()(payload: CollabStepsPayload) => CollabSendResult | Promise<CollabSendResult>Inherited from CollabProvider.
onRemoteSteps()(handler: (payload: CollabRemotePayload) => void) => () => voidInherited from CollabProvider.
onStatus()optional((handler: (status: "online" | "offline") => void) => () => void) | undefinedInherited from CollabProvider.
onConnection()optional((handler: (status: CollabConnectionStatus) => void) => () => void) | undefinedInherited from CollabProvider.
onReset()optional((handler: (snapshot: CollabSnapshot) => void) => () => void) | undefinedInherited from CollabProvider.
presenceTimeoutoptionalnumber | undefinedInherited from CollabProvider.

Defined in packages/document/src/editor/collab/types.ts:439

LoopbackHubinterface#

interface LoopbackHub
PropertyTypeDescription
connect()(clientId: CollabClientId) => LoopbackConnection—
version()() => number—
getDocumentSteps()() => { step: unknown; clientId: CollabClientId }[]—
authority()() => CollabAuthority—
pending()() => number—
step()() => boolean—
flush()(limit?: number) => number—
destroy()() => void—

Defined in packages/document/src/editor/collab/types.ts:456

LoopbackHubOptionsinterface#

interface LoopbackHubOptions extends CollabAuthorityOptions
PropertyTypeDescription
latencyoptionalnumber—
jitteroptionalnumber—
dropRateoptionalnumber—
manualoptionalboolean—
randomoptional() => number—
documentoptionalDocumentInput | null | undefinedThe document at version 0. Without it, and without snapshot, the authority starts from an empty document. Inherited from CollabAuthorityOptions.
limitsoptionalPartial<CollabDocumentLimits> | undefinedInherited from CollabAuthorityOptions.
trustClientsoptionalboolean | undefinedRelay steps without applying them. Only for a process where every client is your own code, such as a unit test of a transport: a client can then store any document and move any lock. Inherited from CollabAuthorityOptions.
snapshotoptionalCollabSnapshot | null | undefinedInherited from CollabAuthorityOptions.
snapshotEveryoptionalnumber | undefinedInherited from CollabAuthorityOptions.
retainStepsoptionalnumber | undefinedInherited from CollabAuthorityOptions.
versionsoptionalreadonly CollabStoredVersion[] | null | undefinedNamed versions saved earlier, as storedVersions() returned them. Inherited from CollabAuthorityOptions.
nowoptional(() => number) | undefinedInherited from CollabAuthorityOptions.
createIdoptional(() => string) | undefinedInherited from CollabAuthorityOptions.

Defined in packages/document/src/editor/collab/types.ts:431

PresenceStateinterface#

interface PresenceState
PropertyTypeDescription
clientIdCollabClientId—
namestring—
coloroptionalstring—
anchornumber | null—
headnumber | null—
focusedboolean—
clockoptionalnumber—

Defined in packages/document/src/editor/collab/types.ts:71

CollabBackendEventtype#

type CollabBackendEvent =
  | { type: 'connection'; status: CollabConnectionStatus }
  | { type: 'steps'; payload: CollabRemotePayload }
  | { type: 'reset'; snapshot: CollabSnapshot }
  | { type: 'presence'; states: Record<string, PresenceState> }
  | { type: 'locks'; state: CollabLockState }
  | { type: 'snapshotRequest' };

Defined in packages/document/src/editor/collab/types.ts:189

CollabClientIdtype#

type CollabClientId = string | number;

Defined in packages/document/src/editor/collab/types.ts:14

CollabCommandtype#

type CollabCommand = never;

Defined in packages/document/src/editor/collab/types.ts:12

CollabCommentOperationtype#

type CollabCommentOperation =
  | { type: 'add'; thread: CommentThread }
  | { type: 'reply'; id: string; reply: CommentReply }
  | { type: 'edit'; id: string; text: string }
  | { type: 'resolve'; id: string; resolved: boolean }
  | { type: 'delete'; id: string }
  | { type: 'editReply'; id: string; replyId: string; text: string }
  | { type: 'deleteReply'; id: string; replyId: string };

Defined in packages/document/src/editor/collab/types.ts:16

CollabConnectionStatustype#

type CollabConnectionStatus = 'connected' | 'reconnecting' | 'offline';

Defined in packages/document/src/editor/collab/types.ts:30

CollabDocumentPreparedtype#

type CollabDocumentPrepared =
  { ok: true; footprint: CollabStepFootprint[]; commit(): void } | { ok: false; reason: string };

The authority's own copy of the document. Steps are applied to it, and a step that does not apply is refused.

Defined in packages/document/src/editor/collab/types.ts:232

CollabDocumentResulttype#

type CollabDocumentResult = { ok: true; footprint: CollabStepFootprint[] } | { ok: false; reason: string };

Defined in packages/document/src/editor/collab/types.ts:229

CollabMetaOperationtype#

type CollabMetaOperation =
  | { type: 'pageSetup'; page: PageSetup }
  | { type: 'headerFooter'; parts: HeaderFooterContent }
  | { type: 'comment'; operation: CollabCommentOperation };

Defined in packages/document/src/editor/collab/types.ts:25

CollabRejectReasontype#

type CollabRejectReason = 'stale' | 'locked' | 'offline' | 'invalid';

Defined in packages/document/src/editor/collab/types.ts:56

CollabSendResulttype#

type CollabSendResult = void | boolean | CollabSubmitResult;

Defined in packages/document/src/editor/collab/types.ts:187

CollabStatetype#

type CollabState = 'disabled' | 'synced' | 'pending' | 'offline' | 'desynced';

Defined in packages/document/src/editor/collab/types.ts:352

CollabStoredVersiontype#

type CollabStoredVersion = CollabVersionSnapshot | CollabVersionDelta;

Defined in packages/document/src/editor/collab/types.ts:139

CollabWireMessagetype#

type CollabWireMessage = { type: string } & Record<string, unknown>;

Defined in packages/document/src/editor/collab/types.ts:298

@birchui/document/docx#

buildDocxPartsfunction#

function buildDocxParts(input: DocumentData, options: DocxWriteOptions = {}): ZipInputFile[]
ParameterTypeDescription
inputDocumentData—
optionsoptionalDocxWriteOptions—

Defined in packages/document/src/docx/writer.ts:1505

detectFileTypefunction#

function detectFileType(input: FileTypeInput): FileTypeInfo

The type of an embedded file. The ProgID is asked first, then the file name, then the content type and the extension of the part, and last the leading bytes.

ParameterTypeDescription
inputFileTypeInput—

Defined in packages/document/src/docx/file-type.ts:352

documentToDocxfunction#

function documentToDocx(data: DocumentData, options: DocxWriteOptions = {}): Promise<Uint8Array>
ParameterTypeDescription
dataDocumentData—
optionsoptionalDocxWriteOptions—

Defined in packages/document/src/docx/writer.ts:1545

docxToDocumentfunction#

function docxToDocument(input: Uint8Array | ArrayBuffer | Blob, options: DocxReadOptions = {}): Promise<DocumentData>
ParameterTypeDescription
inputUint8Array | ArrayBuffer | Blob—
optionsoptionalDocxReadOptions—

Defined in packages/document/src/docx/reader.ts:774

embeddedObjectFilefunction#

function embeddedObjectFile(attrs: Attrs): EmbeddedObjectFile
ParameterTypeDescription
attrsAttrs—

Defined in packages/document/src/docx/embedded.ts:107

embeddedObjectNodefunction#

function embeddedObjectNode(input: EmbeddedObjectInput): DocNodeJSON
ParameterTypeDescription
inputEmbeddedObjectInput—

Defined in packages/document/src/docx/embedded.ts:85

embeddedObjectTypefunction#

function embeddedObjectType(attrs: Attrs): FileTypeInfo

The file type of an embedded_object node, from its ProgID, file name, content type and bytes, in that order.

ParameterTypeDescription
attrsAttrs—

Defined in packages/document/src/docx/embedded.ts:63

fileIconSvgfunction#

function fileIconSvg(type: Pick<FileTypeInfo, 'kind' | 'badge'>, options: FileIconSvgOptions = {}): string

A standalone SVG picture of the icon of a file type, with the badge as text.

ParameterTypeDescription
typePick<FileTypeInfo, 'kind' | 'badge'>—
optionsoptionalFileIconSvgOptions—

Defined in packages/document/src/docx/file-icon.ts:143

fileTypeLabelfunction#

function fileTypeLabel(label: FileTypeLabel, translate?: FileTypeTranslate): string

The name of a file type as it reads inside a sentence: "PDF document", "image".

ParameterTypeDescription
labelFileTypeLabel—
translateoptionalFileTypeTranslate—

Defined in packages/document/src/docx/file-type.ts:420

metafileToSvgfunction#

function metafileToSvg(bytes: Uint8Array, options: MetafileOptions = {}): string | null
ParameterTypeDescription
bytesUint8Array—
optionsoptionalMetafileOptions—

Defined in packages/document/src/docx/metafile.ts:584

readDocxfunction#

function readDocx(input: Uint8Array | ArrayBuffer | Blob, options: DocxReadOptions = {}): Promise<DocxReadResult>
ParameterTypeDescription
inputUint8Array | ArrayBuffer | Blob—
optionsoptionalDocxReadOptions—

Defined in packages/document/src/docx/reader.ts:447

validateDocxPackagefunction#

function validateDocxPackage(bytes: Uint8Array | ArrayBuffer, options: { limits?: Partial<ZipLimits> } = {}): Promise<DocxValidationResult>
ParameterTypeDescription
bytesUint8Array | ArrayBuffer—
optionsoptional{ limits?: Partial<ZipLimits> }—

Defined in packages/document/src/docx/validate.ts:940

validateDocxPartsfunction#

function validateDocxParts(files: Map<string, Uint8Array>): DocxValidationResult
ParameterTypeDescription
filesMap<string, Uint8Array>—

Defined in packages/document/src/docx/validate.ts:878

DocumentFormatErrorclass#

class DocumentFormatError extends Error
new DocumentFormatError(readonly code: DocumentFormatCode, message: string)
MemberTypeDescription
namereadonly"DocumentFormatError"—
codereadonlyDocumentFormatCode—

Defined in packages/document/src/docx/errors.ts:42

ZipLimitErrorclass#

class ZipLimitError extends Error
new ZipLimitError(code: ZipLimitCode, message: string, detail: { limit: number; actual: number; entryName?: string })
MemberTypeDescription
codereadonlyZipLimitCode—
limitreadonlynumber—
actualreadonlynumber—
entryNamereadonlystring | undefined—

Defined in packages/document/src/docx/errors.ts:23

DEFAULT_ZIP_LIMITSconst#

const DEFAULT_ZIP_LIMITS: Readonly<ZipLimits>

Defined in packages/document/src/docx/errors.ts:16

DOCX_MIMEconst#

const DOCX_MIME: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'

Defined in packages/document/src/docx/write-parts.ts:74

DocxImportFeatureinterface#

interface DocxImportFeature
PropertyTypeDescription
featurestring—
countnumber—
noteoptionalstring—

Defined in packages/document/src/docx/report.ts:1

DocxImportReportinterface#

interface DocxImportReport

Defined in packages/document/src/docx/report.ts:7

DocxPageMapinterface#

interface DocxPageMap
PropertyTypeDescription
bookmarksoptionalReadonly<Record<string, number>>—
headingsoptionalreadonly number[]—
headerFooteroptionalReadonly<Partial<Record<'default' | 'first' | 'even', number>>>—

Defined in packages/document/src/docx/writer.ts:84

DocxReadOptionsinterface#

interface DocxReadOptions
PropertyTypeDescription
limitsoptionalPartial<ZipLimits>Caps on the archive: entry count, inflated size of one entry, total inflated size and compression ratio.

Defined in packages/document/src/docx/reader.ts:442

DocxReadResultinterface#

interface DocxReadResult
PropertyTypeDescription
documentDocumentData—
warningsstring[]—
reportDocxImportReport—

Defined in packages/document/src/docx/reader.ts:367

DocxValidationIssueinterface#

interface DocxValidationIssue
PropertyTypeDescription
severity'error' | 'warning'—
codestring—
partstring—
messagestring—

Defined in packages/document/src/docx/validate.ts:7

DocxValidationResultinterface#

interface DocxValidationResult
PropertyTypeDescription
okboolean—
issuesDocxValidationIssue[]—

Defined in packages/document/src/docx/validate.ts:14

DocxWriteOptionsinterface#

interface DocxWriteOptions
PropertyTypeDescription
trackRevisionsoptionalboolean—
zoomoptionalnumber—
pageCountoptionalnumber—
pagesoptionalDocxPageMap—
compressoptionalboolean—
nowoptionalDate—
preserveSourceoptionalboolean | 'exact'—

Defined in packages/document/src/docx/writer.ts:90

EmbeddedObjectFileinterface#

interface EmbeddedObjectFile
PropertyTypeDescription
fileNamestring—
mimeTypestring—
progIdstring—
dataUint8Array—

Defined in packages/document/src/docx/embedded.ts:30

EmbeddedObjectInputinterface#

interface EmbeddedObjectInput
PropertyTypeDescription
dataUint8Array | ArrayBuffer—
fileNamestring—
mimeTypeoptionalstring—
asIconoptionalboolean—
iconoptionalstring—
widthoptionalnumber—
heightoptionalnumber—

Defined in packages/document/src/docx/embedded.ts:20

FileIconSvgOptionsinterface#

interface FileIconSvgOptions
PropertyTypeDescription
widthoptionalnumber—
heightoptionalnumber—
titleoptionalstring—

Defined in packages/document/src/docx/file-icon.ts:136

FileTypeInfointerface#

interface FileTypeInfo
PropertyTypeDescription
kindFileKind—
labelFileTypeLabel—
extensionstringLower-case extension without the dot; empty when nothing is known.
badgestringUp to four upper-case characters for the icon.
mimeTypestring—
sourceFileTypeSource—

Defined in packages/document/src/docx/file-type.ts:28

FileTypeInputinterface#

interface FileTypeInput
PropertyTypeDescription
progIdoptionalstring | null—
fileNameoptionalstring | null—
mimeTypeoptionalstring | null—
partNameoptionalstring | null—
dataoptionalUint8Array | null—

Defined in packages/document/src/docx/file-type.ts:39

MetafileOptionsinterface#

interface MetafileOptions
PropertyTypeDescription
embeddedEmfoptionalboolean—

Defined in packages/document/src/docx/metafile.ts:580

UnzipOptionsinterface#

interface UnzipOptions
PropertyTypeDescription
limitsoptionalPartial<ZipLimits>—

Defined in packages/document/src/docx/errors.ts:10

ZipLimitsinterface#

interface ZipLimits
PropertyTypeDescription
maxEntriesnumber—
maxEntryBytesnumber—
maxTotalBytesnumber—
maxRationumber—

Defined in packages/document/src/docx/errors.ts:1

DocumentFormatCodetype#

type DocumentFormatCode =
  'encrypted-or-legacy-doc' | 'encrypted-entry' | 'not-a-zip' | 'not-a-word-document' | 'xml-too-deep';

Defined in packages/document/src/docx/errors.ts:39

FileKindtype#

type FileKind =
  'word' | 'excel' | 'powerpoint' | 'pdf' | 'email' | 'image' | 'text' | 'archive' | 'media' | 'file';

Defined in packages/document/src/docx/file-type.ts:5

FileTypeLabeltype#

type FileTypeLabel =
  | 'word'
  | 'excel'
  | 'powerpoint'
  | 'document'
  | 'spreadsheet'
  | 'presentation'
  | 'pdf'
  | 'outlook'
  | 'email'
  | 'image'
  | 'text'
  | 'csv'
  | 'archive'
  | 'audio'
  | 'video'
  | 'file';

Defined in packages/document/src/docx/file-type.ts:8

FileTypeSourcetype#

type FileTypeSource = 'progId' | 'fileName' | 'contentType' | 'content' | 'none';

Defined in packages/document/src/docx/file-type.ts:26

ZipLimitCodetype#

type ZipLimitCode = 'too-many-entries' | 'entry-too-large' | 'archive-too-large' | 'ratio-too-high';

Defined in packages/document/src/docx/errors.ts:8

@birchui/document/formats#

docToDocumentfunction#

function docToDocument(input: Uint8Array | ArrayBuffer, options: DocReadOptions = {}): DocumentData

Reads a Word 97–2003 binary document (.doc). Every failure is a DocFormatError; hostile or damaged input never reads outside the file and stays within limits.

ParameterTypeDescription
inputUint8Array | ArrayBuffer—
optionsoptionalDocReadOptions—

Defined in packages/document/src/doc/reader.ts:865

documentToHtmlfunction#

function documentToHtml(input: DocumentInput, options: HtmlDocumentOptions = {}): string
ParameterTypeDescription
inputDocumentInput—
optionsoptionalHtmlDocumentOptions—

Defined in packages/document/src/formats/html.ts:964

documentToMarkdownfunction#

function documentToMarkdown(input: DocumentInput, options: MarkdownOptions = {}): string
ParameterTypeDescription
inputDocumentInput—
optionsoptionalMarkdownOptions—

Defined in packages/document/src/formats/markdown.ts:261

documentToOdtfunction#

function documentToOdt(input: DocumentInput): Promise<Uint8Array>
ParameterTypeDescription
inputDocumentInput—

Defined in packages/document/src/formats/odt.ts:452

htmlToDocumentfunction#

function htmlToDocument(html: string): DocumentData
ParameterTypeDescription
htmlstring—

Defined in packages/document/src/formats/html.ts:690

markdownToDocumentfunction#

function markdownToDocument(markdown: string): DocumentData
ParameterTypeDescription
markdownstring—

Defined in packages/document/src/formats/markdown.ts:748

odtToDocumentfunction#

function odtToDocument(input: Uint8Array | ArrayBuffer | Blob, options: { limits?: Partial<ZipLimits> } = {}): Promise<DocumentData>
ParameterTypeDescription
inputUint8Array | ArrayBuffer | Blob—
optionsoptional{ limits?: Partial<ZipLimits> }—

Defined in packages/document/src/formats/odt.ts:831

rtfToDocumentfunction#

function rtfToDocument(input: string | Uint8Array | ArrayBuffer): DocumentData
ParameterTypeDescription
inputstring | Uint8Array | ArrayBuffer—

Defined in packages/document/src/formats/rtf.ts:700

DocFormatErrorclass#

class DocFormatError extends Error
new DocFormatError(readonly code: DocFormatCode, message: string)
MemberTypeDescription
namereadonly"DocFormatError"—
codereadonlyDocFormatCode—

Defined in packages/document/src/doc/errors.ts:4

DEFAULT_DOC_LIMITSconst#

const DEFAULT_DOC_LIMITS: Readonly<DocLimits>

Defined in packages/document/src/doc/errors.ts:28

ODT_MIMEconst#

const ODT_MIME: "application/vnd.oasis.opendocument.text" = 'application/vnd.oasis.opendocument.text'

Defined in packages/document/src/formats/odt.ts:26

DocLimitsinterface#

interface DocLimits
PropertyTypeDescription
maxBytesnumberLargest file that is read at all, in bytes.
maxCharactersnumberLargest number of characters in the body of the document.
maxPictureBytesnumberTotal size of the pictures that are kept, in bytes. Pictures past it are left out.
maxTableCellsnumberLargest number of cells in one table. A table past it is read as paragraphs.

Defined in packages/document/src/doc/errors.ts:15

DocReadOptionsinterface#

interface DocReadOptions
PropertyTypeDescription
limitsoptionalPartial<DocLimits>—

Defined in packages/document/src/doc/reader.ts:43

HtmlDocumentOptionsinterface#

interface HtmlDocumentOptions
PropertyTypeDescription
fullDocumentoptionalboolean—
titleoptionalstring—
includeDeletedoptionalboolean—
linkSchemesoptionalreadonly string[]Schemes written as links that can be followed, besides http, https, mailto and tel.

Defined in packages/document/src/formats/html.ts:23

MarkdownOptionsinterface#

interface MarkdownOptions
PropertyTypeDescription
includeDeletedoptionalboolean—

Defined in packages/document/src/formats/markdown.ts:21

DocFormatCodetype#

type DocFormatCode =
  'not-a-doc' | 'encrypted' | 'unsupported-version' | 'too-large' | 'too-many-characters' | 'corrupt';

Defined in packages/document/src/doc/errors.ts:1

@birchui/document/headless#

acceptAllRevisionsfunction#

function acceptAllRevisions(doc: DocNodeJSON): DocNodeJSON
ParameterTypeDescription
docDocNodeJSON—

Defined in packages/document/src/model/compare.ts:677

breakGapsfunction#

function breakGaps(breaks: readonly LayoutBreak[], pageStride: number): number[]
ParameterTypeDescription
breaksreadonly LayoutBreak[]—
pageStridenumber—

Defined in packages/document/src/layout/paginate.ts:630

buildDocxPartsfunction#

function buildDocxParts(input: DocumentData, options: DocxWriteOptions = {}): ZipInputFile[]
ParameterTypeDescription
inputDocumentData—
optionsoptionalDocxWriteOptions—

Defined in packages/document/src/docx/writer.ts:1505

clearRegisteredFontsfunction#

function clearRegisteredFonts(): void

Defined in packages/document/src/layout/pdf/font-substitution.ts:89

combineDocumentsfunction#

function combineDocuments(original: DocNodeJSON, first: DocNodeJSON, second: DocNodeJSON, options: CombineOptions = {}): DocNodeJSON
ParameterTypeDescription
originalDocNodeJSON—
firstDocNodeJSON—
secondDocNodeJSON—
optionsoptionalCombineOptions—

Defined in packages/document/src/model/combine.ts:78

compareDocumentsfunction#

function compareDocuments(original: DocNodeJSON, revised: DocNodeJSON, options: CompareOptions & { idPrefix?: string } = {}): DocNodeJSON
ParameterTypeDescription
originalDocNodeJSON—
revisedDocNodeJSON—
optionsoptionalCompareOptions & { idPrefix?: string }—

Defined in packages/document/src/model/compare.ts:593

contentBoxfunction#

function contentBox(setup: PageSetup): { width: number; height: number }
ParameterTypeDescription
setupPageSetup—

Defined in packages/document/src/model/page-setup.ts:45

countRevisionsfunction#

function countRevisions(doc: DocNodeJSON): number
ParameterTypeDescription
docDocNodeJSON—

Defined in packages/document/src/model/compare.ts:656

detectFileTypefunction#

function detectFileType(input: FileTypeInput): FileTypeInfo

The type of an embedded file. The ProgID is asked first, then the file name, then the content type and the extension of the part, and last the leading bytes.

ParameterTypeDescription
inputFileTypeInput—

Defined in packages/document/src/docx/file-type.ts:352

docToDocumentfunction#

function docToDocument(input: Uint8Array | ArrayBuffer, options: DocReadOptions = {}): DocumentData

Reads a Word 97–2003 binary document (.doc). Every failure is a DocFormatError; hostile or damaged input never reads outside the file and stays within limits.

ParameterTypeDescription
inputUint8Array | ArrayBuffer—
optionsoptionalDocReadOptions—

Defined in packages/document/src/doc/reader.ts:865

documentSectionsfunction#

function documentSections(data: Pick<DocumentData, 'content' | 'page'> & Partial<DocumentData>): DocumentSection[]
ParameterTypeDescription
dataPick<DocumentData, 'content' | 'page'> & Partial<DocumentData>—

Defined in packages/document/src/model/sections.ts:10

documentTextfunction#

function documentText(doc: DocNodeJSON, options: { skipDeleted?: boolean } = {}): string
ParameterTypeDescription
docDocNodeJSON—
optionsoptional{ skipDeleted?: boolean }—

Defined in packages/document/src/model/json.ts:257

documentToDocxfunction#

function documentToDocx(data: DocumentData, options: DocxWriteOptions = {}): Promise<Uint8Array>
ParameterTypeDescription
dataDocumentData—
optionsoptionalDocxWriteOptions—

Defined in packages/document/src/docx/writer.ts:1545

documentToHtmlfunction#

function documentToHtml(input: DocumentInput, options: HtmlDocumentOptions = {}): string
ParameterTypeDescription
inputDocumentInput—
optionsoptionalHtmlDocumentOptions—

Defined in packages/document/src/formats/html.ts:964

documentToMarkdownfunction#

function documentToMarkdown(input: DocumentInput, options: MarkdownOptions = {}): string
ParameterTypeDescription
inputDocumentInput—
optionsoptionalMarkdownOptions—

Defined in packages/document/src/formats/markdown.ts:261

documentToOdtfunction#

function documentToOdt(input: DocumentInput): Promise<Uint8Array>
ParameterTypeDescription
inputDocumentInput—

Defined in packages/document/src/formats/odt.ts:452

documentToPdffunction#

function documentToPdf(input: DocumentInput, options: DocumentPdfOptions = {}): Promise<Uint8Array>
ParameterTypeDescription
inputDocumentInput—
optionsoptionalDocumentPdfOptions—

Defined in packages/document/src/layout/pdf/document-layout.ts:471

docxToDocumentfunction#

function docxToDocument(input: Uint8Array | ArrayBuffer | Blob, options: DocxReadOptions = {}): Promise<DocumentData>
ParameterTypeDescription
inputUint8Array | ArrayBuffer | Blob—
optionsoptionalDocxReadOptions—

Defined in packages/document/src/docx/reader.ts:774

embeddedObjectFilefunction#

function embeddedObjectFile(attrs: Attrs): EmbeddedObjectFile
ParameterTypeDescription
attrsAttrs—

Defined in packages/document/src/docx/embedded.ts:107

embeddedObjectNodefunction#

function embeddedObjectNode(input: EmbeddedObjectInput): DocNodeJSON
ParameterTypeDescription
inputEmbeddedObjectInput—

Defined in packages/document/src/docx/embedded.ts:85

embeddedObjectTypefunction#

function embeddedObjectType(attrs: Attrs): FileTypeInfo

The file type of an embedded_object node, from its ProgID, file name, content type and bytes, in that order.

ParameterTypeDescription
attrsAttrs—

Defined in packages/document/src/docx/embedded.ts:63

emptyDocumentfunction#

function emptyDocument(): DocumentData

Defined in packages/document/src/model/json.ts:37

fileIconSvgfunction#

function fileIconSvg(type: Pick<FileTypeInfo, 'kind' | 'badge'>, options: FileIconSvgOptions = {}): string

A standalone SVG picture of the icon of a file type, with the badge as text.

ParameterTypeDescription
typePick<FileTypeInfo, 'kind' | 'badge'>—
optionsoptionalFileIconSvgOptions—

Defined in packages/document/src/docx/file-icon.ts:143

fileTypeLabelfunction#

function fileTypeLabel(label: FileTypeLabel, translate?: FileTypeTranslate): string

The name of a file type as it reads inside a sentence: "PDF document", "image".

ParameterTypeDescription
labelFileTypeLabel—
translateoptionalFileTypeTranslate—

Defined in packages/document/src/docx/file-type.ts:420

findMatchesfunction#

function findMatches(blocks: readonly SearchBlock[], query: string, options: FindOptions = {}): SearchMatch[]
ParameterTypeDescription
blocksreadonly SearchBlock[]—
querystring—
optionsoptionalFindOptions—

Defined in packages/document/src/model/search.ts:96

fontFamilyStackfunction#

function fontFamilyStack(fontFamily: string): string

A CSS font-family list that puts the metric-compatible substitutes right after each requested family.

ParameterTypeDescription
fontFamilystring—

Defined in packages/document/src/layout/pdf/font-substitution.ts:48

fontSubstitutesfunction#

function fontSubstitutes(family: string): readonly string[]
ParameterTypeDescription
familystring—

Defined in packages/document/src/layout/pdf/font-substitution.ts:36

formatDatePicturefunction#

function formatDatePicture(date: Date, picture: string): string
ParameterTypeDescription
dateDate—
picturestring—

Defined in packages/document/src/model/fields.ts:186

formatNumberfunction#

function formatNumber(value: number, format: string): string
ParameterTypeDescription
valuenumber—
formatstring—

Defined in packages/document/src/model/numbering.ts:239

htmlToDocumentfunction#

function htmlToDocument(html: string): DocumentData
ParameterTypeDescription
htmlstring—

Defined in packages/document/src/formats/html.ts:690

imageSourceKindfunction#

function imageSourceKind(value: unknown): ImageSourceKind
ParameterTypeDescription
valueunknown—

Defined in packages/document/src/model/url.ts:79

layoutDocumentfunction#

function layoutDocument(input: DocumentInput, options: DocumentPdfOptions = {}): { layout: PdfDocumentLayout; warnings: string[]; missingFonts: string[] }
ParameterTypeDescription
inputDocumentInput—
optionsoptionalDocumentPdfOptions—

Defined in packages/document/src/layout/pdf/document-layout.ts:105

layoutToPdffunction#

function layoutToPdf(layout: PdfDocumentLayout, options: PdfWriteOptions = {}): Promise<Uint8Array>
ParameterTypeDescription
layoutPdfDocumentLayout—
optionsoptionalPdfWriteOptions—

Defined in packages/document/src/layout/pdf/writer.ts:722

markdownToDocumentfunction#

function markdownToDocument(markdown: string): DocumentData
ParameterTypeDescription
markdownstring—

Defined in packages/document/src/formats/markdown.ts:748

markMovesfunction#

function markMoves(doc: DocNodeJSON): DocNodeJSON
ParameterTypeDescription
docDocNodeJSON—

Defined in packages/document/src/model/compare.ts:652

mergeContentfunction#

function mergeContent(doc: DocNodeJSON, values: MergeValues, options: MergeOptions = {}): DocNodeJSON
ParameterTypeDescription
docDocNodeJSON—
valuesMergeValues—
optionsoptionalMergeOptions—

Defined in packages/document/src/model/merge.ts:520

mergeDocumentfunction#

function mergeDocument(data: DocumentData, values: MergeValues, options: MergeOptions = {}): DocumentData
ParameterTypeDescription
dataDocumentData—
valuesMergeValues—
optionsoptionalMergeOptions—

Defined in packages/document/src/model/merge.ts:525

mergeFieldNamesfunction#

function mergeFieldNames(doc: DocNodeJSON): string[]
ParameterTypeDescription
docDocNodeJSON—

Defined in packages/document/src/model/merge.ts:537

metafileToSvgfunction#

function metafileToSvg(bytes: Uint8Array, options: MetafileOptions = {}): string | null
ParameterTypeDescription
bytesUint8Array—
optionsoptionalMetafileOptions—

Defined in packages/document/src/docx/metafile.ts:584

multiplyMatrixfunction#

function multiplyMatrix(first: PdfMatrix, second: PdfMatrix): PdfMatrix
ParameterTypeDescription
firstPdfMatrix—
secondPdfMatrix—

Defined in packages/document/src/layout/pdf/layout-tree.ts:204

normalizeDocumentfunction#

function normalizeDocument(input: DocumentInput | null | undefined): DocumentData
ParameterTypeDescription
inputDocumentInput | null | undefined—

Defined in packages/document/src/model/json.ts:155

normalizePageSetupfunction#

function normalizePageSetup(input: Partial<PageSetup> | undefined, base: PageSetup = DEFAULT_PAGE_SETUP): PageSetup
ParameterTypeDescription
inputPartial<PageSetup> | undefined—
baseoptionalPageSetup—

Defined in packages/document/src/model/page-setup.ts:109

numberingLabelsfunction#

function numberingLabels(document: Pick<DocumentData, 'content'> & Partial<DocumentData>): NumberingLabel[]
ParameterTypeDescription
documentPick<DocumentData, 'content'> & Partial<DocumentData>—

Defined in packages/document/src/model/numbering.ts:639

odtToDocumentfunction#

function odtToDocument(input: Uint8Array | ArrayBuffer | Blob, options: { limits?: Partial<ZipLimits> } = {}): Promise<DocumentData>
ParameterTypeDescription
inputUint8Array | ArrayBuffer | Blob—
optionsoptional{ limits?: Partial<ZipLimits> }—

Defined in packages/document/src/formats/odt.ts:831

outlineOffunction#

function outlineOf(doc: DocNodeJSON): OutlineEntry[]
ParameterTypeDescription
docDocNodeJSON—

Defined in packages/document/src/model/json.ts:307

pageDimensionsfunction#

function pageDimensions(setup: PageSetup): { width: number; height: number }
ParameterTypeDescription
setupPageSetup—

Defined in packages/document/src/model/page-setup.ts:38

paginatefunction#

function paginate(blocks: readonly LayoutBlock[], options: PaginateOptions): PaginationResult
ParameterTypeDescription
blocksreadonly LayoutBlock[]—
optionsPaginateOptions—

Defined in packages/document/src/layout/paginate.ts:617

parseFieldInstructionfunction#

function parseFieldInstruction(instruction: string): ParsedField
ParameterTypeDescription
instructionstring—

Defined in packages/document/src/model/fields.ts:122

readDocxfunction#

function readDocx(input: Uint8Array | ArrayBuffer | Blob, options: DocxReadOptions = {}): Promise<DocxReadResult>
ParameterTypeDescription
inputUint8Array | ArrayBuffer | Blob—
optionsoptionalDocxReadOptions—

Defined in packages/document/src/docx/reader.ts:447

registeredFontsfunction#

function registeredFonts(): readonly PdfFontSource[]

Defined in packages/document/src/layout/pdf/font-substitution.ts:85

registerFontsfunction#

function registerFonts(fonts: readonly PdfFontSource[]): void

Makes font files available to every PDF written afterwards, in the browser and on a server, in addition to the fonts passed with a single call. Registering a face again replaces it.

ParameterTypeDescription
fontsreadonly PdfFontSource[]—

Defined in packages/document/src/layout/pdf/font-substitution.ts:70

rejectAllRevisionsfunction#

function rejectAllRevisions(doc: DocNodeJSON): DocNodeJSON
ParameterTypeDescription
docDocNodeJSON—

Defined in packages/document/src/model/compare.ts:681

renderDocumentPdffunction#

function renderDocumentPdf(input: DocumentInput, options: DocumentPdfOptions = {}): Promise<DocumentPdfResult>
ParameterTypeDescription
inputDocumentInput—
optionsoptionalDocumentPdfOptions—

Defined in packages/document/src/layout/pdf/document-layout.ts:457

rotationMatrixfunction#

function rotationMatrix(degrees: number, centerX: number, centerY: number): PdfMatrix
ParameterTypeDescription
degreesnumber—
centerXnumber—
centerYnumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:197

rtfToDocumentfunction#

function rtfToDocument(input: string | Uint8Array | ArrayBuffer): DocumentData
ParameterTypeDescription
inputstring | Uint8Array | ArrayBuffer—

Defined in packages/document/src/formats/rtf.ts:700

sanitizeHreffunction#

function sanitizeHref(value: unknown, linkSchemes?: readonly string[]): string | null

The address when it may be followed, otherwise null. linkSchemes extends the allow-list.

ParameterTypeDescription
valueunknown—
linkSchemesoptionalreadonly string[]—

Defined in packages/document/src/model/url.ts:56

sanitizeImageSrcfunction#

function sanitizeImageSrc(value: unknown): string
ParameterTypeDescription
valueunknown—

Defined in packages/document/src/model/url.ts:92

updateFieldsfunction#

function updateFields(input: DocumentData, context: FieldContext = {}): DocumentData
ParameterTypeDescription
inputDocumentData—
contextoptionalFieldContext—

Defined in packages/document/src/model/fields.ts:419

validateDocxPackagefunction#

function validateDocxPackage(bytes: Uint8Array | ArrayBuffer, options: { limits?: Partial<ZipLimits> } = {}): Promise<DocxValidationResult>
ParameterTypeDescription
bytesUint8Array | ArrayBuffer—
optionsoptional{ limits?: Partial<ZipLimits> }—

Defined in packages/document/src/docx/validate.ts:940

validateDocxPartsfunction#

function validateDocxParts(files: Map<string, Uint8Array>): DocxValidationResult
ParameterTypeDescription
filesMap<string, Uint8Array>—

Defined in packages/document/src/docx/validate.ts:878

wordCountfunction#

function wordCount(doc: DocNodeJSON): WordCount
ParameterTypeDescription
docDocNodeJSON—

Defined in packages/document/src/model/json.ts:274

writePdffunction#

function writePdf(layout: PdfDocumentLayout, options: PdfWriteOptions = {}): Promise<PdfWriteResult>
ParameterTypeDescription
layoutPdfDocumentLayout—
optionsoptionalPdfWriteOptions—

Defined in packages/document/src/layout/pdf/writer.ts:613

DocFormatErrorclass#

class DocFormatError extends Error
new DocFormatError(readonly code: DocFormatCode, message: string)
MemberTypeDescription
namereadonly"DocFormatError"—
codereadonlyDocFormatCode—

Defined in packages/document/src/doc/errors.ts:4

DocumentFormatErrorclass#

class DocumentFormatError extends Error
new DocumentFormatError(readonly code: DocumentFormatCode, message: string)
MemberTypeDescription
namereadonly"DocumentFormatError"—
codereadonlyDocumentFormatCode—

Defined in packages/document/src/docx/errors.ts:42

PdfFontErrorclass#

class PdfFontError extends Error
new PdfFontError(readonly families: readonly string[])
MemberTypeDescription
codereadonly"pdfa-fonts-missing"—
familiesreadonlyreadonly string[]—

Defined in packages/document/src/layout/pdf/font-substitution.ts:97

ZipLimitErrorclass#

class ZipLimitError extends Error
new ZipLimitError(code: ZipLimitCode, message: string, detail: { limit: number; actual: number; entryName?: string })
MemberTypeDescription
codereadonlyZipLimitCode—
limitreadonlynumber—
actualreadonlynumber—
entryNamereadonlystring | undefined—

Defined in packages/document/src/docx/errors.ts:23

DEFAULT_DOC_LIMITSconst#

const DEFAULT_DOC_LIMITS: Readonly<DocLimits>

Defined in packages/document/src/doc/errors.ts:28

DEFAULT_PAGE_SETUPconst#

const DEFAULT_PAGE_SETUP: PageSetup

Defined in packages/document/src/model/page-setup.ts:17

DEFAULT_ZIP_LIMITSconst#

const DEFAULT_ZIP_LIMITS: Readonly<ZipLimits>

Defined in packages/document/src/docx/errors.ts:16

DOCX_MIMEconst#

const DOCX_MIME: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'

Defined in packages/document/src/docx/write-parts.ts:74

FONT_SUBSTITUTIONSconst#

const FONT_SUBSTITUTIONS: Readonly<Record<string, readonly string[]>>

Fonts with the same advance widths as the font they replace, so text set in the substitute breaks at the same places. Carlito and Caladea match Calibri and Cambria; the Liberation and Croscore families match Arial, Times New Roman and Courier New; Gelasio matches Georgia and Selawik matches Segoe UI.

Defined in packages/document/src/layout/pdf/font-substitution.ts:8

ODT_MIMEconst#

const ODT_MIME: "application/vnd.oasis.opendocument.text" = 'application/vnd.oasis.opendocument.text'

Defined in packages/document/src/formats/odt.ts:26

PAGE_SIZESconst#

const PAGE_SIZES: Readonly<Record<PageSizeName, { width: number; height: number }>>

Defined in packages/document/src/model/page-setup.ts:3

PARAGRAPH_STYLESconst#

const PARAGRAPH_STYLES: readonly ParagraphStyleDefinition[]

Defined in packages/document/src/model/paragraph-styles.ts:24

AbstractNumberinginterface#

interface AbstractNumbering
PropertyTypeDescription
idnumber—
nameoptionalstring—
multiLevelTypeoptionalstring—
levelsNumberingLevel[]—

Defined in packages/document/src/model/numbering.ts:31

CombineOptionsinterface#

interface CombineOptions extends Pick<CompareOptions, 'date' | 'granularity' | 'formatting'>
PropertyTypeDescription
firstAuthoroptionalstring—
secondAuthoroptionalstring—
movesoptionalboolean—
dateoptionalstring | undefinedInherited from CompareOptions.
granularityoptional"word" | "character" | undefinedInherited from CompareOptions.
formattingoptionalboolean | undefinedInherited from CompareOptions.

Defined in packages/document/src/model/combine.ts:5

DocLimitsinterface#

interface DocLimits
PropertyTypeDescription
maxBytesnumberLargest file that is read at all, in bytes.
maxCharactersnumberLargest number of characters in the body of the document.
maxPictureBytesnumberTotal size of the pictures that are kept, in bytes. Pictures past it are left out.
maxTableCellsnumberLargest number of cells in one table. A table past it is read as paragraphs.

Defined in packages/document/src/doc/errors.ts:15

DocMarkJSONinterface#

interface DocMarkJSON
PropertyTypeDescription
typestring—
attrsoptionalRecord<string, unknown>—

Defined in packages/document/src/types.ts:29

DocNodeJSONinterface#

interface DocNodeJSON
PropertyTypeDescription
typestring—
attrsoptionalRecord<string, unknown>—
contentoptionalDocNodeJSON[]—
marksoptionalDocMarkJSON[]—
textoptionalstring—

Defined in packages/document/src/types.ts:34

DocReadOptionsinterface#

interface DocReadOptions
PropertyTypeDescription
limitsoptionalPartial<DocLimits>—

Defined in packages/document/src/doc/reader.ts:43

DocumentDatainterface#

interface DocumentData extends HeaderFooterContent

Defined in packages/document/src/types.ts:522

DocumentPdfOptionsinterface#

interface DocumentPdfOptions extends PdfWriteOptions
PropertyTypeDescription
fontsoptionalreadonly PdfFontSource[]—
titleoptionalstring—
authoroptionalstring—
subjectoptionalstring—
keywordsoptionalstring—
languageoptionalstring—
outlineoptionalboolean—
compressoptionalboolean | undefinedInherited from PdfWriteOptions.
creationDateoptionalDate | undefinedInherited from PdfWriteOptions.
produceroptionalstring | undefinedInherited from PdfWriteOptions.
pdfAoptionalboolean | undefinedInherited from PdfWriteOptions.
taggedoptionalboolean | undefinedInherited from PdfWriteOptions.

Defined in packages/document/src/layout/pdf/document-layout.ts:28

DocumentPdfResultinterface#

interface DocumentPdfResult
PropertyTypeDescription
bytesUint8Array—
warningsstring[]—
pageCountnumber—
missingFontsstring[]Font families the document asks for that had no font file and no metric-compatible substitute.

Defined in packages/document/src/layout/pdf/document-layout.ts:38

DocumentPropertiesinterface#

interface DocumentProperties
PropertyTypeDescription
titleoptionalstring—
subjectoptionalstring—
authoroptionalstring—
keywordsoptionalstring—
descriptionoptionalstring—
createdoptionalstring—
modifiedoptionalstring—
categoryoptionalstring—
lastModifiedByoptionalstring—
revisionoptionalstring—
companyoptionalstring—
manageroptionalstring—
customoptionalRecord<string, string | number | boolean>—

Defined in packages/document/src/types.ts:158

DocumentSettingsinterface#

interface DocumentSettings
PropertyTypeDescription
evenAndOddHeadersoptionalboolean—
mirrorMarginsoptionalboolean—
trackRevisionsoptionalboolean—
defaultTabStopoptionalnumber—
protectionoptionalDocumentProtection | null—
footnotesoptionalNoteSettings—
endnotesoptionalNoteSettings—
compatibilityModeoptionalnumber—
compatoptionalCompatibilitySettings—
kerningoptionalbooleanFalse when the document's default text has Word's "Kerning for fonts" switched off, which is the case for most Word documents. Text is then laid out without pair kerning, as Word does, unless a run switches it on.

Defined in packages/document/src/types.ts:194

DocumentStyleinterface#

interface DocumentStyle
PropertyTypeDescription
idstring—
namestring—
typeDocumentStyleType—
basedOnoptionalstring—
nextoptionalstring—
isDefaultoptionalboolean—
isHiddenoptionalboolean—
isQuickStyleoptionalboolean—
builtinoptionalParagraphStyleId—
outlineLeveloptionalnumber—
numberingoptional{ numId: number; level: number }—
paragraphoptionalRecord<string, unknown>—
runoptionalRecord<string, unknown>—
tableoptionalRecord<string, unknown>—

Defined in packages/document/src/types.ts:213

DocxImportFeatureinterface#

interface DocxImportFeature
PropertyTypeDescription
featurestring—
countnumber—
noteoptionalstring—

Defined in packages/document/src/docx/report.ts:1

DocxImportReportinterface#

interface DocxImportReport

Defined in packages/document/src/docx/report.ts:7

DocxPageMapinterface#

interface DocxPageMap
PropertyTypeDescription
bookmarksoptionalReadonly<Record<string, number>>—
headingsoptionalreadonly number[]—
headerFooteroptionalReadonly<Partial<Record<'default' | 'first' | 'even', number>>>—

Defined in packages/document/src/docx/writer.ts:84

DocxReadOptionsinterface#

interface DocxReadOptions
PropertyTypeDescription
limitsoptionalPartial<ZipLimits>Caps on the archive: entry count, inflated size of one entry, total inflated size and compression ratio.

Defined in packages/document/src/docx/reader.ts:442

DocxReadResultinterface#

interface DocxReadResult
PropertyTypeDescription
documentDocumentData—
warningsstring[]—
reportDocxImportReport—

Defined in packages/document/src/docx/reader.ts:367

DocxValidationIssueinterface#

interface DocxValidationIssue
PropertyTypeDescription
severity'error' | 'warning'—
codestring—
partstring—
messagestring—

Defined in packages/document/src/docx/validate.ts:7

DocxValidationResultinterface#

interface DocxValidationResult
PropertyTypeDescription
okboolean—
issuesDocxValidationIssue[]—

Defined in packages/document/src/docx/validate.ts:14

DocxWriteOptionsinterface#

interface DocxWriteOptions
PropertyTypeDescription
trackRevisionsoptionalboolean—
zoomoptionalnumber—
pageCountoptionalnumber—
pagesoptionalDocxPageMap—
compressoptionalboolean—
nowoptionalDate—
preserveSourceoptionalboolean | 'exact'—

Defined in packages/document/src/docx/writer.ts:90

EmbeddedObjectFileinterface#

interface EmbeddedObjectFile
PropertyTypeDescription
fileNamestring—
mimeTypestring—
progIdstring—
dataUint8Array—

Defined in packages/document/src/docx/embedded.ts:30

EmbeddedObjectInputinterface#

interface EmbeddedObjectInput
PropertyTypeDescription
dataUint8Array | ArrayBuffer—
fileNamestring—
mimeTypeoptionalstring—
asIconoptionalboolean—
iconoptionalstring—
widthoptionalnumber—
heightoptionalnumber—

Defined in packages/document/src/docx/embedded.ts:20

FieldContextinterface#

interface FieldContext
PropertyTypeDescription
nowoptionalDate—
valuesoptionalRecord<string, unknown>—
pagesoptionalRecord<string, number>—
pageCountoptionalnumber—

Defined in packages/document/src/model/fields.ts:37

FileIconSvgOptionsinterface#

interface FileIconSvgOptions
PropertyTypeDescription
widthoptionalnumber—
heightoptionalnumber—
titleoptionalstring—

Defined in packages/document/src/docx/file-icon.ts:136

FileTypeInfointerface#

interface FileTypeInfo
PropertyTypeDescription
kindFileKind—
labelFileTypeLabel—
extensionstringLower-case extension without the dot; empty when nothing is known.
badgestringUp to four upper-case characters for the icon.
mimeTypestring—
sourceFileTypeSource—

Defined in packages/document/src/docx/file-type.ts:28

FileTypeInputinterface#

interface FileTypeInput
PropertyTypeDescription
progIdoptionalstring | null—
fileNameoptionalstring | null—
mimeTypeoptionalstring | null—
partNameoptionalstring | null—
dataoptionalUint8Array | null—

Defined in packages/document/src/docx/file-type.ts:39

HtmlDocumentOptionsinterface#

interface HtmlDocumentOptions
PropertyTypeDescription
fullDocumentoptionalboolean—
titleoptionalstring—
includeDeletedoptionalboolean—
linkSchemesoptionalreadonly string[]Schemes written as links that can be followed, besides http, https, mailto and tel.

Defined in packages/document/src/formats/html.ts:23

MarkdownOptionsinterface#

interface MarkdownOptions
PropertyTypeDescription
includeDeletedoptionalboolean—

Defined in packages/document/src/formats/markdown.ts:21

MergeOptionsinterface#

interface MergeOptions
PropertyTypeDescription
missingoptional'empty' | 'keep' | 'placeholder'—
localeoptionalstring—
currencyoptionalstring—

Defined in packages/document/src/types.ts:643

MetafileOptionsinterface#

interface MetafileOptions
PropertyTypeDescription
embeddedEmfoptionalboolean—

Defined in packages/document/src/docx/metafile.ts:580

NumberingDefinitionsinterface#

interface NumberingDefinitions

Defined in packages/document/src/model/numbering.ts:52

NumberingInstanceinterface#

interface NumberingInstance
PropertyTypeDescription
idnumber—
abstractIdnumber—
overridesoptionalNumberingOverride[]—

Defined in packages/document/src/model/numbering.ts:46

NumberingLabelinterface#

interface NumberingLabel
PropertyTypeDescription
pathnumber[]—
labelstring—
levelnumber—
numIdnumber | null—
formatstring—
suffix'tab' | 'space' | 'nothing'—
textstring—

Defined in packages/document/src/model/numbering.ts:57

NumberingLevelinterface#

interface NumberingLevel
PropertyTypeDescription
levelnumber—
startnumber—
formatstring—
textstring—
suffixoptional'tab' | 'space' | 'nothing'—
restartoptionalnumber—
paragraphStyleoptionalstring—
isLegaloptionalboolean—
alignoptionalstring—
indentLeftoptionalnumber—
hangingoptionalnumber—
fontoptionalstring—
runoptionalNumberingRun—

Defined in packages/document/src/model/numbering.ts:15

NumberingOverrideinterface#

interface NumberingOverride
PropertyTypeDescription
levelnumber—
startoptionalnumber—
definitionoptionalNumberingLevel—

Defined in packages/document/src/model/numbering.ts:40

PageSetupinterface#

interface PageSetup
PropertyTypeDescription
sizePageSizeName | { width: number; height: number }—
orientationPageOrientation—
marginsPageMargins—
headerDistancenumber—
footerDistancenumber—
differentFirstPageboolean—
gutteroptionalnumber—
columnsoptionalSectionColumns | null—
sectionTypeoptionalSectionBreakType | null—
pageNumbersoptionalPageNumbering | null—
verticalAlignoptional'top' | 'center' | 'bottom' | 'justify' | null—
rtloptionalboolean—
lineNumbersoptionalLineNumbering | null—
pageBordersoptionalPageBorders | null—
docxoptionalPreservedXml | null—
changeoptionalSectionFormatChange | null—

Defined in packages/document/src/types.ts:52

ParagraphStyleDefinitioninterface#

interface ParagraphStyleDefinition
PropertyTypeDescription
idParagraphStyleId—
wordNamestring—
labelstring—
tag'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'blockquote' | 'pre'—
fontSizeoptionalnumber—
fontFamilyoptionalstring—
boldoptionalboolean—
italicoptionalboolean—
coloroptionalstring—
spaceBeforeoptionalnumber—
spaceAfteroptionalnumber—
lineHeightoptionalnumber—
alignoptionalTextAlignment—
indentLeftoptionalnumber—
indentRightoptionalnumber—
outlineLeveloptionalnumber—
keepWithNextoptionalboolean—
shadingoptionalstring—

Defined in packages/document/src/model/paragraph-styles.ts:3

ParsedFieldinterface#

interface ParsedField
PropertyTypeDescription
keywordstring—
kindFieldKind | 'link'—
namestring—
argsstring[]—
switchesRecord<string, string | true>—
hrefstring | null—
titlestring | null—
canonicalstring—
placeholderstring | null—

Defined in packages/document/src/model/fields.ts:25

PdfClusterinterface#

interface PdfCluster
PropertyTypeDescription
xnumber—
widthnumber—
lengthnumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:47

PdfColorinterface#

interface PdfColor
PropertyTypeDescription
rnumber—
gnumber—
bnumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:1

PdfDestinationinterface#

interface PdfDestination
PropertyTypeDescription
kind'destination'—
namestring—
ynumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:144

PdfDocumentLayoutinterface#

interface PdfDocumentLayout
PropertyTypeDescription
pagesPdfPage[]—
outlineoptionalPdfOutlineEntry[]—
titleoptionalstring—
authoroptionalstring—
subjectoptionalstring—
keywordsoptionalstring—
languageoptionalstring—
fontsoptionalreadonly PdfFontSource[]—
structureoptionalreadonly PdfStructNode[]—
pdfAoptionalboolean—
createdoptionalDate—
modifiedoptionalDate—

Defined in packages/document/src/layout/pdf/layout-tree.ts:182

PdfFontSourceinterface#

interface PdfFontSource
PropertyTypeDescription
familystring—
boldoptionalboolean—
italicoptionalboolean—
dataUint8Array—

Defined in packages/document/src/layout/pdf/layout-tree.ts:175

PdfGroupinterface#

interface PdfGroup extends PdfTagging
PropertyTypeDescription
kind'group'—
itemsPdfItem[]—
matrixoptionalPdfMatrix—
clipoptional{ x: number; y: number; width: number; height: number }—
opacityoptionalnumber—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:152

PdfImageinterface#

interface PdfImage extends PdfTagging
PropertyTypeDescription
kind'image'—
xnumber—
ynumber—
widthnumber—
heightnumber—
dataUint8Array—
mime'image/jpeg' | 'image/png'—
altoptionalstring—
rotationoptionalnumber—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:121

PdfLineinterface#

interface PdfLine extends PdfTagging
PropertyTypeDescription
kind'line'—
x1number—
y1number—
x2number—
y2number—
coloroptionalPdfColor—
widthoptionalnumber—
dashoptionalreadonly number[]—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:93

PdfLinkAreainterface#

interface PdfLinkArea
PropertyTypeDescription
kind'link'—
xnumber—
ynumber—
widthnumber—
heightnumber—
hrefoptionalstring—
destinationoptionalstring—
structoptionalnumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:133

PdfOutlineEntryinterface#

interface PdfOutlineEntry
PropertyTypeDescription
titlestring—
levelnumber—
pagenumber—
ynumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:168

PdfPageinterface#

interface PdfPage
PropertyTypeDescription
widthnumber—
heightnumber—
itemsPdfItem[]—

Defined in packages/document/src/layout/pdf/layout-tree.ts:162

PdfPathinterface#

interface PdfPath extends PdfTagging
PropertyTypeDescription
kind'path'—
commandsreadonly PdfPathCommand[]—
filloptionalPdfColor—
strokeoptionalPdfColor—
strokeWidthoptionalnumber—
dashoptionalreadonly number[]—
roundCapsoptionalboolean—
roundJoinsoptionalboolean—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:110

PdfRectinterface#

interface PdfRect extends PdfTagging
PropertyTypeDescription
kind'rect'—
xnumber—
ynumber—
widthnumber—
heightnumber—
filloptionalPdfColor—
strokeoptionalPdfColor—
strokeWidthoptionalnumber—
dashoptionalreadonly number[]—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:81

PdfStructNodeinterface#

interface PdfStructNode
PropertyTypeDescription
typePdfStructType—
parentnumber—
altoptionalstring—
languageoptionalstring—

Defined in packages/document/src/layout/pdf/layout-tree.ts:35

PdfTagginginterface#

interface PdfTagging
PropertyTypeDescription
structoptionalnumber—
artifactoptionalPdfArtifactType—

Defined in packages/document/src/layout/pdf/layout-tree.ts:42

PdfTextRuninterface#

interface PdfTextRun extends PdfTagging
PropertyTypeDescription
kind'text'—
xnumber—
baselinenumber—
widthnumber—
textstring—
fontFamilystring—
fontSizenumber—
boldoptionalboolean—
italicoptionalboolean—
coloroptionalPdfColor—
underlineoptionalboolean—
underlineStyleoptionalPdfUnderlineStyleThe line drawn for underline; a single line when left out.
underlineColoroptionalPdfColorThe colour of the underline; the colour of the text when left out.
strikeoptionalboolean—
doubleStrikeoptionalboolean—
backgroundoptionalPdfColor—
directionoptional'ltr' | 'rtl'—
clustersoptionalreadonly PdfCluster[]—
trailingSpaceoptionalboolean—
decorationoptional{ x: number; width: number }—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:55

PdfWriteOptionsinterface#

interface PdfWriteOptions
PropertyTypeDescription
compressoptionalboolean—
creationDateoptionalDate—
produceroptionalstring—
pdfAoptionalboolean—
taggedoptionalboolean—

Defined in packages/document/src/layout/pdf/writer.ts:29

PdfWriteResultinterface#

interface PdfWriteResult
PropertyTypeDescription
bytesUint8Array—
warningsstring[]—

Defined in packages/document/src/layout/pdf/writer.ts:37

SearchBlockinterface#

interface SearchBlock
PropertyTypeDescription
textstring—
startnumber—

Defined in packages/document/src/model/search.ts:3

SearchMatchinterface#

interface SearchMatch
PropertyTypeDescription
fromnumber—
tonumber—
groupsstring[]—

Defined in packages/document/src/model/search.ts:8

UnzipOptionsinterface#

interface UnzipOptions
PropertyTypeDescription
limitsoptionalPartial<ZipLimits>—

Defined in packages/document/src/docx/errors.ts:10

ZipLimitsinterface#

interface ZipLimits
PropertyTypeDescription
maxEntriesnumber—
maxEntryBytesnumber—
maxTotalBytesnumber—
maxRationumber—

Defined in packages/document/src/docx/errors.ts:1

DocFormatCodetype#

type DocFormatCode =
  'not-a-doc' | 'encrypted' | 'unsupported-version' | 'too-large' | 'too-many-characters' | 'corrupt';

Defined in packages/document/src/doc/errors.ts:1

DocumentFormatCodetype#

type DocumentFormatCode =
  'encrypted-or-legacy-doc' | 'encrypted-entry' | 'not-a-zip' | 'not-a-word-document' | 'xml-too-deep';

Defined in packages/document/src/docx/errors.ts:39

DocumentInputtype#

type DocumentInput = Partial<DocumentData> | DocNodeJSON;

Defined in packages/document/src/types.ts:544

FieldKindtype#

type FieldKind =
  | 'merge'
  | 'page'
  | 'pages'
  | 'date'
  | 'time'
  | 'ref'
  | 'pageref'
  | 'noteref'
  | 'seq'
  | 'if'
  | 'toc'
  | 'styleref'
  | 'property'
  | 'form'
  | 'citation'
  | 'bibliography'
  | 'other';

Defined in packages/document/src/model/fields.ts:6

FileKindtype#

type FileKind =
  'word' | 'excel' | 'powerpoint' | 'pdf' | 'email' | 'image' | 'text' | 'archive' | 'media' | 'file';

Defined in packages/document/src/docx/file-type.ts:5

FileTypeLabeltype#

type FileTypeLabel =
  | 'word'
  | 'excel'
  | 'powerpoint'
  | 'document'
  | 'spreadsheet'
  | 'presentation'
  | 'pdf'
  | 'outlook'
  | 'email'
  | 'image'
  | 'text'
  | 'csv'
  | 'archive'
  | 'audio'
  | 'video'
  | 'file';

Defined in packages/document/src/docx/file-type.ts:8

FileTypeSourcetype#

type FileTypeSource = 'progId' | 'fileName' | 'contentType' | 'content' | 'none';

Defined in packages/document/src/docx/file-type.ts:26

ImageSourceKindtype#

type ImageSourceKind = 'embedded' | 'remote' | 'none';

Defined in packages/document/src/model/url.ts:7

MergeValuestype#

type MergeValues = Record<string, unknown>;

Defined in packages/document/src/types.ts:641

PdfArtifactTypetype#

type PdfArtifactType = 'header' | 'footer' | 'watermark' | 'pagination' | 'layout';

Defined in packages/document/src/layout/pdf/layout-tree.ts:7

PdfFontLoadertype#

type PdfFontLoader = (
  family: string,
  style: { bold: boolean; italic: boolean },
) => Promise<ArrayBuffer | Uint8Array | null>;

Defined in packages/document/src/layout/pdf/font-loading.ts:5

PdfItemtype#

type PdfItem = PdfTextRun | PdfRect | PdfLine | PdfPath | PdfImage | PdfLinkArea | PdfDestination | PdfGroup;

Defined in packages/document/src/layout/pdf/layout-tree.ts:160

PdfMatrixtype#

type PdfMatrix = readonly [number, number, number, number, number, number];

Defined in packages/document/src/layout/pdf/layout-tree.ts:150

PdfPathCommandtype#

type PdfPathCommand =
  | readonly ['M', number, number]
  | readonly ['L', number, number]
  | readonly ['C', number, number, number, number, number, number]
  | readonly ['Z'];

Defined in packages/document/src/layout/pdf/layout-tree.ts:104

PdfStructTypetype#

type PdfStructType =
  | 'P'
  | 'H1'
  | 'H2'
  | 'H3'
  | 'H4'
  | 'H5'
  | 'H6'
  | 'L'
  | 'LI'
  | 'Lbl'
  | 'LBody'
  | 'Table'
  | 'TR'
  | 'TH'
  | 'TD'
  | 'Figure'
  | 'Link'
  | 'Note'
  | 'Span'
  | 'TOC'
  | 'TOCI'
  | 'Sect'
  | 'BlockQuote'
  | 'Code';

Defined in packages/document/src/layout/pdf/layout-tree.ts:9

PdfUnderlineStyletype#

type PdfUnderlineStyle = 'single' | 'double' | 'thick' | 'dotted' | 'dash' | 'dotDash' | 'wave';

Defined in packages/document/src/layout/pdf/layout-tree.ts:53

ZipLimitCodetype#

type ZipLimitCode = 'too-many-entries' | 'entry-too-large' | 'archive-too-large' | 'ratio-too-high';

Defined in packages/document/src/docx/errors.ts:8

@birchui/document/locales#

DOCUMENT_LOCALESconst#

const DOCUMENT_LOCALES: Record<string, Record<string, string>>

Defined in packages/document/src/locales/index.ts:11

documentDeconst#

const documentDe: Record<string, string>

Defined in packages/document/src/locales/de.ts:8

documentEnconst#

const documentEn: Record<string, string>

Defined in packages/document/src/locales/en.ts:8

documentEsconst#

const documentEs: Record<string, string>

Defined in packages/document/src/locales/es.ts:8

documentFrconst#

const documentFr: Record<string, string>

Defined in packages/document/src/locales/fr.ts:8

documentJaconst#

const documentJa: Record<string, string>

Defined in packages/document/src/locales/ja.ts:8

documentPtconst#

const documentPt: Record<string, string>

Defined in packages/document/src/locales/pt.ts:8

documentZhconst#

const documentZh: Record<string, string>

Defined in packages/document/src/locales/zh.ts:8

@birchui/document/pdf#

clearRegisteredFontsfunction#

function clearRegisteredFonts(): void

Defined in packages/document/src/layout/pdf/font-substitution.ts:89

documentToPdffunction#

function documentToPdf(input: DocumentInput, options: DocumentPdfOptions = {}): Promise<Uint8Array>
ParameterTypeDescription
inputDocumentInput—
optionsoptionalDocumentPdfOptions—

Defined in packages/document/src/layout/pdf/document-layout.ts:471

fontFamilyStackfunction#

function fontFamilyStack(fontFamily: string): string

A CSS font-family list that puts the metric-compatible substitutes right after each requested family.

ParameterTypeDescription
fontFamilystring—

Defined in packages/document/src/layout/pdf/font-substitution.ts:48

fontSubstitutesfunction#

function fontSubstitutes(family: string): readonly string[]
ParameterTypeDescription
familystring—

Defined in packages/document/src/layout/pdf/font-substitution.ts:36

layoutDocumentfunction#

function layoutDocument(input: DocumentInput, options: DocumentPdfOptions = {}): { layout: PdfDocumentLayout; warnings: string[]; missingFonts: string[] }
ParameterTypeDescription
inputDocumentInput—
optionsoptionalDocumentPdfOptions—

Defined in packages/document/src/layout/pdf/document-layout.ts:105

layoutToPdffunction#

function layoutToPdf(layout: PdfDocumentLayout, options: PdfWriteOptions = {}): Promise<Uint8Array>
ParameterTypeDescription
layoutPdfDocumentLayout—
optionsoptionalPdfWriteOptions—

Defined in packages/document/src/layout/pdf/writer.ts:722

multiplyMatrixfunction#

function multiplyMatrix(first: PdfMatrix, second: PdfMatrix): PdfMatrix
ParameterTypeDescription
firstPdfMatrix—
secondPdfMatrix—

Defined in packages/document/src/layout/pdf/layout-tree.ts:204

registeredFontsfunction#

function registeredFonts(): readonly PdfFontSource[]

Defined in packages/document/src/layout/pdf/font-substitution.ts:85

registerFontsfunction#

function registerFonts(fonts: readonly PdfFontSource[]): void

Makes font files available to every PDF written afterwards, in the browser and on a server, in addition to the fonts passed with a single call. Registering a face again replaces it.

ParameterTypeDescription
fontsreadonly PdfFontSource[]—

Defined in packages/document/src/layout/pdf/font-substitution.ts:70

renderDocumentPdffunction#

function renderDocumentPdf(input: DocumentInput, options: DocumentPdfOptions = {}): Promise<DocumentPdfResult>
ParameterTypeDescription
inputDocumentInput—
optionsoptionalDocumentPdfOptions—

Defined in packages/document/src/layout/pdf/document-layout.ts:457

rotationMatrixfunction#

function rotationMatrix(degrees: number, centerX: number, centerY: number): PdfMatrix
ParameterTypeDescription
degreesnumber—
centerXnumber—
centerYnumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:197

writePdffunction#

function writePdf(layout: PdfDocumentLayout, options: PdfWriteOptions = {}): Promise<PdfWriteResult>
ParameterTypeDescription
layoutPdfDocumentLayout—
optionsoptionalPdfWriteOptions—

Defined in packages/document/src/layout/pdf/writer.ts:613

PdfFontErrorclass#

class PdfFontError extends Error
new PdfFontError(readonly families: readonly string[])
MemberTypeDescription
codereadonly"pdfa-fonts-missing"—
familiesreadonlyreadonly string[]—

Defined in packages/document/src/layout/pdf/font-substitution.ts:97

FONT_SUBSTITUTIONSconst#

const FONT_SUBSTITUTIONS: Readonly<Record<string, readonly string[]>>

Fonts with the same advance widths as the font they replace, so text set in the substitute breaks at the same places. Carlito and Caladea match Calibri and Cambria; the Liberation and Croscore families match Arial, Times New Roman and Courier New; Gelasio matches Georgia and Selawik matches Segoe UI.

Defined in packages/document/src/layout/pdf/font-substitution.ts:8

DocumentPdfOptionsinterface#

interface DocumentPdfOptions extends PdfWriteOptions
PropertyTypeDescription
fontsoptionalreadonly PdfFontSource[]—
titleoptionalstring—
authoroptionalstring—
subjectoptionalstring—
keywordsoptionalstring—
languageoptionalstring—
outlineoptionalboolean—
compressoptionalboolean | undefinedInherited from PdfWriteOptions.
creationDateoptionalDate | undefinedInherited from PdfWriteOptions.
produceroptionalstring | undefinedInherited from PdfWriteOptions.
pdfAoptionalboolean | undefinedInherited from PdfWriteOptions.
taggedoptionalboolean | undefinedInherited from PdfWriteOptions.

Defined in packages/document/src/layout/pdf/document-layout.ts:28

DocumentPdfResultinterface#

interface DocumentPdfResult
PropertyTypeDescription
bytesUint8Array—
warningsstring[]—
pageCountnumber—
missingFontsstring[]Font families the document asks for that had no font file and no metric-compatible substitute.

Defined in packages/document/src/layout/pdf/document-layout.ts:38

PdfClusterinterface#

interface PdfCluster
PropertyTypeDescription
xnumber—
widthnumber—
lengthnumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:47

PdfColorinterface#

interface PdfColor
PropertyTypeDescription
rnumber—
gnumber—
bnumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:1

PdfDestinationinterface#

interface PdfDestination
PropertyTypeDescription
kind'destination'—
namestring—
ynumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:144

PdfDocumentLayoutinterface#

interface PdfDocumentLayout
PropertyTypeDescription
pagesPdfPage[]—
outlineoptionalPdfOutlineEntry[]—
titleoptionalstring—
authoroptionalstring—
subjectoptionalstring—
keywordsoptionalstring—
languageoptionalstring—
fontsoptionalreadonly PdfFontSource[]—
structureoptionalreadonly PdfStructNode[]—
pdfAoptionalboolean—
createdoptionalDate—
modifiedoptionalDate—

Defined in packages/document/src/layout/pdf/layout-tree.ts:182

PdfFontSourceinterface#

interface PdfFontSource
PropertyTypeDescription
familystring—
boldoptionalboolean—
italicoptionalboolean—
dataUint8Array—

Defined in packages/document/src/layout/pdf/layout-tree.ts:175

PdfGroupinterface#

interface PdfGroup extends PdfTagging
PropertyTypeDescription
kind'group'—
itemsPdfItem[]—
matrixoptionalPdfMatrix—
clipoptional{ x: number; y: number; width: number; height: number }—
opacityoptionalnumber—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:152

PdfImageinterface#

interface PdfImage extends PdfTagging
PropertyTypeDescription
kind'image'—
xnumber—
ynumber—
widthnumber—
heightnumber—
dataUint8Array—
mime'image/jpeg' | 'image/png'—
altoptionalstring—
rotationoptionalnumber—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:121

PdfLineinterface#

interface PdfLine extends PdfTagging
PropertyTypeDescription
kind'line'—
x1number—
y1number—
x2number—
y2number—
coloroptionalPdfColor—
widthoptionalnumber—
dashoptionalreadonly number[]—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:93

PdfLinkAreainterface#

interface PdfLinkArea
PropertyTypeDescription
kind'link'—
xnumber—
ynumber—
widthnumber—
heightnumber—
hrefoptionalstring—
destinationoptionalstring—
structoptionalnumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:133

PdfOutlineEntryinterface#

interface PdfOutlineEntry
PropertyTypeDescription
titlestring—
levelnumber—
pagenumber—
ynumber—

Defined in packages/document/src/layout/pdf/layout-tree.ts:168

PdfPageinterface#

interface PdfPage
PropertyTypeDescription
widthnumber—
heightnumber—
itemsPdfItem[]—

Defined in packages/document/src/layout/pdf/layout-tree.ts:162

PdfPathinterface#

interface PdfPath extends PdfTagging
PropertyTypeDescription
kind'path'—
commandsreadonly PdfPathCommand[]—
filloptionalPdfColor—
strokeoptionalPdfColor—
strokeWidthoptionalnumber—
dashoptionalreadonly number[]—
roundCapsoptionalboolean—
roundJoinsoptionalboolean—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:110

PdfRectinterface#

interface PdfRect extends PdfTagging
PropertyTypeDescription
kind'rect'—
xnumber—
ynumber—
widthnumber—
heightnumber—
filloptionalPdfColor—
strokeoptionalPdfColor—
strokeWidthoptionalnumber—
dashoptionalreadonly number[]—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:81

PdfStructNodeinterface#

interface PdfStructNode
PropertyTypeDescription
typePdfStructType—
parentnumber—
altoptionalstring—
languageoptionalstring—

Defined in packages/document/src/layout/pdf/layout-tree.ts:35

PdfTagginginterface#

interface PdfTagging
PropertyTypeDescription
structoptionalnumber—
artifactoptionalPdfArtifactType—

Defined in packages/document/src/layout/pdf/layout-tree.ts:42

PdfTextRuninterface#

interface PdfTextRun extends PdfTagging
PropertyTypeDescription
kind'text'—
xnumber—
baselinenumber—
widthnumber—
textstring—
fontFamilystring—
fontSizenumber—
boldoptionalboolean—
italicoptionalboolean—
coloroptionalPdfColor—
underlineoptionalboolean—
underlineStyleoptionalPdfUnderlineStyleThe line drawn for underline; a single line when left out.
underlineColoroptionalPdfColorThe colour of the underline; the colour of the text when left out.
strikeoptionalboolean—
doubleStrikeoptionalboolean—
backgroundoptionalPdfColor—
directionoptional'ltr' | 'rtl'—
clustersoptionalreadonly PdfCluster[]—
trailingSpaceoptionalboolean—
decorationoptional{ x: number; width: number }—
structoptionalnumber | undefinedInherited from PdfTagging.
artifactoptionalPdfArtifactType | undefinedInherited from PdfTagging.

Defined in packages/document/src/layout/pdf/layout-tree.ts:55

PdfWriteOptionsinterface#

interface PdfWriteOptions
PropertyTypeDescription
compressoptionalboolean—
creationDateoptionalDate—
produceroptionalstring—
pdfAoptionalboolean—
taggedoptionalboolean—

Defined in packages/document/src/layout/pdf/writer.ts:29

PdfWriteResultinterface#

interface PdfWriteResult
PropertyTypeDescription
bytesUint8Array—
warningsstring[]—

Defined in packages/document/src/layout/pdf/writer.ts:37

PdfArtifactTypetype#

type PdfArtifactType = 'header' | 'footer' | 'watermark' | 'pagination' | 'layout';

Defined in packages/document/src/layout/pdf/layout-tree.ts:7

PdfFontLoadertype#

type PdfFontLoader = (
  family: string,
  style: { bold: boolean; italic: boolean },
) => Promise<ArrayBuffer | Uint8Array | null>;

Defined in packages/document/src/layout/pdf/font-loading.ts:5

PdfItemtype#

type PdfItem = PdfTextRun | PdfRect | PdfLine | PdfPath | PdfImage | PdfLinkArea | PdfDestination | PdfGroup;

Defined in packages/document/src/layout/pdf/layout-tree.ts:160

PdfMatrixtype#

type PdfMatrix = readonly [number, number, number, number, number, number];

Defined in packages/document/src/layout/pdf/layout-tree.ts:150

PdfPathCommandtype#

type PdfPathCommand =
  | readonly ['M', number, number]
  | readonly ['L', number, number]
  | readonly ['C', number, number, number, number, number, number]
  | readonly ['Z'];

Defined in packages/document/src/layout/pdf/layout-tree.ts:104

PdfStructTypetype#

type PdfStructType =
  | 'P'
  | 'H1'
  | 'H2'
  | 'H3'
  | 'H4'
  | 'H5'
  | 'H6'
  | 'L'
  | 'LI'
  | 'Lbl'
  | 'LBody'
  | 'Table'
  | 'TR'
  | 'TH'
  | 'TD'
  | 'Figure'
  | 'Link'
  | 'Note'
  | 'Span'
  | 'TOC'
  | 'TOCI'
  | 'Sect'
  | 'BlockQuote'
  | 'Code';

Defined in packages/document/src/layout/pdf/layout-tree.ts:9

PdfUnderlineStyletype#

type PdfUnderlineStyle = 'single' | 'double' | 'thick' | 'dotted' | 'dash' | 'dotDash' | 'wave';

Defined in packages/document/src/layout/pdf/layout-tree.ts:53

↑ ↓ to move, Enter to open, Esc to close