Skip to content

Commit

Permalink
fix(es/typescript): Update ts-strip type definition (#9415)
Browse files Browse the repository at this point in the history
**Related issue:**
 - Closes #9413
  • Loading branch information
magic-akari authored Aug 9, 2024
1 parent 442fb7b commit 165c8fa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/thin-chicken-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
swc_fast_ts_strip: patch
swc_core: patch
---

fix(es/typescript): Update ts-strip type definition
5 changes: 3 additions & 2 deletions bindings/binding_typescript_wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ use wasm_bindgen_futures::{
/// auto generated one, which is not reflecting most of types in detail.
#[wasm_bindgen(typescript_custom_section)]
const INTERFACE_DEFINITIONS: &'static str = r#"
export function transform(src: string, opts?: Options): Promise<TransformOutput>;
export function transformSync(src: string, opts?: Options): TransformOutput;
export declare function transform(src: string, opts?: Options): Promise<TransformOutput>;
export declare function transformSync(src: string, opts?: Options): TransformOutput;
export type { Options, TransformOutput };
"#;

#[wasm_bindgen(skip_typescript)]
Expand Down
9 changes: 9 additions & 0 deletions crates/swc_fast_ts_strip/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,17 @@ interface Options {
module?: boolean;
filename?: string;
mode?: Mode;
transform?; TransformConfig;
sourceMap?: boolean;
}
interface TransformConfig {
verbatimModuleSyntax?: boolean;
importNotUsedAsValues?: "remove" | "preserve";
noEmptyExport?: boolean;
importExportAssignConfig?: "Classic" | "Preserve" | "NodeNext" | "EsNext";
tsEnumIsMutable?: boolean;
}
"#;

#[derive(Debug, Default, Deserialize)]
Expand Down

0 comments on commit 165c8fa

Please sign in to comment.