@f-office/core 0.2.0 → 0.2.2
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 +16 -1
- package/dist/browser.d.ts +7 -0
- package/dist/browser.js +10 -0
- package/dist/core.d.ts +122 -0
- package/dist/core.js +375 -0
- package/dist/index.d.ts +1 -113
- package/dist/index.js +1 -342
- package/dist/node.d.ts +7 -0
- package/dist/node.js +14 -0
- package/dist/types.d.ts +42 -1
- package/dist/wasm/f_office_wasm.d.ts +476 -2
- package/dist/wasm/f_office_wasm.js +1181 -101
- package/dist/wasm/f_office_wasm_bg.wasm +0 -0
- package/dist/wasm/f_office_wasm_bg.wasm.d.ts +56 -0
- package/dist/worker.d.ts +3 -1
- package/dist/worker.js +8 -1
- package/package.json +11 -3
|
@@ -135,6 +135,24 @@ export class Document {
|
|
|
135
135
|
}
|
|
136
136
|
return PageImage.__wrap(ret[0]);
|
|
137
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* Searches all laid-out stories of the document for `query` over the compact text map
|
|
140
|
+
* without rasterizing offscreen pages.
|
|
141
|
+
* @param {string} query
|
|
142
|
+
* @param {boolean | null} [case_sensitive]
|
|
143
|
+
* @param {boolean | null} [whole_word]
|
|
144
|
+
* @param {number | null} [max_results]
|
|
145
|
+
* @returns {SearchMatch[]}
|
|
146
|
+
*/
|
|
147
|
+
search(query, case_sensitive, whole_word, max_results) {
|
|
148
|
+
const val2 = +(isLikeNone(max_results) ? Number.MAX_SAFE_INTEGER : (max_results) >>> 0);
|
|
149
|
+
const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
150
|
+
const len0 = WASM_VECTOR_LEN;
|
|
151
|
+
const ret = wasm.document_search(this.__wbg_ptr, ptr0, len0, isLikeNone(case_sensitive) ? 0xFFFFFF : case_sensitive ? 1 : 0, isLikeNone(whole_word) ? 0xFFFFFF : whole_word ? 1 : 0, val2);
|
|
152
|
+
var v3 = getArrayJsValueFromWasm0(ret[0], ret[1]);
|
|
153
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
154
|
+
return v3;
|
|
155
|
+
}
|
|
138
156
|
/**
|
|
139
157
|
* Returns the upright text runs of one page in painting order, for a text layer.
|
|
140
158
|
*
|
|
@@ -203,6 +221,65 @@ export class Document {
|
|
|
203
221
|
}
|
|
204
222
|
if (Symbol.dispose) Document.prototype[Symbol.dispose] = Document.prototype.free;
|
|
205
223
|
|
|
224
|
+
/**
|
|
225
|
+
* A drawn page for JavaScript: its width, height and RGBA pixels.
|
|
226
|
+
*/
|
|
227
|
+
export class Drawing {
|
|
228
|
+
static __wrap(ptr) {
|
|
229
|
+
const obj = Object.create(Drawing.prototype);
|
|
230
|
+
obj.__wbg_ptr = ptr;
|
|
231
|
+
DrawingFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
232
|
+
return obj;
|
|
233
|
+
}
|
|
234
|
+
__destroy_into_raw() {
|
|
235
|
+
const ptr = this.__wbg_ptr;
|
|
236
|
+
this.__wbg_ptr = 0;
|
|
237
|
+
DrawingFinalization.unregister(this);
|
|
238
|
+
return ptr;
|
|
239
|
+
}
|
|
240
|
+
free() {
|
|
241
|
+
const ptr = this.__destroy_into_raw();
|
|
242
|
+
wasm.__wbg_drawing_free(ptr, 0);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* The height in pixels.
|
|
246
|
+
* @returns {number}
|
|
247
|
+
*/
|
|
248
|
+
get height() {
|
|
249
|
+
const ret = wasm.drawing_height(this.__wbg_ptr);
|
|
250
|
+
return ret >>> 0;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* The pixels, four bytes each, row by row from the top, as a new array.
|
|
254
|
+
* @returns {Uint8Array}
|
|
255
|
+
*/
|
|
256
|
+
get pixels() {
|
|
257
|
+
const ret = wasm.drawing_pixels(this.__wbg_ptr);
|
|
258
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
259
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
260
|
+
return v1;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Consumes and returns the RGBA pixels without cloning inside WebAssembly.
|
|
264
|
+
* @returns {Uint8Array}
|
|
265
|
+
*/
|
|
266
|
+
takePixels() {
|
|
267
|
+
const ret = wasm.drawing_takePixels(this.__wbg_ptr);
|
|
268
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
269
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
270
|
+
return v1;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* The width in pixels.
|
|
274
|
+
* @returns {number}
|
|
275
|
+
*/
|
|
276
|
+
get width() {
|
|
277
|
+
const ret = wasm.drawing_width(this.__wbg_ptr);
|
|
278
|
+
return ret >>> 0;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if (Symbol.dispose) Drawing.prototype[Symbol.dispose] = Drawing.prototype.free;
|
|
282
|
+
|
|
206
283
|
/**
|
|
207
284
|
* A font that a document's text asks for and the families that the target tries for it.
|
|
208
285
|
*/
|
|
@@ -429,8 +506,10 @@ export class Renderer {
|
|
|
429
506
|
return ret[0] >>> 0;
|
|
430
507
|
}
|
|
431
508
|
/**
|
|
432
|
-
* Adds every face in an OpenType font or font collection (`.ttf`, `.otf`, `.ttc`
|
|
433
|
-
*
|
|
509
|
+
* Adds every face in an OpenType font or font collection (`.ttf`, `.otf`, `.ttc`, `.otc`)
|
|
510
|
+
* or WOFF2 webfont (`.woff2` when built with the `woff2` feature), and returns the number
|
|
511
|
+
* of faces that it added. Full-table WOFF2 preserves exact layout metrics, while
|
|
512
|
+
* web-subsetted WOFF2 may omit glyphs or OpenType tables. A document that is already open
|
|
434
513
|
* keeps its layout.
|
|
435
514
|
*
|
|
436
515
|
* # Errors
|
|
@@ -634,160 +713,1148 @@ export class Renderer {
|
|
|
634
713
|
if (Symbol.dispose) Renderer.prototype[Symbol.dispose] = Renderer.prototype.free;
|
|
635
714
|
|
|
636
715
|
/**
|
|
637
|
-
*
|
|
638
|
-
* glyphs from its font's ascender to its descender, and its glyphs.
|
|
716
|
+
* One search match returned by `Document.search`.
|
|
639
717
|
*/
|
|
640
|
-
export class
|
|
718
|
+
export class SearchMatch {
|
|
641
719
|
static __wrap(ptr) {
|
|
642
|
-
const obj = Object.create(
|
|
720
|
+
const obj = Object.create(SearchMatch.prototype);
|
|
643
721
|
obj.__wbg_ptr = ptr;
|
|
644
|
-
|
|
722
|
+
SearchMatchFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
645
723
|
return obj;
|
|
646
724
|
}
|
|
647
725
|
__destroy_into_raw() {
|
|
648
726
|
const ptr = this.__wbg_ptr;
|
|
649
727
|
this.__wbg_ptr = 0;
|
|
650
|
-
|
|
728
|
+
SearchMatchFinalization.unregister(this);
|
|
651
729
|
return ptr;
|
|
652
730
|
}
|
|
653
731
|
free() {
|
|
654
732
|
const ptr = this.__destroy_into_raw();
|
|
655
|
-
wasm.
|
|
733
|
+
wasm.__wbg_searchmatch_free(ptr, 0);
|
|
656
734
|
}
|
|
657
735
|
/**
|
|
658
|
-
*
|
|
736
|
+
* Stable paragraph address when present (for example `"p12"`).
|
|
737
|
+
* @returns {string | undefined}
|
|
738
|
+
*/
|
|
739
|
+
get address() {
|
|
740
|
+
const ret = wasm.searchmatch_address(this.__wbg_ptr);
|
|
741
|
+
let v1;
|
|
742
|
+
if (ret[0] !== 0) {
|
|
743
|
+
v1 = getStringFromWasm0(ret[0], ret[1]);
|
|
744
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
745
|
+
}
|
|
746
|
+
return v1;
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Exclusive end offset in UTF-16 code units within the matched paragraph.
|
|
659
750
|
* @returns {number}
|
|
660
751
|
*/
|
|
661
|
-
get
|
|
662
|
-
const ret = wasm.
|
|
663
|
-
return ret;
|
|
752
|
+
get end() {
|
|
753
|
+
const ret = wasm.searchmatch_end(this.__wbg_ptr);
|
|
754
|
+
return ret >>> 0;
|
|
664
755
|
}
|
|
665
756
|
/**
|
|
666
|
-
*
|
|
667
|
-
*
|
|
668
|
-
* @returns {Uint32Array}
|
|
757
|
+
* Zero-based page index where the match starts.
|
|
758
|
+
* @returns {number}
|
|
669
759
|
*/
|
|
670
|
-
get
|
|
671
|
-
const ret = wasm.
|
|
672
|
-
|
|
673
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
674
|
-
return v1;
|
|
760
|
+
get page() {
|
|
761
|
+
const ret = wasm.searchmatch_page(this.__wbg_ptr);
|
|
762
|
+
return ret >>> 0;
|
|
675
763
|
}
|
|
676
764
|
/**
|
|
677
|
-
*
|
|
678
|
-
* @returns {
|
|
765
|
+
* Zero-based paragraph index in the matched story.
|
|
766
|
+
* @returns {number}
|
|
679
767
|
*/
|
|
680
|
-
get
|
|
681
|
-
const ret = wasm.
|
|
682
|
-
|
|
683
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
684
|
-
return v1;
|
|
768
|
+
get paragraph() {
|
|
769
|
+
const ret = wasm.searchmatch_paragraph(this.__wbg_ptr);
|
|
770
|
+
return ret >>> 0;
|
|
685
771
|
}
|
|
686
772
|
/**
|
|
687
|
-
*
|
|
773
|
+
* Flat array of highlight rectangles in points on `page`: `[left, top, width, height, ...]`.
|
|
688
774
|
* @returns {Float64Array}
|
|
689
775
|
*/
|
|
690
|
-
get
|
|
691
|
-
const ret = wasm.
|
|
776
|
+
get rects() {
|
|
777
|
+
const ret = wasm.searchmatch_rects(this.__wbg_ptr);
|
|
692
778
|
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
693
779
|
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
694
780
|
return v1;
|
|
695
781
|
}
|
|
696
782
|
/**
|
|
697
|
-
*
|
|
698
|
-
* @returns {
|
|
783
|
+
* Surrounding context excerpt from the matched paragraph.
|
|
784
|
+
* @returns {string}
|
|
699
785
|
*/
|
|
700
|
-
get
|
|
701
|
-
|
|
702
|
-
|
|
786
|
+
get snippet() {
|
|
787
|
+
let deferred1_0;
|
|
788
|
+
let deferred1_1;
|
|
789
|
+
try {
|
|
790
|
+
const ret = wasm.searchmatch_snippet(this.__wbg_ptr);
|
|
791
|
+
deferred1_0 = ret[0];
|
|
792
|
+
deferred1_1 = ret[1];
|
|
793
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
794
|
+
} finally {
|
|
795
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
796
|
+
}
|
|
703
797
|
}
|
|
704
798
|
/**
|
|
705
|
-
*
|
|
799
|
+
* Start offset in UTF-16 code units within the matched paragraph.
|
|
706
800
|
* @returns {number}
|
|
707
801
|
*/
|
|
708
|
-
get
|
|
709
|
-
const ret = wasm.
|
|
710
|
-
return ret;
|
|
802
|
+
get start() {
|
|
803
|
+
const ret = wasm.searchmatch_start(this.__wbg_ptr);
|
|
804
|
+
return ret >>> 0;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
if (Symbol.dispose) SearchMatch.prototype[Symbol.dispose] = SearchMatch.prototype.free;
|
|
808
|
+
|
|
809
|
+
/**
|
|
810
|
+
* The viewer's session for JavaScript, as [`Session`] says.
|
|
811
|
+
*/
|
|
812
|
+
export class Session {
|
|
813
|
+
__destroy_into_raw() {
|
|
814
|
+
const ptr = this.__wbg_ptr;
|
|
815
|
+
this.__wbg_ptr = 0;
|
|
816
|
+
SessionFinalization.unregister(this);
|
|
817
|
+
return ptr;
|
|
818
|
+
}
|
|
819
|
+
free() {
|
|
820
|
+
const ptr = this.__destroy_into_raw();
|
|
821
|
+
wasm.__wbg_session_free(ptr, 0);
|
|
711
822
|
}
|
|
712
823
|
/**
|
|
713
|
-
*
|
|
824
|
+
* Takes the ICU4X word dictionaries from an external postcard data blob, for the open
|
|
825
|
+
* document and the ones that it opens later.
|
|
826
|
+
*
|
|
827
|
+
* # Errors
|
|
828
|
+
*
|
|
829
|
+
* Throws when the data holds no word dictionaries.
|
|
830
|
+
* @param {Uint8Array | number[]} blob
|
|
831
|
+
*/
|
|
832
|
+
addDictionaries(blob) {
|
|
833
|
+
const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
|
|
834
|
+
const len0 = WASM_VECTOR_LEN;
|
|
835
|
+
const ret = wasm.session_addDictionaries(this.__wbg_ptr, ptr0, len0);
|
|
836
|
+
if (ret[1]) {
|
|
837
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Adds the faces of a font file and returns how many it holds.
|
|
842
|
+
*
|
|
843
|
+
* # Errors
|
|
844
|
+
*
|
|
845
|
+
* Throws when the data is no font.
|
|
846
|
+
* @param {Uint8Array | number[]} data
|
|
714
847
|
* @returns {number}
|
|
715
848
|
*/
|
|
716
|
-
|
|
717
|
-
const
|
|
718
|
-
|
|
849
|
+
addFont(data) {
|
|
850
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
851
|
+
const len0 = WASM_VECTOR_LEN;
|
|
852
|
+
const ret = wasm.session_addFont(this.__wbg_ptr, ptr0, len0);
|
|
853
|
+
if (ret[2]) {
|
|
854
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
855
|
+
}
|
|
856
|
+
return ret[0] >>> 0;
|
|
719
857
|
}
|
|
720
858
|
/**
|
|
721
|
-
*
|
|
859
|
+
* Ends a press because the window lost the focus, and returns what it did, as JSON
|
|
860
|
+
* ([`handled_json`]).
|
|
861
|
+
*
|
|
862
|
+
* # Errors
|
|
863
|
+
*
|
|
864
|
+
* Throws when no document is open.
|
|
722
865
|
* @returns {string}
|
|
723
866
|
*/
|
|
724
|
-
|
|
725
|
-
let
|
|
726
|
-
let
|
|
867
|
+
blur() {
|
|
868
|
+
let deferred2_0;
|
|
869
|
+
let deferred2_1;
|
|
727
870
|
try {
|
|
728
|
-
const ret = wasm.
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
871
|
+
const ret = wasm.session_blur(this.__wbg_ptr);
|
|
872
|
+
var ptr1 = ret[0];
|
|
873
|
+
var len1 = ret[1];
|
|
874
|
+
if (ret[3]) {
|
|
875
|
+
ptr1 = 0; len1 = 0;
|
|
876
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
877
|
+
}
|
|
878
|
+
deferred2_0 = ptr1;
|
|
879
|
+
deferred2_1 = len1;
|
|
880
|
+
return getStringFromWasm0(ptr1, len1);
|
|
732
881
|
} finally {
|
|
733
|
-
wasm.__wbindgen_free(
|
|
882
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
734
883
|
}
|
|
735
884
|
}
|
|
736
885
|
/**
|
|
737
|
-
*
|
|
738
|
-
*
|
|
886
|
+
* Clears all caller-supplied highlights, or only those matching `kind`.
|
|
887
|
+
*
|
|
888
|
+
* # Errors
|
|
889
|
+
*
|
|
890
|
+
* Throws when no document is open.
|
|
891
|
+
* @param {string | null} [kind]
|
|
739
892
|
*/
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
893
|
+
clearHighlights(kind) {
|
|
894
|
+
var ptr0 = isLikeNone(kind) ? 0 : passStringToWasm0(kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
895
|
+
var len0 = WASM_VECTOR_LEN;
|
|
896
|
+
const ret = wasm.session_clearHighlights(this.__wbg_ptr, ptr0, len0);
|
|
897
|
+
if (ret[1]) {
|
|
898
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
899
|
+
}
|
|
743
900
|
}
|
|
744
901
|
/**
|
|
745
|
-
*
|
|
902
|
+
* Clears the selection.
|
|
903
|
+
*
|
|
904
|
+
* # Errors
|
|
905
|
+
*
|
|
906
|
+
* Throws when no document is open.
|
|
907
|
+
*/
|
|
908
|
+
clearSelection() {
|
|
909
|
+
const ret = wasm.session_clearSelection(this.__wbg_ptr);
|
|
910
|
+
if (ret[1]) {
|
|
911
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Draws a page at a resolution, and counts the drawing as the shell's.
|
|
916
|
+
*
|
|
917
|
+
* # Errors
|
|
918
|
+
*
|
|
919
|
+
* Throws when no document is open, or the page does not exist or cannot be drawn.
|
|
920
|
+
* @param {number} page
|
|
921
|
+
* @param {number} dpi
|
|
922
|
+
* @returns {Drawing}
|
|
923
|
+
*/
|
|
924
|
+
draw(page, dpi) {
|
|
925
|
+
const ret = wasm.session_draw(this.__wbg_ptr, page, dpi);
|
|
926
|
+
if (ret[2]) {
|
|
927
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
928
|
+
}
|
|
929
|
+
return Drawing.__wrap(ret[0]);
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Ends a zoom gesture, so that the next frame asks for the drawings at its zoom.
|
|
933
|
+
*
|
|
934
|
+
* # Errors
|
|
935
|
+
*
|
|
936
|
+
* Throws when no document is open.
|
|
937
|
+
*/
|
|
938
|
+
endGesture() {
|
|
939
|
+
const ret = wasm.session_endGesture(this.__wbg_ptr);
|
|
940
|
+
if (ret[1]) {
|
|
941
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* Makes the next match current when `forward` is set, and the match before it when not.
|
|
946
|
+
*
|
|
947
|
+
* # Errors
|
|
948
|
+
*
|
|
949
|
+
* Throws when no document is open.
|
|
950
|
+
* @param {boolean} forward
|
|
951
|
+
*/
|
|
952
|
+
findStep(forward) {
|
|
953
|
+
const ret = wasm.session_findStep(this.__wbg_ptr, forward);
|
|
954
|
+
if (ret[1]) {
|
|
955
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* Searches the document for `query`, and returns the number of matches.
|
|
960
|
+
*
|
|
961
|
+
* # Errors
|
|
962
|
+
*
|
|
963
|
+
* Throws when no document is open.
|
|
964
|
+
* @param {string} query
|
|
746
965
|
* @returns {number}
|
|
747
966
|
*/
|
|
748
|
-
|
|
749
|
-
const
|
|
750
|
-
|
|
967
|
+
find(query) {
|
|
968
|
+
const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
969
|
+
const len0 = WASM_VECTOR_LEN;
|
|
970
|
+
const ret = wasm.session_find(this.__wbg_ptr, ptr0, len0);
|
|
971
|
+
if (ret[2]) {
|
|
972
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
973
|
+
}
|
|
974
|
+
return ret[0] >>> 0;
|
|
751
975
|
}
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
976
|
+
/**
|
|
977
|
+
* The fonts that a random-access DOCX source asks for on `target`, as JSON, without copying
|
|
978
|
+
* the whole archive into WASM linear memory ([`Session::fonts_needed_source`]).
|
|
979
|
+
*
|
|
980
|
+
* # Errors
|
|
981
|
+
*
|
|
982
|
+
* Throws when `byteLength` is invalid, no target has the ID, or the source cannot be opened.
|
|
983
|
+
* @param {number} byte_length
|
|
984
|
+
* @param {Function} read_at
|
|
985
|
+
* @param {string | null} [target]
|
|
986
|
+
* @returns {string}
|
|
987
|
+
*/
|
|
988
|
+
static fontsNeededSource(byte_length, read_at, target) {
|
|
989
|
+
let deferred4_0;
|
|
990
|
+
let deferred4_1;
|
|
991
|
+
try {
|
|
992
|
+
const val2 = +byte_length;
|
|
993
|
+
var ptr0 = isLikeNone(target) ? 0 : passStringToWasm0(target, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
994
|
+
var len0 = WASM_VECTOR_LEN;
|
|
995
|
+
const ret = wasm.session_fontsNeededSource(val2, read_at, ptr0, len0);
|
|
996
|
+
var ptr3 = ret[0];
|
|
997
|
+
var len3 = ret[1];
|
|
998
|
+
if (ret[3]) {
|
|
999
|
+
ptr3 = 0; len3 = 0;
|
|
1000
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1001
|
+
}
|
|
1002
|
+
deferred4_0 = ptr3;
|
|
1003
|
+
deferred4_1 = len3;
|
|
1004
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1005
|
+
} finally {
|
|
1006
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* The fonts that `docx` asks for on `target`, as JSON ([`Session::fonts_needed`]).
|
|
1011
|
+
*
|
|
1012
|
+
* # Errors
|
|
1013
|
+
*
|
|
1014
|
+
* Throws when no target has the ID or the file cannot be opened.
|
|
1015
|
+
* @param {Uint8Array | number[]} docx
|
|
1016
|
+
* @param {string | null} [target]
|
|
1017
|
+
* @returns {string}
|
|
1018
|
+
*/
|
|
1019
|
+
static fontsNeeded(docx, target) {
|
|
1020
|
+
let deferred4_0;
|
|
1021
|
+
let deferred4_1;
|
|
1022
|
+
try {
|
|
1023
|
+
let ptr0, len0, ptr1, len1;
|
|
1024
|
+
try {
|
|
1025
|
+
ptr0 = passArray8ToWasm0(docx, wasm.__wbindgen_malloc);
|
|
1026
|
+
len0 = WASM_VECTOR_LEN;
|
|
1027
|
+
ptr1 = isLikeNone(target) ? 0 : passStringToWasm0(target, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1028
|
+
len1 = WASM_VECTOR_LEN;
|
|
1029
|
+
} catch (e) {
|
|
1030
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
1031
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
1032
|
+
throw e;
|
|
1033
|
+
}
|
|
1034
|
+
const ret = wasm.session_fontsNeeded(ptr0, len0, ptr1, len1);
|
|
1035
|
+
var ptr3 = ret[0];
|
|
1036
|
+
var len3 = ret[1];
|
|
1037
|
+
if (ret[3]) {
|
|
1038
|
+
ptr3 = 0; len3 = 0;
|
|
1039
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1040
|
+
}
|
|
1041
|
+
deferred4_0 = ptr3;
|
|
1042
|
+
deferred4_1 = len3;
|
|
1043
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1044
|
+
} finally {
|
|
1045
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* Forgets the drawings that the worker was asked for and has not drawn.
|
|
1050
|
+
*
|
|
1051
|
+
* # Errors
|
|
1052
|
+
*
|
|
1053
|
+
* Throws when no document is open.
|
|
1054
|
+
*/
|
|
1055
|
+
forgetRequests() {
|
|
1056
|
+
const ret = wasm.session_forgetRequests(this.__wbg_ptr);
|
|
1057
|
+
if (ret[1]) {
|
|
1058
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* What the shell shows now, as JSON ([`frame_json`]).
|
|
1063
|
+
*
|
|
1064
|
+
* # Errors
|
|
1065
|
+
*
|
|
1066
|
+
* Throws when no document is open.
|
|
1067
|
+
* @returns {string}
|
|
1068
|
+
*/
|
|
1069
|
+
frame() {
|
|
1070
|
+
let deferred2_0;
|
|
1071
|
+
let deferred2_1;
|
|
1072
|
+
try {
|
|
1073
|
+
const ret = wasm.session_frame(this.__wbg_ptr);
|
|
1074
|
+
var ptr1 = ret[0];
|
|
1075
|
+
var len1 = ret[1];
|
|
1076
|
+
if (ret[3]) {
|
|
1077
|
+
ptr1 = 0; len1 = 0;
|
|
1078
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1079
|
+
}
|
|
1080
|
+
deferred2_0 = ptr1;
|
|
1081
|
+
deferred2_1 = len1;
|
|
1082
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1083
|
+
} finally {
|
|
1084
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1088
|
+
* Zooms to `factor` during a zoom gesture, around the viewport's point at `anchor_x` and
|
|
1089
|
+
* `anchor_y`: the frames ask for no drawing until [`Session::end_gesture`].
|
|
1090
|
+
*
|
|
1091
|
+
* # Errors
|
|
1092
|
+
*
|
|
1093
|
+
* Throws when no document is open.
|
|
1094
|
+
* @param {number} factor
|
|
1095
|
+
* @param {number | null} [anchor_x]
|
|
1096
|
+
* @param {number | null} [anchor_y]
|
|
1097
|
+
*/
|
|
1098
|
+
gestureZoom(factor, anchor_x, anchor_y) {
|
|
1099
|
+
const ret = wasm.session_gestureZoom(this.__wbg_ptr, factor, !isLikeNone(anchor_x), isLikeNone(anchor_x) ? 0 : anchor_x, !isLikeNone(anchor_y), isLikeNone(anchor_y) ? 0 : anchor_y);
|
|
1100
|
+
if (ret[1]) {
|
|
1101
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Scrolls to the line where the bookmark `name` starts, and returns whether it went.
|
|
1106
|
+
*
|
|
1107
|
+
* # Errors
|
|
1108
|
+
*
|
|
1109
|
+
* Throws when no document is open.
|
|
1110
|
+
* @param {string} name
|
|
1111
|
+
* @returns {boolean}
|
|
1112
|
+
*/
|
|
1113
|
+
goToBookmark(name) {
|
|
1114
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1115
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1116
|
+
const ret = wasm.session_goToBookmark(this.__wbg_ptr, ptr0, len0);
|
|
1117
|
+
if (ret[2]) {
|
|
1118
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1119
|
+
}
|
|
1120
|
+
return ret[0] !== 0;
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* Scrolls to the first line of a heading of the outline, by its index in the outline, and
|
|
1124
|
+
* makes it the frame's `currentHeading` until the next scroll.
|
|
1125
|
+
*
|
|
1126
|
+
* # Errors
|
|
1127
|
+
*
|
|
1128
|
+
* Throws when no document is open.
|
|
1129
|
+
* @param {number} index
|
|
1130
|
+
*/
|
|
1131
|
+
goToHeading(index) {
|
|
1132
|
+
const ret = wasm.session_goToHeading(this.__wbg_ptr, index);
|
|
1133
|
+
if (ret[1]) {
|
|
1134
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
/**
|
|
1138
|
+
* Scrolls the top of a page, counted from 0, to the top of the viewport.
|
|
1139
|
+
*
|
|
1140
|
+
* # Errors
|
|
1141
|
+
*
|
|
1142
|
+
* Throws when no document is open.
|
|
1143
|
+
* @param {number} page
|
|
1144
|
+
*/
|
|
1145
|
+
goToPage(page) {
|
|
1146
|
+
const ret = wasm.session_goToPage(this.__wbg_ptr, page);
|
|
1147
|
+
if (ret[1]) {
|
|
1148
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
/**
|
|
1152
|
+
* The innermost hyperlink under the viewport's point `x`, `y`, as JSON: its `target`, an
|
|
1153
|
+
* `external` `address` or a `bookmark` `name`, and its `tooltip`; null away from a link.
|
|
1154
|
+
*
|
|
1155
|
+
* # Errors
|
|
1156
|
+
*
|
|
1157
|
+
* Throws when no document is open.
|
|
1158
|
+
* @param {number} x
|
|
1159
|
+
* @param {number} y
|
|
1160
|
+
* @returns {string}
|
|
1161
|
+
*/
|
|
1162
|
+
linkAt(x, y) {
|
|
1163
|
+
let deferred2_0;
|
|
1164
|
+
let deferred2_1;
|
|
1165
|
+
try {
|
|
1166
|
+
const ret = wasm.session_linkAt(this.__wbg_ptr, x, y);
|
|
1167
|
+
var ptr1 = ret[0];
|
|
1168
|
+
var len1 = ret[1];
|
|
1169
|
+
if (ret[3]) {
|
|
1170
|
+
ptr1 = 0; len1 = 0;
|
|
1171
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1172
|
+
}
|
|
1173
|
+
deferred2_0 = ptr1;
|
|
1174
|
+
deferred2_1 = len1;
|
|
1175
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1176
|
+
} finally {
|
|
1177
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
/**
|
|
1181
|
+
* A session with no fonts and no document.
|
|
1182
|
+
*/
|
|
1183
|
+
constructor() {
|
|
1184
|
+
const ret = wasm.session_new();
|
|
1185
|
+
this.__wbg_ptr = ret;
|
|
1186
|
+
SessionFinalization.register(this, this.__wbg_ptr, this);
|
|
1187
|
+
return this;
|
|
1188
|
+
}
|
|
1189
|
+
/**
|
|
1190
|
+
* Opens a random-access DOCX source for `target` without copying the full archive into WASM
|
|
1191
|
+
* linear memory ([`Session::open_source`]).
|
|
1192
|
+
*
|
|
1193
|
+
* # Errors
|
|
1194
|
+
*
|
|
1195
|
+
* Throws when `byteLength` is invalid, no target has the ID, or the source cannot be opened.
|
|
1196
|
+
* @param {number} byte_length
|
|
1197
|
+
* @param {Function} read_at
|
|
1198
|
+
* @param {string | null} [target]
|
|
1199
|
+
* @returns {string}
|
|
1200
|
+
*/
|
|
1201
|
+
openSource(byte_length, read_at, target) {
|
|
1202
|
+
let deferred4_0;
|
|
1203
|
+
let deferred4_1;
|
|
1204
|
+
try {
|
|
1205
|
+
const val2 = +byte_length;
|
|
1206
|
+
var ptr0 = isLikeNone(target) ? 0 : passStringToWasm0(target, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1207
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1208
|
+
const ret = wasm.session_openSource(this.__wbg_ptr, val2, read_at, ptr0, len0);
|
|
1209
|
+
var ptr3 = ret[0];
|
|
1210
|
+
var len3 = ret[1];
|
|
1211
|
+
if (ret[3]) {
|
|
1212
|
+
ptr3 = 0; len3 = 0;
|
|
1213
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1214
|
+
}
|
|
1215
|
+
deferred4_0 = ptr3;
|
|
1216
|
+
deferred4_1 = len3;
|
|
1217
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1218
|
+
} finally {
|
|
1219
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* Opens `docx` for `target`, and returns its page count and outline as JSON
|
|
1224
|
+
* ([`Session::open`]).
|
|
1225
|
+
*
|
|
1226
|
+
* # Errors
|
|
1227
|
+
*
|
|
1228
|
+
* Throws when no target has the ID or the file cannot be opened.
|
|
1229
|
+
* @param {Uint8Array | number[]} docx
|
|
1230
|
+
* @param {string | null} [target]
|
|
1231
|
+
* @returns {string}
|
|
1232
|
+
*/
|
|
1233
|
+
open(docx, target) {
|
|
1234
|
+
let deferred4_0;
|
|
1235
|
+
let deferred4_1;
|
|
1236
|
+
try {
|
|
1237
|
+
let ptr0, len0, ptr1, len1;
|
|
1238
|
+
try {
|
|
1239
|
+
ptr0 = passArray8ToWasm0(docx, wasm.__wbindgen_malloc);
|
|
1240
|
+
len0 = WASM_VECTOR_LEN;
|
|
1241
|
+
ptr1 = isLikeNone(target) ? 0 : passStringToWasm0(target, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1242
|
+
len1 = WASM_VECTOR_LEN;
|
|
1243
|
+
} catch (e) {
|
|
1244
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
1245
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
1246
|
+
throw e;
|
|
1247
|
+
}
|
|
1248
|
+
const ret = wasm.session_open(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1249
|
+
var ptr3 = ret[0];
|
|
1250
|
+
var len3 = ret[1];
|
|
1251
|
+
if (ret[3]) {
|
|
1252
|
+
ptr3 = 0; len3 = 0;
|
|
1253
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1254
|
+
}
|
|
1255
|
+
deferred4_0 = ptr3;
|
|
1256
|
+
deferred4_1 = len3;
|
|
1257
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1258
|
+
} finally {
|
|
1259
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* Whether the viewport's point `x`, `y` lies on a line of text.
|
|
1264
|
+
*
|
|
1265
|
+
* # Errors
|
|
1266
|
+
*
|
|
1267
|
+
* Throws when no document is open.
|
|
1268
|
+
* @param {number} x
|
|
1269
|
+
* @param {number} y
|
|
1270
|
+
* @returns {boolean}
|
|
1271
|
+
*/
|
|
1272
|
+
overText(x, y) {
|
|
1273
|
+
const ret = wasm.session_overText(this.__wbg_ptr, x, y);
|
|
1274
|
+
if (ret[2]) {
|
|
1275
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1276
|
+
}
|
|
1277
|
+
return ret[0] !== 0;
|
|
1278
|
+
}
|
|
1279
|
+
/**
|
|
1280
|
+
* The hyperlinks of a page, counted from 0, as JSON: in reading order, each with its
|
|
1281
|
+
* `target`, `tooltip`, `text` and `boxes`, the boxes as shares of the page's width and
|
|
1282
|
+
* height.
|
|
1283
|
+
*
|
|
1284
|
+
* # Errors
|
|
1285
|
+
*
|
|
1286
|
+
* Throws when no document is open.
|
|
1287
|
+
* @param {number} page
|
|
1288
|
+
* @returns {string}
|
|
1289
|
+
*/
|
|
1290
|
+
pageLinks(page) {
|
|
1291
|
+
let deferred2_0;
|
|
1292
|
+
let deferred2_1;
|
|
1293
|
+
try {
|
|
1294
|
+
const ret = wasm.session_pageLinks(this.__wbg_ptr, page);
|
|
1295
|
+
var ptr1 = ret[0];
|
|
1296
|
+
var len1 = ret[1];
|
|
1297
|
+
if (ret[3]) {
|
|
1298
|
+
ptr1 = 0; len1 = 0;
|
|
1299
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1300
|
+
}
|
|
1301
|
+
deferred2_0 = ptr1;
|
|
1302
|
+
deferred2_1 = len1;
|
|
1303
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1304
|
+
} finally {
|
|
1305
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* Writes the open document's pages as a PDF file, for printing.
|
|
1310
|
+
*
|
|
1311
|
+
* # Errors
|
|
1312
|
+
*
|
|
1313
|
+
* Throws when no document is open, or the pages cannot be written as PDF.
|
|
1314
|
+
* @returns {Uint8Array}
|
|
1315
|
+
*/
|
|
1316
|
+
pdf() {
|
|
1317
|
+
const ret = wasm.session_pdf(this.__wbg_ptr);
|
|
1318
|
+
if (ret[3]) {
|
|
1319
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1320
|
+
}
|
|
1321
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1322
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1323
|
+
return v1;
|
|
1324
|
+
}
|
|
1325
|
+
/**
|
|
1326
|
+
* Ends a press that the platform cancelled or whose capture it lost, and returns what it
|
|
1327
|
+
* did, as JSON ([`handled_json`]).
|
|
1328
|
+
*
|
|
1329
|
+
* # Errors
|
|
1330
|
+
*
|
|
1331
|
+
* Throws when no document is open.
|
|
1332
|
+
* @returns {string}
|
|
1333
|
+
*/
|
|
1334
|
+
pointerCancel() {
|
|
1335
|
+
let deferred2_0;
|
|
1336
|
+
let deferred2_1;
|
|
1337
|
+
try {
|
|
1338
|
+
const ret = wasm.session_pointerCancel(this.__wbg_ptr);
|
|
1339
|
+
var ptr1 = ret[0];
|
|
1340
|
+
var len1 = ret[1];
|
|
1341
|
+
if (ret[3]) {
|
|
1342
|
+
ptr1 = 0; len1 = 0;
|
|
1343
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1344
|
+
}
|
|
1345
|
+
deferred2_0 = ptr1;
|
|
1346
|
+
deferred2_1 = len1;
|
|
1347
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1348
|
+
} finally {
|
|
1349
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
/**
|
|
1353
|
+
* Takes a press at the viewport's point `x`, `y` at `time` milliseconds: whether of the
|
|
1354
|
+
* `primary` button, by a `pointer` of kind `mouse`, `pen` or `touch`, with `shift`, on a
|
|
1355
|
+
* `hit` of kind `page`, `gap`, `scroll-bar`, `start-handle` or `end-handle`. Returns what it did, as JSON
|
|
1356
|
+
* ([`handled_json`]).
|
|
1357
|
+
*
|
|
1358
|
+
* # Errors
|
|
1359
|
+
*
|
|
1360
|
+
* Throws when no document is open or a kind has another name.
|
|
1361
|
+
* @param {number} x
|
|
1362
|
+
* @param {number} y
|
|
1363
|
+
* @param {boolean} primary
|
|
1364
|
+
* @param {string} pointer
|
|
1365
|
+
* @param {boolean} shift
|
|
1366
|
+
* @param {number} time
|
|
1367
|
+
* @param {string} hit
|
|
1368
|
+
* @returns {string}
|
|
1369
|
+
*/
|
|
1370
|
+
pointerDown(x, y, primary, pointer, shift, time, hit) {
|
|
1371
|
+
let deferred9_0;
|
|
1372
|
+
let deferred9_1;
|
|
1373
|
+
try {
|
|
1374
|
+
const val3 = +x;
|
|
1375
|
+
const val4 = +y;
|
|
1376
|
+
const val5 = +primary;
|
|
1377
|
+
const val6 = +shift;
|
|
1378
|
+
const val7 = +time;
|
|
1379
|
+
let ptr0, len0, ptr1, len1;
|
|
1380
|
+
try {
|
|
1381
|
+
ptr0 = passStringToWasm0(pointer, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1382
|
+
len0 = WASM_VECTOR_LEN;
|
|
1383
|
+
ptr1 = passStringToWasm0(hit, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1384
|
+
len1 = WASM_VECTOR_LEN;
|
|
1385
|
+
} catch (e) {
|
|
1386
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
1387
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
1388
|
+
throw e;
|
|
1389
|
+
}
|
|
1390
|
+
const ret = wasm.session_pointerDown(this.__wbg_ptr, val3, val4, val5, ptr0, len0, val6, val7, ptr1, len1);
|
|
1391
|
+
var ptr8 = ret[0];
|
|
1392
|
+
var len8 = ret[1];
|
|
1393
|
+
if (ret[3]) {
|
|
1394
|
+
ptr8 = 0; len8 = 0;
|
|
1395
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1396
|
+
}
|
|
1397
|
+
deferred9_0 = ptr8;
|
|
1398
|
+
deferred9_1 = len8;
|
|
1399
|
+
return getStringFromWasm0(ptr8, len8);
|
|
1400
|
+
} finally {
|
|
1401
|
+
wasm.__wbindgen_free(deferred9_0, deferred9_1, 1);
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
/**
|
|
1405
|
+
* Moves a press's pointer to the viewport's point `x`, `y` at `time` milliseconds, and
|
|
1406
|
+
* returns what it did, as JSON ([`handled_json`]).
|
|
1407
|
+
*
|
|
1408
|
+
* # Errors
|
|
1409
|
+
*
|
|
1410
|
+
* Throws when no document is open.
|
|
1411
|
+
* @param {number} x
|
|
1412
|
+
* @param {number} y
|
|
1413
|
+
* @param {number} time
|
|
1414
|
+
* @returns {string}
|
|
1415
|
+
*/
|
|
1416
|
+
pointerMove(x, y, time) {
|
|
1417
|
+
let deferred2_0;
|
|
1418
|
+
let deferred2_1;
|
|
1419
|
+
try {
|
|
1420
|
+
const ret = wasm.session_pointerMove(this.__wbg_ptr, x, y, time);
|
|
1421
|
+
var ptr1 = ret[0];
|
|
1422
|
+
var len1 = ret[1];
|
|
1423
|
+
if (ret[3]) {
|
|
1424
|
+
ptr1 = 0; len1 = 0;
|
|
1425
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1426
|
+
}
|
|
1427
|
+
deferred2_0 = ptr1;
|
|
1428
|
+
deferred2_1 = len1;
|
|
1429
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1430
|
+
} finally {
|
|
1431
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* Ends a press at the viewport's point `x`, `y` at `time` milliseconds, and returns what
|
|
1436
|
+
* it did, as JSON ([`handled_json`]).
|
|
1437
|
+
*
|
|
1438
|
+
* # Errors
|
|
1439
|
+
*
|
|
1440
|
+
* Throws when no document is open.
|
|
1441
|
+
* @param {number} x
|
|
1442
|
+
* @param {number} y
|
|
1443
|
+
* @param {number} time
|
|
1444
|
+
* @returns {string}
|
|
1445
|
+
*/
|
|
1446
|
+
pointerUp(x, y, time) {
|
|
1447
|
+
let deferred2_0;
|
|
1448
|
+
let deferred2_1;
|
|
1449
|
+
try {
|
|
1450
|
+
const ret = wasm.session_pointerUp(this.__wbg_ptr, x, y, time);
|
|
1451
|
+
var ptr1 = ret[0];
|
|
1452
|
+
var len1 = ret[1];
|
|
1453
|
+
if (ret[3]) {
|
|
1454
|
+
ptr1 = 0; len1 = 0;
|
|
1455
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1456
|
+
}
|
|
1457
|
+
deferred2_0 = ptr1;
|
|
1458
|
+
deferred2_1 = len1;
|
|
1459
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1460
|
+
} finally {
|
|
1461
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
/**
|
|
1465
|
+
* Draws a page at a resolution for the browser's own Print, without counting the
|
|
1466
|
+
* drawing as the shell's.
|
|
1467
|
+
*
|
|
1468
|
+
* # Errors
|
|
1469
|
+
*
|
|
1470
|
+
* Throws when no document is open, or the page does not exist or cannot be drawn.
|
|
1471
|
+
* @param {number} page
|
|
1472
|
+
* @param {number} dpi
|
|
1473
|
+
* @returns {Drawing}
|
|
1474
|
+
*/
|
|
1475
|
+
printPage(page, dpi) {
|
|
1476
|
+
const ret = wasm.session_printPage(this.__wbg_ptr, page, dpi);
|
|
1477
|
+
if (ret[2]) {
|
|
1478
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1479
|
+
}
|
|
1480
|
+
return Drawing.__wrap(ret[0]);
|
|
1481
|
+
}
|
|
1482
|
+
/**
|
|
1483
|
+
* The reading text of a page, counted from 0, as JSON: its paragraphs in reading order,
|
|
1484
|
+
* each with its `text` and its outline `level` or null.
|
|
1485
|
+
*
|
|
1486
|
+
* # Errors
|
|
1487
|
+
*
|
|
1488
|
+
* Throws when no document is open.
|
|
1489
|
+
* @param {number} page
|
|
1490
|
+
* @returns {string}
|
|
1491
|
+
*/
|
|
1492
|
+
readingText(page) {
|
|
1493
|
+
let deferred2_0;
|
|
1494
|
+
let deferred2_1;
|
|
1495
|
+
try {
|
|
1496
|
+
const ret = wasm.session_readingText(this.__wbg_ptr, page);
|
|
1497
|
+
var ptr1 = ret[0];
|
|
1498
|
+
var len1 = ret[1];
|
|
1499
|
+
if (ret[3]) {
|
|
1500
|
+
ptr1 = 0; len1 = 0;
|
|
1501
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1502
|
+
}
|
|
1503
|
+
deferred2_0 = ptr1;
|
|
1504
|
+
deferred2_1 = len1;
|
|
1505
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1506
|
+
} finally {
|
|
1507
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
/**
|
|
1511
|
+
* Gives the viewer the viewport's size in CSS pixels and the device pixel ratio.
|
|
1512
|
+
*
|
|
1513
|
+
* # Errors
|
|
1514
|
+
*
|
|
1515
|
+
* Throws when no document is open.
|
|
1516
|
+
* @param {number} width
|
|
1517
|
+
* @param {number} height
|
|
1518
|
+
* @param {number} ratio
|
|
1519
|
+
*/
|
|
1520
|
+
resize(width, height, ratio) {
|
|
1521
|
+
const ret = wasm.session_resize(this.__wbg_ptr, width, height, ratio);
|
|
1522
|
+
if (ret[1]) {
|
|
1523
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
/**
|
|
1527
|
+
* Scrolls to `page`, optionally focusing a point-space rectangle with `block` placement.
|
|
1528
|
+
*
|
|
1529
|
+
* # Errors
|
|
1530
|
+
*
|
|
1531
|
+
* Throws when no document is open.
|
|
1532
|
+
* @param {number} page
|
|
1533
|
+
* @param {number | null} [left]
|
|
1534
|
+
* @param {number | null} [top]
|
|
1535
|
+
* @param {number | null} [width]
|
|
1536
|
+
* @param {number | null} [height]
|
|
1537
|
+
* @param {string | null} [block]
|
|
1538
|
+
*/
|
|
1539
|
+
scrollToRect(page, left, top, width, height, block) {
|
|
1540
|
+
const val2 = +page;
|
|
1541
|
+
const val3 = +(isLikeNone(left) ? 0 : left);
|
|
1542
|
+
const val4 = +(isLikeNone(top) ? 0 : top);
|
|
1543
|
+
const val5 = +(isLikeNone(width) ? 0 : width);
|
|
1544
|
+
const val6 = +(isLikeNone(height) ? 0 : height);
|
|
1545
|
+
var ptr0 = isLikeNone(block) ? 0 : passStringToWasm0(block, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1546
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1547
|
+
const ret = wasm.session_scrollToRect(this.__wbg_ptr, val2, !isLikeNone(left), val3, !isLikeNone(top), val4, !isLikeNone(width), val5, !isLikeNone(height), val6, ptr0, len0);
|
|
1548
|
+
if (ret[1]) {
|
|
1549
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Scrolls the viewport's top left corner to `(left, top)`.
|
|
1554
|
+
*
|
|
1555
|
+
* # Errors
|
|
1556
|
+
*
|
|
1557
|
+
* Throws when no document is open.
|
|
1558
|
+
* @param {number} left
|
|
1559
|
+
* @param {number} top
|
|
1560
|
+
*/
|
|
1561
|
+
scrollTo(left, top) {
|
|
1562
|
+
const ret = wasm.session_scrollTo(this.__wbg_ptr, left, top);
|
|
1563
|
+
if (ret[1]) {
|
|
1564
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
/**
|
|
1568
|
+
* Selects the whole story of the last press.
|
|
1569
|
+
*
|
|
1570
|
+
* # Errors
|
|
1571
|
+
*
|
|
1572
|
+
* Throws when no document is open.
|
|
1573
|
+
*/
|
|
1574
|
+
selectAll() {
|
|
1575
|
+
const ret = wasm.session_selectAll(this.__wbg_ptr);
|
|
1576
|
+
if (ret[1]) {
|
|
1577
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
/**
|
|
1581
|
+
* The selected text, as a copy gives it.
|
|
1582
|
+
*
|
|
1583
|
+
* # Errors
|
|
1584
|
+
*
|
|
1585
|
+
* Throws when no document is open.
|
|
1586
|
+
* @returns {string}
|
|
1587
|
+
*/
|
|
1588
|
+
selectedText() {
|
|
1589
|
+
let deferred2_0;
|
|
1590
|
+
let deferred2_1;
|
|
1591
|
+
try {
|
|
1592
|
+
const ret = wasm.session_selectedText(this.__wbg_ptr);
|
|
1593
|
+
var ptr1 = ret[0];
|
|
1594
|
+
var len1 = ret[1];
|
|
1595
|
+
if (ret[3]) {
|
|
1596
|
+
ptr1 = 0; len1 = 0;
|
|
1597
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1598
|
+
}
|
|
1599
|
+
deferred2_0 = ptr1;
|
|
1600
|
+
deferred2_1 = len1;
|
|
1601
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1602
|
+
} finally {
|
|
1603
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
/**
|
|
1607
|
+
* Replaces caller-supplied highlights from a JSON array string.
|
|
1608
|
+
*
|
|
1609
|
+
* # Errors
|
|
1610
|
+
*
|
|
1611
|
+
* Throws when no document is open or JSON is malformed.
|
|
1612
|
+
* @param {string} items_json
|
|
1613
|
+
*/
|
|
1614
|
+
setHighlights(items_json) {
|
|
1615
|
+
const ptr0 = passStringToWasm0(items_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1616
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1617
|
+
const ret = wasm.session_setHighlights(this.__wbg_ptr, ptr0, len0);
|
|
1618
|
+
if (ret[1]) {
|
|
1619
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
/**
|
|
1623
|
+
* Enables or disables two-pass progressive drawing (fast 96 DPI draft before `HiDPI`).
|
|
1624
|
+
* @param {boolean} enabled
|
|
1625
|
+
*/
|
|
1626
|
+
setProgressiveDraft(enabled) {
|
|
1627
|
+
wasm.session_setProgressiveDraft(this.__wbg_ptr, enabled);
|
|
1628
|
+
}
|
|
1629
|
+
/**
|
|
1630
|
+
* Sets the zoom, `fixed` at `factor`, `fit-width` or `fit-page`, around the anchor or the
|
|
1631
|
+
* viewport's middle ([`Session::set_zoom`]).
|
|
1632
|
+
*
|
|
1633
|
+
* # Errors
|
|
1634
|
+
*
|
|
1635
|
+
* Throws when no document is open or the kind is no zoom.
|
|
1636
|
+
* @param {string} kind
|
|
1637
|
+
* @param {number} factor
|
|
1638
|
+
* @param {number | null} [anchor_x]
|
|
1639
|
+
* @param {number | null} [anchor_y]
|
|
1640
|
+
*/
|
|
1641
|
+
setZoom(kind, factor, anchor_x, anchor_y) {
|
|
1642
|
+
const val2 = +factor;
|
|
1643
|
+
const val3 = +(isLikeNone(anchor_x) ? 0 : anchor_x);
|
|
1644
|
+
const val4 = +(isLikeNone(anchor_y) ? 0 : anchor_y);
|
|
1645
|
+
const ptr0 = passStringToWasm0(kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1646
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1647
|
+
const ret = wasm.session_setZoom(this.__wbg_ptr, ptr0, len0, val2, !isLikeNone(anchor_x), val3, !isLikeNone(anchor_y), val4);
|
|
1648
|
+
if (ret[1]) {
|
|
1649
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
/**
|
|
1653
|
+
* Scrolls a point in points of a page, counted from 0, to the viewport's top left corner,
|
|
1654
|
+
* as the frame's `place` gave it.
|
|
1655
|
+
*
|
|
1656
|
+
* # Errors
|
|
1657
|
+
*
|
|
1658
|
+
* Throws when no document is open.
|
|
1659
|
+
* @param {number} page
|
|
1660
|
+
* @param {number} x
|
|
1661
|
+
* @param {number} y
|
|
1662
|
+
*/
|
|
1663
|
+
showPlace(page, x, y) {
|
|
1664
|
+
const ret = wasm.session_showPlace(this.__wbg_ptr, page, x, y);
|
|
1665
|
+
if (ret[1]) {
|
|
1666
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
/**
|
|
1670
|
+
* Streams the open document's pages as a PDF to `onChunk(chunk: Uint8Array)` in bounded
|
|
1671
|
+
* 64 KiB chunks without allocating the full PDF in WASM linear memory.
|
|
1672
|
+
*
|
|
1673
|
+
* # Errors
|
|
1674
|
+
*
|
|
1675
|
+
* Throws when no document is open, or the pages cannot be written as PDF.
|
|
1676
|
+
* @param {Function} on_chunk
|
|
1677
|
+
*/
|
|
1678
|
+
writePdfTo(on_chunk) {
|
|
1679
|
+
const ret = wasm.session_writePdfTo(this.__wbg_ptr, on_chunk);
|
|
1680
|
+
if (ret[1]) {
|
|
1681
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* Zooms one step in or out around the anchor or the viewport's middle.
|
|
1686
|
+
*
|
|
1687
|
+
* # Errors
|
|
1688
|
+
*
|
|
1689
|
+
* Throws when no document is open.
|
|
1690
|
+
* @param {boolean} inward
|
|
1691
|
+
* @param {number | null} [anchor_x]
|
|
1692
|
+
* @param {number | null} [anchor_y]
|
|
1693
|
+
*/
|
|
1694
|
+
zoomStep(inward, anchor_x, anchor_y) {
|
|
1695
|
+
const ret = wasm.session_zoomStep(this.__wbg_ptr, inward, !isLikeNone(anchor_x), isLikeNone(anchor_x) ? 0 : anchor_x, !isLikeNone(anchor_y), isLikeNone(anchor_y) ? 0 : anchor_y);
|
|
1696
|
+
if (ret[1]) {
|
|
1697
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
if (Symbol.dispose) Session.prototype[Symbol.dispose] = Session.prototype.free;
|
|
1702
|
+
|
|
1703
|
+
/**
|
|
1704
|
+
* A run of upright text on a page, in points from the page's top left corner: the box of its
|
|
1705
|
+
* glyphs from its font's ascender to its descender, and its glyphs.
|
|
1706
|
+
*/
|
|
1707
|
+
export class TextRun {
|
|
1708
|
+
static __wrap(ptr) {
|
|
1709
|
+
const obj = Object.create(TextRun.prototype);
|
|
1710
|
+
obj.__wbg_ptr = ptr;
|
|
1711
|
+
TextRunFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1712
|
+
return obj;
|
|
1713
|
+
}
|
|
1714
|
+
__destroy_into_raw() {
|
|
1715
|
+
const ptr = this.__wbg_ptr;
|
|
1716
|
+
this.__wbg_ptr = 0;
|
|
1717
|
+
TextRunFinalization.unregister(this);
|
|
1718
|
+
return ptr;
|
|
1719
|
+
}
|
|
1720
|
+
free() {
|
|
1721
|
+
const ptr = this.__destroy_into_raw();
|
|
1722
|
+
wasm.__wbg_textrun_free(ptr, 0);
|
|
1723
|
+
}
|
|
1724
|
+
/**
|
|
1725
|
+
* The baseline.
|
|
1726
|
+
* @returns {number}
|
|
1727
|
+
*/
|
|
1728
|
+
get baseline() {
|
|
1729
|
+
const ret = wasm.textrun_baseline(this.__wbg_ptr);
|
|
1730
|
+
return ret;
|
|
1731
|
+
}
|
|
1732
|
+
/**
|
|
1733
|
+
* The end of each glyph's text in `text`, counted in UTF-16 code units as JavaScript
|
|
1734
|
+
* counts a string's characters.
|
|
1735
|
+
* @returns {Uint32Array}
|
|
1736
|
+
*/
|
|
1737
|
+
get glyphEnds() {
|
|
1738
|
+
const ret = wasm.textrun_glyphEnds(this.__wbg_ptr);
|
|
1739
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
1740
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1741
|
+
return v1;
|
|
1742
|
+
}
|
|
1743
|
+
/**
|
|
1744
|
+
* The left edge of each glyph's cell, in the order of the text.
|
|
1745
|
+
* @returns {Float64Array}
|
|
1746
|
+
*/
|
|
1747
|
+
get glyphLefts() {
|
|
1748
|
+
const ret = wasm.textrun_glyphLefts(this.__wbg_ptr);
|
|
1749
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
1750
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
1751
|
+
return v1;
|
|
1752
|
+
}
|
|
1753
|
+
/**
|
|
1754
|
+
* The advance of each glyph.
|
|
1755
|
+
* @returns {Float64Array}
|
|
1756
|
+
*/
|
|
1757
|
+
get glyphWidths() {
|
|
1758
|
+
const ret = wasm.textrun_glyphWidths(this.__wbg_ptr);
|
|
1759
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
1760
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
1761
|
+
return v1;
|
|
1762
|
+
}
|
|
1763
|
+
/**
|
|
1764
|
+
* The height of the box.
|
|
1765
|
+
* @returns {number}
|
|
1766
|
+
*/
|
|
1767
|
+
get height() {
|
|
1768
|
+
const ret = wasm.textrun_height(this.__wbg_ptr);
|
|
1769
|
+
return ret;
|
|
1770
|
+
}
|
|
1771
|
+
/**
|
|
1772
|
+
* The left edge of the box.
|
|
1773
|
+
* @returns {number}
|
|
1774
|
+
*/
|
|
1775
|
+
get left() {
|
|
1776
|
+
const ret = wasm.textrun_left(this.__wbg_ptr);
|
|
1777
|
+
return ret;
|
|
1778
|
+
}
|
|
1779
|
+
/**
|
|
1780
|
+
* The font size.
|
|
1781
|
+
* @returns {number}
|
|
1782
|
+
*/
|
|
1783
|
+
get size() {
|
|
1784
|
+
const ret = wasm.textrun_size(this.__wbg_ptr);
|
|
1785
|
+
return ret;
|
|
1786
|
+
}
|
|
1787
|
+
/**
|
|
1788
|
+
* The text that the glyphs show.
|
|
1789
|
+
* @returns {string}
|
|
1790
|
+
*/
|
|
1791
|
+
get text() {
|
|
1792
|
+
let deferred1_0;
|
|
1793
|
+
let deferred1_1;
|
|
1794
|
+
try {
|
|
1795
|
+
const ret = wasm.textrun_text(this.__wbg_ptr);
|
|
1796
|
+
deferred1_0 = ret[0];
|
|
1797
|
+
deferred1_1 = ret[1];
|
|
1798
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1799
|
+
} finally {
|
|
1800
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
/**
|
|
1804
|
+
* The top edge of the box.
|
|
1805
|
+
* @returns {number}
|
|
1806
|
+
*/
|
|
1807
|
+
get top() {
|
|
1808
|
+
const ret = wasm.textrun_top(this.__wbg_ptr);
|
|
1809
|
+
return ret;
|
|
1810
|
+
}
|
|
1811
|
+
/**
|
|
1812
|
+
* The width of the box.
|
|
1813
|
+
* @returns {number}
|
|
1814
|
+
*/
|
|
1815
|
+
get width() {
|
|
1816
|
+
const ret = wasm.textrun_width(this.__wbg_ptr);
|
|
1817
|
+
return ret;
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
if (Symbol.dispose) TextRun.prototype[Symbol.dispose] = TextRun.prototype.free;
|
|
1821
|
+
function __wbg_get_imports() {
|
|
1822
|
+
const import0 = {
|
|
1823
|
+
__proto__: null,
|
|
1824
|
+
__wbg_Error_208446807d0d1e30: function(arg0, arg1) {
|
|
1825
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
1826
|
+
return ret;
|
|
1827
|
+
},
|
|
1828
|
+
__wbg___wbindgen_debug_string_f249a2a76caa9a55: function(arg0, arg1) {
|
|
1829
|
+
const ret = debugString(arg1);
|
|
1830
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1831
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1832
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
1833
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
1834
|
+
},
|
|
1835
|
+
__wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
|
|
1836
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1837
|
+
},
|
|
1838
|
+
__wbg_call_a410eb4b59ed5965: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1839
|
+
const ret = arg0.call(arg1, arg2);
|
|
1840
|
+
return ret;
|
|
1841
|
+
}, arguments); },
|
|
1842
|
+
__wbg_call_fc92fee6137d452d: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1843
|
+
const ret = arg0.call(arg1, arg2, arg3);
|
|
1844
|
+
return ret;
|
|
1845
|
+
}, arguments); },
|
|
1846
|
+
__wbg_fontneed_new: function(arg0) {
|
|
1847
|
+
const ret = FontNeed.__wrap(arg0);
|
|
1848
|
+
return ret;
|
|
1849
|
+
},
|
|
1850
|
+
__wbg_instanceof_Uint8Array_d7aeb0dcb3108fea: function(arg0) {
|
|
1851
|
+
let result;
|
|
1852
|
+
try {
|
|
1853
|
+
result = arg0 instanceof Uint8Array;
|
|
1854
|
+
} catch (_) {
|
|
1855
|
+
result = false;
|
|
1856
|
+
}
|
|
1857
|
+
const ret = result;
|
|
791
1858
|
return ret;
|
|
792
1859
|
},
|
|
793
1860
|
__wbg_length_186163212ffe79c3: function(arg0) {
|
|
@@ -809,6 +1876,10 @@ function __wbg_get_imports() {
|
|
|
809
1876
|
__wbg_prototypesetcall_13162965d1fe7aa3: function(arg0, arg1, arg2) {
|
|
810
1877
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
811
1878
|
},
|
|
1879
|
+
__wbg_searchmatch_new: function(arg0) {
|
|
1880
|
+
const ret = SearchMatch.__wrap(arg0);
|
|
1881
|
+
return ret;
|
|
1882
|
+
},
|
|
812
1883
|
__wbg_subarray_58f388a9247ac0bb: function(arg0, arg1, arg2) {
|
|
813
1884
|
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
814
1885
|
return ret;
|
|
@@ -845,6 +1916,9 @@ function __wbg_get_imports() {
|
|
|
845
1916
|
const DocumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
846
1917
|
? { register: () => {}, unregister: () => {} }
|
|
847
1918
|
: new FinalizationRegistry(ptr => wasm.__wbg_document_free(ptr, 1));
|
|
1919
|
+
const DrawingFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1920
|
+
? { register: () => {}, unregister: () => {} }
|
|
1921
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_drawing_free(ptr, 1));
|
|
848
1922
|
const FontNeedFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
849
1923
|
? { register: () => {}, unregister: () => {} }
|
|
850
1924
|
: new FinalizationRegistry(ptr => wasm.__wbg_fontneed_free(ptr, 1));
|
|
@@ -857,6 +1931,12 @@ const PageImageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
857
1931
|
const RendererFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
858
1932
|
? { register: () => {}, unregister: () => {} }
|
|
859
1933
|
: new FinalizationRegistry(ptr => wasm.__wbg_renderer_free(ptr, 1));
|
|
1934
|
+
const SearchMatchFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1935
|
+
? { register: () => {}, unregister: () => {} }
|
|
1936
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_searchmatch_free(ptr, 1));
|
|
1937
|
+
const SessionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1938
|
+
? { register: () => {}, unregister: () => {} }
|
|
1939
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_session_free(ptr, 1));
|
|
860
1940
|
const TextRunFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
861
1941
|
? { register: () => {}, unregister: () => {} }
|
|
862
1942
|
: new FinalizationRegistry(ptr => wasm.__wbg_textrun_free(ptr, 1));
|