@@ -113,14 +113,6 @@ export declare const enum ExportLocalNameKind {
113113 None = 'None'
114114}
115115
116- /**
117- * Get offset within a `Uint8Array` which is aligned on 4 GiB.
118- *
119- * Does not check that the offset is within bounds of `buffer`.
120- * To ensure it always is, provide a `Uint8Array` of at least 4 GiB size.
121- */
122- export declare function getBufferOffset ( buffer : Uint8Array ) : number
123-
124116export interface ImportName {
125117 kind : ImportNameKind
126118 name ?: string
@@ -144,38 +136,6 @@ export declare const enum ImportNameKind {
144136 */
145137export declare function parseAsync ( filename : string , sourceText : string , options ?: ParserOptions | undefined | null ) : Promise < ParseResult >
146138
147- /**
148- * Parse AST into provided `Uint8Array` buffer, asynchronously.
149- *
150- * Note: This function can be slower than `parseSyncRaw` due to the overhead of spawning a thread.
151- *
152- * Source text must be written into the start of the buffer, and its length (in UTF-8 bytes)
153- * provided as `source_len`.
154- *
155- * This function will parse the source, and write the AST into the buffer, starting at the end.
156- *
157- * It also writes to the very end of the buffer the offset of `Program` within the buffer.
158- *
159- * Caller can deserialize data from the buffer on JS side.
160- *
161- * # SAFETY
162- *
163- * Caller must ensure:
164- * * Source text is written into start of the buffer.
165- * * Source text's UTF-8 byte length is `source_len`.
166- * * The 1st `source_len` bytes of the buffer comprises a valid UTF-8 string.
167- * * Contents of buffer must not be mutated by caller until the `AsyncTask` returned by this
168- * function resolves.
169- *
170- * If source text is originally a JS string on JS side, and converted to a buffer with
171- * `Buffer.from(str)` or `new TextEncoder().encode(str)`, this guarantees it's valid UTF-8.
172- *
173- * # Panics
174- *
175- * Panics if source text is too long, or AST takes more memory than is available in the buffer.
176- */
177- export declare function parseAsyncRaw ( filename : string , buffer : Uint8Array , sourceLen : number , options ?: ParserOptions | undefined | null ) : Promise < unknown >
178-
179139export interface ParserOptions {
180140 /** Treat the source text as `js`, `jsx`, `ts`, or `tsx`. */
181141 lang ?: 'js' | 'jsx' | 'ts' | 'tsx'
@@ -220,34 +180,6 @@ export interface ParserOptions {
220180/** Parse synchronously. */
221181export declare function parseSync ( filename : string , sourceText : string , options ?: ParserOptions | undefined | null ) : ParseResult
222182
223- /**
224- * Parse AST into provided `Uint8Array` buffer, synchronously.
225- *
226- * Source text must be written into the start of the buffer, and its length (in UTF-8 bytes)
227- * provided as `source_len`.
228- *
229- * This function will parse the source, and write the AST into the buffer, starting at the end.
230- *
231- * It also writes to the very end of the buffer the offset of `Program` within the buffer.
232- *
233- * Caller can deserialize data from the buffer on JS side.
234- *
235- * # SAFETY
236- *
237- * Caller must ensure:
238- * * Source text is written into start of the buffer.
239- * * Source text's UTF-8 byte length is `source_len`.
240- * * The 1st `source_len` bytes of the buffer comprises a valid UTF-8 string.
241- *
242- * If source text is originally a JS string on JS side, and converted to a buffer with
243- * `Buffer.from(str)` or `new TextEncoder().encode(str)`, this guarantees it's valid UTF-8.
244- *
245- * # Panics
246- *
247- * Panics if source text is too long, or AST takes more memory than is available in the buffer.
248- */
249- export declare function parseSyncRaw ( filename : string , buffer : Uint8Array , sourceLen : number , options ?: ParserOptions | undefined | null ) : void
250-
251183/** Returns `true` if raw transfer is supported on this platform. */
252184export declare function rawTransferSupported ( ) : boolean
253185
0 commit comments