@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
|
@@ -1,207 +1,33 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* @docvyu/sdk WASM module
|
|
5
|
+
* @packageDocumentation
|
|
5
6
|
*/
|
|
7
|
+
|
|
6
8
|
export enum RulerUnit {
|
|
7
9
|
Centimeters = 0,
|
|
8
10
|
Inches = 1,
|
|
9
11
|
}
|
|
12
|
+
|
|
10
13
|
export class Editor {
|
|
14
|
+
constructor(canvas_id: string);
|
|
11
15
|
free(): void;
|
|
12
16
|
[Symbol.dispose](): void;
|
|
13
|
-
set_italic(enable: boolean): void;
|
|
14
|
-
on_key_down(key: string): void;
|
|
15
|
-
select_word(): void;
|
|
16
|
-
/**
|
|
17
|
-
* Get current page size name (or "custom" if not matching any preset)
|
|
18
|
-
*/
|
|
19
|
-
get_page_size(): string;
|
|
20
|
-
/**
|
|
21
|
-
* Check if the current paragraph has any numbering
|
|
22
|
-
*/
|
|
23
|
-
has_numbering(): boolean;
|
|
24
|
-
on_mouse_drag(click_x: number, click_y: number): void;
|
|
25
|
-
save_document(): Uint8Array;
|
|
26
|
-
set_font_size(size: number): void;
|
|
27
|
-
/**
|
|
28
|
-
* Set page size using predefined sizes
|
|
29
|
-
* Sizes: "letter", "legal", "a4", "a5", "b5"
|
|
30
|
-
*/
|
|
31
|
-
set_page_size(size_name: string): void;
|
|
32
|
-
set_underline(enable: boolean): void;
|
|
33
|
-
/**
|
|
34
|
-
* Get current ruler unit
|
|
35
|
-
*/
|
|
36
|
-
get_ruler_unit(): RulerUnit;
|
|
37
|
-
on_mouse_click(click_x: number, click_y: number): void;
|
|
38
|
-
set_font_color(color: string): void;
|
|
39
|
-
/**
|
|
40
|
-
* Set ruler unit (centimeters or inches)
|
|
41
|
-
*/
|
|
42
|
-
set_ruler_unit(unit: RulerUnit): void;
|
|
43
|
-
/**
|
|
44
|
-
* Check if the current paragraph has bullet list numbering
|
|
45
|
-
*/
|
|
46
|
-
has_bullet_list(): boolean;
|
|
47
|
-
reset_font_size(): void;
|
|
48
|
-
select_document(): void;
|
|
49
|
-
/**
|
|
50
|
-
* Set bullet list for the current selection or cursor position
|
|
51
|
-
* Uses num_id=101 by convention for bullet lists
|
|
52
|
-
*/
|
|
53
|
-
set_bullet_list(enable: boolean): void;
|
|
54
|
-
set_font_family(family: string): void;
|
|
55
|
-
/**
|
|
56
|
-
* Remove numbering from the current selection or cursor position
|
|
57
|
-
*/
|
|
58
|
-
remove_numbering(): void;
|
|
59
|
-
reset_font_color(): void;
|
|
60
|
-
select_paragraph(): void;
|
|
61
|
-
set_page_margins(left: number, right: number, top: number, bottom: number): void;
|
|
62
|
-
/**
|
|
63
|
-
* Check if the current paragraph has numbered list numbering (not bullet)
|
|
64
|
-
*/
|
|
65
|
-
has_numbered_list(): boolean;
|
|
66
|
-
reset_font_family(): void;
|
|
67
|
-
/**
|
|
68
|
-
* Set numbered list for the current selection or cursor position
|
|
69
|
-
* Uses num_id=102 by convention for numbered lists (1.)
|
|
70
|
-
*/
|
|
71
|
-
set_numbered_list(enable: boolean): void;
|
|
72
|
-
/**
|
|
73
|
-
* Toggle ruler unit between centimeters and inches
|
|
74
|
-
*/
|
|
75
|
-
toggle_ruler_unit(): void;
|
|
76
|
-
set_cursor_visible(visible: boolean): void;
|
|
77
|
-
load_docx_and_render(data: Uint8Array): void;
|
|
78
|
-
selection_style_state(): SelectionStyleState;
|
|
79
|
-
/**
|
|
80
|
-
* Get the current numbering format ID (101-108 for standard, or mapped from document)
|
|
81
|
-
*/
|
|
82
|
-
get_numbering_format_id(): number | undefined;
|
|
83
|
-
set_paragraph_alignment(alignment: string): void;
|
|
84
|
-
/**
|
|
85
|
-
* Set numbered list with a specific format
|
|
86
|
-
* Formats: "decimal" (1.), "decimal-paren" (1)), "decimal-paren-both" ((1)),
|
|
87
|
-
* "upper-letter" (A.), "lower-letter" (a.),
|
|
88
|
-
* "upper-roman" (I.), "lower-roman" (i.)
|
|
89
|
-
*/
|
|
90
|
-
set_numbered_list_format(format: string): void;
|
|
91
|
-
constructor(canvas_id: string);
|
|
92
|
-
/**
|
|
93
|
-
* Zoom in by 10%
|
|
94
|
-
*/
|
|
95
|
-
zoom_in(): void;
|
|
96
|
-
/**
|
|
97
|
-
* Get current zoom level (1.0 = 100%)
|
|
98
|
-
*/
|
|
99
|
-
get_zoom(): number;
|
|
100
|
-
set_bold(enable: boolean): void;
|
|
101
|
-
/**
|
|
102
|
-
* Set zoom level (0.25 to 4.0, i.e., 25% to 400%)
|
|
103
|
-
*/
|
|
104
|
-
set_zoom(zoom: number): void;
|
|
105
|
-
/**
|
|
106
|
-
* Zoom out by 10%
|
|
107
|
-
*/
|
|
108
|
-
zoom_out(): void;
|
|
109
17
|
}
|
|
18
|
+
|
|
110
19
|
export class SelectionStyleState {
|
|
111
20
|
private constructor();
|
|
112
21
|
free(): void;
|
|
113
22
|
[Symbol.dispose](): void;
|
|
114
|
-
font_color(): string | undefined;
|
|
115
|
-
italic_all(): boolean;
|
|
116
|
-
italic_any(): boolean;
|
|
117
|
-
font_family(): string | undefined;
|
|
118
|
-
underline_all(): boolean;
|
|
119
|
-
underline_any(): boolean;
|
|
120
|
-
paragraph_alignment(): string | undefined;
|
|
121
|
-
bold_all(): boolean;
|
|
122
|
-
bold_any(): boolean;
|
|
123
|
-
font_size(): number | undefined;
|
|
124
23
|
}
|
|
125
24
|
|
|
126
25
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
26
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
127
27
|
|
|
128
28
|
export interface InitOutput {
|
|
129
29
|
readonly memory: WebAssembly.Memory;
|
|
130
|
-
readonly __wbg_editor_free: (a: number, b: number) => void;
|
|
131
|
-
readonly __wbg_selectionstylestate_free: (a: number, b: number) => void;
|
|
132
|
-
readonly editor_get_numbering_format_id: (a: number) => number;
|
|
133
|
-
readonly editor_get_page_size: (a: number, b: number) => void;
|
|
134
|
-
readonly editor_get_ruler_unit: (a: number) => number;
|
|
135
|
-
readonly editor_get_zoom: (a: number) => number;
|
|
136
|
-
readonly editor_has_bullet_list: (a: number) => number;
|
|
137
|
-
readonly editor_has_numbered_list: (a: number) => number;
|
|
138
|
-
readonly editor_has_numbering: (a: number) => number;
|
|
139
|
-
readonly editor_load_docx_and_render: (a: number, b: number, c: number) => void;
|
|
140
|
-
readonly editor_new: (a: number, b: number, c: number) => void;
|
|
141
|
-
readonly editor_on_key_down: (a: number, b: number, c: number) => void;
|
|
142
|
-
readonly editor_on_mouse_click: (a: number, b: number, c: number) => void;
|
|
143
|
-
readonly editor_on_mouse_drag: (a: number, b: number, c: number) => void;
|
|
144
|
-
readonly editor_remove_numbering: (a: number) => void;
|
|
145
|
-
readonly editor_reset_font_color: (a: number) => void;
|
|
146
|
-
readonly editor_reset_font_family: (a: number) => void;
|
|
147
|
-
readonly editor_reset_font_size: (a: number) => void;
|
|
148
|
-
readonly editor_save_document: (a: number, b: number) => void;
|
|
149
|
-
readonly editor_select_document: (a: number) => void;
|
|
150
|
-
readonly editor_select_paragraph: (a: number) => void;
|
|
151
|
-
readonly editor_select_word: (a: number) => void;
|
|
152
|
-
readonly editor_selection_style_state: (a: number) => number;
|
|
153
|
-
readonly editor_set_bold: (a: number, b: number) => void;
|
|
154
|
-
readonly editor_set_bullet_list: (a: number, b: number) => void;
|
|
155
|
-
readonly editor_set_cursor_visible: (a: number, b: number) => void;
|
|
156
|
-
readonly editor_set_font_color: (a: number, b: number, c: number) => void;
|
|
157
|
-
readonly editor_set_font_family: (a: number, b: number, c: number) => void;
|
|
158
|
-
readonly editor_set_font_size: (a: number, b: number) => void;
|
|
159
|
-
readonly editor_set_italic: (a: number, b: number) => void;
|
|
160
|
-
readonly editor_set_numbered_list: (a: number, b: number) => void;
|
|
161
|
-
readonly editor_set_numbered_list_format: (a: number, b: number, c: number) => void;
|
|
162
|
-
readonly editor_set_page_margins: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
163
|
-
readonly editor_set_page_size: (a: number, b: number, c: number) => void;
|
|
164
|
-
readonly editor_set_paragraph_alignment: (a: number, b: number, c: number) => void;
|
|
165
|
-
readonly editor_set_ruler_unit: (a: number, b: number) => void;
|
|
166
|
-
readonly editor_set_underline: (a: number, b: number) => void;
|
|
167
|
-
readonly editor_set_zoom: (a: number, b: number) => void;
|
|
168
|
-
readonly editor_toggle_ruler_unit: (a: number) => void;
|
|
169
|
-
readonly editor_zoom_in: (a: number) => void;
|
|
170
|
-
readonly editor_zoom_out: (a: number) => void;
|
|
171
|
-
readonly selectionstylestate_bold_all: (a: number) => number;
|
|
172
|
-
readonly selectionstylestate_bold_any: (a: number) => number;
|
|
173
|
-
readonly selectionstylestate_font_color: (a: number, b: number) => void;
|
|
174
|
-
readonly selectionstylestate_font_family: (a: number, b: number) => void;
|
|
175
|
-
readonly selectionstylestate_font_size: (a: number, b: number) => void;
|
|
176
|
-
readonly selectionstylestate_italic_all: (a: number) => number;
|
|
177
|
-
readonly selectionstylestate_italic_any: (a: number) => number;
|
|
178
|
-
readonly selectionstylestate_paragraph_alignment: (a: number, b: number) => void;
|
|
179
|
-
readonly selectionstylestate_underline_all: (a: number) => number;
|
|
180
|
-
readonly selectionstylestate_underline_any: (a: number) => number;
|
|
181
|
-
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
182
|
-
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
183
|
-
readonly __wbindgen_export3: (a: number) => void;
|
|
184
|
-
readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
185
|
-
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
186
30
|
}
|
|
187
31
|
|
|
188
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
189
|
-
/**
|
|
190
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
191
|
-
* a precompiled `WebAssembly.Module`.
|
|
192
|
-
*
|
|
193
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
194
|
-
*
|
|
195
|
-
* @returns {InitOutput}
|
|
196
|
-
*/
|
|
197
32
|
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
201
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
202
|
-
*
|
|
203
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
204
|
-
*
|
|
205
|
-
* @returns {Promise<InitOutput>}
|
|
206
|
-
*/
|
|
207
|
-
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
33
|
+
export default function __wbg_init(module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
package/dist/wasm/docvyu_core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
let t,n=new Array(128).fill(void 0);function e(t){return n[t]}function i(t){const n=typeof t;if("number"==n||"boolean"==n||null==t)return`${t}`;if("string"==n)return`"${t}"`;if("symbol"==n){const n=t.description;return null==n?"Symbol":`Symbol(${n})`}if("function"==n){const n=t.name;return"string"==typeof n&&n.length>0?`Function(${n})`:"Function"}if(Array.isArray(t)){const n=t.length;let e="[";n>0&&(e+=i(t[0]));for(let r=1;r<n;r++)e+=", "+i(t[r]);return e+="]",e}const e=/\[object ([^\]]+)\]/.exec(toString.call(t));let r;if(!(e&&e.length>1))return toString.call(t);if(r=e[1],"Object"==r)try{return"Object("+JSON.stringify(t)+")"}catch(t){return"Object"}return t instanceof Error?`${t.name}: ${t.message}\n${t.stack}`:r}n.push(void 0,null,!0,!1);let r=0,o=null;function s(){return null!==o&&0!==o.byteLength||(o=new Uint8Array(t.memory.buffer)),o}const u=new TextEncoder;function c(t,n,e){if(void 0===e){const e=u.encode(t),i=n(e.length,1)>>>0;return s().subarray(i,i+e.length).set(e),r=e.length,i}let i=t.length,o=n(i,1)>>>0;const c=s();let l=0;for(;l<i;l++){const n=t.charCodeAt(l);if(n>127)break;c[o+l]=n}if(l!==i){0!==l&&(t=t.slice(l)),o=e(o,i,i=l+3*t.length,1)>>>0;const n=s().subarray(o+l,o+i);l+=u.encodeInto(t,n).written,o=e(o,i,l,1)>>>0}return r=l,o}"encodeInto"in u||(u.encodeInto=function(t,n){const e=u.encode(t);return n.set(e),{read:t.length,written:e.length}});let l=null;function f(){return(null===l||!0===l.buffer.detached||void 0===l.buffer.detached&&l.buffer!==t.memory.buffer)&&(l=new DataView(t.memory.buffer)),l}let a=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});a.decode();const _=2146435072;let h=0;function y(t,n){return h+=n,h>=_&&(a=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),a.decode(),h=n),a.decode(s().subarray(t,t+n))}function d(t,n){return y(t>>>=0,n)}let b=n.length;function m(t){b===n.length&&n.push(n.length+1);const e=b;return b=n[e],n[e]=t,e}function g(n,e){try{return n.apply(this,e)}catch(n){t.t(m(n))}}function w(t){return null==t}function p(t){t<132||(n[t]=b,b=t)}function v(t){const n=e(t);return p(t),n}function S(t,n){return t>>>=0,s().subarray(t/1,t/1+n)}function z(t,n){const e=n(1*t.length,1)>>>0;return s().set(t,e/1),r=t.length,e}export const RulerUnit=Object.freeze({Centimeters:0,0:"Centimeters",Inches:1,1:"Inches"});const R="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>t.i(n>>>0,1));export class Editor{o(){const t=this.u;return this.u=0,R.unregister(this),t}free(){const n=this.o();t.i(n,0)}set_italic(n){t.editor_set_italic(this.u,n)}on_key_down(n){const e=c(n,t.l,t._),i=r;t.editor_on_key_down(this.u,e,i)}select_word(){t.editor_select_word(this.u)}get_page_size(){let n,e;try{const o=t.h(-16);t.editor_get_page_size(o,this.u);var i=f().getInt32(o+0,!0),r=f().getInt32(o+4,!0);return n=i,e=r,d(i,r)}finally{t.h(16),t.m(n,e,1)}}has_numbering(){return 0!==t.editor_has_numbering(this.u)}on_mouse_drag(n,e){t.editor_on_mouse_drag(this.u,n,e)}save_document(){try{const o=t.h(-16);t.editor_save_document(o,this.u);var n=f().getInt32(o+0,!0),e=f().getInt32(o+4,!0),i=f().getInt32(o+8,!0);if(f().getInt32(o+12,!0))throw v(i);var r=S(n,e).slice();return t.m(n,1*e,1),r}finally{t.h(16)}}set_font_size(n){t.editor_set_font_size(this.u,n)}set_page_size(n){const e=c(n,t.l,t._),i=r;t.editor_set_page_size(this.u,e,i)}set_underline(n){t.editor_set_underline(this.u,n)}get_ruler_unit(){return t.editor_get_ruler_unit(this.u)}on_mouse_click(n,e){t.editor_on_mouse_click(this.u,n,e)}set_font_color(n){const e=c(n,t.l,t._),i=r;t.editor_set_font_color(this.u,e,i)}set_ruler_unit(n){t.editor_set_ruler_unit(this.u,n)}has_bullet_list(){return 0!==t.editor_has_bullet_list(this.u)}reset_font_size(){t.editor_reset_font_size(this.u)}select_document(){t.editor_select_document(this.u)}set_bullet_list(n){t.editor_set_bullet_list(this.u,n)}set_font_family(n){const e=c(n,t.l,t._),i=r;t.editor_set_font_family(this.u,e,i)}remove_numbering(){t.editor_remove_numbering(this.u)}reset_font_color(){t.editor_reset_font_color(this.u)}select_paragraph(){t.editor_select_paragraph(this.u)}set_page_margins(n,e,i,r){t.editor_set_page_margins(this.u,n,e,i,r)}has_numbered_list(){return 0!==t.editor_has_numbered_list(this.u)}reset_font_family(){t.editor_reset_font_family(this.u)}set_numbered_list(n){t.editor_set_numbered_list(this.u,n)}toggle_ruler_unit(){t.editor_toggle_ruler_unit(this.u)}set_cursor_visible(n){t.editor_set_cursor_visible(this.u,n)}load_docx_and_render(n){const e=z(n,t.l),i=r;t.editor_load_docx_and_render(this.u,e,i)}selection_style_state(){const n=t.editor_selection_style_state(this.u);return SelectionStyleState.p(n)}get_numbering_format_id(){const n=t.editor_get_numbering_format_id(this.u);return 4294967297===n?void 0:n}set_paragraph_alignment(n){const e=c(n,t.l,t._),i=r;t.editor_set_paragraph_alignment(this.u,e,i)}set_numbered_list_format(n){const e=c(n,t.l,t._),i=r;t.editor_set_numbered_list_format(this.u,e,i)}constructor(n){try{const o=t.h(-16),s=c(n,t.l,t._),u=r;t.editor_new(o,s,u);var e=f().getInt32(o+0,!0),i=f().getInt32(o+4,!0);if(f().getInt32(o+8,!0))throw v(i);return this.u=e>>>0,R.register(this,this.u,this),this}finally{t.h(16)}}zoom_in(){t.editor_zoom_in(this.u)}get_zoom(){return t.editor_get_zoom(this.u)}set_bold(n){t.editor_set_bold(this.u,n)}set_zoom(n){t.editor_set_zoom(this.u,n)}zoom_out(){t.editor_zoom_out(this.u)}}Symbol.dispose&&(Editor.prototype[Symbol.dispose]=Editor.prototype.free);const O="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>t.v(n>>>0,1));export class SelectionStyleState{static p(t){t>>>=0;const n=Object.create(SelectionStyleState.prototype);return n.u=t,O.register(n,n.u,n),n}o(){const t=this.u;return this.u=0,O.unregister(this),t}free(){const n=this.o();t.v(n,0)}font_color(){try{const i=t.h(-16);t.selectionstylestate_font_color(i,this.u);var n=f().getInt32(i+0,!0),e=f().getInt32(i+4,!0);let r;return 0!==n&&(r=d(n,e).slice(),t.m(n,1*e,1)),r}finally{t.h(16)}}italic_all(){return 0!==t.selectionstylestate_italic_all(this.u)}italic_any(){return 0!==t.selectionstylestate_italic_any(this.u)}font_family(){try{const i=t.h(-16);t.selectionstylestate_font_family(i,this.u);var n=f().getInt32(i+0,!0),e=f().getInt32(i+4,!0);let r;return 0!==n&&(r=d(n,e).slice(),t.m(n,1*e,1)),r}finally{t.h(16)}}underline_all(){return 0!==t.selectionstylestate_underline_all(this.u)}underline_any(){return 0!==t.selectionstylestate_underline_any(this.u)}paragraph_alignment(){try{const i=t.h(-16);t.selectionstylestate_paragraph_alignment(i,this.u);var n=f().getInt32(i+0,!0),e=f().getInt32(i+4,!0);let r;return 0!==n&&(r=d(n,e).slice(),t.m(n,1*e,1)),r}finally{t.h(16)}}bold_all(){return 0!==t.selectionstylestate_bold_all(this.u)}bold_any(){return 0!==t.selectionstylestate_bold_any(this.u)}font_size(){try{const i=t.h(-16);t.selectionstylestate_font_size(i,this.u);var n=f().getInt32(i+0,!0),e=f().getFloat64(i+8,!0);return 0===n?void 0:e}finally{t.h(16)}}}Symbol.dispose&&(SelectionStyleState.prototype[Symbol.dispose]=SelectionStyleState.prototype.free);const A=new Set(["basic","cors","default"]);async function j(t,n){if("function"==typeof Response&&t instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,n)}catch(n){if(!t.ok||!A.has(t.type)||"application/wasm"===t.headers.get("Content-Type"))throw n}const e=await t.arrayBuffer();return await WebAssembly.instantiate(e,n)}{const e=await WebAssembly.instantiate(t,n);return e instanceof WebAssembly.Instance?{instance:e,module:t}:e}}function x(){const n={wbg:{}};return n.wbg.S=function(n,o){const s=c(i(e(o)),t.l,t._),u=r;f().setInt32(n+4,u,!0),f().setInt32(n+0,s,!0)},n.wbg.R=function(t){return void 0===e(t)},n.wbg.O=function(t,n){throw new Error(d(t,n))},n.wbg.A=function(t){e(t).beginPath()},n.wbg.j=function(){return g(function(t,n){return m(e(t).call(e(n)))},arguments)},n.wbg.W=function(t){const n=e(t).canvas;return w(n)?0:m(n)},n.wbg.F=function(t,n,i,r,o){e(t).clearRect(n,i,r,o)},n.wbg.T=function(t){e(t).clip()},n.wbg.$=function(t){const n=e(t).document;return w(n)?0:m(n)},n.wbg.C=function(n,e){let i,r;try{i=n,r=e}finally{t.m(i,r,1)}},n.wbg.U=function(t,n,i,r,o){e(t).fillRect(n,i,r,o)},n.wbg.D=function(){return g(function(t,n,i,r,o){e(t).fillText(d(n,i),r,o)},arguments)},n.wbg.L=function(){return g(function(t,n,i){const r=e(t).getContext(d(n,i));return w(r)?0:m(r)},arguments)},n.wbg.k=function(t,n,i){const r=e(t).getElementById(d(n,i));return w(r)?0:m(r)},n.wbg.I=function(t){return e(t).height},n.wbg.M=function(t){let n;try{n=e(t)instanceof CanvasRenderingContext2D}catch(t){n=!1}return n},n.wbg.q=function(t){let n;try{n=e(t)instanceof HTMLCanvasElement}catch(t){n=!1}return n},n.wbg.B=function(t){let n;try{n=e(t)instanceof Window}catch(t){n=!1}return n},n.wbg.H=function(t,n,i){e(t).lineTo(n,i)},n.wbg.J=function(t,n){},n.wbg.N=function(){return g(function(t,n,i){return m(e(t).measureText(d(n,i)))},arguments)},n.wbg.V=function(t,n,i){e(t).moveTo(n,i)},n.wbg.G=function(){return m(new Error)},n.wbg.K=function(t,n){return m(new Function(d(t,n)))},n.wbg.P=function(t,n,i,r,o){e(t).rect(n,i,r,o)},n.wbg.X=function(){return g(function(t){e(t).resetTransform()},arguments)},n.wbg.Y=function(t){e(t).restore()},n.wbg.Z=function(t){e(t).save()},n.wbg.tt=function(){return g(function(t,n,i){e(t).scale(n,i)},arguments)},n.wbg.nt=function(t,n,i){e(t).fillStyle=d(n,i)},n.wbg.et=function(t,n,i){e(t).font=d(n,i)},n.wbg.it=function(t,n){e(t).height=n>>>0},n.wbg.rt=function(t,n){e(t).lineWidth=n},n.wbg.ot=function(t,n,i){e(t).strokeStyle=d(n,i)},n.wbg.st=function(t,n){e(t).width=n>>>0},n.wbg.ut=function(n,i){const o=c(e(i).stack,t.l,t._),s=r;f().setInt32(n+4,s,!0),f().setInt32(n+0,o,!0)},n.wbg.ct=function(){const t="undefined"==typeof global?null:global;return w(t)?0:m(t)},n.wbg.lt=function(){const t="undefined"==typeof globalThis?null:globalThis;return w(t)?0:m(t)},n.wbg.ft=function(){const t="undefined"==typeof self?null:self;return w(t)?0:m(t)},n.wbg._t=function(){const t="undefined"==typeof window?null:window;return w(t)?0:m(t)},n.wbg.ht=function(t,n,i,r,o){e(t).strokeRect(n,i,r,o)},n.wbg.yt=function(t){e(t).stroke()},n.wbg.dt=function(t){return e(t).width},n.wbg.bt=function(t){return e(t).width},n.wbg.gt=function(t,n){return m(d(t,n))},n.wbg.wt=function(t){return m(e(t))},n.wbg.vt=function(t){v(t)},n}function W(n,e){return t=n.exports,F.St=e,l=null,o=null,t}function E(n){if(void 0!==t)return t;void 0!==n&&Object.getPrototypeOf(n)===Object.prototype&&({module:n}=n);const e=x();return n instanceof WebAssembly.Module||(n=new WebAssembly.Module(n)),W(new WebAssembly.Instance(n,e),n)}async function F(n){if(void 0!==t)return t;void 0!==n&&Object.getPrototypeOf(n)===Object.prototype&&({module_or_path:n}=n),void 0===n&&(n=new URL("docvyu_core_bg.wasm",import.meta.url));const e=x();("string"==typeof n||"function"==typeof Request&&n instanceof Request||"function"==typeof URL&&n instanceof URL)&&(n=fetch(n));const{instance:i,module:r}=await j(await n,e);return W(i,r)}export{E as initSync};export default F;
|
|
1
|
+
let t,n=new Array(128).fill(void 0);function e(t){return n[t]}function r(t){const n=typeof t;if("number"==n||"boolean"==n||null==t)return`${t}`;if("string"==n)return`"${t}"`;if("symbol"==n){const n=t.description;return null==n?"Symbol":`Symbol(${n})`}if("function"==n){const n=t.name;return"string"==typeof n&&n.length>0?`Function(${n})`:"Function"}if(Array.isArray(t)){const n=t.length;let e="[";n>0&&(e+=r(t[0]));for(let i=1;i<n;i++)e+=", "+r(t[i]);return e+="]",e}const e=/\[object ([^\]]+)\]/.exec(toString.call(t));let i;if(!(e&&e.length>1))return toString.call(t);if(i=e[1],"Object"==i)try{return"Object("+JSON.stringify(t)+")"}catch(t){return"Object"}return t instanceof Error?`${t.name}: ${t.message}\n${t.stack}`:i}n.push(void 0,null,!0,!1);let i=0,o=null;function s(){return null!==o&&0!==o.byteLength||(o=new Uint8Array(t.memory.buffer)),o}const u=new TextEncoder;function c(t,n,e){if(void 0===e){const e=u.encode(t),r=n(e.length,1)>>>0;return s().subarray(r,r+e.length).set(e),i=e.length,r}let r=t.length,o=n(r,1)>>>0;const c=s();let a=0;for(;a<r;a++){const n=t.charCodeAt(a);if(n>127)break;c[o+a]=n}if(a!==r){0!==a&&(t=t.slice(a)),o=e(o,r,r=a+3*t.length,1)>>>0;const n=s().subarray(o+a,o+r);a+=u.encodeInto(t,n).written,o=e(o,r,a,1)>>>0}return i=a,o}"encodeInto"in u||(u.encodeInto=function(t,n){const e=u.encode(t);return n.set(e),{read:t.length,written:e.length}});let a=null;function l(){return(null===a||!0===a.buffer.detached||void 0===a.buffer.detached&&a.buffer!==t.memory.buffer)&&(a=new DataView(t.memory.buffer)),a}let _=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});_.decode();const f=2146435072;let h=0;function y(t,n){return h+=n,h>=f&&(_=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),_.decode(),h=n),_.decode(s().subarray(t,t+n))}function g(t,n){return y(t>>>=0,n)}let m=n.length;function d(t){m===n.length&&n.push(n.length+1);const e=m;return m=n[e],n[e]=t,e}function v(n,e){try{return n.apply(this,e)}catch(n){t.t(d(n))}}function p(t){return null==t}function b(t,n){return t>>>=0,s().subarray(t/1,t/1+n)}function w(t){t<132||(n[t]=m,m=t)}function k(t){const n=e(t);return w(t),n}function S(t,n){const e=n(1*t.length,1)>>>0;return s().set(t,e/1),i=t.length,e}let x=null;function R(){return null!==x&&0!==x.byteLength||(x=new Int32Array(t.memory.buffer)),x}function j(t,n){return t>>>=0,R().subarray(t/4,t/4+n)}export const RulerUnit=Object.freeze({Centimeters:0,0:"Centimeters",Inches:1,1:"Inches"});const z="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>t.i(n>>>0,1));export class Editor{o(){const t=this.u;return this.u=0,z.unregister(this),t}free(){const n=this.o();t.i(n,0)}paste_text(n){const e=c(n,t.l,t._),r=i;t.editor_paste_text(this.u,e,r)}redo_count(){return t.editor_redo_count(this.u)>>>0}select_all(){t.editor_select_all(this.u)}set_italic(n){t.editor_set_italic(this.u,n)}undo_count(){return t.editor_undo_count(this.u)>>>0}has_columns(){return 0!==t.editor_has_columns(this.u)}has_footers(){return 0!==t.editor_has_footers(this.u)}has_headers(){return 0!==t.editor_has_headers(this.u)}on_key_down(n){const e=c(n,t.l,t._),r=i;t.editor_on_key_down(this.u,e,r)}replace_all(n){const e=c(n,t.l,t._),r=i;return t.editor_replace_all(this.u,e,r)>>>0}select_word(){t.editor_select_word(this.u)}clear_search(){t.editor_clear_search(this.u)}has_bookmark(n){const e=c(n,t.l,t._),r=i;return 0!==t.editor_has_bookmark(this.u,e,r)}insert_image(n,e,r,o){const s=S(n,t.l),u=i,a=c(o,t.l,t._),l=i;t.editor_insert_image(this.u,s,u,e,r,a,l)}insert_table(n,e){t.editor_insert_table(this.u,n,e)}set_viewport(n,e){t.editor_set_viewport(this.u,n,e)}find_previous(){t.editor_find_previous(this.u)}get_page_size(){let n,e;try{const o=t.h(-16);t.editor_get_page_size(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}get_watermark(){return 0!==t.editor_get_watermark(this.u)}has_numbering(){return 0!==t.editor_has_numbering(this.u)}insert_footer(){t.editor_insert_footer(this.u)}insert_header(){t.editor_insert_header(this.u)}on_ctrl_click(n,e){let r,i;try{const u=t.h(-16);t.editor_on_ctrl_click(u,this.u,n,e);var o=l().getInt32(u+0,!0),s=l().getInt32(u+4,!0);return r=o,i=s,g(o,s)}finally{t.h(16),t.m(r,i,1)}}on_mouse_drag(n,e){t.editor_on_mouse_drag(this.u,n,e)}save_document(){try{const o=t.h(-16);t.editor_save_document(o,this.u);var n=l().getInt32(o+0,!0),e=l().getInt32(o+4,!0),r=l().getInt32(o+8,!0);if(l().getInt32(o+12,!0))throw k(r);var i=b(n,e).slice();return t.m(n,1*e,1),i}finally{t.h(16)}}set_font_size(n){t.editor_set_font_size(this.u,n)}set_page_size(n){const e=c(n,t.l,t._),r=i;t.editor_set_page_size(this.u,e,r)}set_underline(n){t.editor_set_underline(this.u,n)}set_watermark(n){t.editor_set_watermark(this.u,n)}end_image_drag(){t.editor_end_image_drag(this.u)}get_comment_id(n){const e=t.editor_get_comment_id(this.u,n);return 4294967297===e?void 0:e}get_list_level(){return t.editor_get_list_level(this.u)}get_page_count(){return t.editor_get_page_count(this.u)}get_ruler_unit(){return t.editor_get_ruler_unit(this.u)}insert_comment(n,e){const r=c(n,t.l,t._),o=i,s=c(e,t.l,t._),u=i;t.editor_insert_comment(this.u,r,o,s,u)}on_mouse_click(n,e){t.editor_on_mouse_click(this.u,n,e)}set_font_color(n){const e=c(n,t.l,t._),r=i;t.editor_set_font_color(this.u,e,r)}set_ruler_unit(n){t.editor_set_ruler_unit(this.u,n)}accept_revision(n){t.editor_accept_revision(this.u,n)}has_bullet_list(){return 0!==t.editor_has_bullet_list(this.u)}insert_bookmark(n){const e=c(n,t.l,t._),r=i;t.editor_insert_bookmark(this.u,e,r)}move_image_drag(n,e){t.editor_move_image_drag(this.u,n,e)}reject_revision(n){t.editor_reject_revision(this.u,n)}replace_current(n){const e=c(n,t.l,t._),r=i;return t.editor_replace_current(this.u,e,r)>>>0}reset_font_size(){t.editor_reset_font_size(this.u)}select_bookmark(n){const e=c(n,t.l,t._),r=i;return 0!==t.editor_select_bookmark(this.u,e,r)}select_document(){t.editor_select_document(this.u)}set_bullet_list(n){t.editor_set_bullet_list(this.u,n)}set_font_family(n){const e=c(n,t.l,t._),r=i;t.editor_set_font_family(this.u,e,r)}get_column_count(){return t.editor_get_column_count(this.u)>>>0}get_comment_date(n){try{const i=t.h(-16);t.editor_get_comment_date(i,this.u,n);var e=l().getInt32(i+0,!0),r=l().getInt32(i+4,!0);let o;return 0!==e&&(o=g(e,r).slice(),t.m(e,1*r,1)),o}finally{t.h(16)}}get_comment_text(n){try{const i=t.h(-16);t.editor_get_comment_text(i,this.u,n);var e=l().getInt32(i+0,!0),r=l().getInt32(i+4,!0);let o;return 0!==e&&(o=g(e,r).slice(),t.m(e,1*r,1)),o}finally{t.h(16)}}get_current_page(){return t.editor_get_current_page(this.u)}get_edit_context(){let n,e;try{const o=t.h(-16);t.editor_get_edit_context(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}get_list_formats(){let n,e;try{const o=t.h(-16);t.editor_get_list_formats(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}get_search_query(){let n,e;try{const o=t.h(-16);t.editor_get_search_query(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}has_outline_list(){return 0!==t.editor_has_outline_list(this.u)}is_search_active(){return 0!==t.editor_is_search_active(this.u)}remove_numbering(){t.editor_remove_numbering(this.u)}reset_font_color(){t.editor_reset_font_color(this.u)}select_paragraph(){t.editor_select_paragraph(this.u)}set_column_count(n){t.editor_set_column_count(this.u,n)}set_outline_list(n){t.editor_set_outline_list(this.u,n)}set_page_margins(n,e,r,i){t.editor_set_page_margins(this.u,n,e,r,i)}start_image_drag(n,e){return 0!==t.editor_start_image_drag(this.u,n,e)}generate_toc_json(){let n,e;try{const o=t.h(-16);t.editor_generate_toc_json(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}get_bookmark_text(n){try{const o=t.h(-16),s=c(n,t.l,t._),u=i;t.editor_get_bookmark_text(o,this.u,s,u);var e=l().getInt32(o+0,!0),r=l().getInt32(o+4,!0);let a;return 0!==e&&(a=g(e,r).slice(),t.m(e,1*r,1)),a}finally{t.h(16)}}get_comment_count(){return t.editor_get_comment_count(this.u)>>>0}get_cursor_format(){const n=t.editor_get_cursor_format(this.u);return RunFormat.v(n)}get_image_float_x(){return t.editor_get_image_float_x(this.u)}get_image_float_y(){return t.editor_get_image_float_y(this.u)}get_selected_text(){let n,e;try{const o=t.h(-16);t.editor_get_selected_text(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}has_numbered_list(){return 0!==t.editor_has_numbered_list(this.u)}is_dragging_image(){return 0!==t.editor_is_dragging_image(this.u)}is_editing_footer(){return 0!==t.editor_is_editing_footer(this.u)}is_editing_header(){return 0!==t.editor_is_editing_header(this.u)}is_image_floating(){return 0!==t.editor_is_image_floating(this.u)}reset_font_family(){t.editor_reset_font_family(this.u)}set_numbered_list(n){t.editor_set_numbered_list(this.u,n)}set_strikethrough(n){t.editor_set_strikethrough(this.u,n)}toggle_ruler_unit(){t.editor_toggle_ruler_unit(this.u)}clear_undo_history(){t.editor_clear_undo_history(this.u)}get_bookmark_count(){return t.editor_get_bookmark_count(this.u)}get_bookmark_names(){let n,e;try{const o=t.h(-16);t.editor_get_bookmark_names(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}get_bookmarks_json(){let n,e;try{const o=t.h(-16);t.editor_get_bookmarks_json(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}get_clipboard_text(){let n,e;try{const o=t.h(-16);t.editor_get_clipboard_text(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}get_comment_author(n){try{const i=t.h(-16);t.editor_get_comment_author(i,this.u,n);var e=l().getInt32(i+0,!0),r=l().getInt32(i+4,!0);let o;return 0!==e&&(o=g(e,r).slice(),t.m(e,1*r,1)),o}finally{t.h(16)}}get_document_title(){try{const r=t.h(-16);t.editor_get_document_title(r,this.u);var n=l().getInt32(r+0,!0),e=l().getInt32(r+4,!0);let i;return 0!==n&&(i=g(n,e).slice(),t.m(n,1*e,1)),i}finally{t.h(16)}}get_revision_count(){return t.editor_get_revision_count(this.u)>>>0}get_revisions_json(){let n,e;try{const o=t.h(-16);t.editor_get_revisions_json(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}insert_page_x_of_y(){t.editor_insert_page_x_of_y(this.u)}is_cursor_on_image(){return 0!==t.editor_is_cursor_on_image(this.u)}set_clipboard_text(n){const e=c(n,t.l,t._),r=i;t.editor_set_clipboard_text(this.u,e,r)}set_cursor_visible(n){t.editor_set_cursor_visible(this.u,n)}set_document_title(n){const e=c(n,t.l,t._),r=i;t.editor_set_document_title(this.u,e,r)}decrease_list_level(){t.editor_decrease_list_level(this.u)}get_image_wrap_mode(){let n,e;try{const o=t.h(-16);t.editor_get_image_wrap_mode(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}get_toc_entry_count(){return t.editor_get_toc_entry_count(this.u)}increase_list_level(){t.editor_increase_list_level(this.u)}set_image_wrap_mode(n){const e=c(n,t.l,t._),r=i;return 0!==t.editor_set_image_wrap_mode(this.u,e,r)}accept_all_revisions(){t.editor_accept_all_revisions(this.u)}calculate_word_count(){return t.editor_calculate_word_count(this.u)}enter_footer_editing(){t.editor_enter_footer_editing(this.u)}enter_header_editing(){t.editor_enter_header_editing(this.u)}get_available_styles(){let n,e;try{const o=t.h(-16);t.editor_get_available_styles(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}get_comment_initials(n){try{const i=t.h(-16);t.editor_get_comment_initials(i,this.u,n);var e=l().getInt32(i+0,!0),r=l().getInt32(i+4,!0);let o;return 0!==e&&(o=g(e,r).slice(),t.m(e,1*r,1)),o}finally{t.h(16)}}get_document_creator(){try{const r=t.h(-16);t.editor_get_document_creator(r,this.u);var n=l().getInt32(r+0,!0),e=l().getInt32(r+4,!0);let i;return 0!==n&&(i=g(n,e).slice(),t.m(n,1*e,1)),i}finally{t.h(16)}}get_page_orientation(){let n,e;try{const o=t.h(-16);t.editor_get_page_orientation(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}insert_section_break(n){const e=c(n,t.l,t._),r=i;t.editor_insert_section_break(this.u,e,r)}load_docx_and_render(n){try{const r=t.h(-16),o=S(n,t.l),s=i;t.editor_load_docx_and_render(r,this.u,o,s);var e=l().getInt32(r+0,!0);if(l().getInt32(r+4,!0))throw k(e)}finally{t.h(16)}}navigate_to_bookmark(n){const e=c(n,t.l,t._),r=i;return t.editor_navigate_to_bookmark(this.u,e,r)}reject_all_revisions(){t.editor_reject_all_revisions(this.u)}set_document_creator(n){const e=c(n,t.l,t._),r=i;t.editor_set_document_creator(this.u,e,r)}set_page_orientation(n){const e=c(n,t.l,t._),r=i;t.editor_set_page_orientation(this.u,e,r)}apply_paragraph_style(n){const e=c(n,t.l,t._),r=i;t.editor_apply_paragraph_style(this.u,e,r)}has_clipboard_content(){return 0!==t.editor_has_clipboard_content(this.u)}navigate_to_toc_entry(n){return 0!==t.editor_navigate_to_toc_entry(this.u,n)}scale_image_at_cursor(n){return 0!==t.editor_scale_image_at_cursor(this.u,n)}selection_style_state(){const n=t.editor_selection_style_state(this.u);return SelectionStyleState.v(n)}get_comments_at_cursor(){try{const i=t.h(-16);t.editor_get_comments_at_cursor(i,this.u);var n=l().getInt32(i+0,!0),e=l().getInt32(i+4,!0),r=j(n,e).slice();return t.m(n,4*e,4),r}finally{t.h(16)}}get_search_match_count(){return t.editor_get_search_match_count(this.u)>>>0}get_section_break_type(){let n,e;try{const o=t.h(-16);t.editor_get_section_break_type(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}remove_paragraph_style(){t.editor_remove_paragraph_style(this.u)}resize_image_at_cursor(n,e){return 0!==t.editor_resize_image_at_cursor(this.u,n,e)}get_document_word_count(){const n=t.editor_get_document_word_count(this.u);return 4294967297===n?void 0:n}get_numbering_format_id(){const n=t.editor_get_numbering_format_id(this.u);return 4294967297===n?void 0:n}get_paragraph_positions(){let n,e;try{const o=t.h(-16);t.editor_get_paragraph_positions(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}set_paragraph_alignment(n){const e=c(n,t.l,t._),r=i;t.editor_set_paragraph_alignment(this.u,e,r)}get_search_current_index(){return t.editor_get_search_current_index(this.u)>>>0}insert_page_number_field(n){const e=c(n,t.l,t._),r=i;t.editor_insert_page_number_field(this.u,e,r)}set_image_float_position(n,e){return 0!==t.editor_set_image_float_position(this.u,n,e)}set_numbered_list_format(n){const e=c(n,t.l,t._),r=i;t.editor_set_numbered_list_format(this.u,e,r)}calculate_character_count(){return t.editor_calculate_character_count(this.u)}get_hyperlink_at_position(n,e){let r,i;try{const u=t.h(-16);t.editor_get_hyperlink_at_position(u,this.u,n,e);var o=l().getInt32(u+0,!0),s=l().getInt32(u+4,!0);return r=o,i=s,g(o,s)}finally{t.h(16),t.m(r,i,1)}}get_image_width_at_cursor(){return t.editor_get_image_width_at_cursor(this.u)}exit_header_footer_editing(){t.editor_exit_header_footer_editing(this.u)}get_column_properties_json(){let n,e;try{const o=t.h(-16);t.editor_get_column_properties_json(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}get_image_height_at_cursor(){return t.editor_get_image_height_at_cursor(this.u)}get_current_paragraph_style(){try{const r=t.h(-16);t.editor_get_current_paragraph_style(r,this.u);var n=l().getInt32(r+0,!0),e=l().getInt32(r+4,!0);let i;return 0!==n&&(i=g(n,e).slice(),t.m(n,1*e,1)),i}finally{t.h(16)}}get_document_properties_json(){let n,e;try{const o=t.h(-16);t.editor_get_document_properties_json(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}cut(){let n,e;try{const o=t.h(-16);t.editor_cut(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}constructor(n){try{const o=t.h(-16),s=c(n,t.l,t._),u=i;t.editor_new(o,s,u);var e=l().getInt32(o+0,!0),r=l().getInt32(o+4,!0);if(l().getInt32(o+8,!0))throw k(r);return this.u=e>>>0,z.register(this,this.u,this),this}finally{t.h(16)}}copy(){let n,e;try{const o=t.h(-16);t.editor_copy(o,this.u);var r=l().getInt32(o+0,!0),i=l().getInt32(o+4,!0);return n=r,e=i,g(r,i)}finally{t.h(16),t.m(n,e,1)}}find(n,e){const r=c(n,t.l,t._),o=i;return t.editor_find(this.u,r,o,e)>>>0}redo(){return 0!==t.editor_redo(this.u)}undo(){return 0!==t.editor_undo(this.u)}paste(){t.editor_paste(this.u)}render(){t.editor_render(this.u)}zoom_in(){t.editor_zoom_in(this.u)}can_redo(){return 0!==t.editor_can_redo(this.u)}can_undo(){return 0!==t.editor_can_undo(this.u)}get_zoom(){return t.editor_get_zoom(this.u)}set_bold(n){t.editor_set_bold(this.u,n)}set_zoom(n){t.editor_set_zoom(this.u,n)}zoom_out(){t.editor_zoom_out(this.u)}find_next(){t.editor_find_next(this.u)}}Symbol.dispose&&(Editor.prototype[Symbol.dispose]=Editor.prototype.free);const A="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>t.p(n>>>0,1));export class RunFormat{static v(t){t>>>=0;const n=Object.create(RunFormat.prototype);return n.u=t,A.register(n,n.u,n),n}o(){const t=this.u;return this.u=0,A.unregister(this),t}free(){const n=this.o();t.p(n,0)}font_color(){try{const r=t.h(-16);t.runformat_font_color(r,this.u);var n=l().getInt32(r+0,!0),e=l().getInt32(r+4,!0);let i;return 0!==n&&(i=g(n,e).slice(),t.m(n,1*e,1)),i}finally{t.h(16)}}font_family(){try{const r=t.h(-16);t.runformat_font_family(r,this.u);var n=l().getInt32(r+0,!0),e=l().getInt32(r+4,!0);let i;return 0!==n&&(i=g(n,e).slice(),t.m(n,1*e,1)),i}finally{t.h(16)}}paragraph_alignment(){try{const r=t.h(-16);t.runformat_paragraph_alignment(r,this.u);var n=l().getInt32(r+0,!0),e=l().getInt32(r+4,!0);let i;return 0!==n&&(i=g(n,e).slice(),t.m(n,1*e,1)),i}finally{t.h(16)}}bold(){return 0!==t.runformat_bold(this.u)}italic(){return 0!==t.runformat_italic(this.u)}font_size(){try{const r=t.h(-16);t.runformat_font_size(r,this.u);var n=l().getInt32(r+0,!0),e=l().getFloat64(r+8,!0);return 0===n?void 0:e}finally{t.h(16)}}underline(){return 0!==t.runformat_underline(this.u)}}Symbol.dispose&&(RunFormat.prototype[Symbol.dispose]=RunFormat.prototype.free);const F="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>t.k(n>>>0,1));export class SelectionStyleState{static v(t){t>>>=0;const n=Object.create(SelectionStyleState.prototype);return n.u=t,F.register(n,n.u,n),n}o(){const t=this.u;return this.u=0,F.unregister(this),t}free(){const n=this.o();t.k(n,0)}font_color(){try{const r=t.h(-16);t.selectionstylestate_font_color(r,this.u);var n=l().getInt32(r+0,!0),e=l().getInt32(r+4,!0);let i;return 0!==n&&(i=g(n,e).slice(),t.m(n,1*e,1)),i}finally{t.h(16)}}italic_all(){return 0!==t.runformat_underline(this.u)}italic_any(){return 0!==t.selectionstylestate_italic_any(this.u)}strike_all(){return 0!==t.selectionstylestate_strike_all(this.u)}strike_any(){return 0!==t.selectionstylestate_strike_any(this.u)}font_family(){try{const r=t.h(-16);t.selectionstylestate_font_family(r,this.u);var n=l().getInt32(r+0,!0),e=l().getInt32(r+4,!0);let i;return 0!==n&&(i=g(n,e).slice(),t.m(n,1*e,1)),i}finally{t.h(16)}}underline_all(){return 0!==t.selectionstylestate_underline_all(this.u)}underline_any(){return 0!==t.selectionstylestate_underline_any(this.u)}paragraph_alignment(){try{const r=t.h(-16);t.selectionstylestate_paragraph_alignment(r,this.u);var n=l().getInt32(r+0,!0),e=l().getInt32(r+4,!0);let i;return 0!==n&&(i=g(n,e).slice(),t.m(n,1*e,1)),i}finally{t.h(16)}}bold_all(){return 0!==t.runformat_bold(this.u)}bold_any(){return 0!==t.runformat_italic(this.u)}font_size(){try{const r=t.h(-16);t.runformat_font_size(r,this.u);var n=l().getInt32(r+0,!0),e=l().getFloat64(r+8,!0);return 0===n?void 0:e}finally{t.h(16)}}}Symbol.dispose&&(SelectionStyleState.prototype[Symbol.dispose]=SelectionStyleState.prototype.free);const O=new Set(["basic","cors","default"]);async function E(t,n){if("function"==typeof Response&&t instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,n)}catch(n){if(!t.ok||!O.has(t.type)||"application/wasm"===t.headers.get("Content-Type"))throw n}const e=await t.arrayBuffer();return await WebAssembly.instantiate(e,n)}{const e=await WebAssembly.instantiate(t,n);return e instanceof WebAssembly.Instance?{instance:e,module:t}:e}}function W(){const n={wbg:{}};return n.wbg.S=function(n,o){const s=c(r(e(o)),t.l,t._),u=i;l().setInt32(n+4,u,!0),l().setInt32(n+0,s,!0)},n.wbg.R=function(t){return void 0===e(t)},n.wbg.j=function(t,n){throw new Error(g(t,n))},n.wbg.A=function(t){e(t).beginPath()},n.wbg.F=function(t){return d(e(t).buffer)},n.wbg.O=function(){return v(function(t,n){return d(e(t).call(e(n)))},arguments)},n.wbg.W=function(t){const n=e(t).canvas;return p(n)?0:d(n)},n.wbg.T=function(t,n,r,i,o){e(t).clearRect(n,r,i,o)},n.wbg.U=function(t){e(t).clip()},n.wbg.$=function(t){return e(t).complete},n.wbg.C=function(){return v(function(t,n,r){return d(e(t).createElement(g(n,r)))},arguments)},n.wbg.L=function(){return v(function(n,r){const o=c(URL.createObjectURL(e(r)),t.l,t._),s=i;l().setInt32(n+4,s,!0),l().setInt32(n+0,o,!0)},arguments)},n.wbg.D=function(t){const n=e(t).document;return p(n)?0:d(n)},n.wbg.I=function(){return v(function(t,n,r,i,o,s){e(t).drawImage(e(n),r,i,o,s)},arguments)},n.wbg.M=function(n,e){let r,i;try{r=n,i=e}finally{t.m(r,i,1)}},n.wbg.q=function(t,n,r,i,o){e(t).fillRect(n,r,i,o)},n.wbg.B=function(){return v(function(t,n,r,i,o){e(t).fillText(g(n,r),i,o)},arguments)},n.wbg.H=function(){return v(function(t,n,r){const i=e(t).getContext(g(n,r));return p(i)?0:d(i)},arguments)},n.wbg.J=function(t){return e(t).getDate()},n.wbg.N=function(t,n,r){const i=e(t).getElementById(g(n,r));return p(i)?0:d(i)},n.wbg.V=function(t){return e(t).getFullYear()},n.wbg.G=function(t){return e(t).getHours()},n.wbg.K=function(t){return e(t).getMinutes()},n.wbg.P=function(t){return e(t).getMonth()},n.wbg.X=function(t){return e(t).height},n.wbg.Y=function(t){let n;try{n=e(t)instanceof CanvasRenderingContext2D}catch(t){n=!1}return n},n.wbg.Z=function(t){let n;try{n=e(t)instanceof HTMLCanvasElement}catch(t){n=!1}return n},n.wbg.tt=function(t){let n;try{n=e(t)instanceof HTMLImageElement}catch(t){n=!1}return n},n.wbg.nt=function(t){let n;try{n=e(t)instanceof Window}catch(t){n=!1}return n},n.wbg.et=function(t){return e(t).length},n.wbg.rt=function(t,n,r){e(t).lineTo(n,r)},n.wbg.it=function(t,n){},n.wbg.ot=function(){return v(function(t,n,r){return d(e(t).measureText(g(n,r)))},arguments)},n.wbg.st=function(t,n,r){e(t).moveTo(n,r)},n.wbg.ut=function(t){return e(t).naturalWidth},n.wbg.ct=function(){return d(new Date)},n.wbg.lt=function(){return d(new Object)},n.wbg._t=function(){return d(new Error)},n.wbg.ft=function(){return d(new Array)},n.wbg.ht=function(t,n){return d(new Function(g(t,n)))},n.wbg.yt=function(){return v(function(t,n){return d(new Blob(e(t),e(n)))},arguments)},n.wbg.gt=function(t){return d(new Uint8Array(t>>>0))},n.wbg.dt=function(t,n){return d(Array.of(e(t),e(n)))},n.wbg.vt=function(t,n){return e(t).push(e(n))},n.wbg.bt=function(t,n,r,i,o){e(t).quadraticCurveTo(n,r,i,o)},n.wbg.wt=function(t,n,r,i,o){e(t).rect(n,r,i,o)},n.wbg.kt=function(){return v(function(t){e(t).resetTransform()},arguments)},n.wbg.St=function(t){e(t).restore()},n.wbg.xt=function(){return v(function(t,n){e(t).rotate(n)},arguments)},n.wbg.Rt=function(t){e(t).save()},n.wbg.jt=function(){return v(function(t,n,r){e(t).scale(n,r)},arguments)},n.wbg.zt=function(){return v(function(t,n){e(t).setLineDash(e(n))},arguments)},n.wbg.At=function(t,n,r){e(t).set(b(n,r))},n.wbg.Ft=function(){return v(function(t,n,r){return Reflect.set(e(t),e(n),e(r))},arguments)},n.wbg.Ot=function(t,n,r){e(t).fillStyle=g(n,r)},n.wbg.Et=function(t,n,r){e(t).font=g(n,r)},n.wbg.Wt=function(t,n){e(t).globalAlpha=n},n.wbg.Tt=function(t,n){e(t).height=n>>>0},n.wbg.Ut=function(t,n){e(t).lineWidth=n},n.wbg.$t=function(t,n){e(t).shadowBlur=n},n.wbg.Ct=function(t,n,r){e(t).shadowColor=g(n,r)},n.wbg.Lt=function(t,n){e(t).shadowOffsetX=n},n.wbg.Dt=function(t,n){e(t).shadowOffsetY=n},n.wbg.It=function(t,n,r){e(t).src=g(n,r)},n.wbg.Mt=function(t,n,r){e(t).strokeStyle=g(n,r)},n.wbg.qt=function(t,n,r){e(t).textAlign=g(n,r)},n.wbg.Bt=function(t,n,r){e(t).textBaseline=g(n,r)},n.wbg.Ht=function(t,n,r){e(t).type=g(n,r)},n.wbg.Jt=function(t,n){e(t).width=n>>>0},n.wbg.Nt=function(n,r){const o=c(e(r).stack,t.l,t._),s=i;l().setInt32(n+4,s,!0),l().setInt32(n+0,o,!0)},n.wbg.Vt=function(){const t="undefined"==typeof global?null:global;return p(t)?0:d(t)},n.wbg.Gt=function(){const t="undefined"==typeof globalThis?null:globalThis;return p(t)?0:d(t)},n.wbg.Kt=function(){const t="undefined"==typeof self?null:self;return p(t)?0:d(t)},n.wbg.Pt=function(){const t="undefined"==typeof window?null:window;return p(t)?0:d(t)},n.wbg.Qt=function(t,n,r,i,o){e(t).strokeRect(n,r,i,o)},n.wbg.Xt=function(){return v(function(t,n,r,i,o){e(t).strokeText(g(n,r),i,o)},arguments)},n.wbg.Yt=function(t){e(t).stroke()},n.wbg.Zt=function(){return v(function(t,n,r){e(t).translate(n,r)},arguments)},n.wbg.tn=function(t){return e(t).width},n.wbg.nn=function(t){return e(t).width},n.wbg.en=function(t,n){return d(g(t,n))},n.wbg.rn=function(t){return d(t)},n.wbg.sn=function(t){return d(e(t))},n.wbg.un=function(t){k(t)},n}function T(n,e){return t=n.exports,$.cn=e,a=null,x=null,o=null,t}function U(n){if(void 0!==t)return t;void 0!==n&&Object.getPrototypeOf(n)===Object.prototype&&({module:n}=n);const e=W();return n instanceof WebAssembly.Module||(n=new WebAssembly.Module(n)),T(new WebAssembly.Instance(n,e),n)}async function $(n){if(void 0!==t)return t;void 0!==n&&Object.getPrototypeOf(n)===Object.prototype&&({module_or_path:n}=n),void 0===n&&(n=new URL("docvyu_core_bg.wasm",import.meta.url));const e=W();("string"==typeof n||"function"==typeof Request&&n instanceof Request||"function"==typeof URL&&n instanceof URL)&&(n=fetch(n));const{instance:r,module:i}=await E(await n,e);return T(r,i)}export{U as initSync};export default $;
|
|
Binary file
|
|
@@ -1,59 +1,3 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const __wbg_editor_free: (a: number, b: number) => void;
|
|
5
|
-
export const __wbg_selectionstylestate_free: (a: number, b: number) => void;
|
|
6
|
-
export const editor_get_numbering_format_id: (a: number) => number;
|
|
7
|
-
export const editor_get_page_size: (a: number, b: number) => void;
|
|
8
|
-
export const editor_get_ruler_unit: (a: number) => number;
|
|
9
|
-
export const editor_get_zoom: (a: number) => number;
|
|
10
|
-
export const editor_has_bullet_list: (a: number) => number;
|
|
11
|
-
export const editor_has_numbered_list: (a: number) => number;
|
|
12
|
-
export const editor_has_numbering: (a: number) => number;
|
|
13
|
-
export const editor_load_docx_and_render: (a: number, b: number, c: number) => void;
|
|
14
|
-
export const editor_new: (a: number, b: number, c: number) => void;
|
|
15
|
-
export const editor_on_key_down: (a: number, b: number, c: number) => void;
|
|
16
|
-
export const editor_on_mouse_click: (a: number, b: number, c: number) => void;
|
|
17
|
-
export const editor_on_mouse_drag: (a: number, b: number, c: number) => void;
|
|
18
|
-
export const editor_remove_numbering: (a: number) => void;
|
|
19
|
-
export const editor_reset_font_color: (a: number) => void;
|
|
20
|
-
export const editor_reset_font_family: (a: number) => void;
|
|
21
|
-
export const editor_reset_font_size: (a: number) => void;
|
|
22
|
-
export const editor_save_document: (a: number, b: number) => void;
|
|
23
|
-
export const editor_select_document: (a: number) => void;
|
|
24
|
-
export const editor_select_paragraph: (a: number) => void;
|
|
25
|
-
export const editor_select_word: (a: number) => void;
|
|
26
|
-
export const editor_selection_style_state: (a: number) => number;
|
|
27
|
-
export const editor_set_bold: (a: number, b: number) => void;
|
|
28
|
-
export const editor_set_bullet_list: (a: number, b: number) => void;
|
|
29
|
-
export const editor_set_cursor_visible: (a: number, b: number) => void;
|
|
30
|
-
export const editor_set_font_color: (a: number, b: number, c: number) => void;
|
|
31
|
-
export const editor_set_font_family: (a: number, b: number, c: number) => void;
|
|
32
|
-
export const editor_set_font_size: (a: number, b: number) => void;
|
|
33
|
-
export const editor_set_italic: (a: number, b: number) => void;
|
|
34
|
-
export const editor_set_numbered_list: (a: number, b: number) => void;
|
|
35
|
-
export const editor_set_numbered_list_format: (a: number, b: number, c: number) => void;
|
|
36
|
-
export const editor_set_page_margins: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
37
|
-
export const editor_set_page_size: (a: number, b: number, c: number) => void;
|
|
38
|
-
export const editor_set_paragraph_alignment: (a: number, b: number, c: number) => void;
|
|
39
|
-
export const editor_set_ruler_unit: (a: number, b: number) => void;
|
|
40
|
-
export const editor_set_underline: (a: number, b: number) => void;
|
|
41
|
-
export const editor_set_zoom: (a: number, b: number) => void;
|
|
42
|
-
export const editor_toggle_ruler_unit: (a: number) => void;
|
|
43
|
-
export const editor_zoom_in: (a: number) => void;
|
|
44
|
-
export const editor_zoom_out: (a: number) => void;
|
|
45
|
-
export const selectionstylestate_bold_all: (a: number) => number;
|
|
46
|
-
export const selectionstylestate_bold_any: (a: number) => number;
|
|
47
|
-
export const selectionstylestate_font_color: (a: number, b: number) => void;
|
|
48
|
-
export const selectionstylestate_font_family: (a: number, b: number) => void;
|
|
49
|
-
export const selectionstylestate_font_size: (a: number, b: number) => void;
|
|
50
|
-
export const selectionstylestate_italic_all: (a: number) => number;
|
|
51
|
-
export const selectionstylestate_italic_any: (a: number) => number;
|
|
52
|
-
export const selectionstylestate_paragraph_alignment: (a: number, b: number) => void;
|
|
53
|
-
export const selectionstylestate_underline_all: (a: number) => number;
|
|
54
|
-
export const selectionstylestate_underline_any: (a: number) => number;
|
|
55
|
-
export const __wbindgen_export: (a: number, b: number) => number;
|
|
56
|
-
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
57
|
-
export const __wbindgen_export3: (a: number) => void;
|
|
58
|
-
export const __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
59
|
-
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docvyu/sdk",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "DocVyu DOCX Editor SDK - Universal document editor for any frontend framework",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -91,4 +91,4 @@
|
|
|
91
91
|
"optional": true
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
}
|
|
94
|
+
}
|
package/wasm/docvyu_core.d.ts
CHANGED
|
@@ -1,207 +1,33 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* @docvyu/sdk WASM module
|
|
5
|
+
* @packageDocumentation
|
|
5
6
|
*/
|
|
7
|
+
|
|
6
8
|
export enum RulerUnit {
|
|
7
9
|
Centimeters = 0,
|
|
8
10
|
Inches = 1,
|
|
9
11
|
}
|
|
12
|
+
|
|
10
13
|
export class Editor {
|
|
14
|
+
constructor(canvas_id: string);
|
|
11
15
|
free(): void;
|
|
12
16
|
[Symbol.dispose](): void;
|
|
13
|
-
set_italic(enable: boolean): void;
|
|
14
|
-
on_key_down(key: string): void;
|
|
15
|
-
select_word(): void;
|
|
16
|
-
/**
|
|
17
|
-
* Get current page size name (or "custom" if not matching any preset)
|
|
18
|
-
*/
|
|
19
|
-
get_page_size(): string;
|
|
20
|
-
/**
|
|
21
|
-
* Check if the current paragraph has any numbering
|
|
22
|
-
*/
|
|
23
|
-
has_numbering(): boolean;
|
|
24
|
-
on_mouse_drag(click_x: number, click_y: number): void;
|
|
25
|
-
save_document(): Uint8Array;
|
|
26
|
-
set_font_size(size: number): void;
|
|
27
|
-
/**
|
|
28
|
-
* Set page size using predefined sizes
|
|
29
|
-
* Sizes: "letter", "legal", "a4", "a5", "b5"
|
|
30
|
-
*/
|
|
31
|
-
set_page_size(size_name: string): void;
|
|
32
|
-
set_underline(enable: boolean): void;
|
|
33
|
-
/**
|
|
34
|
-
* Get current ruler unit
|
|
35
|
-
*/
|
|
36
|
-
get_ruler_unit(): RulerUnit;
|
|
37
|
-
on_mouse_click(click_x: number, click_y: number): void;
|
|
38
|
-
set_font_color(color: string): void;
|
|
39
|
-
/**
|
|
40
|
-
* Set ruler unit (centimeters or inches)
|
|
41
|
-
*/
|
|
42
|
-
set_ruler_unit(unit: RulerUnit): void;
|
|
43
|
-
/**
|
|
44
|
-
* Check if the current paragraph has bullet list numbering
|
|
45
|
-
*/
|
|
46
|
-
has_bullet_list(): boolean;
|
|
47
|
-
reset_font_size(): void;
|
|
48
|
-
select_document(): void;
|
|
49
|
-
/**
|
|
50
|
-
* Set bullet list for the current selection or cursor position
|
|
51
|
-
* Uses num_id=101 by convention for bullet lists
|
|
52
|
-
*/
|
|
53
|
-
set_bullet_list(enable: boolean): void;
|
|
54
|
-
set_font_family(family: string): void;
|
|
55
|
-
/**
|
|
56
|
-
* Remove numbering from the current selection or cursor position
|
|
57
|
-
*/
|
|
58
|
-
remove_numbering(): void;
|
|
59
|
-
reset_font_color(): void;
|
|
60
|
-
select_paragraph(): void;
|
|
61
|
-
set_page_margins(left: number, right: number, top: number, bottom: number): void;
|
|
62
|
-
/**
|
|
63
|
-
* Check if the current paragraph has numbered list numbering (not bullet)
|
|
64
|
-
*/
|
|
65
|
-
has_numbered_list(): boolean;
|
|
66
|
-
reset_font_family(): void;
|
|
67
|
-
/**
|
|
68
|
-
* Set numbered list for the current selection or cursor position
|
|
69
|
-
* Uses num_id=102 by convention for numbered lists (1.)
|
|
70
|
-
*/
|
|
71
|
-
set_numbered_list(enable: boolean): void;
|
|
72
|
-
/**
|
|
73
|
-
* Toggle ruler unit between centimeters and inches
|
|
74
|
-
*/
|
|
75
|
-
toggle_ruler_unit(): void;
|
|
76
|
-
set_cursor_visible(visible: boolean): void;
|
|
77
|
-
load_docx_and_render(data: Uint8Array): void;
|
|
78
|
-
selection_style_state(): SelectionStyleState;
|
|
79
|
-
/**
|
|
80
|
-
* Get the current numbering format ID (101-108 for standard, or mapped from document)
|
|
81
|
-
*/
|
|
82
|
-
get_numbering_format_id(): number | undefined;
|
|
83
|
-
set_paragraph_alignment(alignment: string): void;
|
|
84
|
-
/**
|
|
85
|
-
* Set numbered list with a specific format
|
|
86
|
-
* Formats: "decimal" (1.), "decimal-paren" (1)), "decimal-paren-both" ((1)),
|
|
87
|
-
* "upper-letter" (A.), "lower-letter" (a.),
|
|
88
|
-
* "upper-roman" (I.), "lower-roman" (i.)
|
|
89
|
-
*/
|
|
90
|
-
set_numbered_list_format(format: string): void;
|
|
91
|
-
constructor(canvas_id: string);
|
|
92
|
-
/**
|
|
93
|
-
* Zoom in by 10%
|
|
94
|
-
*/
|
|
95
|
-
zoom_in(): void;
|
|
96
|
-
/**
|
|
97
|
-
* Get current zoom level (1.0 = 100%)
|
|
98
|
-
*/
|
|
99
|
-
get_zoom(): number;
|
|
100
|
-
set_bold(enable: boolean): void;
|
|
101
|
-
/**
|
|
102
|
-
* Set zoom level (0.25 to 4.0, i.e., 25% to 400%)
|
|
103
|
-
*/
|
|
104
|
-
set_zoom(zoom: number): void;
|
|
105
|
-
/**
|
|
106
|
-
* Zoom out by 10%
|
|
107
|
-
*/
|
|
108
|
-
zoom_out(): void;
|
|
109
17
|
}
|
|
18
|
+
|
|
110
19
|
export class SelectionStyleState {
|
|
111
20
|
private constructor();
|
|
112
21
|
free(): void;
|
|
113
22
|
[Symbol.dispose](): void;
|
|
114
|
-
font_color(): string | undefined;
|
|
115
|
-
italic_all(): boolean;
|
|
116
|
-
italic_any(): boolean;
|
|
117
|
-
font_family(): string | undefined;
|
|
118
|
-
underline_all(): boolean;
|
|
119
|
-
underline_any(): boolean;
|
|
120
|
-
paragraph_alignment(): string | undefined;
|
|
121
|
-
bold_all(): boolean;
|
|
122
|
-
bold_any(): boolean;
|
|
123
|
-
font_size(): number | undefined;
|
|
124
23
|
}
|
|
125
24
|
|
|
126
25
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
26
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
127
27
|
|
|
128
28
|
export interface InitOutput {
|
|
129
29
|
readonly memory: WebAssembly.Memory;
|
|
130
|
-
readonly __wbg_editor_free: (a: number, b: number) => void;
|
|
131
|
-
readonly __wbg_selectionstylestate_free: (a: number, b: number) => void;
|
|
132
|
-
readonly editor_get_numbering_format_id: (a: number) => number;
|
|
133
|
-
readonly editor_get_page_size: (a: number, b: number) => void;
|
|
134
|
-
readonly editor_get_ruler_unit: (a: number) => number;
|
|
135
|
-
readonly editor_get_zoom: (a: number) => number;
|
|
136
|
-
readonly editor_has_bullet_list: (a: number) => number;
|
|
137
|
-
readonly editor_has_numbered_list: (a: number) => number;
|
|
138
|
-
readonly editor_has_numbering: (a: number) => number;
|
|
139
|
-
readonly editor_load_docx_and_render: (a: number, b: number, c: number) => void;
|
|
140
|
-
readonly editor_new: (a: number, b: number, c: number) => void;
|
|
141
|
-
readonly editor_on_key_down: (a: number, b: number, c: number) => void;
|
|
142
|
-
readonly editor_on_mouse_click: (a: number, b: number, c: number) => void;
|
|
143
|
-
readonly editor_on_mouse_drag: (a: number, b: number, c: number) => void;
|
|
144
|
-
readonly editor_remove_numbering: (a: number) => void;
|
|
145
|
-
readonly editor_reset_font_color: (a: number) => void;
|
|
146
|
-
readonly editor_reset_font_family: (a: number) => void;
|
|
147
|
-
readonly editor_reset_font_size: (a: number) => void;
|
|
148
|
-
readonly editor_save_document: (a: number, b: number) => void;
|
|
149
|
-
readonly editor_select_document: (a: number) => void;
|
|
150
|
-
readonly editor_select_paragraph: (a: number) => void;
|
|
151
|
-
readonly editor_select_word: (a: number) => void;
|
|
152
|
-
readonly editor_selection_style_state: (a: number) => number;
|
|
153
|
-
readonly editor_set_bold: (a: number, b: number) => void;
|
|
154
|
-
readonly editor_set_bullet_list: (a: number, b: number) => void;
|
|
155
|
-
readonly editor_set_cursor_visible: (a: number, b: number) => void;
|
|
156
|
-
readonly editor_set_font_color: (a: number, b: number, c: number) => void;
|
|
157
|
-
readonly editor_set_font_family: (a: number, b: number, c: number) => void;
|
|
158
|
-
readonly editor_set_font_size: (a: number, b: number) => void;
|
|
159
|
-
readonly editor_set_italic: (a: number, b: number) => void;
|
|
160
|
-
readonly editor_set_numbered_list: (a: number, b: number) => void;
|
|
161
|
-
readonly editor_set_numbered_list_format: (a: number, b: number, c: number) => void;
|
|
162
|
-
readonly editor_set_page_margins: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
163
|
-
readonly editor_set_page_size: (a: number, b: number, c: number) => void;
|
|
164
|
-
readonly editor_set_paragraph_alignment: (a: number, b: number, c: number) => void;
|
|
165
|
-
readonly editor_set_ruler_unit: (a: number, b: number) => void;
|
|
166
|
-
readonly editor_set_underline: (a: number, b: number) => void;
|
|
167
|
-
readonly editor_set_zoom: (a: number, b: number) => void;
|
|
168
|
-
readonly editor_toggle_ruler_unit: (a: number) => void;
|
|
169
|
-
readonly editor_zoom_in: (a: number) => void;
|
|
170
|
-
readonly editor_zoom_out: (a: number) => void;
|
|
171
|
-
readonly selectionstylestate_bold_all: (a: number) => number;
|
|
172
|
-
readonly selectionstylestate_bold_any: (a: number) => number;
|
|
173
|
-
readonly selectionstylestate_font_color: (a: number, b: number) => void;
|
|
174
|
-
readonly selectionstylestate_font_family: (a: number, b: number) => void;
|
|
175
|
-
readonly selectionstylestate_font_size: (a: number, b: number) => void;
|
|
176
|
-
readonly selectionstylestate_italic_all: (a: number) => number;
|
|
177
|
-
readonly selectionstylestate_italic_any: (a: number) => number;
|
|
178
|
-
readonly selectionstylestate_paragraph_alignment: (a: number, b: number) => void;
|
|
179
|
-
readonly selectionstylestate_underline_all: (a: number) => number;
|
|
180
|
-
readonly selectionstylestate_underline_any: (a: number) => number;
|
|
181
|
-
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
182
|
-
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
183
|
-
readonly __wbindgen_export3: (a: number) => void;
|
|
184
|
-
readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
185
|
-
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
186
30
|
}
|
|
187
31
|
|
|
188
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
189
|
-
/**
|
|
190
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
191
|
-
* a precompiled `WebAssembly.Module`.
|
|
192
|
-
*
|
|
193
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
194
|
-
*
|
|
195
|
-
* @returns {InitOutput}
|
|
196
|
-
*/
|
|
197
32
|
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
201
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
202
|
-
*
|
|
203
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
204
|
-
*
|
|
205
|
-
* @returns {Promise<InitOutput>}
|
|
206
|
-
*/
|
|
207
|
-
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
33
|
+
export default function __wbg_init(module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|