mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
chore(napi): provide a more precise type for source_type (#521)
This commit is contained in:
parent
6428139b76
commit
be13f980bb
2 changed files with 3 additions and 2 deletions
2
crates/oxc_napi/index.d.ts
vendored
2
crates/oxc_napi/index.d.ts
vendored
|
|
@ -9,7 +9,7 @@
|
|||
* <https://github.com/babel/babel/blob/main/packages/babel-parser/typings/babel-parser.d.ts>
|
||||
*/
|
||||
export interface ParserOptions {
|
||||
sourceType?: string
|
||||
sourceType?: 'script' | 'module' | 'unambiguous' | undefined
|
||||
sourceFilename?: string
|
||||
}
|
||||
export interface ParseResult {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ use oxc_span::SourceType;
|
|||
#[napi(object)]
|
||||
#[derive(Default)]
|
||||
pub struct ParserOptions {
|
||||
pub source_type: Option<String>, // "script" | "module" | "unambiguous";
|
||||
#[napi(ts_type = "'script' | 'module' | 'unambiguous' | undefined")]
|
||||
pub source_type: Option<String>,
|
||||
pub source_filename: Option<String>,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue