@docvyu/sdk 0.0.5 → 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 +174 -209
- package/dist/cdn/docvyu.js +5060 -0
- package/dist/cdn/docvyu.min.js +10 -4
- 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 +409 -57
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/i18n/types.d.ts +131 -0
- package/dist/types/index.d.ts +19 -5
- package/dist/types/react/index.d.ts +2 -1
- 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-Bh9EkDQb.js +0 -1
- package/dist/esm/DocvyuEditor-DlUB7weZ.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,10 +88,11 @@ 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
|
|
93
|
+
*
|
|
94
|
+
* IMPORTANT: License validation is MANDATORY. The editor will not function
|
|
95
|
+
* without successful license validation from the server.
|
|
114
96
|
*/
|
|
115
97
|
export declare class DocvyuEditor {
|
|
116
98
|
private wasmEditor;
|
|
@@ -119,14 +101,17 @@ export declare class DocvyuEditor {
|
|
|
119
101
|
private canvas;
|
|
120
102
|
private canvasId;
|
|
121
103
|
private isInitialized;
|
|
104
|
+
private licenseValidated;
|
|
122
105
|
private cursorBlinkInterval;
|
|
123
106
|
private cursorVisible;
|
|
124
107
|
private localeUnsubscribe;
|
|
125
108
|
constructor(config: EditorConfig);
|
|
126
109
|
/**
|
|
127
110
|
* Initialize the editor with WASM module
|
|
111
|
+
* License validation with the server is MANDATORY - the editor will not
|
|
112
|
+
* function without successful validation.
|
|
128
113
|
*/
|
|
129
|
-
initialize(wasmInit:
|
|
114
|
+
initialize(wasmInit: (module?: any) => Promise<any>, EditorClass: new (canvasId: string) => any): Promise<LicenseInfo>;
|
|
130
115
|
/**
|
|
131
116
|
* Load a DOCX file into the editor
|
|
132
117
|
* Now async because usage tracking requires server validation
|
|
@@ -153,7 +138,75 @@ export declare class DocvyuEditor {
|
|
|
153
138
|
setBulletList(enable: boolean): void;
|
|
154
139
|
setNumberedList(enable: boolean): void;
|
|
155
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;
|
|
156
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;
|
|
157
210
|
setMargins(margins: EditorMargins): void;
|
|
158
211
|
setPageSize(size: PageSize): void;
|
|
159
212
|
getPageSize(): PageSize;
|
|
@@ -161,16 +214,250 @@ export declare class DocvyuEditor {
|
|
|
161
214
|
getZoom(): number;
|
|
162
215
|
zoomIn(): void;
|
|
163
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;
|
|
164
229
|
setRulerUnit(unit: RulerUnit): void;
|
|
165
230
|
getRulerUnit(): RulerUnit;
|
|
166
231
|
toggleRulerUnit(): void;
|
|
167
232
|
selectWord(): void;
|
|
168
233
|
selectParagraph(): void;
|
|
169
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[];
|
|
170
451
|
/**
|
|
171
452
|
* Get current selection state
|
|
172
453
|
*/
|
|
173
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;
|
|
174
461
|
/**
|
|
175
462
|
* Handle mouse click on canvas
|
|
176
463
|
*/
|
|
@@ -179,6 +466,16 @@ export declare class DocvyuEditor {
|
|
|
179
466
|
* Handle mouse drag on canvas
|
|
180
467
|
*/
|
|
181
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;
|
|
182
479
|
/**
|
|
183
480
|
* Handle keyboard input
|
|
184
481
|
*/
|
|
@@ -207,16 +504,71 @@ export declare class DocvyuEditor {
|
|
|
207
504
|
* Translate a key with optional parameters
|
|
208
505
|
*/
|
|
209
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;
|
|
210
527
|
/**
|
|
211
528
|
* Destroy the editor and free resources
|
|
212
529
|
*/
|
|
213
530
|
destroy(): void;
|
|
214
531
|
private ensureInitialized;
|
|
532
|
+
private ensureLicenseValid;
|
|
215
533
|
private ensureFeature;
|
|
216
534
|
private notifySelectionChange;
|
|
217
535
|
private startCursorBlink;
|
|
218
536
|
private stopCursorBlink;
|
|
219
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;
|
|
220
572
|
}
|
|
221
573
|
/**
|
|
222
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';
|