Skip to content

Commit

Permalink
fix(ast): rename TSIndexSignatureName in JSON AST
Browse files Browse the repository at this point in the history
Fixes #2656.
  • Loading branch information
overlookmotel committed Mar 10, 2024
1 parent f8e8af2 commit 8e1d27a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions crates/oxc_ast/src/ast/ts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))]
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 8e1d27a

Please sign in to comment.