@stll/docx-core 0.0.1-placeholder.0 → 0.1.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/README.md +40 -0
- package/dist/document-IR6XvC0O.d.ts +1659 -0
- package/dist/index.d.ts +143 -0
- package/dist/index.js +1927 -0
- package/dist/model/document.d.ts +2 -0
- package/dist/model/document.js +0 -0
- package/package.json +64 -3
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# @stll/docx-core
|
|
2
|
+
|
|
3
|
+
A typed OOXML/DOCX document model with parsing, validation, and serialization.
|
|
4
|
+
|
|
5
|
+
The package exposes a structured document model (paragraphs, runs, tables,
|
|
6
|
+
styles, section properties) together with the tools to produce and check DOCX
|
|
7
|
+
packages, plus a legal-source compiler that turns a plain legal draft into that
|
|
8
|
+
model or a finished DOCX file.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { compileLegalSourceToDocx, validateDocxPackage } from "@stll/docx-core";
|
|
12
|
+
|
|
13
|
+
const { docx } = await compileLegalSourceToDocx(source);
|
|
14
|
+
const result = await validateDocxPackage(docx);
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The document model types are also available from a dedicated subpath:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import type { Document, Paragraph, Run } from "@stll/docx-core/model";
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
bun add @stll/docx-core
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Exports
|
|
30
|
+
|
|
31
|
+
- `.` — the document model types, the legal-source compiler
|
|
32
|
+
(`parseLegalSource`, `compileLegalSourceToDocument`,
|
|
33
|
+
`compileLegalSourceToDocx`, `validateLegalDraft`), DOCX serialization
|
|
34
|
+
(`serializeDocumentToDocx`), and validation (`validateDocxPackage`,
|
|
35
|
+
`validateDocumentModel`, `assertValidDocumentModel`).
|
|
36
|
+
- `./model` — the document model types only.
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
Apache-2.0
|