From d47f0e247db24319995fbe4f26255379a931db6d Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Sun, 10 Mar 2024 17:11:28 +0000 Subject: [PATCH] fix(ast): rename `TSIndexSignatureName` in JSON AST (#2664) Fixes #2656. --- crates/oxc_ast/src/ast/ts.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/crates/oxc_ast/src/ast/ts.rs b/crates/oxc_ast/src/ast/ts.rs index 33caa7a37c385..ff84c49473d94 100644 --- a/crates/oxc_ast/src/ast/ts.rs +++ b/crates/oxc_ast/src/ast/ts.rs @@ -10,6 +10,16 @@ use serde::Serialize; use super::{js::*, literal::*}; +#[cfg(feature = "wasm")] +#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] +const TS_APPEND_CONTENT: &'static str = r#" +export interface TSIndexSignatureName extends Span { + type: "Identifier", + name: Atom, + typeAnnotation: TSTypeAnnotation, +} +"#; + #[derive(Debug, Hash)] #[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))] #[cfg_attr(feature = "wasm", derive(tsify::Tsify))] @@ -634,8 +644,11 @@ pub struct TSConstructSignatureDeclaration<'a> { } #[derive(Debug, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))] -#[cfg_attr(feature = "wasm", derive(tsify::Tsify))] +#[cfg_attr( + feature = "serde", + derive(Serialize), + serde(tag = "type", rename = "Identifier", rename_all = "camelCase") +)] pub struct TSIndexSignatureName<'a> { #[cfg_attr(feature = "serde", serde(flatten))] pub span: Span,