docxkeun 0.1.3 → 0.3.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.
Files changed (199) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +166 -16
  3. package/dist/api/editor.d.ts +231 -7
  4. package/dist/api/editor.js +1125 -26
  5. package/dist/api/headers.d.ts +51 -0
  6. package/dist/api/headers.js +133 -0
  7. package/dist/api/index.d.ts +6 -1
  8. package/dist/api/index.js +4 -1
  9. package/dist/api/lists.d.ts +37 -0
  10. package/dist/api/lists.js +132 -0
  11. package/dist/api/parts.js +1 -0
  12. package/dist/api/positions.js +1 -0
  13. package/dist/api/revisions.d.ts +61 -0
  14. package/dist/api/revisions.js +401 -0
  15. package/dist/api/selection.d.ts +57 -0
  16. package/dist/api/selection.js +91 -0
  17. package/dist/api/tables.d.ts +60 -0
  18. package/dist/api/tables.js +138 -0
  19. package/dist/charts/color.d.ts +45 -0
  20. package/dist/charts/color.js +322 -0
  21. package/dist/charts/format.d.ts +12 -0
  22. package/dist/charts/format.js +459 -0
  23. package/dist/charts/index.d.ts +11 -0
  24. package/dist/charts/index.js +8 -0
  25. package/dist/charts/model.d.ts +225 -0
  26. package/dist/charts/model.js +758 -0
  27. package/dist/charts/outline.d.ts +17 -0
  28. package/dist/charts/outline.js +214 -0
  29. package/dist/charts/render.d.ts +20 -0
  30. package/dist/charts/render.js +1772 -0
  31. package/dist/drawing/arrows.d.ts +37 -0
  32. package/dist/drawing/arrows.js +99 -0
  33. package/dist/drawing/formula.d.ts +40 -0
  34. package/dist/drawing/formula.js +159 -0
  35. package/dist/drawing/geometry.d.ts +61 -0
  36. package/dist/drawing/geometry.js +286 -0
  37. package/dist/drawing/index.d.ts +12 -0
  38. package/dist/drawing/index.js +8 -0
  39. package/dist/drawing/presets.d.ts +72 -0
  40. package/dist/drawing/presets.js +2874 -0
  41. package/dist/fonts/shaping/apply.d.ts +94 -0
  42. package/dist/fonts/shaping/apply.js +349 -0
  43. package/dist/fonts/shaping/arabic.d.ts +28 -0
  44. package/dist/fonts/shaping/arabic.js +235 -0
  45. package/dist/fonts/shaping/buffer.d.ts +53 -0
  46. package/dist/fonts/shaping/buffer.js +95 -0
  47. package/dist/fonts/shaping/gdef.d.ts +30 -0
  48. package/dist/fonts/shaping/gdef.js +66 -0
  49. package/dist/fonts/shaping/gpos.d.ts +86 -0
  50. package/dist/fonts/shaping/gpos.js +428 -0
  51. package/dist/fonts/shaping/gsub.d.ts +65 -0
  52. package/dist/fonts/shaping/gsub.js +313 -0
  53. package/dist/fonts/shaping/index.d.ts +32 -0
  54. package/dist/fonts/shaping/index.js +402 -0
  55. package/dist/fonts/shaping/indic.d.ts +6 -0
  56. package/dist/fonts/shaping/indic.js +805 -0
  57. package/dist/fonts/shaping/layout-common.d.ts +124 -0
  58. package/dist/fonts/shaping/layout-common.js +349 -0
  59. package/dist/fonts/shaping/plan.d.ts +87 -0
  60. package/dist/fonts/shaping/plan.js +152 -0
  61. package/dist/fonts/shaping/scripts.d.ts +26 -0
  62. package/dist/fonts/shaping/scripts.js +160 -0
  63. package/dist/fonts/shaping/shaper.d.ts +23 -0
  64. package/dist/fonts/shaping/shaper.js +5 -0
  65. package/dist/fonts/shaping/unicode.d.ts +34 -0
  66. package/dist/fonts/shaping/unicode.js +138 -0
  67. package/dist/images/bmp.d.ts +9 -0
  68. package/dist/images/bmp.js +234 -0
  69. package/dist/images/gif.d.ts +9 -0
  70. package/dist/images/gif.js +215 -0
  71. package/dist/images/index.d.ts +18 -0
  72. package/dist/images/index.js +63 -0
  73. package/dist/images/png-encode.d.ts +4 -0
  74. package/dist/images/png-encode.js +73 -0
  75. package/dist/images/size.d.ts +10 -0
  76. package/dist/images/size.js +83 -0
  77. package/dist/images/tiff.d.ts +14 -0
  78. package/dist/images/tiff.js +407 -0
  79. package/dist/index.d.ts +7 -2
  80. package/dist/index.js +5 -0
  81. package/dist/layout/bidi.d.ts +18 -0
  82. package/dist/layout/bidi.js +71 -0
  83. package/dist/layout/blocks.d.ts +20 -3
  84. package/dist/layout/blocks.js +88 -58
  85. package/dist/layout/cache.d.ts +31 -0
  86. package/dist/layout/cache.js +38 -0
  87. package/dist/layout/drawing.d.ts +30 -0
  88. package/dist/layout/drawing.js +120 -0
  89. package/dist/layout/engine.d.ts +3 -0
  90. package/dist/layout/engine.js +218 -11
  91. package/dist/layout/index.d.ts +1 -0
  92. package/dist/layout/index.js +1 -0
  93. package/dist/layout/lines.d.ts +63 -5
  94. package/dist/layout/lines.js +245 -20
  95. package/dist/layout/paint.d.ts +25 -3
  96. package/dist/layout/paint.js +26 -10
  97. package/dist/layout/shapes.d.ts +7 -0
  98. package/dist/layout/shapes.js +338 -0
  99. package/dist/layout/style.d.ts +4 -0
  100. package/dist/layout/style.js +2 -0
  101. package/dist/layout/types.d.ts +89 -2
  102. package/dist/math/boxes.d.ts +88 -0
  103. package/dist/math/boxes.js +166 -0
  104. package/dist/math/index.d.ts +29 -0
  105. package/dist/math/index.js +44 -0
  106. package/dist/math/layout.d.ts +13 -0
  107. package/dist/math/layout.js +771 -0
  108. package/dist/math/linear.d.ts +3 -0
  109. package/dist/math/linear.js +152 -0
  110. package/dist/math/omml.d.ts +15 -0
  111. package/dist/math/omml.js +57 -0
  112. package/dist/math/paths.d.ts +61 -0
  113. package/dist/math/paths.js +450 -0
  114. package/dist/math/symbols.d.ts +49 -0
  115. package/dist/math/symbols.js +269 -0
  116. package/dist/math/text.d.ts +53 -0
  117. package/dist/math/text.js +316 -0
  118. package/dist/metafile/canvas.d.ts +80 -0
  119. package/dist/metafile/canvas.js +515 -0
  120. package/dist/metafile/dib.d.ts +27 -0
  121. package/dist/metafile/dib.js +300 -0
  122. package/dist/metafile/emf.d.ts +31 -0
  123. package/dist/metafile/emf.js +591 -0
  124. package/dist/metafile/geometry.d.ts +49 -0
  125. package/dist/metafile/geometry.js +85 -0
  126. package/dist/metafile/index.d.ts +27 -0
  127. package/dist/metafile/index.js +34 -0
  128. package/dist/metafile/reader.d.ts +28 -0
  129. package/dist/metafile/reader.js +59 -0
  130. package/dist/metafile/state.d.ts +118 -0
  131. package/dist/metafile/state.js +172 -0
  132. package/dist/metafile/text.d.ts +17 -0
  133. package/dist/metafile/text.js +130 -0
  134. package/dist/metafile/wmf.d.ts +33 -0
  135. package/dist/metafile/wmf.js +395 -0
  136. package/dist/model/content.d.ts +92 -7
  137. package/dist/model/content.js +251 -17
  138. package/dist/model/document.d.ts +34 -1
  139. package/dist/model/document.js +80 -1
  140. package/dist/model/fields.d.ts +4 -0
  141. package/dist/model/fields.js +10 -0
  142. package/dist/model/numbering.d.ts +2 -0
  143. package/dist/model/numbering.js +22 -0
  144. package/dist/model/props.d.ts +2 -0
  145. package/dist/model/props.js +3 -0
  146. package/dist/opc/index.d.ts +1 -1
  147. package/dist/opc/package.d.ts +34 -0
  148. package/dist/opc/package.js +58 -4
  149. package/dist/pdf/export.js +97 -6
  150. package/dist/pdf/images.d.ts +7 -0
  151. package/dist/pdf/images.js +39 -2
  152. package/dist/render/activity.d.ts +179 -0
  153. package/dist/render/activity.js +1003 -0
  154. package/dist/render/clipboard.d.ts +29 -0
  155. package/dist/render/clipboard.js +401 -0
  156. package/dist/render/comments.d.ts +166 -0
  157. package/dist/render/comments.js +779 -0
  158. package/dist/render/context-menu.d.ts +124 -0
  159. package/dist/render/context-menu.js +525 -0
  160. package/dist/render/editing.d.ts +146 -5
  161. package/dist/render/editing.js +678 -53
  162. package/dist/render/index.d.ts +12 -0
  163. package/dist/render/index.js +11 -0
  164. package/dist/render/navigation-panel.d.ts +76 -0
  165. package/dist/render/navigation-panel.js +431 -0
  166. package/dist/render/selection.js +5 -0
  167. package/dist/render/svg.d.ts +4 -6
  168. package/dist/render/svg.js +69 -7
  169. package/dist/render/toolbar.d.ts +83 -0
  170. package/dist/render/toolbar.js +505 -0
  171. package/dist/render/ui/comment-layout.d.ts +39 -0
  172. package/dist/render/ui/comment-layout.js +79 -0
  173. package/dist/render/ui/icons.d.ts +6 -0
  174. package/dist/render/ui/icons.js +38 -0
  175. package/dist/render/ui/menu.d.ts +38 -0
  176. package/dist/render/ui/menu.js +274 -0
  177. package/dist/render/ui/nav-model.d.ts +11 -0
  178. package/dist/render/ui/nav-model.js +34 -0
  179. package/dist/render/ui/overflow.d.ts +5 -0
  180. package/dist/render/ui/overflow.js +18 -0
  181. package/dist/render/ui/popover.d.ts +18 -0
  182. package/dist/render/ui/popover.js +109 -0
  183. package/dist/render/ui/theme.d.ts +2 -0
  184. package/dist/render/ui/theme.js +29 -0
  185. package/dist/render/undo.d.ts +76 -0
  186. package/dist/render/undo.js +144 -0
  187. package/dist/render/viewer.d.ts +100 -7
  188. package/dist/render/viewer.js +304 -92
  189. package/dist/security/policy.d.ts +3 -0
  190. package/dist/security/policy.js +6 -2
  191. package/dist/security/protection.d.ts +1 -0
  192. package/dist/security/protection.js +1 -1
  193. package/dist/text/bidi-data.d.ts +53 -0
  194. package/dist/text/bidi-data.js +318 -0
  195. package/dist/text/bidi.d.ts +37 -0
  196. package/dist/text/bidi.js +508 -0
  197. package/dist/xml/ns.d.ts +5 -0
  198. package/dist/xml/ns.js +7 -0
  199. package/package.json +9 -2
@@ -0,0 +1,144 @@
1
+ /**
2
+ * One undo history for the viewer's editing: typing keeps a copy of the story's XML (cheap, one
3
+ * part), while actions that can touch other parts (comments, lists, headers) keep a whole-document
4
+ * checkpoint. No DOM here, so the history can be used and tested without a browser.
5
+ */
6
+ import { EditError } from '../api/positions.js';
7
+ export class UndoHistory {
8
+ limit;
9
+ /**
10
+ * How long (ms) a transaction waits for the one ahead of it before it gives up with an
11
+ * `EditError`. A change started after an `await` inside a transaction's own `run` waits for
12
+ * that run, which may be waiting for it: this turns that hang into an error.
13
+ */
14
+ static queueTimeout = 10_000;
15
+ undoStack = [];
16
+ redoStack = [];
17
+ tail = Promise.resolve();
18
+ pending = 0;
19
+ /** A transaction's `run` is executing synchronously (before its first `await` takes effect). */
20
+ joinDepth = 0;
21
+ constructor(limit = 200) {
22
+ this.limit = limit;
23
+ }
24
+ /** Record a new step; anything that could be redone is dropped. */
25
+ push(e) {
26
+ this.undoStack.push(e);
27
+ if (this.undoStack.length > this.limit)
28
+ this.undoStack.shift();
29
+ this.redoStack.length = 0;
30
+ }
31
+ /**
32
+ * Step back. `current` builds the entry for the state being left (of the same kind as the entry
33
+ * being restored); it goes on the redo stack. Returns the entry to restore.
34
+ */
35
+ undo(current) {
36
+ if (this.pending)
37
+ return undefined;
38
+ const e = this.undoStack[this.undoStack.length - 1];
39
+ if (!e)
40
+ return undefined;
41
+ this.redoStack.push(current(e));
42
+ this.undoStack.pop();
43
+ return e;
44
+ }
45
+ redo(current) {
46
+ if (this.pending)
47
+ return undefined;
48
+ const e = this.redoStack[this.redoStack.length - 1];
49
+ if (!e)
50
+ return undefined;
51
+ this.undoStack.push(current(e));
52
+ this.redoStack.pop();
53
+ return e;
54
+ }
55
+ clear() {
56
+ this.undoStack.length = 0;
57
+ this.redoStack.length = 0;
58
+ }
59
+ /** A transaction is running or waiting; undo and redo do nothing meanwhile. */
60
+ get busy() {
61
+ return this.pending > 0;
62
+ }
63
+ /**
64
+ * A transaction's `run` is executing synchronously: a transaction started now is nested in it
65
+ * and joins it. Later in the run (after an `await`) this is false, as there is no telling a
66
+ * nested call from an unrelated one.
67
+ */
68
+ get joinable() {
69
+ return this.joinDepth > 0;
70
+ }
71
+ get canUndo() {
72
+ return this.undoStack.length > 0;
73
+ }
74
+ get canRedo() {
75
+ return this.redoStack.length > 0;
76
+ }
77
+ /**
78
+ * Run a whole-document action as one undo step. A failure puts the document back as it was
79
+ * and records nothing.
80
+ *
81
+ * Transactions run one at a time: one requested while another is running waits for it, so it
82
+ * checkpoints a settled document and is an undo step of its own, and the other's failure does
83
+ * not touch it. If the wait passes `UndoHistory.queueTimeout`, it gives up with an `EditError`
84
+ * without running (nothing changed, nothing recorded).
85
+ *
86
+ * A transaction requested while another one's `run` is executing synchronously (a nested call
87
+ * before the run's first `await`) joins it: it runs at once as part of that step, with no
88
+ * checkpoint or entry of its own, and a failure goes to the outer `run` (which restores the
89
+ * document if it lets the error through). Later in the run, changes go through the run's own
90
+ * means (the editor it was given), since waiting for the outer step from inside it cannot end.
91
+ */
92
+ async transaction(doc, label, run, where) {
93
+ if (this.joinDepth)
94
+ return await run();
95
+ const before = this.tail;
96
+ let release;
97
+ this.tail = new Promise((r) => (release = r));
98
+ this.pending++;
99
+ let started = false;
100
+ try {
101
+ await waitFor(before, UndoHistory.queueTimeout);
102
+ started = true;
103
+ const checkpoint = doc.checkpoint();
104
+ try {
105
+ let running;
106
+ this.joinDepth++;
107
+ try {
108
+ running = run();
109
+ }
110
+ finally {
111
+ this.joinDepth--;
112
+ }
113
+ const result = await running;
114
+ this.push({ kind: 'package', checkpoint, story: where.story, ...(where.container !== undefined ? { container: where.container } : {}), anchor: { ...where.anchor }, focus: { ...where.focus }, label });
115
+ return result;
116
+ }
117
+ catch (error) {
118
+ doc.restore(checkpoint);
119
+ throw error;
120
+ }
121
+ }
122
+ finally {
123
+ this.pending--;
124
+ // One that gave up keeps its place: the next one still waits for the one ahead of it.
125
+ if (started)
126
+ release();
127
+ else
128
+ void before.then(release);
129
+ }
130
+ }
131
+ }
132
+ /** Wait for `turn`, or reject with an `EditError` after `ms`. */
133
+ async function waitFor(turn, ms) {
134
+ let timer;
135
+ const gaveUp = new Promise((_, reject) => {
136
+ timer = setTimeout(() => reject(new EditError('Another change is still running. Inside viewer.editing.transaction(), make changes through the editor it gives you.')), ms);
137
+ });
138
+ try {
139
+ await Promise.race([turn, gaveUp]);
140
+ }
141
+ finally {
142
+ clearTimeout(timer);
143
+ }
144
+ }
@@ -7,7 +7,13 @@ import { FontRegistry } from '../fonts/registry.js';
7
7
  import type { LayoutResult, Page, PermArea } from '../layout/types.js';
8
8
  import { DocxDocument, type OpenOptions } from '../model/document.js';
9
9
  import type { LinkTarget } from '../model/fields.js';
10
- import { InlineEditing, type EditingOptions } from './editing.js';
10
+ import { InlineEditing, type CaretFormat, type EditingOptions, type EditStory } from './editing.js';
11
+ import { type SelectionInfo } from '../api/selection.js';
12
+ import { ToolbarController, type ToolbarOptions } from './toolbar.js';
13
+ import { NavigationController, type NavigationOptions } from './navigation-panel.js';
14
+ import { ContextMenuController, type ContextMenuOptions } from './context-menu.js';
15
+ import { CommentsController, type CommentsOptions } from './comments.js';
16
+ import { AiActivity, type ActivityOptions } from './activity.js';
11
17
  import { type DocLocation, type NavKind, type NavTarget, type NavTargets } from './navigation.js';
12
18
  import { type InlinePosition } from './selection.js';
13
19
  export interface ViewerOptions {
@@ -29,6 +35,19 @@ export interface ViewerOptions {
29
35
  * what they may change; refused edits are reported through the `editerror` event.
30
36
  */
31
37
  editable?: boolean | EditingOptions;
38
+ /**
39
+ * How an AI assistant's work shows (`viewer.activity`): `false` turns it off, or pass options
40
+ * (`animate: false` for highlights without motion, `marks: false` for no change bars).
41
+ */
42
+ aiActivity?: false | ActivityOptions;
43
+ /** Show a formatting toolbar above the pages while editing (or put it in this element). */
44
+ toolbar?: boolean | HTMLElement | ToolbarOptions;
45
+ /** Show the navigation panel (outline, bookmarks, links) beside the pages. */
46
+ navigation?: boolean | NavigationOptions;
47
+ /** The comment column: `mode` (`auto` switches between cards and bubbles by width) and `showResolved`. `showComments: false` hides it. */
48
+ comments?: CommentsOptions;
49
+ /** Right-click menu (off by default). Shift + right-click still shows the browser's own menu. */
50
+ contextMenu?: boolean | ContextMenuOptions;
32
51
  }
33
52
  export interface ViewerEvents {
34
53
  /** A link was clicked. Call `preventDefault()` to stop the viewer from following it. */
@@ -62,6 +81,24 @@ export interface ViewerEvents {
62
81
  location: DocLocation;
63
82
  target?: NavTarget;
64
83
  };
84
+ /** What is selected (or where the caret is) changed: paragraph numbers, text and pages. */
85
+ selectioninfo: {
86
+ selection: SelectionInfo | undefined;
87
+ };
88
+ /** The caret moved into a header, footer, note or text box, or back to the body. */
89
+ storychange: {
90
+ story: EditStory;
91
+ };
92
+ /** The selection or caret moved, or the formatting at it changed (for toolbars). */
93
+ caretchange: {
94
+ format: CaretFormat | undefined;
95
+ };
96
+ /** A chrome part (toolbar, navigation panel, comment column, context menu) was shown, hidden or folded. */
97
+ chromechange: {
98
+ part: 'toolbar' | 'navigation' | 'comments' | 'contextMenu';
99
+ visible: boolean;
100
+ collapsed?: boolean;
101
+ };
65
102
  }
66
103
  type Listener<K extends keyof ViewerEvents> = (event: ViewerEvents[K]) => void;
67
104
  /** Allow only links whose scheme is on the allow-list. */
@@ -78,19 +115,61 @@ export declare class DocxViewer {
78
115
  private readonly rows;
79
116
  private readonly mounted;
80
117
  private observer;
81
- private comments;
118
+ private commentMap;
119
+ private threadCache;
82
120
  private readonly listeners;
83
121
  private unsubscribe;
84
122
  private relayoutScheduled;
123
+ private layoutCache;
85
124
  private zoomLevel;
86
- private activeComment;
125
+ private activeComments;
87
126
  private editingLayer;
127
+ private toolbarCtl;
128
+ private navigationCtl;
129
+ private commentsCtl;
130
+ private contextMenuCtl;
131
+ private readonly containerEl;
88
132
  private renderedShape;
89
133
  private navTargets;
90
134
  private navCursor;
91
135
  private readonly past;
92
136
  private readonly future;
93
137
  constructor(container: HTMLElement, options?: ViewerOptions);
138
+ /** The threads of the document, in order: each root comment with its replies and anchor. */
139
+ private commentThreads;
140
+ /** What the comment column needs from this viewer. */
141
+ private commentsHost;
142
+ private frameParts;
143
+ /**
144
+ * The frame around the viewer, created on first call: `container > .docxkeun-frame >
145
+ * [.docxkeun-toolbar-slot, .docxkeun-body > root]`. Only chrome parts call it; without them
146
+ * the root stays a direct child of the container.
147
+ * @internal
148
+ */
149
+ frame(): {
150
+ frame: HTMLDivElement;
151
+ toolbarSlot: HTMLDivElement;
152
+ body: HTMLDivElement;
153
+ };
154
+ private activityLayer;
155
+ /**
156
+ * An AI assistant's presence on the pages: `work([4, 5])` shimmers the paragraphs it is
157
+ * changing (with its caret), `reveal(before)` animates what changed. Created on first use.
158
+ */
159
+ get activity(): AiActivity;
160
+ /** The formatting toolbar: `show()`, `hide()`, `collapsed`. Shown when the `toolbar` option is set. */
161
+ get toolbar(): ToolbarController;
162
+ /** The comment column: `show()`, `hide()`, `mode`, `open(id)`, `compose()`, `width`. */
163
+ get comments(): CommentsController;
164
+ /** The right-click menu: `enable()`, `disable()`, `open(x, y)`, `close()`. Enabled by the `contextMenu` option. */
165
+ get contextMenu(): ContextMenuController;
166
+ /** The element the viewer was created in (where chrome such as the menu is placed). @internal */
167
+ get container(): HTMLElement;
168
+ /** A picture as a blob a browser shows (for copying it). Undefined for external or unreadable images. @internal */
169
+ imageBlob(image: {
170
+ target: string | undefined;
171
+ external: boolean;
172
+ }): Promise<Blob | undefined>;
94
173
  /** In-page editing (present when the viewer was created with `editable`). */
95
174
  get editing(): InlineEditing | undefined;
96
175
  /** Turn typing on the pages on or off. */
@@ -125,13 +204,17 @@ export declare class DocxViewer {
125
204
  private linkElement;
126
205
  /** Follow a link the way a click does: emit `linkclick`, then open it or jump to the bookmark. */
127
206
  followLink(target: LinkTarget): void;
128
- private renderComments;
129
- private commentBody;
130
207
  scrollToPage(index: number, y?: number): void;
131
208
  /** Scroll to a bookmark. Returns false when the bookmark does not exist. */
132
209
  scrollToAnchor(name: string): boolean;
133
- /** Headings, bookmarks and hyperlinks of the current layout, each in document order. */
134
- get navigation(): NavTargets;
210
+ /**
211
+ * The navigation panel: `show()`, `hide()`, `collapsed`, `tab`. It also lists the headings,
212
+ * bookmarks and hyperlinks of the current layout (`headings`, `bookmarks`, `links`), each in
213
+ * document order.
214
+ */
215
+ get navigation(): NavigationController;
216
+ /** The navigation targets of the current layout, collected once per layout. @internal */
217
+ collectedTargets(): NavTargets;
135
218
  /** The location at the top of the viewport. */
136
219
  get location(): DocLocation;
137
220
  /**
@@ -165,6 +248,16 @@ export declare class DocxViewer {
165
248
  end: InlinePosition;
166
249
  } | undefined;
167
250
  private onSelectionChange;
251
+ private selectionTimer;
252
+ private lastSelectionKey;
253
+ /** @internal The caret or the selection moved: tell `selectioninfo` listeners (batched, when it changed). */
254
+ selectionMoved(): void;
255
+ /**
256
+ * What the user has selected, or where the caret is: paragraph numbers (as docxkeun-mcp's
257
+ * read_document numbers them), offsets, pages and text. The editing caret when typing is on,
258
+ * otherwise the browser's text selection on the pages. `describeSelection` turns it into a prompt.
259
+ */
260
+ selectionInfo(): SelectionInfo | undefined;
168
261
  destroy(): void;
169
262
  }
170
263
  export {};