feat: use compileStreaming when loading wasm parsers
This commit is contained in:
parent
b75196bb81
commit
9b23cd5394
5 changed files with 30 additions and 27 deletions
10
lib/binding_web/lib/web-tree-sitter.d.ts
generated
vendored
10
lib/binding_web/lib/web-tree-sitter.d.ts
generated
vendored
|
|
@ -11,13 +11,11 @@ declare namespace RuntimeExports {
|
|||
* maximum number of bytes to read. You can omit this parameter to scan the
|
||||
* string until the first 0 byte. If maxBytesToRead is passed, and the string
|
||||
* at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the
|
||||
* string will cut short at that byte index (i.e. maxBytesToRead will not
|
||||
* produce a string of exact length [ptr, ptr+maxBytesToRead[) N.B. mixing
|
||||
* frequent uses of UTF8ToString() with and without maxBytesToRead may throw
|
||||
* JS JIT optimizations off, so it is worth to consider consistently using one
|
||||
* string will cut short at that byte index.
|
||||
* @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.
|
||||
* @return {string}
|
||||
*/
|
||||
function UTF8ToString(ptr: number, maxBytesToRead?: number): string;
|
||||
function UTF8ToString(ptr: number, maxBytesToRead?: number | undefined, ignoreNul?: boolean | undefined): string;
|
||||
function lengthBytesUTF8(str: string): number;
|
||||
function stringToUTF16(str: string, outPtr: number, maxBytesToWrite: number): number;
|
||||
/**
|
||||
|
|
@ -25,7 +23,7 @@ declare namespace RuntimeExports {
|
|||
* @param {Object=} localScope
|
||||
* @param {number=} handle
|
||||
*/
|
||||
function loadWebAssemblyModule(binary: Uint8Array, flags: Record<string, boolean>, libName?: string, localScope?: Record<string, unknown>, handle?: number): Promise<Record<string, () => number>>;
|
||||
function loadWebAssemblyModule(binary: Uint8Array | WebAssembly.Module, flags: Record<string, boolean>, libName?: string, localScope?: Record<string, unknown>, handle?: number): Promise<Record<string, () => number>>;
|
||||
/**
|
||||
* @param {number} ptr
|
||||
* @param {string} type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue