mirror of
https://github.com/danbulant/oxc
synced 2026-05-22 21:58:36 +00:00
This crate will no longer be relevant after we export esm information directly from the parser. Besides, `ex-module-lexer`'s output data is too limited for plugin authors to use.
63 lines
1.6 KiB
TypeScript
63 lines
1.6 KiB
TypeScript
/* auto-generated by NAPI-RS */
|
|
/* eslint-disable */
|
|
|
|
export * from '@oxc-project/types';
|
|
export interface Comment {
|
|
type: 'Line' | 'Block'
|
|
value: string
|
|
start: number
|
|
end: number
|
|
}
|
|
|
|
/**
|
|
* # Panics
|
|
*
|
|
* * Tokio crashes
|
|
*/
|
|
export declare function parseAsync(sourceText: string, options?: ParserOptions | undefined | null): Promise<ParseResult>
|
|
|
|
export interface ParseResult {
|
|
program: import("@oxc-project/types").Program
|
|
comments: Array<Comment>
|
|
errors: Array<string>
|
|
}
|
|
|
|
/**
|
|
* Babel Parser Options
|
|
*
|
|
* <https://github.com/babel/babel/blob/v7.26.2/packages/babel-parser/typings/babel-parser.d.ts>
|
|
*/
|
|
export interface ParserOptions {
|
|
sourceType?: 'script' | 'module' | 'unambiguous' | undefined
|
|
sourceFilename?: string
|
|
/**
|
|
* Emit `ParenthesizedExpression` in AST.
|
|
*
|
|
* If this option is true, parenthesized expressions are represented by
|
|
* (non-standard) `ParenthesizedExpression` nodes that have a single `expression` property
|
|
* containing the expression inside parentheses.
|
|
*
|
|
* Default: true
|
|
*/
|
|
preserveParens?: boolean
|
|
}
|
|
|
|
/**
|
|
* # Panics
|
|
*
|
|
* * File extension is invalid
|
|
* * Serde JSON serialization
|
|
*/
|
|
export declare function parseSync(sourceText: string, options?: ParserOptions | undefined | null): ParseResult
|
|
|
|
/**
|
|
* Parse without returning anything.
|
|
* This is for benchmark purposes such as measuring napi communication overhead.
|
|
*
|
|
* # Panics
|
|
*
|
|
* * File extension is invalid
|
|
* * Serde JSON serialization
|
|
*/
|
|
export declare function parseWithoutReturn(sourceText: string, options?: ParserOptions | undefined | null): void
|
|
|