@docvyu/sdk 0.0.6 → 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 +47 -32
- package/dist/cdn/docvyu.js +2268 -120
- package/dist/cdn/docvyu.min.js +1 -1
- package/dist/cjs/DocvyuEditor-BOTw6i4d.js +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/react/index.js +1 -1
- package/dist/esm/DocvyuEditor-CDLqMpaq.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/react/index.js +1 -1
- package/dist/types/app/DocvyuApp.d.ts +187 -0
- package/dist/types/app/index.d.ts +0 -2
- package/dist/types/core/DocvyuEditor.d.ts +402 -57
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/i18n/types.d.ts +128 -0
- package/dist/wasm/docvyu_core.d.ts +8 -182
- package/dist/wasm/docvyu_core.js +1 -1
- package/dist/wasm/docvyu_core_bg.wasm +0 -0
- package/dist/wasm/docvyu_core_bg.wasm.d.ts +0 -56
- package/package.json +2 -2
- package/wasm/docvyu_core.d.ts +8 -182
- package/wasm/docvyu_core.js +1297 -200
- package/wasm/docvyu_core_bg.wasm +0 -0
- package/wasm/docvyu_core_bg.wasm.d.ts +0 -56
- package/dist/cjs/DocvyuEditor-CwMF2qhs.js +0 -1
- package/dist/esm/DocvyuEditor-CCAFPhSl.js +0 -1
- package/dist/types/app/DocvyuApp.test.d.ts +0 -1
- package/dist/types/app/styles.d.ts +0 -10
- package/dist/types/app/template.d.ts +0 -9
- package/dist/types/core/DocvyuEditor.test.d.ts +0 -4
- package/dist/types/i18n/I18nManager.test.d.ts +0 -4
- package/dist/types/license/LicenseManager.test.d.ts +0 -4
- package/dist/wasm/docuweave_core.d.ts +0 -207
- package/dist/wasm/docuweave_core.js +0 -988
- package/dist/wasm/docuweave_core_bg.wasm +0 -0
- package/dist/wasm/docuweave_core_bg.wasm.d.ts +0 -59
|
@@ -6,63 +6,15 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { type LicenseConfig, type LicenseInfo } from '../license';
|
|
8
8
|
import { type Locale, type I18nConfig } from '../i18n';
|
|
9
|
-
export interface WasmEditor {
|
|
10
|
-
free(): void;
|
|
11
|
-
load_docx_and_render(data: Uint8Array): void;
|
|
12
|
-
save_document(): Uint8Array;
|
|
13
|
-
on_mouse_click(x: number, y: number): void;
|
|
14
|
-
on_mouse_drag(x: number, y: number): void;
|
|
15
|
-
on_key_down(key: string): void;
|
|
16
|
-
set_cursor_visible(visible: boolean): void;
|
|
17
|
-
set_bold(enable: boolean): void;
|
|
18
|
-
set_italic(enable: boolean): void;
|
|
19
|
-
set_underline(enable: boolean): void;
|
|
20
|
-
set_font_size(size: number): void;
|
|
21
|
-
reset_font_size(): void;
|
|
22
|
-
set_font_family(family: string): void;
|
|
23
|
-
reset_font_family(): void;
|
|
24
|
-
set_font_color(color: string): void;
|
|
25
|
-
reset_font_color(): void;
|
|
26
|
-
set_paragraph_alignment(alignment: string): void;
|
|
27
|
-
set_bullet_list(enable: boolean): void;
|
|
28
|
-
set_numbered_list(enable: boolean): void;
|
|
29
|
-
set_numbered_list_format(format: string): void;
|
|
30
|
-
remove_numbering(): void;
|
|
31
|
-
has_bullet_list(): boolean;
|
|
32
|
-
has_numbered_list(): boolean;
|
|
33
|
-
has_numbering(): boolean;
|
|
34
|
-
get_numbering_format_id(): number | undefined;
|
|
35
|
-
set_page_margins(left: number, right: number, top: number, bottom: number): void;
|
|
36
|
-
set_page_size(size: string): void;
|
|
37
|
-
get_page_size(): string;
|
|
38
|
-
get_zoom(): number;
|
|
39
|
-
set_zoom(zoom: number): void;
|
|
40
|
-
zoom_in(): void;
|
|
41
|
-
zoom_out(): void;
|
|
42
|
-
get_ruler_unit(): number;
|
|
43
|
-
set_ruler_unit(unit: number): void;
|
|
44
|
-
toggle_ruler_unit(): void;
|
|
45
|
-
select_word(): void;
|
|
46
|
-
select_paragraph(): void;
|
|
47
|
-
select_document(): void;
|
|
48
|
-
selection_style_state(): SelectionStyleState;
|
|
49
|
-
}
|
|
50
|
-
export interface SelectionStyleState {
|
|
51
|
-
bold_all(): boolean;
|
|
52
|
-
bold_any(): boolean;
|
|
53
|
-
italic_all(): boolean;
|
|
54
|
-
italic_any(): boolean;
|
|
55
|
-
underline_all(): boolean;
|
|
56
|
-
underline_any(): boolean;
|
|
57
|
-
font_size(): number | undefined;
|
|
58
|
-
font_family(): string | undefined;
|
|
59
|
-
font_color(): string | undefined;
|
|
60
|
-
paragraph_alignment(): string | undefined;
|
|
61
|
-
}
|
|
62
9
|
export type Alignment = 'left' | 'center' | 'right' | 'justify';
|
|
63
|
-
export type NumberingFormat = 'decimal' | 'decimal-paren' | 'decimal-paren-both' | 'upper-letter' | 'lower-letter' | 'upper-roman' | 'lower-roman';
|
|
10
|
+
export type NumberingFormat = 'decimal' | 'decimal-paren' | 'decimal-paren-both' | 'upper-letter' | 'lower-letter' | 'upper-roman' | 'lower-roman' | 'outline' | 'outline-decimal' | 'outline-mixed' | 'outline-alpha' | 'outline-legal';
|
|
64
11
|
export type RulerUnit = 'centimeters' | 'inches';
|
|
65
12
|
export type PageSize = 'letter' | 'legal' | 'a4' | 'a5' | 'b5' | 'custom';
|
|
13
|
+
/** Style information for UI display */
|
|
14
|
+
export interface StyleInfo {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}
|
|
66
18
|
export interface EditorConfig extends LicenseConfig {
|
|
67
19
|
/** Canvas element ID or HTMLCanvasElement */
|
|
68
20
|
canvas: string | HTMLCanvasElement;
|
|
@@ -93,13 +45,42 @@ export interface SelectionState {
|
|
|
93
45
|
bold: boolean;
|
|
94
46
|
italic: boolean;
|
|
95
47
|
underline: boolean;
|
|
48
|
+
strikethrough: boolean;
|
|
96
49
|
fontSize?: number;
|
|
97
50
|
fontFamily?: string;
|
|
98
51
|
fontColor?: string;
|
|
99
52
|
alignment?: Alignment;
|
|
100
53
|
hasBulletList: boolean;
|
|
101
54
|
hasNumberedList: boolean;
|
|
55
|
+
hasOutlineList: boolean;
|
|
102
56
|
numberingFormatId?: number;
|
|
57
|
+
/** List level: -1 = not a list, 0-8 = list level */
|
|
58
|
+
listLevel: number;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Search state returned by find operations
|
|
62
|
+
*/
|
|
63
|
+
export interface SearchState {
|
|
64
|
+
/** The current search query */
|
|
65
|
+
query: string;
|
|
66
|
+
/** Total number of matches found */
|
|
67
|
+
matchCount: number;
|
|
68
|
+
/** Current match index (1-based), 0 if no matches */
|
|
69
|
+
currentIndex: number;
|
|
70
|
+
/** Whether search is active */
|
|
71
|
+
isActive: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Format copied from cursor position for copy/paste format functionality
|
|
75
|
+
*/
|
|
76
|
+
export interface CopiedFormat {
|
|
77
|
+
bold: boolean;
|
|
78
|
+
italic: boolean;
|
|
79
|
+
underline: boolean;
|
|
80
|
+
fontSize?: number;
|
|
81
|
+
fontFamily?: string;
|
|
82
|
+
fontColor?: string;
|
|
83
|
+
alignment?: Alignment;
|
|
103
84
|
}
|
|
104
85
|
export interface EditorMargins {
|
|
105
86
|
left: number;
|
|
@@ -107,8 +88,6 @@ export interface EditorMargins {
|
|
|
107
88
|
top: number;
|
|
108
89
|
bottom: number;
|
|
109
90
|
}
|
|
110
|
-
type WasmInit = (module?: any) => Promise<any>;
|
|
111
|
-
type WasmEditorConstructor = new (canvasId: string) => WasmEditor;
|
|
112
91
|
/**
|
|
113
92
|
* DocvyuEditor - The main editor class
|
|
114
93
|
*
|
|
@@ -132,7 +111,7 @@ export declare class DocvyuEditor {
|
|
|
132
111
|
* License validation with the server is MANDATORY - the editor will not
|
|
133
112
|
* function without successful validation.
|
|
134
113
|
*/
|
|
135
|
-
initialize(wasmInit:
|
|
114
|
+
initialize(wasmInit: (module?: any) => Promise<any>, EditorClass: new (canvasId: string) => any): Promise<LicenseInfo>;
|
|
136
115
|
/**
|
|
137
116
|
* Load a DOCX file into the editor
|
|
138
117
|
* Now async because usage tracking requires server validation
|
|
@@ -159,7 +138,75 @@ export declare class DocvyuEditor {
|
|
|
159
138
|
setBulletList(enable: boolean): void;
|
|
160
139
|
setNumberedList(enable: boolean): void;
|
|
161
140
|
setNumberedListFormat(format: NumberingFormat): void;
|
|
141
|
+
/**
|
|
142
|
+
* Set outline list for the current selection or cursor position
|
|
143
|
+
* Uses outline numbering format (1. → 1.1. → 1.1.1.)
|
|
144
|
+
* @param enable - Whether to enable or disable outline list
|
|
145
|
+
*/
|
|
146
|
+
setOutlineList(enable: boolean): void;
|
|
147
|
+
/**
|
|
148
|
+
* Check if the current paragraph has outline list numbering
|
|
149
|
+
* @returns true if paragraph has outline list (IDs 109-111)
|
|
150
|
+
*/
|
|
151
|
+
hasOutlineList(): boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Get available list formats as JSON
|
|
154
|
+
* @returns Array of list format info objects
|
|
155
|
+
*/
|
|
156
|
+
getListFormats(): Array<{
|
|
157
|
+
id: number;
|
|
158
|
+
name: string;
|
|
159
|
+
example: string;
|
|
160
|
+
type: string;
|
|
161
|
+
}>;
|
|
162
|
+
/**
|
|
163
|
+
* Apply numbering by format ID (102-111)
|
|
164
|
+
* @param formatId - The numbering format ID
|
|
165
|
+
*/
|
|
166
|
+
applyNumbering(formatId: number): void;
|
|
162
167
|
removeNumbering(): void;
|
|
168
|
+
/**
|
|
169
|
+
* Get available paragraph styles for the UI dropdown
|
|
170
|
+
* @returns Array of style info objects with id and display name
|
|
171
|
+
*/
|
|
172
|
+
getAvailableStyles(): StyleInfo[];
|
|
173
|
+
/**
|
|
174
|
+
* Apply a paragraph style to the current paragraph or selection
|
|
175
|
+
* @param styleId - The style ID (e.g., "Normal", "Heading1")
|
|
176
|
+
*/
|
|
177
|
+
applyParagraphStyle(styleId: string): void;
|
|
178
|
+
/**
|
|
179
|
+
* Get the current paragraph's style ID
|
|
180
|
+
* @returns Style ID or undefined if no style applied
|
|
181
|
+
*/
|
|
182
|
+
getCurrentParagraphStyle(): string | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* Remove the paragraph style from the current paragraph or selection
|
|
185
|
+
*/
|
|
186
|
+
removeParagraphStyle(): void;
|
|
187
|
+
/**
|
|
188
|
+
* Insert a table at the current cursor position
|
|
189
|
+
* @param rows - Number of rows (1-50)
|
|
190
|
+
* @param cols - Number of columns (1-20)
|
|
191
|
+
*/
|
|
192
|
+
insertTable(rows: number, cols: number): void;
|
|
193
|
+
/**
|
|
194
|
+
* Get the current list level of the paragraph at cursor.
|
|
195
|
+
* @returns -1 if not a list, 0-8 for list level
|
|
196
|
+
*/
|
|
197
|
+
getListLevel(): number;
|
|
198
|
+
/**
|
|
199
|
+
* Increase the list level (indent) of the current paragraph.
|
|
200
|
+
* Only works if the paragraph is already a list item.
|
|
201
|
+
* Maximum level is 8.
|
|
202
|
+
*/
|
|
203
|
+
increaseListLevel(): void;
|
|
204
|
+
/**
|
|
205
|
+
* Decrease the list level (outdent) of the current paragraph.
|
|
206
|
+
* Only works if the paragraph is already a list item.
|
|
207
|
+
* Minimum level is 0.
|
|
208
|
+
*/
|
|
209
|
+
decreaseListLevel(): void;
|
|
163
210
|
setMargins(margins: EditorMargins): void;
|
|
164
211
|
setPageSize(size: PageSize): void;
|
|
165
212
|
getPageSize(): PageSize;
|
|
@@ -167,16 +214,250 @@ export declare class DocvyuEditor {
|
|
|
167
214
|
getZoom(): number;
|
|
168
215
|
zoomIn(): void;
|
|
169
216
|
zoomOut(): void;
|
|
217
|
+
/**
|
|
218
|
+
* Set the visible viewport for rendering optimization.
|
|
219
|
+
* Call this when the scroll container scrolls.
|
|
220
|
+
* @param y Scroll position (pixels from top)
|
|
221
|
+
* @param height Visible viewport height (pixels)
|
|
222
|
+
*/
|
|
223
|
+
setViewport(y: number, height: number): void;
|
|
224
|
+
/**
|
|
225
|
+
* Get paragraph Y positions for hit-testing optimization.
|
|
226
|
+
* @returns JSON array of [start_y, end_y, page_index] for each paragraph
|
|
227
|
+
*/
|
|
228
|
+
getParagraphPositions(): string;
|
|
170
229
|
setRulerUnit(unit: RulerUnit): void;
|
|
171
230
|
getRulerUnit(): RulerUnit;
|
|
172
231
|
toggleRulerUnit(): void;
|
|
173
232
|
selectWord(): void;
|
|
174
233
|
selectParagraph(): void;
|
|
175
234
|
selectAll(): void;
|
|
235
|
+
/**
|
|
236
|
+
* Get the text content of the current selection
|
|
237
|
+
* @returns The selected text as a string, or empty string if no selection
|
|
238
|
+
*/
|
|
239
|
+
getSelectedText(): string;
|
|
240
|
+
/**
|
|
241
|
+
* Copy selected text to internal clipboard
|
|
242
|
+
* @returns The copied text
|
|
243
|
+
*/
|
|
244
|
+
copyText(): string;
|
|
245
|
+
/**
|
|
246
|
+
* Cut selected text (copy to internal clipboard and delete)
|
|
247
|
+
* @returns The cut text
|
|
248
|
+
*/
|
|
249
|
+
cutText(): string;
|
|
250
|
+
/**
|
|
251
|
+
* Paste text at cursor position
|
|
252
|
+
* @param text The text to paste
|
|
253
|
+
*/
|
|
254
|
+
pasteText(text: string): void;
|
|
255
|
+
/**
|
|
256
|
+
* Start a new search with the given query
|
|
257
|
+
* @param query The text to search for
|
|
258
|
+
* @param caseSensitive Whether to match case (default: false)
|
|
259
|
+
* @returns Search state with match count and current index
|
|
260
|
+
*/
|
|
261
|
+
find(query: string, caseSensitive?: boolean): SearchState;
|
|
262
|
+
/**
|
|
263
|
+
* Navigate to the next search match
|
|
264
|
+
* @returns Updated search state
|
|
265
|
+
*/
|
|
266
|
+
findNext(): SearchState;
|
|
267
|
+
/**
|
|
268
|
+
* Navigate to the previous search match
|
|
269
|
+
* @returns Updated search state
|
|
270
|
+
*/
|
|
271
|
+
findPrevious(): SearchState;
|
|
272
|
+
/**
|
|
273
|
+
* Clear the current search and highlights
|
|
274
|
+
*/
|
|
275
|
+
clearSearch(): void;
|
|
276
|
+
/**
|
|
277
|
+
* Get the current search state
|
|
278
|
+
* @returns Current search state
|
|
279
|
+
*/
|
|
280
|
+
getSearchState(): SearchState;
|
|
281
|
+
/**
|
|
282
|
+
* Replace the current search match with the given text
|
|
283
|
+
* @param replacement The replacement text
|
|
284
|
+
* @returns Number of remaining matches
|
|
285
|
+
*/
|
|
286
|
+
replaceCurrent(replacement: string): number;
|
|
287
|
+
/**
|
|
288
|
+
* Replace all search matches with the given text
|
|
289
|
+
* @param replacement The replacement text
|
|
290
|
+
* @returns Number of replacements made
|
|
291
|
+
*/
|
|
292
|
+
replaceAll(replacement: string): number;
|
|
293
|
+
/**
|
|
294
|
+
* Undo the last operation
|
|
295
|
+
* @returns true if an operation was undone, false if nothing to undo
|
|
296
|
+
*/
|
|
297
|
+
undo(): boolean;
|
|
298
|
+
/**
|
|
299
|
+
* Redo the last undone operation
|
|
300
|
+
* @returns true if an operation was redone, false if nothing to redo
|
|
301
|
+
*/
|
|
302
|
+
redo(): boolean;
|
|
303
|
+
/**
|
|
304
|
+
* Check if there are operations that can be undone
|
|
305
|
+
* @returns true if undo is available
|
|
306
|
+
*/
|
|
307
|
+
canUndo(): boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Check if there are operations that can be redone
|
|
310
|
+
* @returns true if redo is available
|
|
311
|
+
*/
|
|
312
|
+
canRedo(): boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Insert an image at the current cursor position
|
|
315
|
+
* @param data - Image data as Uint8Array
|
|
316
|
+
* @param width - Image width in pixels
|
|
317
|
+
* @param height - Image height in pixels
|
|
318
|
+
* @param name - Image file name
|
|
319
|
+
*/
|
|
320
|
+
insertImage(data: Uint8Array, width: number, height: number, name: string): void;
|
|
321
|
+
/**
|
|
322
|
+
* Force a re-render of the document
|
|
323
|
+
* Useful after async operations like image loading
|
|
324
|
+
*/
|
|
325
|
+
render(): void;
|
|
326
|
+
/**
|
|
327
|
+
* Check if cursor is currently on an image
|
|
328
|
+
* @returns true if cursor is on an image
|
|
329
|
+
*/
|
|
330
|
+
isCursorOnImage(): boolean;
|
|
331
|
+
/**
|
|
332
|
+
* Get dimensions of image at cursor
|
|
333
|
+
* @returns {width, height} or null if not on image
|
|
334
|
+
*/
|
|
335
|
+
getImageDimensions(): {
|
|
336
|
+
width: number;
|
|
337
|
+
height: number;
|
|
338
|
+
} | null;
|
|
339
|
+
/**
|
|
340
|
+
* Resize image at cursor to specific dimensions
|
|
341
|
+
* @param width - New width in pixels
|
|
342
|
+
* @param height - New height in pixels
|
|
343
|
+
* @returns true if image was resized
|
|
344
|
+
*/
|
|
345
|
+
resizeImage(width: number, height: number): boolean;
|
|
346
|
+
/**
|
|
347
|
+
* Scale image at cursor by a factor
|
|
348
|
+
* @param scale - Scale factor (e.g., 0.5 for 50%, 2.0 for 200%)
|
|
349
|
+
* @returns true if image was scaled
|
|
350
|
+
*/
|
|
351
|
+
scaleImage(scale: number): boolean;
|
|
352
|
+
/**
|
|
353
|
+
* Get the wrap mode of the image at cursor
|
|
354
|
+
* @returns "inline", "square", "inFrontOfText", "behindText", or empty string
|
|
355
|
+
*/
|
|
356
|
+
getImageWrapMode(): string;
|
|
357
|
+
/**
|
|
358
|
+
* Set the wrap mode of the image at cursor
|
|
359
|
+
* @param mode - "inline", "square", "inFrontOfText", "behindText"
|
|
360
|
+
* @returns true if mode was set
|
|
361
|
+
*/
|
|
362
|
+
setImageWrapMode(mode: string): boolean;
|
|
363
|
+
/**
|
|
364
|
+
* Check if the image at cursor is in floating mode
|
|
365
|
+
* @returns true if image is floating
|
|
366
|
+
*/
|
|
367
|
+
isImageFloating(): boolean;
|
|
368
|
+
/**
|
|
369
|
+
* Get the floating position of the image
|
|
370
|
+
* @returns {x, y} or null if not floating
|
|
371
|
+
*/
|
|
372
|
+
getImageFloatPosition(): {
|
|
373
|
+
x: number;
|
|
374
|
+
y: number;
|
|
375
|
+
} | null;
|
|
376
|
+
/**
|
|
377
|
+
* Set the floating position of the image
|
|
378
|
+
* @param x - X position
|
|
379
|
+
* @param y - Y position
|
|
380
|
+
* @returns true if position was set
|
|
381
|
+
*/
|
|
382
|
+
setImageFloatPosition(x: number, y: number): boolean;
|
|
383
|
+
/**
|
|
384
|
+
* Start dragging a floating image
|
|
385
|
+
* @param x - Mouse X coordinate
|
|
386
|
+
* @param y - Mouse Y coordinate
|
|
387
|
+
* @returns true if drag started (clicked on a floating image)
|
|
388
|
+
*/
|
|
389
|
+
startImageDrag(x: number, y: number): boolean;
|
|
390
|
+
/**
|
|
391
|
+
* Move the dragged image
|
|
392
|
+
* @param x - Mouse X coordinate
|
|
393
|
+
* @param y - Mouse Y coordinate
|
|
394
|
+
*/
|
|
395
|
+
moveImageDrag(x: number, y: number): void;
|
|
396
|
+
/**
|
|
397
|
+
* End the image drag operation
|
|
398
|
+
*/
|
|
399
|
+
endImageDrag(): void;
|
|
400
|
+
/**
|
|
401
|
+
* Check if currently dragging an image
|
|
402
|
+
* @returns true if dragging
|
|
403
|
+
*/
|
|
404
|
+
isDraggingImage(): boolean;
|
|
405
|
+
/**
|
|
406
|
+
* Insert a comment at the current selection
|
|
407
|
+
* @param author - Comment author name
|
|
408
|
+
* @param text - Comment text content
|
|
409
|
+
*/
|
|
410
|
+
insertComment(author: string, text: string): void;
|
|
411
|
+
/**
|
|
412
|
+
* Get the number of comments in the document
|
|
413
|
+
* @returns Number of comments
|
|
414
|
+
*/
|
|
415
|
+
getCommentCount(): number;
|
|
416
|
+
/**
|
|
417
|
+
* Get the author of a comment by index
|
|
418
|
+
* @param index - Comment index (0-based)
|
|
419
|
+
* @returns Author name
|
|
420
|
+
*/
|
|
421
|
+
getCommentAuthor(index: number): string;
|
|
422
|
+
/**
|
|
423
|
+
* Get the initials of a comment author by index
|
|
424
|
+
* @param index - Comment index (0-based)
|
|
425
|
+
* @returns Author initials
|
|
426
|
+
*/
|
|
427
|
+
getCommentInitials(index: number): string;
|
|
428
|
+
/**
|
|
429
|
+
* Get the date of a comment by index
|
|
430
|
+
* @param index - Comment index (0-based)
|
|
431
|
+
* @returns Comment date in ISO format
|
|
432
|
+
*/
|
|
433
|
+
getCommentDate(index: number): string;
|
|
434
|
+
/**
|
|
435
|
+
* Get the text of a comment by index
|
|
436
|
+
* @param index - Comment index (0-based)
|
|
437
|
+
* @returns Comment text content
|
|
438
|
+
*/
|
|
439
|
+
getCommentText(index: number): string;
|
|
440
|
+
/**
|
|
441
|
+
* Get the ID of a comment by index
|
|
442
|
+
* @param index - Comment index (0-based)
|
|
443
|
+
* @returns Comment ID
|
|
444
|
+
*/
|
|
445
|
+
getCommentId(index: number): number;
|
|
446
|
+
/**
|
|
447
|
+
* Get comment IDs at the current cursor position
|
|
448
|
+
* @returns Array of comment IDs at cursor
|
|
449
|
+
*/
|
|
450
|
+
getCommentsAtCursor(): number[];
|
|
176
451
|
/**
|
|
177
452
|
* Get current selection state
|
|
178
453
|
*/
|
|
179
454
|
getSelectionState(): SelectionState;
|
|
455
|
+
/**
|
|
456
|
+
* Get the format at the cursor position or the start of the selection.
|
|
457
|
+
* This returns the actual format of a single run, not the consensus of the selection.
|
|
458
|
+
* Used for copy/paste format functionality.
|
|
459
|
+
*/
|
|
460
|
+
getCursorFormat(): CopiedFormat;
|
|
180
461
|
/**
|
|
181
462
|
* Handle mouse click on canvas
|
|
182
463
|
*/
|
|
@@ -185,6 +466,16 @@ export declare class DocvyuEditor {
|
|
|
185
466
|
* Handle mouse drag on canvas
|
|
186
467
|
*/
|
|
187
468
|
handleMouseDrag(x: number, y: number): void;
|
|
469
|
+
/**
|
|
470
|
+
* Get hyperlink URL at the given screen coordinates
|
|
471
|
+
* Returns empty string if no hyperlink at that position
|
|
472
|
+
*/
|
|
473
|
+
getHyperlinkAtPosition(x: number, y: number): string;
|
|
474
|
+
/**
|
|
475
|
+
* Navigate to an internal bookmark by name
|
|
476
|
+
* Returns the Y scroll position if found, -1 if not found
|
|
477
|
+
*/
|
|
478
|
+
navigateToBookmark(name: string): number;
|
|
188
479
|
/**
|
|
189
480
|
* Handle keyboard input
|
|
190
481
|
*/
|
|
@@ -213,6 +504,26 @@ export declare class DocvyuEditor {
|
|
|
213
504
|
* Translate a key with optional parameters
|
|
214
505
|
*/
|
|
215
506
|
translate(key: string, params?: Record<string, string | number>): string;
|
|
507
|
+
/**
|
|
508
|
+
* Insert a header (or enter editing if one exists)
|
|
509
|
+
*/
|
|
510
|
+
insertHeader(): void;
|
|
511
|
+
/**
|
|
512
|
+
* Insert a footer (or enter editing if one exists)
|
|
513
|
+
*/
|
|
514
|
+
insertFooter(): void;
|
|
515
|
+
/**
|
|
516
|
+
* Enter header editing mode (only if header exists)
|
|
517
|
+
*/
|
|
518
|
+
enterHeaderEditing(): void;
|
|
519
|
+
/**
|
|
520
|
+
* Enter footer editing mode (only if footer exists)
|
|
521
|
+
*/
|
|
522
|
+
enterFooterEditing(): void;
|
|
523
|
+
/**
|
|
524
|
+
* Get the current edit context (body, header, footer)
|
|
525
|
+
*/
|
|
526
|
+
getEditContext(): string;
|
|
216
527
|
/**
|
|
217
528
|
* Destroy the editor and free resources
|
|
218
529
|
*/
|
|
@@ -224,6 +535,40 @@ export declare class DocvyuEditor {
|
|
|
224
535
|
private startCursorBlink;
|
|
225
536
|
private stopCursorBlink;
|
|
226
537
|
private resetCursorBlink;
|
|
538
|
+
setStrikethrough(enable: boolean): void;
|
|
539
|
+
getRevisionCount(): number;
|
|
540
|
+
getRevisionsJson(): string;
|
|
541
|
+
acceptRevision(revisionId: number): void;
|
|
542
|
+
rejectRevision(revisionId: number): void;
|
|
543
|
+
acceptAllRevisions(): void;
|
|
544
|
+
rejectAllRevisions(): void;
|
|
545
|
+
insertPageNumberField(fieldType: string): void;
|
|
546
|
+
insertPageXOfY(): void;
|
|
547
|
+
getPageOrientation(): string;
|
|
548
|
+
setPageOrientation(orient: string): void;
|
|
549
|
+
getColumnCount(): number;
|
|
550
|
+
setColumnCount(count: number): void;
|
|
551
|
+
hasColumns(): boolean;
|
|
552
|
+
insertSectionBreak(breakType: string): void;
|
|
553
|
+
getSectionBreakType(): string;
|
|
554
|
+
getBookmarkCount(): number;
|
|
555
|
+
getBookmarksJson(): string;
|
|
556
|
+
getBookmarkNames(): string;
|
|
557
|
+
hasBookmark(name: string): boolean;
|
|
558
|
+
selectBookmark(name: string): boolean;
|
|
559
|
+
insertBookmark(name: string): void;
|
|
560
|
+
generateTocJson(): string;
|
|
561
|
+
getTocEntryCount(): number;
|
|
562
|
+
navigateToTocEntry(index: number): boolean;
|
|
563
|
+
getDocumentPropertiesJson(): string;
|
|
564
|
+
getDocumentTitle(): string | undefined;
|
|
565
|
+
setDocumentTitle(title: string): void;
|
|
566
|
+
getDocumentCreator(): string | undefined;
|
|
567
|
+
setDocumentCreator(creator: string): void;
|
|
568
|
+
calculateWordCount(): number;
|
|
569
|
+
calculateCharacterCount(): number;
|
|
570
|
+
getPageCount(): number;
|
|
571
|
+
getCurrentPage(): number;
|
|
227
572
|
}
|
|
228
573
|
/**
|
|
229
574
|
* Create a new DocVyu editor instance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DocvyuEditor, createEditor, type EditorConfig, type SelectionState, type EditorMargins, type Alignment, type NumberingFormat, type RulerUnit, type PageSize, } from './DocvyuEditor';
|
|
1
|
+
export { DocvyuEditor, createEditor, type EditorConfig, type SelectionState, type CopiedFormat, type EditorMargins, type Alignment, type NumberingFormat, type RulerUnit, type PageSize, } from './DocvyuEditor';
|
|
@@ -54,10 +54,37 @@ export interface Translations {
|
|
|
54
54
|
font: string;
|
|
55
55
|
paragraph: string;
|
|
56
56
|
editing: string;
|
|
57
|
+
tables: string;
|
|
58
|
+
styles: string;
|
|
57
59
|
find: string;
|
|
58
60
|
replace: string;
|
|
59
61
|
size: string;
|
|
60
62
|
numberingFormat: string;
|
|
63
|
+
table: string;
|
|
64
|
+
insertTable: string;
|
|
65
|
+
rows: string;
|
|
66
|
+
columns: string;
|
|
67
|
+
image: string;
|
|
68
|
+
insertImage: string;
|
|
69
|
+
illustrations: string;
|
|
70
|
+
comment: string;
|
|
71
|
+
comments: string;
|
|
72
|
+
insertComment: string;
|
|
73
|
+
showComments: string;
|
|
74
|
+
header: string;
|
|
75
|
+
footer: string;
|
|
76
|
+
headerFooter: string;
|
|
77
|
+
insertHeader: string;
|
|
78
|
+
insertFooter: string;
|
|
79
|
+
review: string;
|
|
80
|
+
pageNumber: string;
|
|
81
|
+
pageXOfY: string;
|
|
82
|
+
fields: string;
|
|
83
|
+
sectionBreak: string;
|
|
84
|
+
breaks: string;
|
|
85
|
+
bookmark: string;
|
|
86
|
+
bookmarks: string;
|
|
87
|
+
insertBookmark: string;
|
|
61
88
|
};
|
|
62
89
|
formatting: {
|
|
63
90
|
bold: string;
|
|
@@ -75,6 +102,9 @@ export interface Translations {
|
|
|
75
102
|
alignJustify: string;
|
|
76
103
|
bulletList: string;
|
|
77
104
|
numberedList: string;
|
|
105
|
+
numberingFormats: string;
|
|
106
|
+
simpleList: string;
|
|
107
|
+
outlineList: string;
|
|
78
108
|
increaseIndent: string;
|
|
79
109
|
decreaseIndent: string;
|
|
80
110
|
lineSpacing: string;
|
|
@@ -97,6 +127,10 @@ export interface Translations {
|
|
|
97
127
|
a4: string;
|
|
98
128
|
a5: string;
|
|
99
129
|
b5: string;
|
|
130
|
+
columns: string;
|
|
131
|
+
oneColumn: string;
|
|
132
|
+
twoColumns: string;
|
|
133
|
+
threeColumns: string;
|
|
100
134
|
};
|
|
101
135
|
zoom: {
|
|
102
136
|
zoomIn: string;
|
|
@@ -105,6 +139,19 @@ export interface Translations {
|
|
|
105
139
|
fitToPage: string;
|
|
106
140
|
fitToWidth: string;
|
|
107
141
|
};
|
|
142
|
+
styles: {
|
|
143
|
+
paragraphStyle: string;
|
|
144
|
+
normal: string;
|
|
145
|
+
heading1: string;
|
|
146
|
+
heading2: string;
|
|
147
|
+
heading3: string;
|
|
148
|
+
heading4: string;
|
|
149
|
+
heading5: string;
|
|
150
|
+
heading6: string;
|
|
151
|
+
title: string;
|
|
152
|
+
subtitle: string;
|
|
153
|
+
listParagraph: string;
|
|
154
|
+
};
|
|
108
155
|
ruler: {
|
|
109
156
|
centimeters: string;
|
|
110
157
|
inches: string;
|
|
@@ -155,6 +202,87 @@ export interface Translations {
|
|
|
155
202
|
pageOf: string;
|
|
156
203
|
words: string;
|
|
157
204
|
selectLanguage: string;
|
|
205
|
+
copied: string;
|
|
206
|
+
cut: string;
|
|
207
|
+
pasted: string;
|
|
208
|
+
copyError: string;
|
|
209
|
+
cutError: string;
|
|
210
|
+
pasteError: string;
|
|
211
|
+
listLevel: string;
|
|
212
|
+
listLevelTooltip: string;
|
|
213
|
+
insertingImage: string;
|
|
214
|
+
imageInserted: string;
|
|
215
|
+
imageError: string;
|
|
216
|
+
};
|
|
217
|
+
comments: {
|
|
218
|
+
enterAuthor: string;
|
|
219
|
+
enterComment: string;
|
|
220
|
+
commentAdded: string;
|
|
221
|
+
commentError: string;
|
|
222
|
+
noComments: string;
|
|
223
|
+
documentComments: string;
|
|
224
|
+
};
|
|
225
|
+
headerFooter: {
|
|
226
|
+
headerNotSupported: string;
|
|
227
|
+
footerNotSupported: string;
|
|
228
|
+
};
|
|
229
|
+
contextMenu: {
|
|
230
|
+
copy: string;
|
|
231
|
+
cut: string;
|
|
232
|
+
paste: string;
|
|
233
|
+
selectAll: string;
|
|
234
|
+
copyFormat: string;
|
|
235
|
+
applyFormat: string;
|
|
236
|
+
};
|
|
237
|
+
formatPainter: {
|
|
238
|
+
copyFormat: string;
|
|
239
|
+
applyFormat: string;
|
|
240
|
+
formatCopied: string;
|
|
241
|
+
formatApplied: string;
|
|
242
|
+
noFormatCopied: string;
|
|
243
|
+
};
|
|
244
|
+
review: {
|
|
245
|
+
accept: string;
|
|
246
|
+
reject: string;
|
|
247
|
+
acceptAll: string;
|
|
248
|
+
rejectAll: string;
|
|
249
|
+
noRevisions: string;
|
|
250
|
+
changes: string;
|
|
251
|
+
trackChanges: string;
|
|
252
|
+
};
|
|
253
|
+
viewTab: {
|
|
254
|
+
properties: string;
|
|
255
|
+
title: string;
|
|
256
|
+
author: string;
|
|
257
|
+
wordCount: string;
|
|
258
|
+
characterCount: string;
|
|
259
|
+
bookmarksPanel: string;
|
|
260
|
+
tocPanel: string;
|
|
261
|
+
noBookmarks: string;
|
|
262
|
+
noHeadings: string;
|
|
263
|
+
documentInfo: string;
|
|
264
|
+
navigation: string;
|
|
265
|
+
};
|
|
266
|
+
sectionBreaks: {
|
|
267
|
+
nextPage: string;
|
|
268
|
+
continuous: string;
|
|
269
|
+
evenPage: string;
|
|
270
|
+
oddPage: string;
|
|
271
|
+
};
|
|
272
|
+
search: {
|
|
273
|
+
find: string;
|
|
274
|
+
findPlaceholder: string;
|
|
275
|
+
noResults: string;
|
|
276
|
+
matchOf: string;
|
|
277
|
+
matchesFound: string;
|
|
278
|
+
caseSensitive: string;
|
|
279
|
+
close: string;
|
|
280
|
+
next: string;
|
|
281
|
+
previous: string;
|
|
282
|
+
replacePlaceholder: string;
|
|
283
|
+
replaceOne: string;
|
|
284
|
+
replaceAll: string;
|
|
285
|
+
replacedCount: string;
|
|
158
286
|
};
|
|
159
287
|
}
|
|
160
288
|
/**
|