diff --git a/.changeset/thin-chicken-build.md b/.changeset/thin-chicken-build.md new file mode 100644 index 000000000000..43571479659d --- /dev/null +++ b/.changeset/thin-chicken-build.md @@ -0,0 +1,6 @@ +--- +swc_fast_ts_strip: patch +swc_core: patch +--- + +fix(es/typescript): Update ts-strip type definition diff --git a/bindings/binding_typescript_wasm/src/lib.rs b/bindings/binding_typescript_wasm/src/lib.rs index 680726add384..0a9a3b35e525 100644 --- a/bindings/binding_typescript_wasm/src/lib.rs +++ b/bindings/binding_typescript_wasm/src/lib.rs @@ -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; -export function transformSync(src: string, opts?: Options): TransformOutput; +export declare function transform(src: string, opts?: Options): Promise; +export declare function transformSync(src: string, opts?: Options): TransformOutput; +export type { Options, TransformOutput }; "#; #[wasm_bindgen(skip_typescript)] diff --git a/crates/swc_fast_ts_strip/src/lib.rs b/crates/swc_fast_ts_strip/src/lib.rs index cf81f508c347..d67bfd499a82 100644 --- a/crates/swc_fast_ts_strip/src/lib.rs +++ b/crates/swc_fast_ts_strip/src/lib.rs @@ -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)]