Skip to content

Commit 1796d2c

Browse files
committed
chore: update type
1 parent 30dfcf0 commit 1796d2c

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

crates/node_binding/binding.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2364,7 +2364,7 @@ export interface RawToOptions {
23642364
}
23652365

23662366
export interface RawTransformOptions {
2367-
transformer: TransformerFn
2367+
transformer: { transformer: (input: string, absoluteFilename: string) => string | Buffer | Promise<string> | Promise<Buffer> }
23682368
}
23692369

23702370
export interface RawTrustedTypes {

crates/node_binding/src/raw_options/raw_builtins/raw_copy.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ type RawTo = Either<String, RawToFn>;
1919
#[derive(Debug, Clone)]
2020
#[napi(object, object_to_js = false)]
2121
pub struct RawTransformOptions {
22+
#[debug(skip)]
23+
#[napi(
24+
ts_type = "{ transformer: (input: string, absoluteFilename: string) => string | Buffer | Promise<string> | Promise<Buffer> }"
25+
)]
2226
pub transformer: TransformerFn,
2327
}
2428

0 commit comments

Comments
 (0)