/** * DOCX Module - Base Exports (Platform Independent) * * Shared exports for both Node.js and browser environments. * * Each export is annotated with a `@stability` tag: * * - `@stability stable` — Public API. Backwards-compatible changes only; * semver-major bumps for any breaking changes. * - `@stability experimental` — Public but evolving. The shape may change * without a major version bump while we collect feedback. Consumers * should pin to exact minor versions if they rely on these. * - `@stability preserve-only` — Round-trip preservation types. They exist * so reading and writing a DOCX is loss-less; the underlying schema is * not yet promised to be ergonomic. Avoid building features on top of * them unless you also handle the underlying OOXML directly. * * Tree-shakeable subpaths: HTML/Markdown/Excel/PDF integrations live under * `excelts/word/{html,markdown,excel}` and `excelts/pdf` — they are not * re-exported here so bundlers can drop them when unused. */ /** @stability stable */ export type { HalfPoint, Twips, Emu, EighthPoint, HexColor, ShadingType, BorderStyle, PageOrientation, PageSize, PageMargins, ColumnDef, SectionColumns, SectionBreakType, PageNumberFormat, HeaderFooterType, HeaderFooterRef, PageVerticalAlign, DocumentGridType, Border, ArtBorderType, PageBorders, SectionProperties, UnderlineStyle, VerticalAlign, HighlightColor, FontSpec, Shading, UnderlineSpec, TextEffect, EmphasisMarkType, EastAsianCombineBrackets, EastAsianLayoutSpec, ColorSpec, RunProperties, RunContent, TextContent, BreakContent, TabContent, PositionalTabContent, RubyContent, RubyAlign, RubyProperties, SymbolContent, FootnoteRefContent, EndnoteRefContent, FieldContent, InlineImageContent, CarriageReturnContent, NoBreakHyphenContent, SoftHyphenContent, LastRenderedPageBreakContent, AnnotationReferenceContent, PageNumberType, DateFieldContent, Run, RevisionInfo, InsertedRun, DeletedRun, MovedFromRun, MovedToRun, MoveRangeMarker, CustomXmlTrackingMarker, ParagraphPropertyChange, RunPropertyChange, SectionPropertyChange, TableRowRevision, CommentDef, CommentRangeStart, CommentRangeEnd, CommentReference, Alignment, LineSpacingRule, LineSpacing, Indentation, TabStopType, TabStopLeader, TabStop, PositionalTabAlignment, PositionalTabRelativeTo, PositionalTabLeader, ParagraphBorders, NumberingRef, FrameAnchorType, DropCapType, ParagraphFrame, ParagraphProperties, Paragraph, Hyperlink, BookmarkStart, BookmarkEnd, ParagraphChild, TableWidth, TableBorders, TableCellMargins, TableLayout, TableLook, TableFloat, TableProperties, RowHeightRule, TableRowProperties, VerticalCellAlign, TextDirection, VerticalMerge, TableCellProperties, TableCell, TableRow, Table, HorizontalPositionRelative, VerticalPositionRelative, WrapStyle, WrapTextSide, WrapMargins, FloatingImage, DrawingShape, PresetShapeType, Chart, ChartType, ChartSeries, ChartLegendPosition, ChartAxis, ChartContent, ChartExContent, ChartExData, ChartExSeriesData, ChartTrendline, ChartTrendlineType, ChartErrorBars, ChartErrorBarDirection, ChartErrorBarType, ChartDataLabels, ChartDataLabelPosition, AltChunk, WebSettings, PersonInfo, NoteType, FootnoteProperties, EndnoteProperties, NoteNumberFormat, NoteNumberRestart, TablePropertyChange, TableRowPropertyChange, TableCellPropertyChange, CellMergeRevision, DocxDocumentType, TableOfContents, MathRun, MathFraction, MathSuperScript, MathSubScript, MathSubSuperScript, MathPreSubSuperScript, MathPhantom, MathGroupChar, MathBorderBox, MathRadical, MathDelimiter, MathNary, MathFunction, MathLimit, MathMatrix, MathAccent, MathBar, MathBox, MathEquationArray, MathContent, MathBlock, TextBox, CheckBox, SdtListItem, SdtDateProperties, SdtProperties, SdtDataBinding, SdtCheckboxProperties, SdtRepeatingSectionProperties, StructuredDocumentTag, CustomXmlPart, FormFieldType, FormField, TextFormField, CheckBoxFormField, DropDownFormField, Watermark, TextWatermark, ImageWatermark, BodyContent, StyleType, TableStyleConditionType, TableStyleConditionalFormat, StyleDef, DocDefaults, NumberFormat, LevelJustification, LevelSuffix, NumberingLevel, MultiLevelType, AbstractNumbering, LevelOverride, NumberingInstance, NumPicBullet, HeaderFooterContent, HeaderDef, FooterDef, FootnoteDef, EndnoteDef, ImageMediaType, ImageDef, FontFamily, FontPitch, FontDef, EmbeddedFont, ProtectionType, HyphenationSettings, DocumentSettings, CompatSetting, CompatFlag, DocumentBackground, DocumentTheme, ThemeColorScheme, ThemeFontScheme, ThemeFont, ThemeFormatScheme, ThemeColorName, CustomPropertyValue, CustomProperty, CoreProperties, AppProperties, DocxDocument, DocxOptions } from "./types.js"; /** @stability preserve-only */ export type { OpaquePart, OpaqueRelationship, OpaqueDrawing, OpaqueRunContent, OpaqueParagraphChild, OleObjectPart } from "./types.js"; /** @stability stable */ export { DocxError, DocxParseError, DocxWriteError, DocxMissingPartError, DocxInvalidStructureError, DocxUnsupportedFeatureError, DocxEncryptedError, DocxDecryptionError, DocxLimitExceededError, isDocxError } from "./errors.js"; /** @stability stable */ export { inchesToTwips, twipsToInches, cmToTwips, twipsToCm, ptToTwips, twipsToPt, mmToTwips, inchesToEmu, emuToInches, cmToEmu, emuToCm, ptToEmu, pxToEmu, emuToPx, ptToHalfPoint, halfPointToPt, ptToEighthPoint, eighthPointToPt, lineMultiplierToSpacing, spacingToLineMultiplier, percentToTablePct, tablePctToPercent } from "./units.js"; /** @stability stable */ export { Document } from "./builder/document-handle.js"; /** @stability stable */ export type { DocumentHandle } from "./builder/document-handle.js"; /** @stability stable — Run / Field / Math / shape / chart / SDT builders */ export { text, bold, italic, underline, strikethrough, pageBreak, lineBreak, columnBreak, tab, positionalTab, ruby, carriageReturn, noBreakHyphen, softHyphen, field, pageNumberField, totalPagesField, sectionPagesField, sectionField, dateField, sequenceField, timeField, authorField, titleField, subjectField, keywordsField, fileNameField, fileSizeField, styleRefField, refField, pageRefField, noteRefField, hyperlinkField, quoteField, tocField, tcField, indexEntryField, indexField, ifField, includeTextField, includePictureField, formTextField, formCheckboxField, formDropdownField, checkBox, mathBlock, mathRun, mathFraction, mathSqrt, mathRoot, mathSum, mathIntegral, mathProduct, mathSuperScript, mathSubScript, mathSubSuperScript, mathPreSubSuperScript, mathPhantom, mathGroupChar, mathBorderBox, mathDelimiter, mathNary, mathFunction, mathLimit, mathMatrix, mathAccent, mathBar, mathBox, mathEquationArray, symbol, floatingImage, drawingShape, chart, structuredDocumentTag } from "./builder/run-builders.js"; /** @stability stable — paragraph / hyperlink / comment / track-changes builders */ export { paragraph, textParagraph, heading, hyperlink, bookmarkStart, bookmarkEnd, commentRangeStart, commentRangeEnd, commentReference, insertedRun, deletedRun, movedFromRun, movedToRun, moveFromRangeStart, moveFromRangeEnd, moveToRangeStart, moveToRangeEnd } from "./builder/paragraph-builders.js"; /** @stability stable — table builders */ export { border, gridBorders, cell, row, table, simpleTable } from "./builder/table-builders.js"; /** @stability stable — theme color resolution */ export { resolveThemeColor } from "./core/color-utils.js"; /** @stability stable — search / queries */ export { paragraphCount, countWords, getHeadings, findBookmark, findComment, listImages, listTables, listHyperlinks, listSections, tableCount, extractText, searchText } from "./query/search.js"; /** @stability stable */ export type { SearchResult, DocumentHeading, DocumentSection } from "./query/search.js"; /** @stability stable */ export { replaceText } from "./query/replace.js"; /** @stability stable */ export { mailMerge } from "./query/mail-merge.js"; /** @stability stable */ export { mergeDocuments } from "./query/merge.js"; /** @stability stable */ export type { MergeOptions } from "./query/merge.js"; /** @stability stable */ export { splitDocument } from "./query/split.js"; /** @stability stable */ export type { SplitOptions } from "./query/split.js"; /** @stability stable */ export { acceptAllRevisions, rejectAllRevisions, listRevisions, acceptRevision, rejectRevision } from "./query/revisions.js"; /** @stability stable */ export type { RevisionEntry } from "./query/revisions.js"; /** @stability stable */ export { resolveStyle, resolveRunStyle, resolveNumberingLevel, resolveTableStyle } from "./query/style-resolve.js"; /** @stability stable */ export type { StyleResolveContext, ResolvedParagraphStyle, ResolvedRunStyle, ResolvedNumberingLevel } from "./query/style-resolve.js"; /** @stability stable */ export { getCompatibilityMode, setCompatibilityMode } from "./query/compat.js"; /** @stability stable */ export type { CompatibilityMode } from "./query/compat.js"; /** @stability stable */ export { resolveDataBindings } from "./query/data-binding.js"; /** @stability stable */ export { extractFormFields, fillFormFields } from "./query/form-fields.js"; /** @stability stable */ export type { FormFieldEntry } from "./query/form-fields.js"; /** @stability stable */ export type { PatchContent, PatchOperation, PatchOptions, CompiledTemplate } from "./document-io.js"; export type { IncrementalEdit, IncrementalEditOptions } from "./incremental-edit.js"; export { editDocxIncremental, listDocxParts, readDocxPart } from "./incremental-edit.js"; /** @stability stable */ export { packageDocx } from "./writer/docx-packager.js"; /** @stability stable */ export { readDocx } from "./reader/docx-reader.js"; /** @stability stable */ export type { ReadDocxOptions } from "./reader/docx-reader.js"; /** @stability stable */ export { toBuffer, toBase64, patchDocument, compileTemplate, patchTemplate, fillTemplateFromBuffer, toFlatOpcFromDoc } from "./document-io.js"; /** @stability experimental */ export { diffDocuments } from "./advanced/diff.js"; /** @stability experimental */ export type { DiffChangeType, DiffEntry, DiffSummary, DiffResult } from "./advanced/diff.js"; /** @stability experimental */ export { fillTemplate, fillTemplateEnhanced, listTemplateTags, isTemplateChart, TemplateError } from "./template/template-engine.js"; /** @stability experimental */ export type { TemplateOptions, TemplateImage, TemplateRichText, TemplateSubDocument, TemplateChart, TemplateHtmlChunk, TemplateTag } from "./template/template-engine.js"; /** @stability stable */ export { parseFlatOpc, isFlatOpc, toFlatOpc } from "./convert/flat-opc.js"; /** @stability stable */ export type { FlatOpcPart } from "./convert/flat-opc.js"; /** @stability experimental */ export { StreamingDocxWriter, createDocxStream } from "./writer/streaming-writer.js"; /** @stability experimental */ export type { StreamingDocxOptions, StreamingProgressCallback } from "./writer/streaming-writer.js"; /** @stability experimental */ export { validateDocument } from "./advanced/validation.js"; /** @stability experimental */ export type { ValidationSeverity, ValidationIssue, ValidationResult, ValidationOptions } from "./advanced/validation.js"; /** @stability stable */ export { embedFont, embedFontFamily, addEmbeddedFonts, subsetFont } from "./font/font-embed.js"; /** @stability stable */ export type { FontEmbedStyle, EmbedFontOptions, EmbedFontResult } from "./font/font-embed.js"; /** @stability experimental */ export { extractOleObjects, hasOleObjects, getOleObjectData, createOleEmbedding, addOleObject } from "./advanced/ole-objects.js"; /** @stability experimental */ export type { OleObject, OleObjectType, OleDisplayAs, OleExtractionResult, OleEmbeddingResult } from "./advanced/ole-objects.js"; /** @stability experimental */ export { createBuildingBlock, createGlossaryDocument, findBuildingBlock, listBuildingBlocks, getAutoTextEntries, getQuickParts } from "./advanced/glossary.js"; /** @stability experimental */ export type { BuildingBlockGallery, BuildingBlock, GlossaryDocument } from "./advanced/glossary.js"; /** @stability stable */ export { protectDocument, unprotectDocument, isDocumentProtected, getProtectionState, verifyProtectionPassword } from "./security/document-protection.js"; /** @stability stable */ export type { ProtectionEditType, ProtectionHashAlgorithm, DocumentProtectionOptions, ProtectionState } from "./security/document-protection.js"; /** @stability stable */ export { parseStyleMap, createStyleMap, mergeStyleMaps, matchStyleMap, DEFAULT_STYLE_MAP } from "./advanced/style-map.js"; /** @stability stable */ export type { MappingSourceType, MappingCondition, MappingTarget, StyleMappingRule, StyleMap, StyleMapOptions } from "./advanced/style-map.js"; /** @stability experimental */ export { hasVbaProject, getVbaProjectInfo, getVbaProjectData, addVbaProject, removeVbaProject, listVbaParts } from "./advanced/vba-project.js"; /** @stability experimental */ export type { VbaProjectInfo } from "./advanced/vba-project.js"; /** @stability experimental */ export { layoutDocument } from "./layout/layout.js"; /** @stability experimental */ export type { LayoutResult, LayoutOptions } from "./layout/layout.js"; /** @stability experimental */ export { layoutDocumentFull } from "./layout/layout-full.js"; /** @stability experimental */ export type { FullLayoutOptions, PageGeometryOverride } from "./layout/layout-full.js"; /** @stability experimental */ export { updateFields, updateTableOfContents } from "./advanced/field-engine.js"; /** @stability experimental */ export type { FieldUpdateOptions } from "./advanced/field-engine.js"; /** @stability experimental */ export { ommlToMathML, mathMLToOmml } from "./advanced/math-convert.js"; /** @stability experimental */ export { createShape, createRect, createRoundRect, createEllipse, createLine, createArrow, createFlowchartShape, createCallout, createStar } from "./advanced/drawing-shapes.js"; /** @stability experimental */ export type { StandardShapeType, SolidFill, GradientStop, GradientFill, PatternFill, NoFill, ShapeFill, LineDash, LineEndType, LineEndSize, ShapeOutline, ShadowEffect, GlowEffect, ReflectionEffect, Effect3D, ShapeEffects, TextVerticalAnchor, TextWrap, ShapeTextBody, CreateShapeOptions } from "./advanced/drawing-shapes.js"; /** @stability experimental — Text shaping for complex scripts */ export { shapeText, detectScript, detectDirection } from "./font/text-shaping.js"; export type { ScriptType, BiDiDirection, ShapedCluster, ShapingOptions } from "./font/text-shaping.js"; /** @stability experimental — Hyphenation engine */ export { createHyphenator, hyphenateWord, hyphenateText, ENGLISH_US_PATTERNS } from "./font/hyphenation.js"; export type { HyphenationOptions, HyphenationPatterns } from "./font/hyphenation.js"; /** @stability experimental — Format-based search */ export { searchByFormat, countByFormat, getUsedFormats } from "./query/format-search.js"; export type { FormatCriteria, FormatSearchResult } from "./query/format-search.js"; /** @stability experimental — ODT (OpenDocument Text) read/write */ export { readOdt, writeOdt } from "./convert/odt/odt.js"; /** @stability experimental — Page rendering to SVG */ export { renderPageToSvg, renderDocumentToSvg, renderPageFromLayout } from "./layout/render-page.js"; export type { RenderOptions } from "./layout/render-page.js"; /** @stability experimental — Template data source abstraction */ export { JsonDataSource, XmlDataSource, CsvDataSource, CompositeDataSource, fillTemplateFromSource } from "./template/template-datasource.js"; export type { DataSource } from "./template/template-datasource.js"; /** @stability experimental — Chart data binding for templates */ export { bindChartData } from "./template/template-chart.js"; export type { ChartBinding, ChartSeriesData, ChartTemplateData } from "./template/template-chart.js"; /** @stability stable — DOCX encryption */ export { encryptDocx } from "./security/encryption.js"; export type { EncryptOptions } from "./security/encryption.js"; /** @stability experimental */ export type { WordSecurityPolicy } from "./security/policy.js"; /** @stability experimental */ export { DEFAULT_SECURITY_POLICY, STRICT_SECURITY_POLICY, resolveSecurityPolicy } from "./security/policy.js"; /** @stability experimental */ export type { WordRenderContext, IdGenerators } from "./writer/render-context.js"; /** @stability experimental */ export { createRenderContext, createIdGenerators } from "./writer/render-context.js"; /** @stability experimental */ export type { DocxTransformer, MapOptions } from "./core/mapper.js"; /** @stability experimental */ export { mapDocument } from "./core/mapper.js"; /** @stability experimental */ export type { DocxVisitor, WalkPath, WalkOptions, VisitAction } from "./core/walker.js"; /** @stability experimental */ export { walkDocument, walkBlocks, collectParagraphs, collectRuns, collectTables } from "./core/walker.js"; /** @stability experimental */ export type { LayoutDocument, LayoutPage, PageGeometry, PageContent, LayoutParagraph, LayoutTable, LayoutTableCell, LayoutImage, LayoutFloat, LayoutFloatWrap, LayoutTextBox, LayoutShape, LayoutChart, LayoutSdt, LayoutMath, LayoutCheckBox, LayoutTableOfContents, LayoutAltChunk, LayoutOpaqueDrawing, LineBox, LineBoxItem, PositionedInlineImage, PositionedRun } from "./layout/layout-model.js"; /** @stability experimental */ export type { SemanticDocument, SemanticBlock, SemanticInline, ConversionContext, ConversionWarning, ConversionAsset, ResolvedFormatting } from "./convert/conversion-ir.js"; /** @stability experimental */ export { createConversionContext } from "./convert/conversion-ir.js"; /** @stability experimental */ export { docxToSemantic } from "./convert/docx-to-semantic.js"; /** @stability experimental */ export type { DocxToSemanticOptions } from "./convert/docx-to-semantic.js"; /** @stability experimental */ export type { AssetRef, MediaAsset } from "./types.js";