diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs
index 5f3cb751e..89500f597 100644
--- a/crates/oxc_ast/src/ast/js.rs
+++ b/crates/oxc_ast/src/ast/js.rs
@@ -15,6 +15,18 @@ use serde::Serialize;
#[allow(clippy::wildcard_imports)]
use crate::ast::*;
+#[cfg_attr(
+ all(feature = "serde", feature = "wasm"),
+ wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)
+)]
+#[allow(dead_code)]
+const TS_APPEND_CONTENT: &'static str = r#"
+export interface BindingIdentifier extends Span { type: "Identifier", name: Atom }
+export interface IdentifierReference extends Span { type: "Identifier", name: Atom }
+export interface IdentifierName extends Span { type: "Identifier", name: Atom }
+export interface LabelIdentifier extends Span { type: "Identifier", name: Atom }
+"#;
+
#[derive(Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
@@ -298,11 +310,9 @@ impl<'a> Expression<'a> {
}
/// Identifier Name
+// See serializer in serialize.rs
#[derive(Debug, Clone, Hash)]
-#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
-#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
pub struct IdentifierName<'a> {
- #[cfg_attr(feature = "serde", serde(flatten))]
pub span: Span,
pub name: Atom<'a>,
}
@@ -314,11 +324,9 @@ impl<'a> IdentifierName<'a> {
}
/// Identifier Reference
+// See serializer in serialize.rs
#[derive(Debug, Clone)]
-#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
-#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
pub struct IdentifierReference<'a> {
- #[cfg_attr(feature = "serde", serde(flatten))]
pub span: Span,
pub name: Atom<'a>,
pub reference_id: Cell