fix(ast): rename TSIndexSignatureName in JSON AST (#2664)

Fixes #2656.
This commit is contained in:
overlookmotel 2024-03-10 17:11:28 +00:00 committed by GitHub
parent 975bc05f76
commit d47f0e247d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,6 +10,16 @@ use serde::Serialize;
use super::{js::*, literal::*}; 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)] #[derive(Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))] #[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))] #[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
@ -634,8 +644,11 @@ pub struct TSConstructSignatureDeclaration<'a> {
} }
#[derive(Debug, Hash)] #[derive(Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))] #[cfg_attr(
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))] feature = "serde",
derive(Serialize),
serde(tag = "type", rename = "Identifier", rename_all = "camelCase")
)]
pub struct TSIndexSignatureName<'a> { pub struct TSIndexSignatureName<'a> {
#[cfg_attr(feature = "serde", serde(flatten))] #[cfg_attr(feature = "serde", serde(flatten))]
pub span: Span, pub span: Span,