mirror of
https://github.com/danbulant/oxc
synced 2026-05-20 20:58:48 +00:00
41 lines
1 KiB
TypeScript
41 lines
1 KiB
TypeScript
/* tslint:disable */
|
|
/* eslint-disable */
|
|
|
|
/* auto-generated by NAPI-RS */
|
|
|
|
/**
|
|
* Babel Parser Options
|
|
*
|
|
* <https://github.com/babel/babel/blob/main/packages/babel-parser/typings/babel-parser.d.ts>
|
|
*/
|
|
export interface ParserOptions {
|
|
sourceType?: 'script' | 'module' | 'unambiguous' | undefined
|
|
sourceFilename?: string
|
|
}
|
|
export interface ParseResult {
|
|
program: string
|
|
errors: Array<string>
|
|
}
|
|
/**
|
|
* Parse without returning anything.
|
|
* This is for benchmark purposes such as measuring napi communication overhead.
|
|
*
|
|
* # Panics
|
|
*
|
|
* * File extension is invalid
|
|
* * Serde JSON serialization
|
|
*/
|
|
export function parseWithoutReturn(sourceText: string, options?: ParserOptions | undefined | null): void
|
|
/**
|
|
* # Panics
|
|
*
|
|
* * File extension is invalid
|
|
* * Serde JSON serialization
|
|
*/
|
|
export function parseSync(sourceText: string, options?: ParserOptions | undefined | null): ParseResult
|
|
/**
|
|
* # Panics
|
|
*
|
|
* * Tokio crashes
|
|
*/
|
|
export function parseAsync(sourceText: string, options?: ParserOptions | undefined | null): Promise<ParseResult>
|