@microsoft/webui 0.0.22 → 0.0.23
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 +1 -0
- package/bin/webui +0 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/wasm/all/README.md +36 -0
- package/wasm/all/package.json +32 -0
- package/wasm/all/webui_wasm_all.d.ts +154 -0
- package/wasm/all/webui_wasm_all.js +928 -0
- package/wasm/all/webui_wasm_all_bg.wasm +0 -0
- package/wasm/all/webui_wasm_all_bg.wasm.d.ts +25 -0
- package/wasm/handler/README.md +36 -0
- package/wasm/handler/package.json +32 -0
- package/wasm/handler/webui_wasm_handler.d.ts +146 -0
- package/wasm/handler/webui_wasm_handler.js +878 -0
- package/wasm/handler/webui_wasm_handler_bg.wasm +0 -0
- package/wasm/handler/webui_wasm_handler_bg.wasm.d.ts +24 -0
- package/wasm/parser/README.md +36 -0
- package/wasm/parser/package.json +32 -0
- package/wasm/parser/webui_wasm_parser.d.ts +43 -0
- package/wasm/parser/webui_wasm_parser.js +485 -0
- package/wasm/parser/webui_wasm_parser_bg.wasm +0 -0
- package/wasm/parser/webui_wasm_parser_bg.wasm.d.ts +9 -0
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_protocol_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_streamingsession_free: (a: number, b: number) => void;
|
|
6
|
+
export const protocol_new: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
7
|
+
export const protocol_render: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
8
|
+
export const protocol_renderComponentTemplates: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
9
|
+
export const protocol_renderPartial: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
10
|
+
export const protocol_renderStream: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
11
|
+
export const protocol_streamResponse: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
12
|
+
export const protocol_tokens: (a: number, b: number) => void;
|
|
13
|
+
export const streamingsession_boundary: (a: number, b: number, c: number, d: number) => void;
|
|
14
|
+
export const streamingsession_boundaryCount: (a: number) => number;
|
|
15
|
+
export const streamingsession_finish: (a: number, b: number, c: number, d: number) => void;
|
|
16
|
+
export const streamingsession_finished: (a: number) => number;
|
|
17
|
+
export const streamingsession_update: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
18
|
+
export const streamingsession_writeBoundary: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
19
|
+
export const streamingsession_writeShell: (a: number, b: number, c: number, d: number) => void;
|
|
20
|
+
export const __wbindgen_export: (a: number, b: number) => number;
|
|
21
|
+
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
22
|
+
export const __wbindgen_export3: (a: number) => void;
|
|
23
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
24
|
+
export const __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# microsoft-webui-wasm
|
|
2
|
+
|
|
3
|
+
WebAssembly bindings for the [WebUI](https://github.com/microsoft/webui) framework, built with `wasm-bindgen`.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`microsoft-webui-wasm` can be built as three browser bundles:
|
|
8
|
+
|
|
9
|
+
| Feature | Bundle | Exports |
|
|
10
|
+
|---------|--------|---------|
|
|
11
|
+
| `handler` | `webui_wasm_handler.js` | `Protocol` |
|
|
12
|
+
| `parser` | `webui_wasm_parser.js` | `build_protocol` |
|
|
13
|
+
| `all` | `webui_wasm_all.js` | Parser and handler exports |
|
|
14
|
+
|
|
15
|
+
The default feature is `all`, which powers the online playground. Consumers that only need to render prebuilt protobuf protocol bytes should use the handler bundle to avoid shipping parser code.
|
|
16
|
+
|
|
17
|
+
Construct `Protocol` once from protocol bytes. It exposes `render`,
|
|
18
|
+
`renderStream`, `renderPartial`, `renderComponentTemplates`, and `tokens`.
|
|
19
|
+
Streaming callbacks are coalesced around a 16 KiB target before crossing into
|
|
20
|
+
JavaScript.
|
|
21
|
+
|
|
22
|
+
## Building
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
cargo xtask build-wasm
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
This writes the three generated bundles under `docs/.webui-press/public/wasm/`.
|
|
29
|
+
|
|
30
|
+
## Documentation
|
|
31
|
+
|
|
32
|
+
See the [WebUI repository](https://github.com/microsoft/webui) for full usage guides and examples.
|
|
33
|
+
|
|
34
|
+
## License
|
|
35
|
+
|
|
36
|
+
MIT - Copyright (c) Microsoft Corporation.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "microsoft-webui-wasm",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"collaborators": [
|
|
5
|
+
"Microsoft Edge"
|
|
6
|
+
],
|
|
7
|
+
"description": "WebAssembly bindings for WebUI framework — powers the online playground",
|
|
8
|
+
"version": "0.0.23",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/microsoft/webui"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"webui_wasm_parser_bg.wasm",
|
|
16
|
+
"webui_wasm_parser.js",
|
|
17
|
+
"webui_wasm_parser.d.ts"
|
|
18
|
+
],
|
|
19
|
+
"main": "webui_wasm_parser.js",
|
|
20
|
+
"homepage": "https://microsoft.github.io/webui",
|
|
21
|
+
"types": "webui_wasm_parser.d.ts",
|
|
22
|
+
"sideEffects": [
|
|
23
|
+
"./snippets/*"
|
|
24
|
+
],
|
|
25
|
+
"keywords": [
|
|
26
|
+
"webui",
|
|
27
|
+
"wasm",
|
|
28
|
+
"webassembly",
|
|
29
|
+
"ssr",
|
|
30
|
+
"rendering"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Build protocol protobuf bytes from virtual files without rendering.
|
|
6
|
+
*
|
|
7
|
+
* Returns the serialized `WebUIProtocol` as protobuf bytes.
|
|
8
|
+
*/
|
|
9
|
+
export function build_protocol(files: any, entry: string, projection_manifests?: any | null): Uint8Array;
|
|
10
|
+
|
|
11
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
12
|
+
|
|
13
|
+
export interface InitOutput {
|
|
14
|
+
readonly memory: WebAssembly.Memory;
|
|
15
|
+
readonly build_protocol: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
16
|
+
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
17
|
+
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
18
|
+
readonly __wbindgen_export3: (a: number) => void;
|
|
19
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
20
|
+
readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
27
|
+
* a precompiled `WebAssembly.Module`.
|
|
28
|
+
*
|
|
29
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
30
|
+
*
|
|
31
|
+
* @returns {InitOutput}
|
|
32
|
+
*/
|
|
33
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
37
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
38
|
+
*
|
|
39
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
40
|
+
*
|
|
41
|
+
* @returns {Promise<InitOutput>}
|
|
42
|
+
*/
|
|
43
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
/* @ts-self-types="./webui_wasm_parser.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Build protocol protobuf bytes from virtual files without rendering.
|
|
5
|
+
*
|
|
6
|
+
* Returns the serialized `WebUIProtocol` as protobuf bytes.
|
|
7
|
+
* @param {any} files
|
|
8
|
+
* @param {string} entry
|
|
9
|
+
* @param {any | null} [projection_manifests]
|
|
10
|
+
* @returns {Uint8Array}
|
|
11
|
+
*/
|
|
12
|
+
export function build_protocol(files, entry, projection_manifests) {
|
|
13
|
+
try {
|
|
14
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
15
|
+
const ptr0 = passStringToWasm0(entry, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
16
|
+
const len0 = WASM_VECTOR_LEN;
|
|
17
|
+
wasm.build_protocol(retptr, addHeapObject(files), ptr0, len0, isLikeNone(projection_manifests) ? 0 : addHeapObject(projection_manifests));
|
|
18
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
19
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
20
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
21
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
22
|
+
if (r3) {
|
|
23
|
+
throw takeObject(r2);
|
|
24
|
+
}
|
|
25
|
+
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
26
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
27
|
+
return v2;
|
|
28
|
+
} finally {
|
|
29
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function __wbg_get_imports() {
|
|
33
|
+
const import0 = {
|
|
34
|
+
__proto__: null,
|
|
35
|
+
__wbg_Error_92b29b0548f8b746: function(arg0, arg1) {
|
|
36
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
37
|
+
return addHeapObject(ret);
|
|
38
|
+
},
|
|
39
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
40
|
+
const ret = String(getObject(arg1));
|
|
41
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
42
|
+
const len1 = WASM_VECTOR_LEN;
|
|
43
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
44
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
45
|
+
},
|
|
46
|
+
__wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
|
|
47
|
+
const v = getObject(arg0);
|
|
48
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
49
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
50
|
+
},
|
|
51
|
+
__wbg___wbindgen_debug_string_c25d447a39f5578f: function(arg0, arg1) {
|
|
52
|
+
const ret = debugString(getObject(arg1));
|
|
53
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
54
|
+
const len1 = WASM_VECTOR_LEN;
|
|
55
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
56
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
57
|
+
},
|
|
58
|
+
__wbg___wbindgen_in_aca499c5de7ff5e5: function(arg0, arg1) {
|
|
59
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
60
|
+
return ret;
|
|
61
|
+
},
|
|
62
|
+
__wbg___wbindgen_is_function_1ff95bcc5517c252: function(arg0) {
|
|
63
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
64
|
+
return ret;
|
|
65
|
+
},
|
|
66
|
+
__wbg___wbindgen_is_object_a27215656b807791: function(arg0) {
|
|
67
|
+
const val = getObject(arg0);
|
|
68
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
69
|
+
return ret;
|
|
70
|
+
},
|
|
71
|
+
__wbg___wbindgen_is_undefined_c05833b95a3cf397: function(arg0) {
|
|
72
|
+
const ret = getObject(arg0) === undefined;
|
|
73
|
+
return ret;
|
|
74
|
+
},
|
|
75
|
+
__wbg___wbindgen_jsval_loose_eq_db4c3b15f63fc170: function(arg0, arg1) {
|
|
76
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
77
|
+
return ret;
|
|
78
|
+
},
|
|
79
|
+
__wbg___wbindgen_number_get_394265ed1e1b84ee: function(arg0, arg1) {
|
|
80
|
+
const obj = getObject(arg1);
|
|
81
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
82
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
83
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
84
|
+
},
|
|
85
|
+
__wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
|
|
86
|
+
const obj = getObject(arg1);
|
|
87
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
88
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
89
|
+
var len1 = WASM_VECTOR_LEN;
|
|
90
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
91
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
92
|
+
},
|
|
93
|
+
__wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
|
|
94
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
95
|
+
},
|
|
96
|
+
__wbg_call_8a2dd23819f8a60a: function() { return handleError(function (arg0, arg1) {
|
|
97
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
98
|
+
return addHeapObject(ret);
|
|
99
|
+
}, arguments); },
|
|
100
|
+
__wbg_done_89b2b13e91a60321: function(arg0) {
|
|
101
|
+
const ret = getObject(arg0).done;
|
|
102
|
+
return ret;
|
|
103
|
+
},
|
|
104
|
+
__wbg_entries_015dc610cd81ede0: function(arg0) {
|
|
105
|
+
const ret = Object.entries(getObject(arg0));
|
|
106
|
+
return addHeapObject(ret);
|
|
107
|
+
},
|
|
108
|
+
__wbg_get_507a50627bffa49b: function(arg0, arg1) {
|
|
109
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
110
|
+
return addHeapObject(ret);
|
|
111
|
+
},
|
|
112
|
+
__wbg_get_c7eb1f358a7654df: function() { return handleError(function (arg0, arg1) {
|
|
113
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
114
|
+
return addHeapObject(ret);
|
|
115
|
+
}, arguments); },
|
|
116
|
+
__wbg_get_unchecked_6e0ad6d2a41b06f6: function(arg0, arg1) {
|
|
117
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
118
|
+
return addHeapObject(ret);
|
|
119
|
+
},
|
|
120
|
+
__wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
|
|
121
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
122
|
+
return addHeapObject(ret);
|
|
123
|
+
},
|
|
124
|
+
__wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
|
|
125
|
+
let result;
|
|
126
|
+
try {
|
|
127
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
128
|
+
} catch (_) {
|
|
129
|
+
result = false;
|
|
130
|
+
}
|
|
131
|
+
const ret = result;
|
|
132
|
+
return ret;
|
|
133
|
+
},
|
|
134
|
+
__wbg_instanceof_Uint8Array_309b927aaf7a3fc7: function(arg0) {
|
|
135
|
+
let result;
|
|
136
|
+
try {
|
|
137
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
138
|
+
} catch (_) {
|
|
139
|
+
result = false;
|
|
140
|
+
}
|
|
141
|
+
const ret = result;
|
|
142
|
+
return ret;
|
|
143
|
+
},
|
|
144
|
+
__wbg_isArray_0677c962b281d01a: function(arg0) {
|
|
145
|
+
const ret = Array.isArray(getObject(arg0));
|
|
146
|
+
return ret;
|
|
147
|
+
},
|
|
148
|
+
__wbg_iterator_6f722e4a93058b71: function() {
|
|
149
|
+
const ret = Symbol.iterator;
|
|
150
|
+
return addHeapObject(ret);
|
|
151
|
+
},
|
|
152
|
+
__wbg_length_1f0964f4a5e2c6d8: function(arg0) {
|
|
153
|
+
const ret = getObject(arg0).length;
|
|
154
|
+
return ret;
|
|
155
|
+
},
|
|
156
|
+
__wbg_length_370319915dc99107: function(arg0) {
|
|
157
|
+
const ret = getObject(arg0).length;
|
|
158
|
+
return ret;
|
|
159
|
+
},
|
|
160
|
+
__wbg_new_cd45aabdf6073e84: function(arg0) {
|
|
161
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
162
|
+
return addHeapObject(ret);
|
|
163
|
+
},
|
|
164
|
+
__wbg_next_6dbf2c0ac8cde20f: function(arg0) {
|
|
165
|
+
const ret = getObject(arg0).next;
|
|
166
|
+
return addHeapObject(ret);
|
|
167
|
+
},
|
|
168
|
+
__wbg_next_71f2aa1cb3d1e37e: function() { return handleError(function (arg0) {
|
|
169
|
+
const ret = getObject(arg0).next();
|
|
170
|
+
return addHeapObject(ret);
|
|
171
|
+
}, arguments); },
|
|
172
|
+
__wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
|
|
173
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
174
|
+
},
|
|
175
|
+
__wbg_value_a5d5488a9589444a: function(arg0) {
|
|
176
|
+
const ret = getObject(arg0).value;
|
|
177
|
+
return addHeapObject(ret);
|
|
178
|
+
},
|
|
179
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
180
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
181
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
182
|
+
return addHeapObject(ret);
|
|
183
|
+
},
|
|
184
|
+
__wbindgen_object_clone_ref: function(arg0) {
|
|
185
|
+
const ret = getObject(arg0);
|
|
186
|
+
return addHeapObject(ret);
|
|
187
|
+
},
|
|
188
|
+
__wbindgen_object_drop_ref: function(arg0) {
|
|
189
|
+
takeObject(arg0);
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
return {
|
|
193
|
+
__proto__: null,
|
|
194
|
+
"./webui_wasm_parser_bg.js": import0,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function addHeapObject(obj) {
|
|
199
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
200
|
+
const idx = heap_next;
|
|
201
|
+
heap_next = heap[idx];
|
|
202
|
+
|
|
203
|
+
heap[idx] = obj;
|
|
204
|
+
return idx;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function debugString(val) {
|
|
208
|
+
// primitive types
|
|
209
|
+
const type = typeof val;
|
|
210
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
211
|
+
return `${val}`;
|
|
212
|
+
}
|
|
213
|
+
if (type == 'string') {
|
|
214
|
+
return `"${val}"`;
|
|
215
|
+
}
|
|
216
|
+
if (type == 'symbol') {
|
|
217
|
+
const description = val.description;
|
|
218
|
+
if (description == null) {
|
|
219
|
+
return 'Symbol';
|
|
220
|
+
} else {
|
|
221
|
+
return `Symbol(${description})`;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
if (type == 'function') {
|
|
225
|
+
const name = val.name;
|
|
226
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
227
|
+
return `Function(${name})`;
|
|
228
|
+
} else {
|
|
229
|
+
return 'Function';
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
// objects
|
|
233
|
+
if (Array.isArray(val)) {
|
|
234
|
+
const length = val.length;
|
|
235
|
+
let debug = '[';
|
|
236
|
+
if (length > 0) {
|
|
237
|
+
debug += debugString(val[0]);
|
|
238
|
+
}
|
|
239
|
+
for(let i = 1; i < length; i++) {
|
|
240
|
+
debug += ', ' + debugString(val[i]);
|
|
241
|
+
}
|
|
242
|
+
debug += ']';
|
|
243
|
+
return debug;
|
|
244
|
+
}
|
|
245
|
+
// Test for built-in
|
|
246
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
247
|
+
let className;
|
|
248
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
249
|
+
className = builtInMatches[1];
|
|
250
|
+
} else {
|
|
251
|
+
// Failed to match the standard '[object ClassName]'
|
|
252
|
+
return toString.call(val);
|
|
253
|
+
}
|
|
254
|
+
if (className == 'Object') {
|
|
255
|
+
// we're a user defined class or Object
|
|
256
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
257
|
+
// easier than looping through ownProperties of `val`.
|
|
258
|
+
try {
|
|
259
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
260
|
+
} catch (_) {
|
|
261
|
+
return 'Object';
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// errors
|
|
265
|
+
if (val instanceof Error) {
|
|
266
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
267
|
+
}
|
|
268
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
269
|
+
return className;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function dropObject(idx) {
|
|
273
|
+
if (idx < 1028) return;
|
|
274
|
+
heap[idx] = heap_next;
|
|
275
|
+
heap_next = idx;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
279
|
+
ptr = ptr >>> 0;
|
|
280
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
let cachedDataViewMemory0 = null;
|
|
284
|
+
function getDataViewMemory0() {
|
|
285
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
286
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
287
|
+
}
|
|
288
|
+
return cachedDataViewMemory0;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function getStringFromWasm0(ptr, len) {
|
|
292
|
+
return decodeText(ptr >>> 0, len);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
let cachedUint8ArrayMemory0 = null;
|
|
296
|
+
function getUint8ArrayMemory0() {
|
|
297
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
298
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
299
|
+
}
|
|
300
|
+
return cachedUint8ArrayMemory0;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function getObject(idx) { return heap[idx]; }
|
|
304
|
+
|
|
305
|
+
function handleError(f, args) {
|
|
306
|
+
try {
|
|
307
|
+
return f.apply(this, args);
|
|
308
|
+
} catch (e) {
|
|
309
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
let heap = new Array(1024).fill(undefined);
|
|
314
|
+
heap.push(undefined, null, true, false);
|
|
315
|
+
|
|
316
|
+
let heap_next = heap.length;
|
|
317
|
+
|
|
318
|
+
function isLikeNone(x) {
|
|
319
|
+
return x === undefined || x === null;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
323
|
+
if (realloc === undefined) {
|
|
324
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
325
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
326
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
327
|
+
WASM_VECTOR_LEN = buf.length;
|
|
328
|
+
return ptr;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
let len = arg.length;
|
|
332
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
333
|
+
|
|
334
|
+
const mem = getUint8ArrayMemory0();
|
|
335
|
+
|
|
336
|
+
let offset = 0;
|
|
337
|
+
|
|
338
|
+
for (; offset < len; offset++) {
|
|
339
|
+
const code = arg.charCodeAt(offset);
|
|
340
|
+
if (code > 0x7F) break;
|
|
341
|
+
mem[ptr + offset] = code;
|
|
342
|
+
}
|
|
343
|
+
if (offset !== len) {
|
|
344
|
+
if (offset !== 0) {
|
|
345
|
+
arg = arg.slice(offset);
|
|
346
|
+
}
|
|
347
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
348
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
349
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
350
|
+
|
|
351
|
+
offset += ret.written;
|
|
352
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
WASM_VECTOR_LEN = offset;
|
|
356
|
+
return ptr;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
function takeObject(idx) {
|
|
360
|
+
const ret = getObject(idx);
|
|
361
|
+
dropObject(idx);
|
|
362
|
+
return ret;
|
|
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
|
+
const cachedTextEncoder = new TextEncoder();
|
|
380
|
+
|
|
381
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
382
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
383
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
384
|
+
view.set(buf);
|
|
385
|
+
return {
|
|
386
|
+
read: arg.length,
|
|
387
|
+
written: buf.length
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
let WASM_VECTOR_LEN = 0;
|
|
393
|
+
|
|
394
|
+
let wasmModule, wasmInstance, wasm;
|
|
395
|
+
function __wbg_finalize_init(instance, module) {
|
|
396
|
+
wasmInstance = instance;
|
|
397
|
+
wasm = instance.exports;
|
|
398
|
+
wasmModule = module;
|
|
399
|
+
cachedDataViewMemory0 = null;
|
|
400
|
+
cachedUint8ArrayMemory0 = null;
|
|
401
|
+
return wasm;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
async function __wbg_load(module, imports) {
|
|
405
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
406
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
407
|
+
try {
|
|
408
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
409
|
+
} catch (e) {
|
|
410
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
411
|
+
|
|
412
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
413
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
414
|
+
|
|
415
|
+
} else { throw e; }
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
const bytes = await module.arrayBuffer();
|
|
420
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
421
|
+
} else {
|
|
422
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
423
|
+
|
|
424
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
425
|
+
return { instance, module };
|
|
426
|
+
} else {
|
|
427
|
+
return instance;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
function expectedResponseType(type) {
|
|
432
|
+
switch (type) {
|
|
433
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
434
|
+
}
|
|
435
|
+
return false;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function initSync(module) {
|
|
440
|
+
if (wasm !== undefined) return wasm;
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
if (module !== undefined) {
|
|
444
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
445
|
+
({module} = module)
|
|
446
|
+
} else {
|
|
447
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
const imports = __wbg_get_imports();
|
|
452
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
453
|
+
module = new WebAssembly.Module(module);
|
|
454
|
+
}
|
|
455
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
456
|
+
return __wbg_finalize_init(instance, module);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
async function __wbg_init(module_or_path) {
|
|
460
|
+
if (wasm !== undefined) return wasm;
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
if (module_or_path !== undefined) {
|
|
464
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
465
|
+
({module_or_path} = module_or_path)
|
|
466
|
+
} else {
|
|
467
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
if (module_or_path === undefined) {
|
|
472
|
+
module_or_path = new URL('webui_wasm_parser_bg.wasm', import.meta.url);
|
|
473
|
+
}
|
|
474
|
+
const imports = __wbg_get_imports();
|
|
475
|
+
|
|
476
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
477
|
+
module_or_path = fetch(module_or_path);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
481
|
+
|
|
482
|
+
return __wbg_finalize_init(instance, module);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export { initSync, __wbg_init as default };
|
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const build_protocol: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
5
|
+
export const __wbindgen_export: (a: number, b: number) => number;
|
|
6
|
+
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
7
|
+
export const __wbindgen_export3: (a: number) => void;
|
|
8
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
9
|
+
export const __wbindgen_export4: (a: number, b: number, c: number) => void;
|