@@ -70,48 +70,56 @@ export function createLevel(id, start, format, text, jc) {
7070function isLikeNone ( x ) {
7171 return x === undefined || x === null ;
7272}
73- /**
74- * @returns {Docx }
75- */
76- export function createDocx ( ) {
77- const ret = wasm . createDocx ( ) ;
78- return Docx . __wrap ( ret ) ;
79- }
8073
8174function _assertClass ( instance , klass ) {
8275 if ( ! ( instance instanceof klass ) ) {
8376 throw new Error ( `expected instance of ${ klass . name } ` ) ;
8477 }
8578 return instance . ptr ;
8679}
87-
88- let cachegetInt32Memory = null ;
89- function getInt32Memory ( ) {
90- if ( cachegetInt32Memory === null || cachegetInt32Memory . buffer !== wasm . memory . buffer ) {
91- cachegetInt32Memory = new Int32Array ( wasm . memory . buffer ) ;
92- }
93- return cachegetInt32Memory ;
80+ /**
81+ * @param {Run } run
82+ * @returns {Delete }
83+ */
84+ export function createDelete ( run ) {
85+ _assertClass ( run , Run ) ;
86+ const ptr0 = run . ptr ;
87+ run . ptr = 0 ;
88+ const ret = wasm . createDelete ( ptr0 ) ;
89+ return Delete . __wrap ( ret ) ;
9490}
9591
96- function getArrayU8FromWasm ( ptr , len ) {
97- return getUint8Memory ( ) . subarray ( ptr / 1 , ptr / 1 + len ) ;
98- }
9992/**
93+ * @param {Run } run
10094* @returns {Insert }
10195*/
102- export function createInsert ( ) {
103- const ret = wasm . createInsert ( ) ;
96+ export function createInsert ( run ) {
97+ _assertClass ( run , Run ) ;
98+ const ptr0 = run . ptr ;
99+ run . ptr = 0 ;
100+ const ret = wasm . createInsert ( ptr0 ) ;
104101 return Insert . __wrap ( ret ) ;
105102}
106103
107104/**
108- * @returns {Delete }
105+ * @returns {Docx }
109106*/
110- export function createDelete ( ) {
111- const ret = wasm . createDelete ( ) ;
112- return Delete . __wrap ( ret ) ;
107+ export function createDocx ( ) {
108+ const ret = wasm . createDocx ( ) ;
109+ return Docx . __wrap ( ret ) ;
113110}
114111
112+ let cachegetInt32Memory = null ;
113+ function getInt32Memory ( ) {
114+ if ( cachegetInt32Memory === null || cachegetInt32Memory . buffer !== wasm . memory . buffer ) {
115+ cachegetInt32Memory = new Int32Array ( wasm . memory . buffer ) ;
116+ }
117+ return cachegetInt32Memory ;
118+ }
119+
120+ function getArrayU8FromWasm ( ptr , len ) {
121+ return getUint8Memory ( ) . subarray ( ptr / 1 , ptr / 1 + len ) ;
122+ }
115123/**
116124* @param {number } id
117125* @returns {Numbering }
0 commit comments