@stll/docx-core 0.39.1 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/archive-yBR7X-Qc.js +456 -0
- package/dist/{document-BkGU2ctn.d.ts → document-BWDHON3T.d.ts} +1 -47
- package/dist/{document-oU-dz9zs.js → document-NtScxyHH.js} +18 -36
- package/dist/docx_kernel_bg.wasm +0 -0
- package/dist/errors-Dm3jsb5q.d.ts +57 -0
- package/dist/format-DXPXB02u.js +378 -0
- package/dist/{href-2XSCK-T8.js → href-ogmJmncc.js} +2 -4
- package/dist/index.d.ts +1 -34
- package/dist/index.js +125 -228
- package/dist/model/document.d.ts +2 -2
- package/dist/model/document.js +1 -1
- package/dist/ops/documentOps.d.ts +1 -61
- package/dist/ops/documentOps.js +55 -108
- package/dist/{preservedMarkup-G8XjWhs2.d.ts → preservedMarkup-9L4lbGnE.d.ts} +0 -2
- package/dist/projection.d.ts +0 -4
- package/dist/projection.js +2 -4
- package/dist/schema/sequenceChildren.d.ts +1 -5
- package/dist/schema/sequenceChildren.js +1 -1
- package/dist/{sequenceChildren-9SUK1Tm1.js → sequenceChildren-CrMcryEF.js} +2 -4
- package/dist/zip/archive.d.ts +114 -0
- package/dist/zip/archive.js +3 -0
- package/dist/zip/stream.d.ts +30 -0
- package/dist/zip/stream.js +117 -0
- package/package.json +10 -6
- package/dist/zip/writeZipPart.d.ts +0 -12
- package/dist/zip/writeZipPart.js +0 -17
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { B as finalizeParagraphFormatting, Dn as Run, E as Style, H as setDocumentBodyComments, K as BlockContent, On as RunContent, Pn as SectionProperties, Q as BreakContent, V as isCanonicallyEmptyParagraphFormatting, Vr as NumberingDefinitions, Xn as TableCell, Yn as Table, _n as PositionalTab, cr as TextContent, ct as DocumentBackground, dn as Paragraph, fn as ParagraphContent, i as Document, ir as TableRow, lt as DocumentBackgroundDrawing, o as DocxConformanceClass, r as DOCX_CONFORMANCE_CLASSES, s as DocxPackage, ut as DocumentBody } from "./document-
|
|
1
|
+
import { B as finalizeParagraphFormatting, Dn as Run, E as Style, H as setDocumentBodyComments, K as BlockContent, On as RunContent, Pn as SectionProperties, Q as BreakContent, V as isCanonicallyEmptyParagraphFormatting, Vr as NumberingDefinitions, Xn as TableCell, Yn as Table, _n as PositionalTab, cr as TextContent, ct as DocumentBackground, dn as Paragraph, fn as ParagraphContent, i as Document, ir as TableRow, lt as DocumentBackgroundDrawing, o as DocxConformanceClass, r as DOCX_CONFORMANCE_CLASSES, s as DocxPackage, ut as DocumentBody } from "./document-BWDHON3T.js";
|
|
2
2
|
import { TaggedErrorClass } from "better-result";
|
|
3
|
-
import JSZip from "jszip";
|
|
4
3
|
import { Buffer } from "node:buffer";
|
|
5
|
-
//#region src/legal-source/types.d.ts
|
|
6
4
|
type LegalDocumentKind = "agreement" | "letter" | "memo" | "checklist" | "pleading" | "other";
|
|
7
5
|
type LegalNumberingProfile = "legal" | "none" | "checklist";
|
|
8
6
|
type LegalPageSize = "A4" | "Letter";
|
|
@@ -107,22 +105,12 @@ type LegalSourceDocxCompileResult = ({
|
|
|
107
105
|
} & CompiledLegalDocument) | Extract<LegalSourceCompileResult, {
|
|
108
106
|
status: "needs_llm_repair";
|
|
109
107
|
}>;
|
|
110
|
-
//#endregion
|
|
111
|
-
//#region src/legal-source/compile.d.ts
|
|
112
108
|
export declare const compileLegalSourceToDocument: (source: string, options?: LegalSourceCompileOptions) => LegalSourceCompileResult;
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region src/legal-source/parser.d.ts
|
|
115
109
|
export declare const parseLegalSource: (source: string, options?: {
|
|
116
110
|
titleFallback?: string;
|
|
117
111
|
}) => LegalSourceParseResult;
|
|
118
|
-
//#endregion
|
|
119
|
-
//#region src/legal-source/validate.d.ts
|
|
120
112
|
export declare const validateLegalDraft: (draft: LegalDraft) => LegalDraftDiagnostic[];
|
|
121
|
-
//#endregion
|
|
122
|
-
//#region src/legal-source/index.d.ts
|
|
123
113
|
export declare const compileLegalSourceToDocx: (source: string, options?: LegalSourceCompileOptions) => Promise<LegalSourceDocxCompileResult>;
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region src/markdown/content.d.ts
|
|
126
114
|
/** Block content and the numbering definitions its list paragraphs reference. */
|
|
127
115
|
type MarkdownContent = {
|
|
128
116
|
content: BlockContent[];
|
|
@@ -141,8 +129,6 @@ type MarkdownContent = {
|
|
|
141
129
|
* (page geometry, styles, and presets are the host's decision).
|
|
142
130
|
*/
|
|
143
131
|
export declare const compileMarkdownToContent: (markdown: string) => MarkdownContent;
|
|
144
|
-
//#endregion
|
|
145
|
-
//#region src/markdown/href.d.ts
|
|
146
132
|
/**
|
|
147
133
|
* Keep only http(s), mailto, and tel URLs, normalised through the URL parser.
|
|
148
134
|
* Anything else (javascript:, data:, relative paths, malformed input) drops to
|
|
@@ -150,8 +136,6 @@ export declare const compileMarkdownToContent: (markdown: string) => MarkdownCon
|
|
|
150
136
|
* executable target into the document.
|
|
151
137
|
*/
|
|
152
138
|
export declare const sanitizeExternalUrl: (rawUrl: string | undefined) => string | undefined;
|
|
153
|
-
//#endregion
|
|
154
|
-
//#region src/serialize/docx.d.ts
|
|
155
139
|
type SerializeDocumentOptions = {
|
|
156
140
|
/** BCP-47 language tag (e.g. "en", "cs", "cs-CZ"); used for footer labels. */
|
|
157
141
|
language?: string;
|
|
@@ -177,8 +161,6 @@ type SerializeDocumentOptions = {
|
|
|
177
161
|
* not the other way round.
|
|
178
162
|
*/
|
|
179
163
|
export declare const serializeDocumentToDocx: (document: Document, options?: SerializeDocumentOptions) => Promise<ArrayBuffer>;
|
|
180
|
-
//#endregion
|
|
181
|
-
//#region src/serialize/numericIds.d.ts
|
|
182
164
|
declare const InvalidOoxmlNumericIdErrorBase: TaggedErrorClass<"InvalidOoxmlNumericIdError">;
|
|
183
165
|
/** A writer would emit an identifier outside its OOXML schema's numeric domain. */
|
|
184
166
|
export declare class InvalidOoxmlNumericIdError extends InvalidOoxmlNumericIdErrorBase<{
|
|
@@ -226,8 +208,6 @@ export declare const mayContainInvalidOoxmlNumericIds: (xml: string, mode?: "sch
|
|
|
226
208
|
* Permission-range ids are strings in OOXML and intentionally remain unrestricted.
|
|
227
209
|
*/
|
|
228
210
|
export declare const assertValidOoxmlNumericIds: (xml: string, partPath: string) => void;
|
|
229
|
-
//#endregion
|
|
230
|
-
//#region src/serialize/xml.d.ts
|
|
231
211
|
/**
|
|
232
212
|
* The one writer for a `CT_OnOff` element: `w:b`, `w:cantSplit`, `w:hideMark`,
|
|
233
213
|
* every element the schema types `CT_OnOff`.
|
|
@@ -259,8 +239,6 @@ export declare const serializeOnOffElement: (value: boolean | undefined, name: s
|
|
|
259
239
|
* that would turn an unformatted run into a `<w:rPr></w:rPr>`.
|
|
260
240
|
*/
|
|
261
241
|
export declare const pushOnOffElement: (parts: string[], value: boolean | undefined, name: string) => void;
|
|
262
|
-
//#endregion
|
|
263
|
-
//#region src/serialize/xmlEscape.d.ts
|
|
264
242
|
/** Escape a value for XML element content. Tab and LF survive as themselves. */
|
|
265
243
|
export declare const escapeXmlText: (value: string) => string;
|
|
266
244
|
/**
|
|
@@ -282,8 +260,6 @@ export declare const hasIllegalXmlCharacters: (value: string) => boolean;
|
|
|
282
260
|
* further down, but by then nobody can say which input lost a character.
|
|
283
261
|
*/
|
|
284
262
|
export declare const sanitizeXmlCharacters: (value: string) => string;
|
|
285
|
-
//#endregion
|
|
286
|
-
//#region src/serialize/textWhitespace.d.ts
|
|
287
263
|
/**
|
|
288
264
|
* Whether `<w:t>` needs `xml:space="preserve"` to render the text as written.
|
|
289
265
|
*
|
|
@@ -295,14 +271,6 @@ export declare const sanitizeXmlCharacters: (value: string) => string;
|
|
|
295
271
|
* runs merged, because ProseMirror has nowhere to carry it.
|
|
296
272
|
*/
|
|
297
273
|
export declare const requiresXmlSpacePreserve: (text: string) => boolean;
|
|
298
|
-
//#endregion
|
|
299
|
-
//#region src/validate/docx.d.ts
|
|
300
|
-
declare module "jszip" {
|
|
301
|
-
interface JSZipObject {
|
|
302
|
-
/** Chunked read of the entry content, missing from the published typings. */
|
|
303
|
-
internalStream(type: "uint8array"): JSZip.JSZipStreamHelper<Uint8Array>;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
274
|
export declare const DOCX_PACKAGE_ISSUE_CODES: {
|
|
307
275
|
readonly ArchiveBoundsExceeded: "archive_bounds_exceeded";
|
|
308
276
|
readonly InvalidArchive: "invalid_archive";
|
|
@@ -332,5 +300,4 @@ type ValidateDocumentModelResult = {
|
|
|
332
300
|
export declare const validateDocxPackage: (buffer: ArrayBuffer | Uint8Array) => Promise<ValidateDocxPackageResult>;
|
|
333
301
|
export declare const validateDocumentModel: (document: Document) => ValidateDocumentModelResult;
|
|
334
302
|
export declare const assertValidDocumentModel: (document: Document) => void;
|
|
335
|
-
//#endregion
|
|
336
303
|
export { type Autofix, type BlockContent, type BreakContent, type CompiledLegalDocument, DOCX_CONFORMANCE_CLASSES, type Document, type DocumentBackground, type DocumentBackgroundDrawing, type DocumentBody, type DocxConformanceClass, type DocxPackage, type DocxPackageIssueCode, type LegalDraft, type LegalDraftBlock, type LegalDraftDiagnostic, type LegalSourceCompileOptions, type LegalSourceCompileResult, type LegalSourceDocxCompileResult, type LegalSourceParseResult, type MarkdownContent, type Paragraph, type ParagraphContent, type PositionalTab, type Run, type RunContent, type SectionProperties, type Style, type Table, type TableCell, type TableRow, type TextContent, type ValidateDocumentModelIssue, type ValidateDocumentModelResult, type ValidateDocxPackageResult, finalizeParagraphFormatting, isCanonicallyEmptyParagraphFormatting, setDocumentBodyComments };
|