@betteroffice/docx 0.0.1
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/LICENSE +201 -0
- package/README.md +41 -0
- package/dist/Subscribable-DOz6Ohoo.d.mts +33 -0
- package/dist/agent/index.d.mts +531 -0
- package/dist/agent/index.mjs +1 -0
- package/dist/chunk-34K66SY4.mjs +1 -0
- package/dist/chunk-3UBMCDME.mjs +1 -0
- package/dist/chunk-4RCISPPE.mjs +1 -0
- package/dist/chunk-4UD54UM5.mjs +1 -0
- package/dist/chunk-52GB3Y42.mjs +1 -0
- package/dist/chunk-6NEKRDXF.mjs +1 -0
- package/dist/chunk-6PW4CWUG.mjs +1 -0
- package/dist/chunk-7DEIW7FL.mjs +1 -0
- package/dist/chunk-7PCO5I2O.mjs +1 -0
- package/dist/chunk-BI3B33LI.mjs +1 -0
- package/dist/chunk-BIQWVK5P.mjs +2 -0
- package/dist/chunk-CIRN3LZA.mjs +1 -0
- package/dist/chunk-DXKG3HQ5.mjs +16 -0
- package/dist/chunk-EUUIJVM6.mjs +0 -0
- package/dist/chunk-FPZBTOD6.mjs +1 -0
- package/dist/chunk-FZIA7OFY.mjs +1 -0
- package/dist/chunk-GWKJ2Y4Y.mjs +1 -0
- package/dist/chunk-H3JCIGWK.mjs +1 -0
- package/dist/chunk-HJGAQIU7.mjs +2 -0
- package/dist/chunk-I6KKMUUC.mjs +1 -0
- package/dist/chunk-IL5JZJT7.mjs +1 -0
- package/dist/chunk-JY6ILTNS.mjs +1 -0
- package/dist/chunk-KEE52TT5.mjs +1 -0
- package/dist/chunk-KVKLLTDP.mjs +58 -0
- package/dist/chunk-KXNZFTTK.mjs +1 -0
- package/dist/chunk-L5ISVQ3W.mjs +1 -0
- package/dist/chunk-LDUWIM7M.mjs +1 -0
- package/dist/chunk-N5Q3YN64.mjs +1 -0
- package/dist/chunk-NEWOMDTX.mjs +1 -0
- package/dist/chunk-O2QSE2I7.mjs +1 -0
- package/dist/chunk-OBQGPMPQ.mjs +1 -0
- package/dist/chunk-OJOHXQNQ.mjs +1 -0
- package/dist/chunk-OMR3TWCD.mjs +2 -0
- package/dist/chunk-P3KDV4M2.mjs +1 -0
- package/dist/chunk-Q7PO7V73.mjs +1 -0
- package/dist/chunk-QOUFE3VX.mjs +1 -0
- package/dist/chunk-SINEY6ZF.mjs +1 -0
- package/dist/chunk-T4EZMUXM.mjs +1 -0
- package/dist/chunk-TTRUPDAB.mjs +1 -0
- package/dist/chunk-TYHI7RAD.mjs +1 -0
- package/dist/chunk-UIEJWORW.mjs +1 -0
- package/dist/chunk-VAOUFAUH.mjs +1 -0
- package/dist/chunk-VBOTMRXV.mjs +1 -0
- package/dist/chunk-VCER63GQ.mjs +1 -0
- package/dist/chunk-WAUF2UC7.mjs +2 -0
- package/dist/chunk-WRWRCBLK.mjs +1 -0
- package/dist/chunk-X4XDO3LZ.mjs +1 -0
- package/dist/chunk-XQBCCJBO.mjs +9 -0
- package/dist/chunk-XWUOLYRQ.mjs +2 -0
- package/dist/chunk-XYH6XWP3.mjs +10 -0
- package/dist/chunk-YBIM6UJV.mjs +8 -0
- package/dist/chunk-YCIH2Q3E.mjs +1 -0
- package/dist/chunk-YUOKI2HB.mjs +1 -0
- package/dist/chunk-ZOV5KL7C.mjs +1 -0
- package/dist/colorResolver-n0o7H7ep.d.mts +290 -0
- package/dist/content-sSHuWw49.d.mts +2202 -0
- package/dist/core-plugins.d.mts +37 -0
- package/dist/core-plugins.mjs +1 -0
- package/dist/core.d.mts +451 -0
- package/dist/core.mjs +1 -0
- package/dist/displayListQueries-p-ijSzdh.d.mts +222 -0
- package/dist/docx/index.d.mts +618 -0
- package/dist/docx/index.mjs +2 -0
- package/dist/docx/parser.d.mts +41 -0
- package/dist/docx/parser.mjs +1 -0
- package/dist/docx/rezip.d.mts +148 -0
- package/dist/docx/rezip.mjs +1 -0
- package/dist/docx/serializer/index.d.mts +42 -0
- package/dist/docx/serializer/index.mjs +1 -0
- package/dist/docx/wrapTypes.d.mts +19 -0
- package/dist/docx/wrapTypes.mjs +1 -0
- package/dist/docxInput-DTbCa48g.d.mts +21 -0
- package/dist/editor/index.d.mts +170 -0
- package/dist/editor/index.mjs +1 -0
- package/dist/editorTree-DO5PyDK8.d.mts +37 -0
- package/dist/executor-7O2RBJ2B.mjs +1 -0
- package/dist/fontLoader-Bx6DK6-2.d.mts +327 -0
- package/dist/formatting-DoL7KBSL.d.mts +823 -0
- package/dist/generated/edit/docx_edit_bg.wasm +0 -0
- package/dist/generated/layout/docx_layout_bg.wasm +0 -0
- package/dist/generated/opc/ooxml_opc_bg.wasm +0 -0
- package/dist/generated/parse/docx_parse_bg.wasm +0 -0
- package/dist/headerFooterLayout-0zPT64Qc.d.mts +316 -0
- package/dist/headless.d.mts +69 -0
- package/dist/headless.mjs +1 -0
- package/dist/layout/flow/index.d.mts +149 -0
- package/dist/layout/flow/index.mjs +1 -0
- package/dist/layout/index.d.mts +307 -0
- package/dist/layout/index.mjs +1 -0
- package/dist/layout/measure/index.d.mts +324 -0
- package/dist/layout/measure/index.mjs +1 -0
- package/dist/layout/pagination/index.d.mts +60 -0
- package/dist/layout/pagination/index.mjs +1 -0
- package/dist/layout/pagination/types.d.mts +4 -0
- package/dist/layout/pagination/types.mjs +1 -0
- package/dist/layout/render/index.d.mts +733 -0
- package/dist/layout/render/index.mjs +1 -0
- package/dist/loadWasmAsset-CMvnVkfA.d.mts +3 -0
- package/dist/managers/AutoSaveManager.d.mts +81 -0
- package/dist/managers/AutoSaveManager.mjs +1 -0
- package/dist/managers/TableSelectionManager.d.mts +74 -0
- package/dist/managers/TableSelectionManager.mjs +1 -0
- package/dist/managers/types.d.mts +113 -0
- package/dist/managers/types.mjs +0 -0
- package/dist/mcp-cli.mjs +142 -0
- package/dist/mcp.d.mts +162 -0
- package/dist/mcp.mjs +16 -0
- package/dist/measureBlocksPipeline-Df0Bbrwy.d.mts +109 -0
- package/dist/measuredBlock-DZwz8zhD.d.mts +26 -0
- package/dist/plugin-api/RenderedDomContext.d.mts +114 -0
- package/dist/plugin-api/RenderedDomContext.mjs +1 -0
- package/dist/plugin-api/index.d.mts +7 -0
- package/dist/plugin-api/index.mjs +0 -0
- package/dist/plugin-api/resolveItemPositions.d.mts +39 -0
- package/dist/plugin-api/resolveItemPositions.mjs +1 -0
- package/dist/plugin-api/types.d.mts +193 -0
- package/dist/plugin-api/types.mjs +0 -0
- package/dist/processTemplate-HDUIZFJ5.mjs +1 -0
- package/dist/registry-DMM5VTdT.d.mts +165 -0
- package/dist/rustDisplayList-dqunvwxH.d.mts +1036 -0
- package/dist/rustPagination-Bj2hq013.d.mts +106 -0
- package/dist/sectionConfigs-DW3J8q0X.d.mts +55 -0
- package/dist/selectionContext-Buc9BCU1.d.mts +570 -0
- package/dist/selectiveSave-oFBJ1n71.d.mts +16 -0
- package/dist/selectiveXmlPatch-ypkxlTD_.d.mts +23 -0
- package/dist/settingsParser-CcGvtmCK.d.mts +33 -0
- package/dist/styles/index.d.mts +162 -0
- package/dist/styles/index.mjs +1 -0
- package/dist/styles-VxNcXLdi.d.mts +189 -0
- package/dist/types/agentApi.d.mts +456 -0
- package/dist/types/agentApi.mjs +1 -0
- package/dist/types/content.d.mts +3 -0
- package/dist/types/content.mjs +1 -0
- package/dist/types/document.d.mts +117 -0
- package/dist/types/document.mjs +1 -0
- package/dist/types-DNrYr6yQ.d.mts +1754 -0
- package/dist/types-dYdjUZMo.d.mts +311 -0
- package/dist/units-O5Y02RKQ.d.mts +34 -0
- package/dist/utils/autoScroll.d.mts +24 -0
- package/dist/utils/autoScroll.mjs +1 -0
- package/dist/utils/cardStyles.d.mts +22 -0
- package/dist/utils/cardStyles.mjs +1 -0
- package/dist/utils/comments.d.mts +120 -0
- package/dist/utils/comments.mjs +4 -0
- package/dist/utils/findReplace.d.mts +114 -0
- package/dist/utils/findReplace.mjs +2 -0
- package/dist/utils/findVerticalScrollParent.d.mts +25 -0
- package/dist/utils/findVerticalScrollParent.mjs +1 -0
- package/dist/utils/fontOptions.d.mts +21 -0
- package/dist/utils/fontOptions.mjs +1 -0
- package/dist/utils/headingCollector.d.mts +28 -0
- package/dist/utils/headingCollector.mjs +1 -0
- package/dist/utils/highlightColors.d.mts +14 -0
- package/dist/utils/highlightColors.mjs +1 -0
- package/dist/utils/index.d.mts +956 -0
- package/dist/utils/index.mjs +84 -0
- package/dist/utils/listState.d.mts +27 -0
- package/dist/utils/listState.mjs +1 -0
- package/dist/utils/reportIssue.d.mts +23 -0
- package/dist/utils/reportIssue.mjs +2 -0
- package/dist/utils/sidebarConstants.d.mts +10 -0
- package/dist/utils/sidebarConstants.mjs +1 -0
- package/dist/utils/stylePreview.d.mts +70 -0
- package/dist/utils/stylePreview.mjs +1 -0
- package/dist/utils/textSelection.d.mts +92 -0
- package/dist/utils/textSelection.mjs +1 -0
- package/dist/utils/units.d.mts +78 -0
- package/dist/utils/units.mjs +1 -0
- package/dist/variableDetector-Borj29SF.d.mts +115 -0
- package/dist/wasm-FZQ5XB2Y.mjs +1 -0
- package/dist/wasm-SA237OSP.mjs +1 -0
- package/dist/wasm-edit.d.mts +473 -0
- package/dist/wasm-edit.mjs +1 -0
- package/dist/wasm-layout.d.mts +112 -0
- package/dist/wasm-layout.mjs +1 -0
- package/dist/wasm-opc.d.mts +16 -0
- package/dist/wasm-opc.mjs +1 -0
- package/dist/wasm-parse.d.mts +18 -0
- package/dist/wasm-parse.mjs +1 -0
- package/dist/watermarkApi-DCxjutkg.d.mts +38 -0
- package/dist/yrs/index.d.mts +882 -0
- package/dist/yrs/index.mjs +1 -0
- package/dist/yrs/residentEngineWorker.d.mts +2 -0
- package/dist/yrs/residentEngineWorker.mjs +1 -0
- package/package.json +365 -0
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
import { W as WasmAsyncInput } from './loadWasmAsset-CMvnVkfA.mjs';
|
|
2
|
+
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* One yrs replica of the DOCX editing model, held for a JS host.
|
|
8
|
+
*
|
|
9
|
+
* Owns the [`EditingDoc`] plus the (single) JS update observer. The JS facade
|
|
10
|
+
* multiplexes its own listener set over that one callback.
|
|
11
|
+
*/
|
|
12
|
+
declare class EditSession {
|
|
13
|
+
free(): void;
|
|
14
|
+
[Symbol.dispose](): void;
|
|
15
|
+
/**
|
|
16
|
+
* Accepts tracked changes (S4b): pending insertions become plain content,
|
|
17
|
+
* pending deletions are carried out; `pPrIns` marks clear (the split
|
|
18
|
+
* stays), `pPrDel` marks join with the following paragraph (its pPr
|
|
19
|
+
* survives). `target_json`: `{"revisionId": string}` for one coalesced
|
|
20
|
+
* revision (any story) or
|
|
21
|
+
* `{"story","startPara","startOffset","endPara","endOffset"}` for a Loc
|
|
22
|
+
* range. Receipt: `{"revisionIds": [string, …]}` — the revision ids
|
|
23
|
+
* resolved. Resolving never stamps a new revision.
|
|
24
|
+
*/
|
|
25
|
+
accept_change(target_json: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Adds a sticky-anchored comment. `ranges_json`:
|
|
28
|
+
* `[{"story","startPara","startOffset","endPara","endOffset"}, …]`;
|
|
29
|
+
* `body_json` is any JSON value. Receipt: `{"commentId"}`.
|
|
30
|
+
*/
|
|
31
|
+
add_comment(ranges_json: string, author: string, date: string, body_json: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Apply one ordinary collapsed character deletion (or adjacent paragraph
|
|
34
|
+
* merge at a boundary) and return the resulting resident FrameDelta.
|
|
35
|
+
*/
|
|
36
|
+
apply_delete(direction: string, expected_frame_epoch: number): Uint8Array;
|
|
37
|
+
/**
|
|
38
|
+
* Instrumented twin of `apply_delete`, used only by opt-in browser perf
|
|
39
|
+
* traces. Keeping this separate leaves the production hot path timer-free.
|
|
40
|
+
*/
|
|
41
|
+
apply_delete_profiled(direction: string, expected_frame_epoch: number): Uint8Array;
|
|
42
|
+
/**
|
|
43
|
+
* Apply one ordinary collapsed body-text insertion and return the
|
|
44
|
+
* resulting FrameDelta. Selection, measurement inputs, pagination
|
|
45
|
+
* checkpoints, and display state all remain resident in this session.
|
|
46
|
+
*/
|
|
47
|
+
apply_input(text: string, expected_frame_epoch: number): Uint8Array;
|
|
48
|
+
/**
|
|
49
|
+
* Last opt-in `apply_input_profiled` stage timings as a compact JSON object.
|
|
50
|
+
*/
|
|
51
|
+
apply_input_profile_json(): string;
|
|
52
|
+
/**
|
|
53
|
+
* Instrumented twin of `apply_input`, used only by opt-in browser perf
|
|
54
|
+
* traces. Keeping this separate leaves the production hot path timer-free.
|
|
55
|
+
*/
|
|
56
|
+
apply_input_profiled(text: string, expected_frame_epoch: number): Uint8Array;
|
|
57
|
+
/**
|
|
58
|
+
* Applies an update produced by this document's dedicated local worker.
|
|
59
|
+
* The local origin lets the main replica's UndoManager retain ownership of
|
|
60
|
+
* the edit; remote/collaboration updates must use `apply_update` instead.
|
|
61
|
+
*/
|
|
62
|
+
apply_local_update(update: Uint8Array): void;
|
|
63
|
+
/**
|
|
64
|
+
* Applies a paragraph style id to every paragraph intersecting
|
|
65
|
+
* `[start, end)`. With no host style resolver at this boundary, this is
|
|
66
|
+
* the PM fallback path: write `pStyle` without fabricating a resolved
|
|
67
|
+
* paragraph/run formatting projection.
|
|
68
|
+
*/
|
|
69
|
+
apply_paragraph_style(story: string, start_para: string, start_offset: number, end_para: string, end_offset: number, style_id: string, author_name?: string | null, author_date?: string | null): void;
|
|
70
|
+
/**
|
|
71
|
+
* Applies a batch of raw story mutations in ONE transaction — the
|
|
72
|
+
* coexistence bridge's mirror-into-yrs path (not a user-intent op). `ops_json`
|
|
73
|
+
* is `[{ "op":"insert"|"delete"|"format"|"insertEmbed"|"setEmbedAttr"
|
|
74
|
+
* |"setComment"|"removeComment", "index", … }, …]`; each op's index (and each
|
|
75
|
+
* `setComment` `[start, end)` range) is read against the story state after all
|
|
76
|
+
* prior ops in the batch. Attributes/payloads are faithful mirrors of the
|
|
77
|
+
* bridge's lowered PM state (tracked-change stamps arrive inside `attrs`;
|
|
78
|
+
* comments are keyed by the PM comment id and anchored sticky, side-map only).
|
|
79
|
+
*/
|
|
80
|
+
apply_raw_ops(story: string, ops_json: string): void;
|
|
81
|
+
/**
|
|
82
|
+
* Applies a remote/incremental yrs v1 update.
|
|
83
|
+
*/
|
|
84
|
+
apply_update(update: Uint8Array): void;
|
|
85
|
+
/**
|
|
86
|
+
* Binary FrameDelta v1 display output. The returned `Vec<u8>` is exposed
|
|
87
|
+
* by wasm-bindgen as a transferable-friendly `Uint8Array`.
|
|
88
|
+
*/
|
|
89
|
+
build_display_list_frame(input: string, expected_frame_epoch: number): Uint8Array;
|
|
90
|
+
/**
|
|
91
|
+
* Build display primitives against the same resident font store used by
|
|
92
|
+
* this session's measurement path.
|
|
93
|
+
*/
|
|
94
|
+
build_display_list_json(input: string): string;
|
|
95
|
+
can_redo(): boolean;
|
|
96
|
+
can_undo(): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Resolves the current local cell selection, or `null` before the host
|
|
99
|
+
* establishes one. Deleted endpoints clamp to a surviving nearby cell.
|
|
100
|
+
*/
|
|
101
|
+
cell_selection(): string;
|
|
102
|
+
/**
|
|
103
|
+
* Clears the authored `value` from a stable-id content-control embed.
|
|
104
|
+
*/
|
|
105
|
+
clear_content_control_value(embed_id: string): void;
|
|
106
|
+
/**
|
|
107
|
+
* Clears every direct formatting attribute over `[start, end)`, while
|
|
108
|
+
* retaining hyperlinks and tracked-change stamps.
|
|
109
|
+
*/
|
|
110
|
+
clear_formatting(story: string, start_para: string, start_offset: number, end_para: string, end_offset: number): void;
|
|
111
|
+
/**
|
|
112
|
+
* Clear this editing wasm's resident measurement fonts.
|
|
113
|
+
*/
|
|
114
|
+
clear_measure_fonts(): void;
|
|
115
|
+
/**
|
|
116
|
+
* Drops the update observer registered by [`EditSession::set_update_observer`].
|
|
117
|
+
*/
|
|
118
|
+
clear_update_observer(): void;
|
|
119
|
+
client_id(): number;
|
|
120
|
+
/**
|
|
121
|
+
* Adds a story with one paragraph. Receipt: `{"paraId"}` (the final
|
|
122
|
+
* pilcrow's paragraph).
|
|
123
|
+
*/
|
|
124
|
+
create_story(story_id: string, initial_text: string, p_style: string, alignment: string): string;
|
|
125
|
+
/**
|
|
126
|
+
* Deletes every column covered by an explicit cell range.
|
|
127
|
+
*/
|
|
128
|
+
delete_column(range_json: string): string;
|
|
129
|
+
/**
|
|
130
|
+
* Deletes `[start, end)` given as two Locs in one story. A range whose
|
|
131
|
+
* ends sit in different paragraphs spans the boundary pilcrows, so the
|
|
132
|
+
* plain delete also merges (the pilcrow-as-character dividend).
|
|
133
|
+
* Suggesting mode retains the content with a `del` revision instead.
|
|
134
|
+
* Receipt: `{"revisionId": string|null}`.
|
|
135
|
+
*/
|
|
136
|
+
delete_range(story: string, start_para: string, start_offset: number, end_para: string, end_offset: number, author_name?: string | null, author_date?: string | null): string;
|
|
137
|
+
/**
|
|
138
|
+
* Deletes every row covered by an explicit cell range.
|
|
139
|
+
*/
|
|
140
|
+
delete_row(range_json: string, author_name?: string | null, author_date?: string | null): string;
|
|
141
|
+
/**
|
|
142
|
+
* Removes one complete story (used for unreachable table-cell stories).
|
|
143
|
+
*/
|
|
144
|
+
delete_story(story_id: string): void;
|
|
145
|
+
/**
|
|
146
|
+
* Removes one complete table plus all of its reachable cell stories.
|
|
147
|
+
*/
|
|
148
|
+
delete_table(table_json: string): string;
|
|
149
|
+
/**
|
|
150
|
+
* Hit-test without re-serializing the resident display list through JS.
|
|
151
|
+
*/
|
|
152
|
+
display_hit_test_regions_json(page_index: number, x: number, y: number): string;
|
|
153
|
+
/**
|
|
154
|
+
* Body range geometry without a display-list JSON round trip.
|
|
155
|
+
*/
|
|
156
|
+
display_range_rects_json(from: number, to: number): string;
|
|
157
|
+
/**
|
|
158
|
+
* Region-scoped range geometry without a display-list JSON round trip.
|
|
159
|
+
*/
|
|
160
|
+
display_range_rects_region_json(region: string, r_id: string, from: number, to: number): string;
|
|
161
|
+
/**
|
|
162
|
+
* Full document state as one yrs v1 update (Yjs wire format).
|
|
163
|
+
*/
|
|
164
|
+
encode_state(): Uint8Array;
|
|
165
|
+
/**
|
|
166
|
+
* Applies a set-valued, tri-state inline formatting delta over
|
|
167
|
+
* `[start, end)` in one transaction. Omitted fields are kept and `null`
|
|
168
|
+
* fields are cleared.
|
|
169
|
+
*/
|
|
170
|
+
format_range(story: string, start_para: string, start_offset: number, end_para: string, end_offset: number, delta_json: string): void;
|
|
171
|
+
/**
|
|
172
|
+
* Inserts a column left (`after = false`) or right (`after = true`) of a cell.
|
|
173
|
+
*/
|
|
174
|
+
insert_column(at_json: string, after: boolean): string;
|
|
175
|
+
/**
|
|
176
|
+
* Inserts one native inline image embed at a paragraph-keyed location.
|
|
177
|
+
*/
|
|
178
|
+
insert_image(story: string, para_id: string, offset: number, payload_json: string, author_name?: string | null, author_date?: string | null): string;
|
|
179
|
+
/**
|
|
180
|
+
* Inserts a native page-break embed at a Loc.
|
|
181
|
+
*/
|
|
182
|
+
insert_page_break(story: string, para_id: string, offset: number): void;
|
|
183
|
+
/**
|
|
184
|
+
* Inserts a row above (`after = false`) or below (`after = true`) a cell.
|
|
185
|
+
*/
|
|
186
|
+
insert_row(at_json: string, after: boolean, author_name?: string | null, author_date?: string | null): string;
|
|
187
|
+
/**
|
|
188
|
+
* Inserts a native section-break embed at a Loc.
|
|
189
|
+
*/
|
|
190
|
+
insert_section_break(story: string, para_id: string, offset: number, break_type: string): void;
|
|
191
|
+
/**
|
|
192
|
+
* Inserts a rectangular structural table at a paragraph-keyed location.
|
|
193
|
+
*/
|
|
194
|
+
insert_table(story: string, para_id: string, offset: number, rows: number, columns: number, author_name?: string | null, author_date?: string | null): string;
|
|
195
|
+
/**
|
|
196
|
+
* Inserts paragraph-break-free text at `(story, para_id, offset)`.
|
|
197
|
+
* Receipt: `{"revisionId": string|null}` (non-null in suggesting mode).
|
|
198
|
+
*/
|
|
199
|
+
insert_text(story: string, para_id: string, offset: number, text: string, author_name?: string | null, author_date?: string | null): string;
|
|
200
|
+
/**
|
|
201
|
+
* Inserts a typed watermark embed at a Loc.
|
|
202
|
+
*/
|
|
203
|
+
insert_watermark(story: string, para_id: string, offset: number, watermark_json: string): void;
|
|
204
|
+
/**
|
|
205
|
+
* Paginate and retain the measured input and Layout. The full JSON return
|
|
206
|
+
* remains the migration parity bridge until binary frames consume it.
|
|
207
|
+
*/
|
|
208
|
+
layout_document_json(input: string): string;
|
|
209
|
+
/**
|
|
210
|
+
* Every tracked-change run/paragraph-mark revision across all stories,
|
|
211
|
+
* in deterministic story/position order.
|
|
212
|
+
*/
|
|
213
|
+
list_revisions(): string;
|
|
214
|
+
/**
|
|
215
|
+
* Hydrates this replica from an encoded yrs update (the bytes form of
|
|
216
|
+
* `load` — typically another replica's `encode_state()` output).
|
|
217
|
+
*/
|
|
218
|
+
load(update: Uint8Array): void;
|
|
219
|
+
/**
|
|
220
|
+
* Seeds stories from JSON (the json form of `load`):
|
|
221
|
+
* `[{"storyId","paragraphs":[{"text","pStyle"?,"alignment"?}, …]}, …]`.
|
|
222
|
+
* Paragraph text must not contain paragraph breaks. Returns
|
|
223
|
+
* `{storyId: [paraId, …]}` in document order. This is an S1 seeding
|
|
224
|
+
* scaffold composed from public ops; the real `load(ParsedDocument)`
|
|
225
|
+
* belongs to the ops track.
|
|
226
|
+
*/
|
|
227
|
+
load_json(stories_json: string): string;
|
|
228
|
+
/**
|
|
229
|
+
* `{"start","end"}` — the paragraph's story span; `end` is its pilcrow's
|
|
230
|
+
* index, so `end - start` is the paragraph length (`offset` domain).
|
|
231
|
+
*/
|
|
232
|
+
locate_paragraph(story: string, para_id: string): string;
|
|
233
|
+
/**
|
|
234
|
+
* Paragraph-measure compatibility export on the resident engine module.
|
|
235
|
+
*/
|
|
236
|
+
measure_paragraph_json(input: string): string;
|
|
237
|
+
/**
|
|
238
|
+
* Merges a rectangular cell range into its top-left cell.
|
|
239
|
+
*/
|
|
240
|
+
merge_cells(range_json: string): string;
|
|
241
|
+
/**
|
|
242
|
+
* Merges `para_id` with the FOLLOWING paragraph by deleting (plain) or
|
|
243
|
+
* `del`-marking (suggesting) its pilcrow. Errors on the story's final
|
|
244
|
+
* paragraph. Receipt: `{"revisionId": string|null}`.
|
|
245
|
+
*/
|
|
246
|
+
merge_paragraphs(story: string, para_id: string, author_name?: string | null, author_date?: string | null): string;
|
|
247
|
+
/**
|
|
248
|
+
* Creates a replica. `client_id` must be a non-negative safe integer —
|
|
249
|
+
* the host allocates it (yjs-style random 32-bit ids are fine).
|
|
250
|
+
*/
|
|
251
|
+
constructor(client_id: number);
|
|
252
|
+
/**
|
|
253
|
+
* Resolve one glyph outline from the session's resident font store.
|
|
254
|
+
*/
|
|
255
|
+
outline_glyph_json(font_id: number, glyph_id: number): string;
|
|
256
|
+
/**
|
|
257
|
+
* Compact paragraph-position projection in one story traversal:
|
|
258
|
+
* `[{"paraId","length"}]`. Length counts UTF-16 text and inline embed
|
|
259
|
+
* units before each paragraph's pilcrow. The JS input shim uses this
|
|
260
|
+
* instead of crossing the wasm boundary once per paragraph.
|
|
261
|
+
*/
|
|
262
|
+
paragraph_spans(story: string): string;
|
|
263
|
+
/**
|
|
264
|
+
* `[{"paraId","text","properties"}]` in document order. `properties`
|
|
265
|
+
* carries pStyle/alignment plus any op-set extras.
|
|
266
|
+
*/
|
|
267
|
+
paragraphs(story: string): string;
|
|
268
|
+
/**
|
|
269
|
+
* Reapplies the latest locally undone transaction.
|
|
270
|
+
*/
|
|
271
|
+
redo(): boolean;
|
|
272
|
+
/**
|
|
273
|
+
* Current local redo stack size. Zero before a story starts tracking.
|
|
274
|
+
*/
|
|
275
|
+
redo_depth(): number;
|
|
276
|
+
/**
|
|
277
|
+
* Register font bytes in this editing wasm's resident measurement store.
|
|
278
|
+
* Returned ids are valid for measurement and display work in this module.
|
|
279
|
+
*/
|
|
280
|
+
register_measure_font(bytes: Uint8Array): number;
|
|
281
|
+
/**
|
|
282
|
+
* Rejects tracked changes — the inverse of [`EditSession::accept_change`]:
|
|
283
|
+
* pending insertions roll back, pending deletions restore their text;
|
|
284
|
+
* `pPrIns` marks join back with the following paragraph, `pPrDel` marks
|
|
285
|
+
* clear (the split stays). Same target and receipt shapes.
|
|
286
|
+
*/
|
|
287
|
+
reject_change(target_json: string): string;
|
|
288
|
+
/**
|
|
289
|
+
* Replaces `[start, end)` with text in one transaction. The inserted text
|
|
290
|
+
* adopts the first replaced unit's formatting; in suggesting mode the
|
|
291
|
+
* deletion and insertion share one revision id.
|
|
292
|
+
*/
|
|
293
|
+
replace_range(story: string, start_para: string, start_offset: number, end_para: string, end_offset: number, text: string, author_name?: string | null, author_date?: string | null): string;
|
|
294
|
+
/**
|
|
295
|
+
* Current offsets of a comment's sticky anchors:
|
|
296
|
+
* `[{"story","start","end"}]`. Errors when an anchor no longer resolves.
|
|
297
|
+
*/
|
|
298
|
+
resolve_comment(comment_id: string): string;
|
|
299
|
+
/**
|
|
300
|
+
* Resolves this peer's current sticky selection as two public Locs, or
|
|
301
|
+
* `null` before the host establishes an initial selection.
|
|
302
|
+
*/
|
|
303
|
+
selection(): string;
|
|
304
|
+
/**
|
|
305
|
+
* Aggregated toolbar/a11y state over one paragraph-addressed story
|
|
306
|
+
* range. Toggle marks are `true`, `false`, or `"mixed"`; value marks
|
|
307
|
+
* are their uniform value or `null` when absent/mixed.
|
|
308
|
+
*/
|
|
309
|
+
selection_context(story: string, start_para: string, start_offset: number, end_para: string, end_offset: number): string;
|
|
310
|
+
/**
|
|
311
|
+
* Replaces the selected cells' complete border property object.
|
|
312
|
+
*/
|
|
313
|
+
set_cell_borders(range_json: string, borders_json: string): string;
|
|
314
|
+
/**
|
|
315
|
+
* Stores a rectangular anchor-cell → head-cell selection outside the yrs
|
|
316
|
+
* document. `range_json` is a [`TableRange`]. The table embed is held by a
|
|
317
|
+
* sticky index and the endpoints by stable cell-story identity.
|
|
318
|
+
*/
|
|
319
|
+
set_cell_selection(range_json: string): void;
|
|
320
|
+
/**
|
|
321
|
+
* Sets/clears selected cells' background color (hex without or with `#`).
|
|
322
|
+
*/
|
|
323
|
+
set_cell_shading(range_json: string, color?: string | null): string;
|
|
324
|
+
/**
|
|
325
|
+
* Merges a JSON cell-format patch into every selected cell's `tcPr`.
|
|
326
|
+
*/
|
|
327
|
+
set_cell_text_format(range_json: string, patch_json: string): string;
|
|
328
|
+
/**
|
|
329
|
+
* Sets one grid-column width in twips.
|
|
330
|
+
*/
|
|
331
|
+
set_column_width(at_json: string, width_twips: number): string;
|
|
332
|
+
/**
|
|
333
|
+
* Sets the authored `value` on a stable-id content-control embed.
|
|
334
|
+
*/
|
|
335
|
+
set_content_control_value(embed_id: string, value_json: string): void;
|
|
336
|
+
/**
|
|
337
|
+
* Sets the authored `value` on a content-control embed at a paragraph-keyed
|
|
338
|
+
* position. This is the fallback for valid controls that have no authored
|
|
339
|
+
* `w:id`/tag and therefore cannot be addressed by stable payload identity.
|
|
340
|
+
*/
|
|
341
|
+
set_content_control_value_at(story: string, para_id: string, offset: number, value_json: string): void;
|
|
342
|
+
/**
|
|
343
|
+
* Sets or clears the protected hyperlink attribute over `[start, end)`.
|
|
344
|
+
* `hyperlink_json` is an object (`{href, tooltip?, rId?}`) or `null`.
|
|
345
|
+
*/
|
|
346
|
+
set_hyperlink(story: string, start_para: string, start_offset: number, end_para: string, end_offset: number, hyperlink_json: string): void;
|
|
347
|
+
/**
|
|
348
|
+
* Commits image geometry fields to a stable-id image embed in one
|
|
349
|
+
* transaction. `null` fields clear; `other` is flattened into the payload.
|
|
350
|
+
*/
|
|
351
|
+
set_image_geometry(embed_id: string, geometry_json: string): void;
|
|
352
|
+
/**
|
|
353
|
+
* Sets one paragraph property (any JSON value) on `para_id`'s pilcrow.
|
|
354
|
+
* `paraId` / the embed discriminator are reserved.
|
|
355
|
+
*/
|
|
356
|
+
set_paragraph_attr(para_id: string, key: string, value_json: string): void;
|
|
357
|
+
/**
|
|
358
|
+
* Applies a tri-state paragraph-property delta to every paragraph
|
|
359
|
+
* intersecting `[start, end)` in one transaction.
|
|
360
|
+
*/
|
|
361
|
+
set_paragraph_attrs(story: string, start_para: string, start_offset: number, end_para: string, end_offset: number, attrs_json: string, author_name?: string | null, author_date?: string | null): void;
|
|
362
|
+
/**
|
|
363
|
+
* Stores this peer's anchor/head as sticky positions. `Assoc::After`
|
|
364
|
+
* makes a collapsed caret advance with text inserted at the caret.
|
|
365
|
+
*/
|
|
366
|
+
set_selection(story: string, anchor_para: string, anchor_offset: number, head_para: string, head_offset: number): void;
|
|
367
|
+
/**
|
|
368
|
+
* Sets the table-wide preferred width in twips.
|
|
369
|
+
*/
|
|
370
|
+
set_table_width(table_json: string, width_twips: number): string;
|
|
371
|
+
/**
|
|
372
|
+
* Subscribes `callback(update: Uint8Array)` to every committed
|
|
373
|
+
* transaction (v1 encoding — feed it straight to `apply_update` on a
|
|
374
|
+
* peer). One observer per session; a second call replaces the first.
|
|
375
|
+
* The facade fans out to multiple JS listeners over this single hook.
|
|
376
|
+
*/
|
|
377
|
+
set_update_observer(callback: Function): void;
|
|
378
|
+
/**
|
|
379
|
+
* Splits the cell covering `at` into the requested grid. Omitted
|
|
380
|
+
* dimensions unmerge the cell into its existing covered slots.
|
|
381
|
+
*/
|
|
382
|
+
split_cell(at_json: string, rows?: number | null, columns?: number | null): string;
|
|
383
|
+
/**
|
|
384
|
+
* Splits a paragraph at `(story, para_id, offset)` by inserting one
|
|
385
|
+
* pilcrow. Under the S1 split the FIRST half keeps the original paraId and
|
|
386
|
+
* the SECOND half is re-minted. Receipt:
|
|
387
|
+
* `{"firstParaId","secondParaId","revisionId": string|null}`.
|
|
388
|
+
*/
|
|
389
|
+
split_paragraph(story: string, para_id: string, offset: number, author_name?: string | null, author_date?: string | null): string;
|
|
390
|
+
/**
|
|
391
|
+
* The story's `canonical-stream-v1` FNV-1a checksum as a decimal string
|
|
392
|
+
* (u64 exceeds JS safe-integer range). The coexistence watchdog compares
|
|
393
|
+
* this against the PM projector's checksum after every mirrored edit.
|
|
394
|
+
*/
|
|
395
|
+
story_checksum(story: string): string;
|
|
396
|
+
/**
|
|
397
|
+
* Story ids currently in the document, sorted for determinism.
|
|
398
|
+
*/
|
|
399
|
+
story_ids(): string[];
|
|
400
|
+
/**
|
|
401
|
+
* Story length in UTF-16 units (every embed, pilcrows included, = 1).
|
|
402
|
+
*/
|
|
403
|
+
story_len(story: string): number;
|
|
404
|
+
/**
|
|
405
|
+
* The raw formatted-segment view (the render bridge's input):
|
|
406
|
+
* `[{"kind":"text","text",…} | {"kind":"pilcrow","paraId","properties",…}
|
|
407
|
+
* | {"kind":"embed",…}]`, each with `"attributes"` (run marks plus
|
|
408
|
+
* `ins`/`del` revision values).
|
|
409
|
+
*/
|
|
410
|
+
story_segments(story: string): string;
|
|
411
|
+
/**
|
|
412
|
+
* Applies one run mark over `[start, end)` (two Locs in one story). Simple
|
|
413
|
+
* marks toggle; font/size/color set (see [`apply_mark`]). `mark_json`:
|
|
414
|
+
* `{"type":"bold"|"italic"|"underline"|"strike"|"superscript"|"subscript"} |
|
|
415
|
+
* {"type":"fontFamily"|"color","value":string} |
|
|
416
|
+
* {"type":"fontSize","value":number}`.
|
|
417
|
+
*/
|
|
418
|
+
toggle_mark(story: string, start_para: string, start_offset: number, end_para: string, end_offset: number, mark_json: string): void;
|
|
419
|
+
/**
|
|
420
|
+
* Starts local undo tracking for a structural table transaction. Besides
|
|
421
|
+
* the parent story (which owns the table embed), the stories root must be
|
|
422
|
+
* in scope so undo/redo also removes/restores cell-story map entries.
|
|
423
|
+
*/
|
|
424
|
+
track_table_undo(story: string): void;
|
|
425
|
+
/**
|
|
426
|
+
* Starts local-origin undo tracking for one story. Hosts call this lazily
|
|
427
|
+
* after import/seeding but before the first direct input operation, so the
|
|
428
|
+
* initial document is not an undo step.
|
|
429
|
+
*/
|
|
430
|
+
track_undo(story: string): void;
|
|
431
|
+
/**
|
|
432
|
+
* Reverts the latest local-origin transaction. Remote/system mirror
|
|
433
|
+
* transactions are excluded by `DocUndoManager`'s tracked-origin policy.
|
|
434
|
+
*/
|
|
435
|
+
undo(): boolean;
|
|
436
|
+
/**
|
|
437
|
+
* Current local undo stack size. Zero before a story starts tracking.
|
|
438
|
+
*/
|
|
439
|
+
undo_depth(): number;
|
|
440
|
+
/**
|
|
441
|
+
* Lowers a story straight to the renderer's `LayoutBlock[]` (JSON) — the
|
|
442
|
+
* yrs-authoritative render path (the eventual replacement for the TS
|
|
443
|
+
* `toLayoutBlocks(pmDoc)`). Errors with an unsupported-embed message on any
|
|
444
|
+
* non-native content (e.g. an opaque page-break blob) until that class is
|
|
445
|
+
* promoted to native; the host falls back to the PM render path there.
|
|
446
|
+
* `env_json` carries theme colors, the default tab stop, and list numeric
|
|
447
|
+
* ids (see [`parse_render_env`]).
|
|
448
|
+
*/
|
|
449
|
+
yrs_blocks_for_story(story: string, env_json: string): string;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Loader for the docx-edit wasm (the Rust yrs editing core + resident layout
|
|
454
|
+
* engine). External-asset pattern — see ./loadWasmAsset.ts for the init
|
|
455
|
+
* contract and URL-geometry invariant.
|
|
456
|
+
*
|
|
457
|
+
* Reached only via the `src/yrs/` facade's dynamic `import()`, so the glue
|
|
458
|
+
* (and the wasm fetch) stay out of every non-editor bundle path. The facade's
|
|
459
|
+
* async `createYrsSession` awaits {@link preloadEditWasm} before constructing
|
|
460
|
+
* a session, which also covers the resident engine worker (it bootstraps
|
|
461
|
+
* through the same facade inside the worker context).
|
|
462
|
+
*/
|
|
463
|
+
|
|
464
|
+
/** Load + instantiate the editing-core wasm (browser path). Idempotent. */
|
|
465
|
+
declare function preloadEditWasm(input?: WasmAsyncInput): Promise<void>;
|
|
466
|
+
/**
|
|
467
|
+
* Constructs a raw wasm `EditSession` replica after ensuring the module is
|
|
468
|
+
* initialized. The `src/yrs/` facade wraps this in the typed `YrsSession`
|
|
469
|
+
* surface — nothing else should call it.
|
|
470
|
+
*/
|
|
471
|
+
declare function createEditSession(clientId: number): EditSession;
|
|
472
|
+
|
|
473
|
+
export { EditSession, createEditSession, preloadEditWasm };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as createEditSession,a as preloadEditWasm}from'./chunk-NEWOMDTX.mjs';import'./chunk-T4EZMUXM.mjs';import'./chunk-TTRUPDAB.mjs';
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { W as WasmAsyncInput } from './loadWasmAsset-CMvnVkfA.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Loader for the docx-layout wasm (the Rust display-list builder and the
|
|
5
|
+
* ooxml-text measure surface). External-asset pattern — see ./loadWasmAsset.ts
|
|
6
|
+
* for the init contract and URL-geometry invariant.
|
|
7
|
+
*
|
|
8
|
+
* IMPORTANT: reach this module only via dynamic `import()` — its consumers are
|
|
9
|
+
* the canvas renderer and the Rust measurement source, and those dynamic-import
|
|
10
|
+
* seams await {@link preloadLayoutWasm} before first use.
|
|
11
|
+
*
|
|
12
|
+
* Requires a CSP that permits wasm compilation (`wasm-unsafe-eval`).
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** Load + instantiate the layout wasm (browser path). Idempotent. */
|
|
16
|
+
declare function preloadLayoutWasm(input?: WasmAsyncInput): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Region-aware hit test over a display list: page-local point in,
|
|
19
|
+
* `{"region":"body"|"header"|"footer","rId"?,"pos":n|null}` (or `"null"` for
|
|
20
|
+
* an out-of-range page) JSON out. Header/footer hits identify the HF PM doc
|
|
21
|
+
* by `rId`; their `pos` refers to that doc, not the body doc.
|
|
22
|
+
*/
|
|
23
|
+
declare function hitTestRegionsJson(displayList: string, pageIndex: number, x: number, y: number): string;
|
|
24
|
+
/**
|
|
25
|
+
* Highlight rects for a body PM range over a display list: JSON array of
|
|
26
|
+
* `{pageIndex, x, y, width, height}` in page-local px. Body-only — HF doc
|
|
27
|
+
* positions live in different PM docs and are never consulted.
|
|
28
|
+
*/
|
|
29
|
+
declare function rangeRectsJson(displayList: string, from: number, to: number): string;
|
|
30
|
+
/**
|
|
31
|
+
* True when the embedded layout wasm carries the session-handle query exports.
|
|
32
|
+
* Callers gate the handle path on this and otherwise use the JSON-arg exports.
|
|
33
|
+
*/
|
|
34
|
+
declare function hasDisplayListSession(): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* True when the embedded layout wasm carries the region-aware range-rect exports
|
|
37
|
+
* (`range_rects_region_json` and its by-handle twin). Callers gate the HF
|
|
38
|
+
* selection/caret geometry on this and otherwise return `[]` — probing here
|
|
39
|
+
* avoids ever invoking (and thus dropping the session handle over) an absent
|
|
40
|
+
* export before the integrator re-embeds.
|
|
41
|
+
*/
|
|
42
|
+
declare function hasRangeRectsRegion(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Parse a display list once and return a handle the by-handle queries reuse.
|
|
45
|
+
* Throws when the export is absent (pre-re-embed) or the JSON is malformed;
|
|
46
|
+
* the query facade catches it and stays on the JSON-arg path.
|
|
47
|
+
*/
|
|
48
|
+
declare function openDisplayList(displayList: string): number;
|
|
49
|
+
/** Drop a display-list handle so its parsed list is freed. No-op when the export is absent. */
|
|
50
|
+
declare function closeDisplayList(handle: number): void;
|
|
51
|
+
/**
|
|
52
|
+
* Region-aware hit test against a stored display list (by handle). Throws when
|
|
53
|
+
* the export is absent or the handle is unknown/closed — the facade catches it
|
|
54
|
+
* and falls back to `hitTestRegionsJson`.
|
|
55
|
+
*/
|
|
56
|
+
declare function hitTestRegionsByHandle(handle: number, pageIndex: number, x: number, y: number): string;
|
|
57
|
+
/**
|
|
58
|
+
* Highlight rects for a body PM range against a stored display list (by handle).
|
|
59
|
+
* Throws when the export is absent or the handle is unknown/closed.
|
|
60
|
+
*/
|
|
61
|
+
declare function rangeRectsByHandle(handle: number, from: number, to: number): string;
|
|
62
|
+
/**
|
|
63
|
+
* Region-aware highlight rects for a PM range: `region` is
|
|
64
|
+
* `"body" | "header" | "footer"`; `rId` scopes header/footer to one HF part
|
|
65
|
+
* (empty string for body / match-any). The `from`/`to` refer to that region's
|
|
66
|
+
* PM doc. Like the session exports, this is resolved by name so the glyph/HF
|
|
67
|
+
* pipeline is safe to ship before the integrator re-embeds; throws when absent
|
|
68
|
+
* so the facade falls back to `[]` (HF selection geometry stays a documented
|
|
69
|
+
* gap until the re-embed lands).
|
|
70
|
+
*/
|
|
71
|
+
declare function rangeRectsRegionJson(displayList: string, region: string, rId: string, from: number, to: number): string;
|
|
72
|
+
/**
|
|
73
|
+
* Region-aware highlight rects against a stored display list (by handle). Throws
|
|
74
|
+
* when the export is absent or the handle is unknown/closed.
|
|
75
|
+
*/
|
|
76
|
+
declare function rangeRectsRegionByHandle(handle: number, region: string, rId: string, from: number, to: number): string;
|
|
77
|
+
/** `{ measured, options, layout }` JSON in, `DisplayList` JSON out. Throws on inputs the Rust builder rejects. */
|
|
78
|
+
declare function buildDisplayListJson(input: string): string;
|
|
79
|
+
/**
|
|
80
|
+
* Pagination: `{ measured, options }` JSON in (the golden-fixture envelope),
|
|
81
|
+
* `Layout` JSON out. Throws for inputs the Rust layout kernel rejects — the
|
|
82
|
+
* layout pipeline surfaces the error and keeps the previous committed
|
|
83
|
+
* layout; there is no fallback engine.
|
|
84
|
+
*/
|
|
85
|
+
declare function layoutDocumentJson(input: string): string;
|
|
86
|
+
/**
|
|
87
|
+
* Register raw sfnt bytes with the measurement FontStore; returns the font id
|
|
88
|
+
* that `measureParagraphJson` inputs reference in their `fontChains`. Throws
|
|
89
|
+
* on malformed bytes (embedded fonts are attacker-controlled — the engine
|
|
90
|
+
* rejects unparseable input at this boundary).
|
|
91
|
+
*/
|
|
92
|
+
declare function registerMeasureFont(bytes: Uint8Array): number;
|
|
93
|
+
/** Drop every registered measurement font (ids restart at 0). Callers must re-register before the next `measureParagraphJson`. */
|
|
94
|
+
declare function clearMeasureFonts(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Measurement input JSON in, `ParagraphExtent` JSON out. Throws with a
|
|
97
|
+
* message starting `"UNSUPPORTED"` for blocks the Rust engine cannot measure
|
|
98
|
+
* yet — the caller must fall back to browser measurement for that block.
|
|
99
|
+
*/
|
|
100
|
+
declare function measureParagraphJson(input: string): string;
|
|
101
|
+
/**
|
|
102
|
+
* Glyph outline for `(fontId, glyphId)` as JSON:
|
|
103
|
+
* `{"upem":2048,"cmds":[{"t":"M",..},{"t":"L",..},{"t":"Q",..},{"t":"C",..},{"t":"Z"}]}`
|
|
104
|
+
* — commands in font units, y-up (font convention). `fontId` is a
|
|
105
|
+
* measurement-FontStore id (`registerMeasureFont`), `glyphId` a glyph index
|
|
106
|
+
* from shaping. Throws when the export is absent (pre-integration) or the
|
|
107
|
+
* glyph cannot be extracted; the canvas backend catches it and paints the run
|
|
108
|
+
* via `fillText` so text is never invisible.
|
|
109
|
+
*/
|
|
110
|
+
declare function outlineGlyphJson(fontId: number, glyphId: number): string;
|
|
111
|
+
|
|
112
|
+
export { buildDisplayListJson, clearMeasureFonts, closeDisplayList, hasDisplayListSession, hasRangeRectsRegion, hitTestRegionsByHandle, hitTestRegionsJson, layoutDocumentJson, measureParagraphJson, openDisplayList, outlineGlyphJson, preloadLayoutWasm, rangeRectsByHandle, rangeRectsJson, rangeRectsRegionByHandle, rangeRectsRegionJson, registerMeasureFont };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{l as buildDisplayListJson,o as clearMeasureFonts,g as closeDisplayList,d as hasDisplayListSession,e as hasRangeRectsRegion,h as hitTestRegionsByHandle,b as hitTestRegionsJson,m as layoutDocumentJson,p as measureParagraphJson,f as openDisplayList,q as outlineGlyphJson,a as preloadLayoutWasm,i as rangeRectsByHandle,c as rangeRectsJson,k as rangeRectsRegionByHandle,j as rangeRectsRegionJson,n as registerMeasureFont}from'./chunk-CIRN3LZA.mjs';import'./chunk-T4EZMUXM.mjs';import'./chunk-TTRUPDAB.mjs';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { W as WasmAsyncInput } from './loadWasmAsset-CMvnVkfA.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Loader for the ooxml-opc wasm (the OPC zip container: unzip/rezip with
|
|
5
|
+
* zip-bomb and path-traversal guards). External-asset pattern — see
|
|
6
|
+
* ./loadWasmAsset.ts for the init contract and URL-geometry invariant.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** Load + instantiate the container wasm (browser path). Idempotent. */
|
|
10
|
+
declare function preloadOpcWasm(input?: WasmAsyncInput): Promise<void>;
|
|
11
|
+
/** Inflate a DOCX container into `{ [path]: Uint8Array }`. */
|
|
12
|
+
declare function unzipContainer(data: Uint8Array): Record<string, Uint8Array>;
|
|
13
|
+
/** Deflate `{ [path]: Uint8Array }` into DOCX bytes. */
|
|
14
|
+
declare function rezipContainer(entries: Record<string, Uint8Array>): Uint8Array;
|
|
15
|
+
|
|
16
|
+
export { preloadOpcWasm, rezipContainer, unzipContainer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as preloadOpcWasm,c as rezipContainer,b as unzipContainer}from'./chunk-H3JCIGWK.mjs';import'./chunk-T4EZMUXM.mjs';import'./chunk-TTRUPDAB.mjs';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { W as WasmAsyncInput } from './loadWasmAsset-CMvnVkfA.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Loader for the docx-parse wasm (the Rust DOCX parser/serializer wire).
|
|
5
|
+
* External-asset pattern — see ./loadWasmAsset.ts for the init contract and
|
|
6
|
+
* URL-geometry invariant.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** Load + instantiate the parser wasm (browser path). Idempotent. */
|
|
10
|
+
declare function preloadParseWasm(input?: WasmAsyncInput): Promise<void>;
|
|
11
|
+
declare function parseDocxS9Wire(data: Uint8Array, optionsJson: string): string;
|
|
12
|
+
declare function parseRelationshipsXmlWire(data: Uint8Array, partPath: string): string;
|
|
13
|
+
declare function serializeDocxS10Wire(requestJson: string): string;
|
|
14
|
+
declare function serializeDocxS11Wire(requestJson: string): string;
|
|
15
|
+
declare function serializeDocxS12Wire(requestJson: string): string;
|
|
16
|
+
declare function writeDocxS13Wire(requestJson: string, originalDocx: Uint8Array): Uint8Array;
|
|
17
|
+
|
|
18
|
+
export { parseDocxS9Wire, parseRelationshipsXmlWire, preloadParseWasm, serializeDocxS10Wire, serializeDocxS11Wire, serializeDocxS12Wire, writeDocxS13Wire };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as parseDocxS9Wire,c as parseRelationshipsXmlWire,a as preloadParseWasm,d as serializeDocxS10Wire,e as serializeDocxS11Wire,f as serializeDocxS12Wire,g as writeDocxS13Wire}from'./chunk-SINEY6ZF.mjs';import'./chunk-T4EZMUXM.mjs';import'./chunk-TTRUPDAB.mjs';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Document } from './types/document.mjs';
|
|
2
|
+
import { W as Watermark } from './content-sSHuWw49.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Watermark document API
|
|
6
|
+
*
|
|
7
|
+
* Platform-agnostic helpers for reading and applying a document watermark.
|
|
8
|
+
* Shared by the React and Vue adapters (and the imperative ref API) so the
|
|
9
|
+
* "Design → Watermark" behavior stays identical across frameworks.
|
|
10
|
+
*
|
|
11
|
+
* A watermark lives on `HeaderFooter.watermark`. MS Word repeats the same
|
|
12
|
+
* watermark across the default, first-page, and even-page headers of every
|
|
13
|
+
* section, so `setDocumentWatermark`:
|
|
14
|
+
*
|
|
15
|
+
* 1. Applies the watermark (a per-header copy) to every existing header, and
|
|
16
|
+
* 2. Creates the header parts a section needs but lacks, so the watermark
|
|
17
|
+
* still shows on title pages (`w:titlePg`) and even pages
|
|
18
|
+
* (`w:evenAndOddHeaders`) and on documents that had no header at all.
|
|
19
|
+
*
|
|
20
|
+
* To avoid breaking header inheritance (a section that omits a header
|
|
21
|
+
* reference inherits the previous section's header — Word's "link to
|
|
22
|
+
* previous"), a missing `first`/`even` header part is only created when **no**
|
|
23
|
+
* header of that type exists anywhere in the document, i.e. there is nothing to
|
|
24
|
+
* inherit. All updates are immutable — a new `Document` is returned so the
|
|
25
|
+
* change lands in the host's undo/redo history.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/** Read the document's watermark (the first header that carries one). */
|
|
29
|
+
declare function getDocumentWatermark(doc: Document | null | undefined): Watermark | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Return a new `Document` with the watermark applied to all headers, or removed
|
|
32
|
+
* when `watermark` is null. Creates the header parts a section needs but lacks
|
|
33
|
+
* (default for a headerless doc; first/even for title/even pages) so the
|
|
34
|
+
* watermark shows on every page MS Word would show it.
|
|
35
|
+
*/
|
|
36
|
+
declare function setDocumentWatermark(doc: Document, watermark: Watermark | null): Document;
|
|
37
|
+
|
|
38
|
+
export { getDocumentWatermark as g, setDocumentWatermark as s };
|