Skip to content

Commit 165c8fa

Browse files
authoredAug 9, 2024··
fix(es/typescript): Update ts-strip type definition (#9415)
**Related issue:** - Closes #9413
1 parent 442fb7b commit 165c8fa

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed
 

‎.changeset/thin-chicken-build.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
swc_fast_ts_strip: patch
3+
swc_core: patch
4+
---
5+
6+
fix(es/typescript): Update ts-strip type definition

‎bindings/binding_typescript_wasm/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ use wasm_bindgen_futures::{
1212
/// auto generated one, which is not reflecting most of types in detail.
1313
#[wasm_bindgen(typescript_custom_section)]
1414
const INTERFACE_DEFINITIONS: &'static str = r#"
15-
export function transform(src: string, opts?: Options): Promise<TransformOutput>;
16-
export function transformSync(src: string, opts?: Options): TransformOutput;
15+
export declare function transform(src: string, opts?: Options): Promise<TransformOutput>;
16+
export declare function transformSync(src: string, opts?: Options): TransformOutput;
17+
export type { Options, TransformOutput };
1718
"#;
1819

1920
#[wasm_bindgen(skip_typescript)]

‎crates/swc_fast_ts_strip/src/lib.rs

+9
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,17 @@ interface Options {
6464
module?: boolean;
6565
filename?: string;
6666
mode?: Mode;
67+
transform?; TransformConfig;
6768
sourceMap?: boolean;
6869
}
70+
71+
interface TransformConfig {
72+
verbatimModuleSyntax?: boolean;
73+
importNotUsedAsValues?: "remove" | "preserve";
74+
noEmptyExport?: boolean;
75+
importExportAssignConfig?: "Classic" | "Preserve" | "NodeNext" | "EsNext";
76+
tsEnumIsMutable?: boolean;
77+
}
6978
"#;
7079

7180
#[derive(Debug, Default, Deserialize)]

0 commit comments

Comments
 (0)
Please sign in to comment.