@iyulab/unhwp 0.9.0 → 0.10.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 +6 -4
- package/package.json +1 -1
- package/unhwp_wasm.d.ts +45 -42
- package/unhwp_wasm.js +5 -1
- package/unhwp_wasm_bg.js +147 -157
- package/unhwp_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -10,10 +10,12 @@ npm install @iyulab/unhwp
|
|
|
10
10
|
|
|
11
11
|
## Usage (ES Module / browser)
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
> 이 패키지는 `wasm-pack --target bundler` 로 빌드된 ES 모듈입니다. WebAssembly 바이너리가
|
|
14
|
+
> 자동으로 초기화되므로 `await init()` 이 필요 없습니다 — 함수를 그대로 import 해 호출하세요.
|
|
15
|
+
> 번들러(webpack, Vite, Rollup, esbuild)를 통해 사용합니다.
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
```js
|
|
18
|
+
import { parse } from '@iyulab/unhwp';
|
|
17
19
|
|
|
18
20
|
const response = await fetch('document.hwp');
|
|
19
21
|
const data = new Uint8Array(await response.arrayBuffer());
|
|
@@ -43,7 +45,7 @@ HWP 또는 HWPX 파일 바이트를 파싱합니다. 파싱 실패 시 오류를
|
|
|
43
45
|
### `ParseOptions`
|
|
44
46
|
|
|
45
47
|
```js
|
|
46
|
-
import {
|
|
48
|
+
import { parseWithOptions, ParseOptions } from '@iyulab/unhwp';
|
|
47
49
|
|
|
48
50
|
const opts = new ParseOptions().lenient().textOnly();
|
|
49
51
|
const doc = parseWithOptions(data, opts);
|
package/package.json
CHANGED
package/unhwp_wasm.d.ts
CHANGED
|
@@ -2,54 +2,57 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
4
|
export class HwpDocument {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
private constructor();
|
|
6
|
+
free(): void;
|
|
7
|
+
[Symbol.dispose](): void;
|
|
8
|
+
static fromBytes(data: Uint8Array): HwpDocument;
|
|
9
|
+
paragraphCount(): number;
|
|
10
|
+
sectionCount(): number;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the document's embedded images as an array of [`HwpImage`],
|
|
13
|
+
* sorted by resource ID for deterministic ordering.
|
|
14
|
+
*/
|
|
15
|
+
toImages(): HwpImage[];
|
|
16
|
+
toJson(): string;
|
|
17
|
+
toMarkdown(): string;
|
|
18
|
+
toText(): string;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* An embedded image extracted from a document.
|
|
23
|
+
*/
|
|
21
24
|
export class HwpImage {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
25
|
+
private constructor();
|
|
26
|
+
free(): void;
|
|
27
|
+
[Symbol.dispose](): void;
|
|
28
|
+
/**
|
|
29
|
+
* Image bytes encoded as standard base64 (for `data:` URLs).
|
|
30
|
+
*/
|
|
31
|
+
readonly base64: string;
|
|
32
|
+
/**
|
|
33
|
+
* Raw image bytes (`Uint8Array` in JS).
|
|
34
|
+
*/
|
|
35
|
+
readonly bytes: Uint8Array;
|
|
36
|
+
/**
|
|
37
|
+
* Original filename, if known.
|
|
38
|
+
*/
|
|
39
|
+
readonly filename: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Resource identifier (matches markdown image references).
|
|
42
|
+
*/
|
|
43
|
+
readonly id: string;
|
|
44
|
+
/**
|
|
45
|
+
* MIME type, if known.
|
|
46
|
+
*/
|
|
47
|
+
readonly mimeType: string | undefined;
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
export class ParseOptions {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
free(): void;
|
|
52
|
+
[Symbol.dispose](): void;
|
|
53
|
+
lenient(): ParseOptions;
|
|
54
|
+
constructor();
|
|
55
|
+
textOnly(): ParseOptions;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
export function parse(data: Uint8Array): HwpDocument;
|
package/unhwp_wasm.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
/* @ts-self-types="./unhwp_wasm.d.ts" */
|
|
1
2
|
import * as wasm from "./unhwp_wasm_bg.wasm";
|
|
2
|
-
export * from "./unhwp_wasm_bg.js";
|
|
3
3
|
import { __wbg_set_wasm } from "./unhwp_wasm_bg.js";
|
|
4
|
+
|
|
4
5
|
__wbg_set_wasm(wasm);
|
|
5
6
|
wasm.__wbindgen_start();
|
|
7
|
+
export {
|
|
8
|
+
HwpDocument, HwpImage, ParseOptions, parse, parseWithOptions
|
|
9
|
+
} from "./unhwp_wasm_bg.js";
|
package/unhwp_wasm_bg.js
CHANGED
|
@@ -1,95 +1,5 @@
|
|
|
1
|
-
let wasm;
|
|
2
|
-
export function __wbg_set_wasm(val) {
|
|
3
|
-
wasm = val;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
function _assertClass(instance, klass) {
|
|
7
|
-
if (!(instance instanceof klass)) {
|
|
8
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function getArrayJsValueFromWasm0(ptr, len) {
|
|
13
|
-
ptr = ptr >>> 0;
|
|
14
|
-
const mem = getDataViewMemory0();
|
|
15
|
-
const result = [];
|
|
16
|
-
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
17
|
-
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
18
|
-
}
|
|
19
|
-
wasm.__externref_drop_slice(ptr, len);
|
|
20
|
-
return result;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
24
|
-
ptr = ptr >>> 0;
|
|
25
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
let cachedDataViewMemory0 = null;
|
|
29
|
-
function getDataViewMemory0() {
|
|
30
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
31
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
32
|
-
}
|
|
33
|
-
return cachedDataViewMemory0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function getStringFromWasm0(ptr, len) {
|
|
37
|
-
ptr = ptr >>> 0;
|
|
38
|
-
return decodeText(ptr, len);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
let cachedUint8ArrayMemory0 = null;
|
|
42
|
-
function getUint8ArrayMemory0() {
|
|
43
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
44
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
45
|
-
}
|
|
46
|
-
return cachedUint8ArrayMemory0;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
50
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
51
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
52
|
-
WASM_VECTOR_LEN = arg.length;
|
|
53
|
-
return ptr;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function takeFromExternrefTable0(idx) {
|
|
57
|
-
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
58
|
-
wasm.__externref_table_dealloc(idx);
|
|
59
|
-
return value;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
63
|
-
cachedTextDecoder.decode();
|
|
64
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
65
|
-
let numBytesDecoded = 0;
|
|
66
|
-
function decodeText(ptr, len) {
|
|
67
|
-
numBytesDecoded += len;
|
|
68
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
69
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
70
|
-
cachedTextDecoder.decode();
|
|
71
|
-
numBytesDecoded = len;
|
|
72
|
-
}
|
|
73
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
let WASM_VECTOR_LEN = 0;
|
|
77
|
-
|
|
78
|
-
const HwpDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
79
|
-
? { register: () => {}, unregister: () => {} }
|
|
80
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_hwpdocument_free(ptr >>> 0, 1));
|
|
81
|
-
|
|
82
|
-
const HwpImageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
83
|
-
? { register: () => {}, unregister: () => {} }
|
|
84
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_hwpimage_free(ptr >>> 0, 1));
|
|
85
|
-
|
|
86
|
-
const ParseOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
87
|
-
? { register: () => {}, unregister: () => {} }
|
|
88
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_parseoptions_free(ptr >>> 0, 1));
|
|
89
|
-
|
|
90
1
|
export class HwpDocument {
|
|
91
2
|
static __wrap(ptr) {
|
|
92
|
-
ptr = ptr >>> 0;
|
|
93
3
|
const obj = Object.create(HwpDocument.prototype);
|
|
94
4
|
obj.__wbg_ptr = ptr;
|
|
95
5
|
HwpDocumentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -118,14 +28,39 @@ export class HwpDocument {
|
|
|
118
28
|
}
|
|
119
29
|
return HwpDocument.__wrap(ret[0]);
|
|
120
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* @returns {number}
|
|
33
|
+
*/
|
|
34
|
+
paragraphCount() {
|
|
35
|
+
const ret = wasm.hwpdocument_paragraphCount(this.__wbg_ptr);
|
|
36
|
+
return ret >>> 0;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @returns {number}
|
|
40
|
+
*/
|
|
41
|
+
sectionCount() {
|
|
42
|
+
const ret = wasm.hwpdocument_sectionCount(this.__wbg_ptr);
|
|
43
|
+
return ret >>> 0;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns the document's embedded images as an array of [`HwpImage`],
|
|
47
|
+
* sorted by resource ID for deterministic ordering.
|
|
48
|
+
* @returns {HwpImage[]}
|
|
49
|
+
*/
|
|
50
|
+
toImages() {
|
|
51
|
+
const ret = wasm.hwpdocument_toImages(this.__wbg_ptr);
|
|
52
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]);
|
|
53
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
54
|
+
return v1;
|
|
55
|
+
}
|
|
121
56
|
/**
|
|
122
57
|
* @returns {string}
|
|
123
58
|
*/
|
|
124
|
-
|
|
59
|
+
toJson() {
|
|
125
60
|
let deferred2_0;
|
|
126
61
|
let deferred2_1;
|
|
127
62
|
try {
|
|
128
|
-
const ret = wasm.
|
|
63
|
+
const ret = wasm.hwpdocument_toJson(this.__wbg_ptr);
|
|
129
64
|
var ptr1 = ret[0];
|
|
130
65
|
var len1 = ret[1];
|
|
131
66
|
if (ret[3]) {
|
|
@@ -139,28 +74,14 @@ export class HwpDocument {
|
|
|
139
74
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
140
75
|
}
|
|
141
76
|
}
|
|
142
|
-
/**
|
|
143
|
-
* @returns {number}
|
|
144
|
-
*/
|
|
145
|
-
sectionCount() {
|
|
146
|
-
const ret = wasm.hwpdocument_sectionCount(this.__wbg_ptr);
|
|
147
|
-
return ret >>> 0;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* @returns {number}
|
|
151
|
-
*/
|
|
152
|
-
paragraphCount() {
|
|
153
|
-
const ret = wasm.hwpdocument_paragraphCount(this.__wbg_ptr);
|
|
154
|
-
return ret >>> 0;
|
|
155
|
-
}
|
|
156
77
|
/**
|
|
157
78
|
* @returns {string}
|
|
158
79
|
*/
|
|
159
|
-
|
|
80
|
+
toMarkdown() {
|
|
160
81
|
let deferred2_0;
|
|
161
82
|
let deferred2_1;
|
|
162
83
|
try {
|
|
163
|
-
const ret = wasm.
|
|
84
|
+
const ret = wasm.hwpdocument_toMarkdown(this.__wbg_ptr);
|
|
164
85
|
var ptr1 = ret[0];
|
|
165
86
|
var len1 = ret[1];
|
|
166
87
|
if (ret[3]) {
|
|
@@ -189,17 +110,6 @@ export class HwpDocument {
|
|
|
189
110
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
190
111
|
}
|
|
191
112
|
}
|
|
192
|
-
/**
|
|
193
|
-
* Returns the document's embedded images as an array of [`HwpImage`],
|
|
194
|
-
* sorted by resource ID for deterministic ordering.
|
|
195
|
-
* @returns {HwpImage[]}
|
|
196
|
-
*/
|
|
197
|
-
toImages() {
|
|
198
|
-
const ret = wasm.hwpdocument_toImages(this.__wbg_ptr);
|
|
199
|
-
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
200
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
201
|
-
return v1;
|
|
202
|
-
}
|
|
203
113
|
}
|
|
204
114
|
if (Symbol.dispose) HwpDocument.prototype[Symbol.dispose] = HwpDocument.prototype.free;
|
|
205
115
|
|
|
@@ -208,7 +118,6 @@ if (Symbol.dispose) HwpDocument.prototype[Symbol.dispose] = HwpDocument.prototyp
|
|
|
208
118
|
*/
|
|
209
119
|
export class HwpImage {
|
|
210
120
|
static __wrap(ptr) {
|
|
211
|
-
ptr = ptr >>> 0;
|
|
212
121
|
const obj = Object.create(HwpImage.prototype);
|
|
213
122
|
obj.__wbg_ptr = ptr;
|
|
214
123
|
HwpImageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -225,14 +134,14 @@ export class HwpImage {
|
|
|
225
134
|
wasm.__wbg_hwpimage_free(ptr, 0);
|
|
226
135
|
}
|
|
227
136
|
/**
|
|
228
|
-
*
|
|
137
|
+
* Image bytes encoded as standard base64 (for `data:` URLs).
|
|
229
138
|
* @returns {string}
|
|
230
139
|
*/
|
|
231
|
-
get
|
|
140
|
+
get base64() {
|
|
232
141
|
let deferred1_0;
|
|
233
142
|
let deferred1_1;
|
|
234
143
|
try {
|
|
235
|
-
const ret = wasm.
|
|
144
|
+
const ret = wasm.hwpimage_base64(this.__wbg_ptr);
|
|
236
145
|
deferred1_0 = ret[0];
|
|
237
146
|
deferred1_1 = ret[1];
|
|
238
147
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -251,14 +160,27 @@ export class HwpImage {
|
|
|
251
160
|
return v1;
|
|
252
161
|
}
|
|
253
162
|
/**
|
|
254
|
-
*
|
|
163
|
+
* Original filename, if known.
|
|
164
|
+
* @returns {string | undefined}
|
|
165
|
+
*/
|
|
166
|
+
get filename() {
|
|
167
|
+
const ret = wasm.hwpimage_filename(this.__wbg_ptr);
|
|
168
|
+
let v1;
|
|
169
|
+
if (ret[0] !== 0) {
|
|
170
|
+
v1 = getStringFromWasm0(ret[0], ret[1]);
|
|
171
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
172
|
+
}
|
|
173
|
+
return v1;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Resource identifier (matches markdown image references).
|
|
255
177
|
* @returns {string}
|
|
256
178
|
*/
|
|
257
|
-
get
|
|
179
|
+
get id() {
|
|
258
180
|
let deferred1_0;
|
|
259
181
|
let deferred1_1;
|
|
260
182
|
try {
|
|
261
|
-
const ret = wasm.
|
|
183
|
+
const ret = wasm.hwpimage_id(this.__wbg_ptr);
|
|
262
184
|
deferred1_0 = ret[0];
|
|
263
185
|
deferred1_1 = ret[1];
|
|
264
186
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -266,19 +188,6 @@ export class HwpImage {
|
|
|
266
188
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
267
189
|
}
|
|
268
190
|
}
|
|
269
|
-
/**
|
|
270
|
-
* Original filename, if known.
|
|
271
|
-
* @returns {string | undefined}
|
|
272
|
-
*/
|
|
273
|
-
get filename() {
|
|
274
|
-
const ret = wasm.hwpimage_filename(this.__wbg_ptr);
|
|
275
|
-
let v1;
|
|
276
|
-
if (ret[0] !== 0) {
|
|
277
|
-
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
278
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
279
|
-
}
|
|
280
|
-
return v1;
|
|
281
|
-
}
|
|
282
191
|
/**
|
|
283
192
|
* MIME type, if known.
|
|
284
193
|
* @returns {string | undefined}
|
|
@@ -287,7 +196,7 @@ export class HwpImage {
|
|
|
287
196
|
const ret = wasm.hwpimage_mimeType(this.__wbg_ptr);
|
|
288
197
|
let v1;
|
|
289
198
|
if (ret[0] !== 0) {
|
|
290
|
-
v1 = getStringFromWasm0(ret[0], ret[1])
|
|
199
|
+
v1 = getStringFromWasm0(ret[0], ret[1]);
|
|
291
200
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
292
201
|
}
|
|
293
202
|
return v1;
|
|
@@ -297,7 +206,6 @@ if (Symbol.dispose) HwpImage.prototype[Symbol.dispose] = HwpImage.prototype.free
|
|
|
297
206
|
|
|
298
207
|
export class ParseOptions {
|
|
299
208
|
static __wrap(ptr) {
|
|
300
|
-
ptr = ptr >>> 0;
|
|
301
209
|
const obj = Object.create(ParseOptions.prototype);
|
|
302
210
|
obj.__wbg_ptr = ptr;
|
|
303
211
|
ParseOptionsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -313,12 +221,6 @@ export class ParseOptions {
|
|
|
313
221
|
const ptr = this.__destroy_into_raw();
|
|
314
222
|
wasm.__wbg_parseoptions_free(ptr, 0);
|
|
315
223
|
}
|
|
316
|
-
constructor() {
|
|
317
|
-
const ret = wasm.parseoptions_new();
|
|
318
|
-
this.__wbg_ptr = ret >>> 0;
|
|
319
|
-
ParseOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
320
|
-
return this;
|
|
321
|
-
}
|
|
322
224
|
/**
|
|
323
225
|
* @returns {ParseOptions}
|
|
324
226
|
*/
|
|
@@ -327,6 +229,12 @@ export class ParseOptions {
|
|
|
327
229
|
const ret = wasm.parseoptions_lenient(ptr);
|
|
328
230
|
return ParseOptions.__wrap(ret);
|
|
329
231
|
}
|
|
232
|
+
constructor() {
|
|
233
|
+
const ret = wasm.parseoptions_new();
|
|
234
|
+
this.__wbg_ptr = ret;
|
|
235
|
+
ParseOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
236
|
+
return this;
|
|
237
|
+
}
|
|
330
238
|
/**
|
|
331
239
|
* @returns {ParseOptions}
|
|
332
240
|
*/
|
|
@@ -368,22 +276,18 @@ export function parseWithOptions(data, opts) {
|
|
|
368
276
|
}
|
|
369
277
|
return HwpDocument.__wrap(ret[0]);
|
|
370
278
|
}
|
|
371
|
-
|
|
372
|
-
export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
|
|
279
|
+
export function __wbg___wbindgen_throw_5d9e815e6fdf150f(arg0, arg1) {
|
|
373
280
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
374
|
-
}
|
|
375
|
-
|
|
281
|
+
}
|
|
376
282
|
export function __wbg_hwpimage_new(arg0) {
|
|
377
283
|
const ret = HwpImage.__wrap(arg0);
|
|
378
284
|
return ret;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
285
|
+
}
|
|
286
|
+
export function __wbindgen_generic_0000000000000001(arg0, arg1) {
|
|
382
287
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
383
288
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
384
289
|
return ret;
|
|
385
|
-
}
|
|
386
|
-
|
|
290
|
+
}
|
|
387
291
|
export function __wbindgen_init_externref_table() {
|
|
388
292
|
const table = wasm.__wbindgen_externrefs;
|
|
389
293
|
const offset = table.grow(4);
|
|
@@ -392,4 +296,90 @@ export function __wbindgen_init_externref_table() {
|
|
|
392
296
|
table.set(offset + 1, null);
|
|
393
297
|
table.set(offset + 2, true);
|
|
394
298
|
table.set(offset + 3, false);
|
|
395
|
-
}
|
|
299
|
+
}
|
|
300
|
+
const HwpDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
301
|
+
? { register: () => {}, unregister: () => {} }
|
|
302
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_hwpdocument_free(ptr, 1));
|
|
303
|
+
const HwpImageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
304
|
+
? { register: () => {}, unregister: () => {} }
|
|
305
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_hwpimage_free(ptr, 1));
|
|
306
|
+
const ParseOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
307
|
+
? { register: () => {}, unregister: () => {} }
|
|
308
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_parseoptions_free(ptr, 1));
|
|
309
|
+
|
|
310
|
+
function _assertClass(instance, klass) {
|
|
311
|
+
if (!(instance instanceof klass)) {
|
|
312
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
317
|
+
ptr = ptr >>> 0;
|
|
318
|
+
const mem = getDataViewMemory0();
|
|
319
|
+
const result = [];
|
|
320
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
321
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
322
|
+
}
|
|
323
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
324
|
+
return result;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
328
|
+
ptr = ptr >>> 0;
|
|
329
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
let cachedDataViewMemory0 = null;
|
|
333
|
+
function getDataViewMemory0() {
|
|
334
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
335
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
336
|
+
}
|
|
337
|
+
return cachedDataViewMemory0;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
function getStringFromWasm0(ptr, len) {
|
|
341
|
+
return decodeText(ptr >>> 0, len);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
let cachedUint8ArrayMemory0 = null;
|
|
345
|
+
function getUint8ArrayMemory0() {
|
|
346
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
347
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
348
|
+
}
|
|
349
|
+
return cachedUint8ArrayMemory0;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
353
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
354
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
355
|
+
WASM_VECTOR_LEN = arg.length;
|
|
356
|
+
return ptr;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
function takeFromExternrefTable0(idx) {
|
|
360
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
361
|
+
wasm.__externref_table_dealloc(idx);
|
|
362
|
+
return value;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
366
|
+
cachedTextDecoder.decode();
|
|
367
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
368
|
+
let numBytesDecoded = 0;
|
|
369
|
+
function decodeText(ptr, len) {
|
|
370
|
+
numBytesDecoded += len;
|
|
371
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
372
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
373
|
+
cachedTextDecoder.decode();
|
|
374
|
+
numBytesDecoded = len;
|
|
375
|
+
}
|
|
376
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
let WASM_VECTOR_LEN = 0;
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
let wasm;
|
|
383
|
+
export function __wbg_set_wasm(val) {
|
|
384
|
+
wasm = val;
|
|
385
|
+
}
|
package/unhwp_wasm_bg.wasm
CHANGED
|
Binary file
|