From 3792f97d615378c6fbc6c09f888c3234e61cba33 Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Sat, 19 Oct 2024 11:16:51 +0100 Subject: [PATCH 1/2] feat(ast_tools): generate TS type defs as text file --- Cargo.lock | 4 + tasks/ast_tools/Cargo.toml | 5 + tasks/ast_tools/src/generators/mod.rs | 2 + tasks/ast_tools/src/generators/typescript.rs | 135 +++++++++++++++++++ tasks/ast_tools/src/main.rs | 1 + 5 files changed, 147 insertions(+) create mode 100644 tasks/ast_tools/src/generators/typescript.rs diff --git a/Cargo.lock b/Cargo.lock index 7aaf1adbead2d..4cb9e8bafa3da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1473,6 +1473,10 @@ dependencies = [ "convert_case", "itertools", "lazy_static", + "oxc_allocator", + "oxc_parser", + "oxc_prettier", + "oxc_span", "prettyplease", "proc-macro2", "quote", diff --git a/tasks/ast_tools/Cargo.toml b/tasks/ast_tools/Cargo.toml index 427ac0533ac7d..f8d478aafbbf3 100644 --- a/tasks/ast_tools/Cargo.toml +++ b/tasks/ast_tools/Cargo.toml @@ -14,6 +14,11 @@ test = false doctest = false [dependencies] +oxc_allocator = { workspace = true } +oxc_parser = { workspace = true } +oxc_prettier = { workspace = true } +oxc_span = { workspace = true } + bpaf = { workspace = true, features = ["autocomplete", "bright-color", "derive"] } convert_case = { workspace = true } itertools = { workspace = true } diff --git a/tasks/ast_tools/src/generators/mod.rs b/tasks/ast_tools/src/generators/mod.rs index bd8df1f3e3d17..899b310dffd0c 100644 --- a/tasks/ast_tools/src/generators/mod.rs +++ b/tasks/ast_tools/src/generators/mod.rs @@ -7,11 +7,13 @@ use crate::codegen::LateCtx; mod assert_layouts; mod ast_builder; mod ast_kind; +// mod typescript; mod visit; pub use assert_layouts::AssertLayouts; pub use ast_builder::AstBuilderGenerator; pub use ast_kind::AstKindGenerator; +// pub use typescript::TypescriptGenerator; pub use visit::{VisitGenerator, VisitMutGenerator}; /// Inserts a newline in the `TokenStream`. diff --git a/tasks/ast_tools/src/generators/typescript.rs b/tasks/ast_tools/src/generators/typescript.rs new file mode 100644 index 0000000000000..2699b21813c8c --- /dev/null +++ b/tasks/ast_tools/src/generators/typescript.rs @@ -0,0 +1,135 @@ +use convert_case::{Case, Casing}; +use itertools::Itertools; +use oxc_allocator::Allocator; +use oxc_parser::{ParseOptions, Parser}; +use oxc_prettier::{Prettier, PrettierOptions, TrailingComma}; +use oxc_span::SourceType; + +use super::define_generator; +use crate::{ + codegen::LateCtx, + output, + schema::{ + serialize::{enum_variant_name, get_type_tag}, + EnumDef, GetIdent, StructDef, TypeDef, TypeName, + }, + Generator, GeneratorOutput, +}; + +// TODO: Generate directly to types.d.ts instead of relying on wasm-bindgen + +define_generator! { + pub struct TypescriptGenerator; +} + +impl Generator for TypescriptGenerator { + fn generate(&mut self, ctx: &LateCtx) -> GeneratorOutput { + let file = file!().replace('\\', "/"); + let mut contents = format!( + "\ + // To edit this generated file you have to edit `{file}`\n\ + // Auto-generated code, DO NOT EDIT DIRECTLY!\n\n" + ); + + for def in ctx.schema() { + if !def.generates_derive("ESTree") { + continue; + } + let type_def = match def { + TypeDef::Struct(it) => generate_struct(it), + TypeDef::Enum(it) => generate_enum(it), + }; + contents.push_str(&type_def); + contents.push_str("\n\n"); + } + + GeneratorOutput::Raw(output(crate::TYPESCRIPT_PACKAGE, "types.d.ts"), contents) + } +} + +// Untagged enums: "type Expression = BooleanLiteral | NullLiteral" +// Tagged enums: "type PropertyKind = 'init' | 'get' | 'set'" +fn generate_enum(def: &EnumDef) -> String { + let union = if def.markers.estree.untagged { + def.all_variants().map(|var| type_to_string(var.fields[0].typ.name())).join(" | ") + } else { + def.all_variants().map(|var| format!("'{}'", enum_variant_name(var, def))).join(" | ") + }; + let ident = def.ident(); + format!("export type {ident} = {union};") +} + +fn generate_struct(def: &StructDef) -> String { + let ident = def.ident(); + let mut fields = String::new(); + let mut extends = vec![]; + + if let Some(type_tag) = get_type_tag(def) { + fields.push_str(&format!("\n\ttype: '{type_tag}';")); + } + + for field in &def.fields { + if field.markers.derive_attributes.estree.skip { + continue; + } + let ty = match &field.markers.derive_attributes.tsify_type { + Some(ty) => ty.clone(), + None => type_to_string(field.typ.name()), + }; + + if field.markers.derive_attributes.estree.flatten { + extends.push(ty); + continue; + } + + let name = match &field.markers.derive_attributes.estree.rename { + Some(rename) => rename.to_string(), + None => field.name.clone().unwrap().to_case(Case::Camel), + }; + + fields.push_str(&format!("\n\t{name}: {ty};")); + } + let extends = + if extends.is_empty() { String::new() } else { format!(" & {}", extends.join(" & ")) }; + format!("export type {ident} = ({{{fields}\n}}){extends};") +} + +fn type_to_string(ty: &TypeName) -> String { + match ty { + TypeName::Ident(ident) => match ident.as_str() { + "f64" | "f32" | "usize" | "u64" | "u32" | "u16" | "u8" | "i64" | "i32" | "i16" + | "i8" => "number", + "bool" => "boolean", + "str" | "String" | "Atom" | "CompactStr" => "string", + ty => ty, + } + .to_string(), + TypeName::Vec(type_name) => format!("Array<{}>", type_to_string(type_name)), + TypeName::Box(type_name) | TypeName::Ref(type_name) | TypeName::Complex(type_name) => { + type_to_string(type_name) + } + TypeName::Opt(type_name) => format!("({}) | null", type_to_string(type_name)), + } +} + +/// Unusable until oxc_prettier supports comments +#[allow(dead_code)] +fn format_typescript(source_text: &str) -> String { + let allocator = Allocator::default(); + let source_type = SourceType::ts(); + let ret = Parser::new(&allocator, source_text, source_type) + .with_options(ParseOptions { preserve_parens: false, ..ParseOptions::default() }) + .parse(); + Prettier::new( + &allocator, + source_text, + ret.trivias, + PrettierOptions { + semi: true, + trailing_comma: TrailingComma::All, + single_quote: true, + ..PrettierOptions::default() + }, + ) + .build(&ret.program) +} diff --git a/tasks/ast_tools/src/main.rs b/tasks/ast_tools/src/main.rs index c500924f418c4..f5b3756c7bce3 100644 --- a/tasks/ast_tools/src/main.rs +++ b/tasks/ast_tools/src/main.rs @@ -43,6 +43,7 @@ static SOURCE_PATHS: &[&str] = &[ ]; const AST_CRATE: &str = "crates/oxc_ast"; +// const TYPESCRIPT_PACKAGE: &str = "npm/oxc-types"; type Result = std::result::Result; type TypeId = usize; From 3bac7126912df33201a4fc443e6f7f38b0a9d83e Mon Sep 17 00:00:00 2001 From: Ottomated Date: Mon, 21 Oct 2024 14:22:29 -0700 Subject: [PATCH 2/2] refactor: remove typescript logic from derive_estree --- crates/oxc_ast/src/generated/derive_estree.rs | 795 ------------------ .../src/generated/derive_estree.rs | 88 -- .../oxc_span/src/generated/derive_estree.rs | 18 - .../oxc_syntax/src/generated/derive_estree.rs | 16 - tasks/ast_tools/src/derives/estree.rs | 90 +- 5 files changed, 2 insertions(+), 1005 deletions(-) diff --git a/crates/oxc_ast/src/generated/derive_estree.rs b/crates/oxc_ast/src/generated/derive_estree.rs index 404abe5b357a8..085ec0e2fc07c 100644 --- a/crates/oxc_ast/src/generated/derive_estree.rs +++ b/crates/oxc_ast/src/generated/derive_estree.rs @@ -27,10 +27,6 @@ impl Serialize for BooleanLiteral { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type BooleanLiteral = ({\n\ttype: 'BooleanLiteral';\n\tvalue: boolean;\n}) & Span;"; - impl Serialize for NullLiteral { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -40,10 +36,6 @@ impl Serialize for NullLiteral { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type NullLiteral = ({\n\ttype: 'NullLiteral';\n}) & Span;"; - impl<'a> Serialize for NumericLiteral<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -55,9 +47,6 @@ impl<'a> Serialize for NumericLiteral<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type NumericLiteral = ({\n\ttype: 'NumericLiteral';\n\tvalue: number;\n\traw: string;\n}) & Span;"; - impl<'a> Serialize for BigIntLiteral<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -68,10 +57,6 @@ impl<'a> Serialize for BigIntLiteral<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type BigIntLiteral = ({\n\ttype: 'BigIntLiteral';\n\traw: string;\n}) & Span;"; - impl<'a> Serialize for RegExpLiteral<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -83,9 +68,6 @@ impl<'a> Serialize for RegExpLiteral<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type RegExpLiteral = ({\n\ttype: 'RegExpLiteral';\n\tvalue: EmptyObject;\n\tregex: RegExp;\n}) & Span;"; - impl<'a> Serialize for RegExp<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -95,10 +77,6 @@ impl<'a> Serialize for RegExp<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type RegExp = ({\n\tpattern: RegExpPattern;\n\tflags: RegExpFlags;\n});"; - impl<'a> Serialize for RegExpPattern<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -109,9 +87,6 @@ impl<'a> Serialize for RegExpPattern<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type RegExpPattern = string | string | Pattern;"; - impl Serialize for EmptyObject { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -119,9 +94,6 @@ impl Serialize for EmptyObject { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type EmptyObject = ({\n});"; - impl<'a> Serialize for StringLiteral<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -132,10 +104,6 @@ impl<'a> Serialize for StringLiteral<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type StringLiteral = ({\n\ttype: 'StringLiteral';\n\tvalue: string;\n}) & Span;"; - impl<'a> Serialize for Program<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -149,9 +117,6 @@ impl<'a> Serialize for Program<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type Program = ({\n\ttype: 'Program';\n\tsourceType: SourceType;\n\thashbang: (Hashbang) | null;\n\tdirectives: Array;\n\tbody: Array;\n}) & Span;"; - impl<'a> Serialize for Expression<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -201,9 +166,6 @@ impl<'a> Serialize for Expression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type Expression = BooleanLiteral | NullLiteral | NumericLiteral | BigIntLiteral | RegExpLiteral | StringLiteral | TemplateLiteral | IdentifierReference | MetaProperty | Super | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | Class | ConditionalExpression | Function | ImportExpression | LogicalExpression | NewExpression | ObjectExpression | ParenthesizedExpression | SequenceExpression | TaggedTemplateExpression | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | PrivateInExpression | JSXElement | JSXFragment | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | TSInstantiationExpression | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression;"; - impl<'a> Serialize for IdentifierName<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -214,10 +176,6 @@ impl<'a> Serialize for IdentifierName<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type IdentifierName = ({\n\ttype: 'Identifier';\n\tname: string;\n}) & Span;"; - impl<'a> Serialize for IdentifierReference<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -228,10 +186,6 @@ impl<'a> Serialize for IdentifierReference<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type IdentifierReference = ({\n\ttype: 'Identifier';\n\tname: string;\n}) & Span;"; - impl<'a> Serialize for BindingIdentifier<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -242,10 +196,6 @@ impl<'a> Serialize for BindingIdentifier<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type BindingIdentifier = ({\n\ttype: 'Identifier';\n\tname: string;\n}) & Span;"; - impl<'a> Serialize for LabelIdentifier<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -256,10 +206,6 @@ impl<'a> Serialize for LabelIdentifier<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type LabelIdentifier = ({\n\ttype: 'Identifier';\n\tname: string;\n}) & Span;"; - impl Serialize for ThisExpression { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -269,10 +215,6 @@ impl Serialize for ThisExpression { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type ThisExpression = ({\n\ttype: 'ThisExpression';\n}) & Span;"; - impl<'a> Serialize for ArrayExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -283,9 +225,6 @@ impl<'a> Serialize for ArrayExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ArrayExpression = ({\n\ttype: 'ArrayExpression';\n\telements: Array;\n}) & Span;"; - impl<'a> Serialize for ArrayExpressionElement<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -361,9 +300,6 @@ impl<'a> Serialize for ObjectExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ObjectExpression = ({\n\ttype: 'ObjectExpression';\n\tproperties: Array;\n}) & Span;"; - impl<'a> Serialize for ObjectPropertyKind<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -373,10 +309,6 @@ impl<'a> Serialize for ObjectPropertyKind<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type ObjectPropertyKind = ObjectProperty | SpreadElement;"; - impl<'a> Serialize for ObjectProperty<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -393,9 +325,6 @@ impl<'a> Serialize for ObjectProperty<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ObjectProperty = ({\n\ttype: 'ObjectProperty';\n\tkind: PropertyKind;\n\tkey: PropertyKey;\n\tvalue: Expression;\n\tinit: (Expression) | null;\n\tmethod: boolean;\n\tshorthand: boolean;\n\tcomputed: boolean;\n}) & Span;"; - impl<'a> Serialize for PropertyKey<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -447,9 +376,6 @@ impl<'a> Serialize for PropertyKey<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type PropertyKey = IdentifierName | PrivateIdentifier | BooleanLiteral | NullLiteral | NumericLiteral | BigIntLiteral | RegExpLiteral | StringLiteral | TemplateLiteral | IdentifierReference | MetaProperty | Super | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | Class | ConditionalExpression | Function | ImportExpression | LogicalExpression | NewExpression | ObjectExpression | ParenthesizedExpression | SequenceExpression | TaggedTemplateExpression | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | PrivateInExpression | JSXElement | JSXFragment | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | TSInstantiationExpression | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression;"; - impl Serialize for PropertyKind { fn serialize(&self, serializer: S) -> Result { match *self { @@ -460,9 +386,6 @@ impl Serialize for PropertyKind { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type PropertyKind = 'init' | 'get' | 'set';"; - impl<'a> Serialize for TemplateLiteral<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -474,9 +397,6 @@ impl<'a> Serialize for TemplateLiteral<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TemplateLiteral = ({\n\ttype: 'TemplateLiteral';\n\tquasis: Array;\n\texpressions: Array;\n}) & Span;"; - impl<'a> Serialize for TaggedTemplateExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -489,9 +409,6 @@ impl<'a> Serialize for TaggedTemplateExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TaggedTemplateExpression = ({\n\ttype: 'TaggedTemplateExpression';\n\ttag: Expression;\n\tquasi: TemplateLiteral;\n\ttypeParameters: (TSTypeParameterInstantiation) | null;\n}) & Span;"; - impl<'a> Serialize for TemplateElement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -503,9 +420,6 @@ impl<'a> Serialize for TemplateElement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TemplateElement = ({\n\ttype: 'TemplateElement';\n\ttail: boolean;\n\tvalue: TemplateElementValue;\n}) & Span;"; - impl<'a> Serialize for TemplateElementValue<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -515,10 +429,6 @@ impl<'a> Serialize for TemplateElementValue<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TemplateElementValue = ({\n\traw: string;\n\tcooked: (string) | null;\n});"; - impl<'a> Serialize for MemberExpression<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -529,9 +439,6 @@ impl<'a> Serialize for MemberExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type MemberExpression = ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression;"; - impl<'a> Serialize for ComputedMemberExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -544,9 +451,6 @@ impl<'a> Serialize for ComputedMemberExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ComputedMemberExpression = ({\n\ttype: 'ComputedMemberExpression';\n\tobject: Expression;\n\texpression: Expression;\n\toptional: boolean;\n}) & Span;"; - impl<'a> Serialize for StaticMemberExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -559,9 +463,6 @@ impl<'a> Serialize for StaticMemberExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type StaticMemberExpression = ({\n\ttype: 'StaticMemberExpression';\n\tobject: Expression;\n\tproperty: IdentifierName;\n\toptional: boolean;\n}) & Span;"; - impl<'a> Serialize for PrivateFieldExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -574,9 +475,6 @@ impl<'a> Serialize for PrivateFieldExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type PrivateFieldExpression = ({\n\ttype: 'PrivateFieldExpression';\n\tobject: Expression;\n\tfield: PrivateIdentifier;\n\toptional: boolean;\n}) & Span;"; - impl<'a> Serialize for CallExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -590,9 +488,6 @@ impl<'a> Serialize for CallExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type CallExpression = ({\n\ttype: 'CallExpression';\n\tcallee: Expression;\n\ttypeParameters: (TSTypeParameterInstantiation) | null;\n\targuments: Array;\n\toptional: boolean;\n}) & Span;"; - impl<'a> Serialize for NewExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -605,9 +500,6 @@ impl<'a> Serialize for NewExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type NewExpression = ({\n\ttype: 'NewExpression';\n\tcallee: Expression;\n\targuments: Array;\n\ttypeParameters: (TSTypeParameterInstantiation) | null;\n}) & Span;"; - impl<'a> Serialize for MetaProperty<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -619,9 +511,6 @@ impl<'a> Serialize for MetaProperty<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type MetaProperty = ({\n\ttype: 'MetaProperty';\n\tmeta: IdentifierName;\n\tproperty: IdentifierName;\n}) & Span;"; - impl<'a> Serialize for SpreadElement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -632,10 +521,6 @@ impl<'a> Serialize for SpreadElement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type SpreadElement = ({\n\ttype: 'SpreadElement';\n\targument: Expression;\n}) & Span;"; - impl<'a> Serialize for Argument<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -686,9 +571,6 @@ impl<'a> Serialize for Argument<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type Argument = SpreadElement | BooleanLiteral | NullLiteral | NumericLiteral | BigIntLiteral | RegExpLiteral | StringLiteral | TemplateLiteral | IdentifierReference | MetaProperty | Super | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | Class | ConditionalExpression | Function | ImportExpression | LogicalExpression | NewExpression | ObjectExpression | ParenthesizedExpression | SequenceExpression | TaggedTemplateExpression | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | PrivateInExpression | JSXElement | JSXFragment | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | TSInstantiationExpression | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression;"; - impl<'a> Serialize for UpdateExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -701,9 +583,6 @@ impl<'a> Serialize for UpdateExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type UpdateExpression = ({\n\ttype: 'UpdateExpression';\n\toperator: UpdateOperator;\n\tprefix: boolean;\n\targument: SimpleAssignmentTarget;\n}) & Span;"; - impl<'a> Serialize for UnaryExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -715,9 +594,6 @@ impl<'a> Serialize for UnaryExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type UnaryExpression = ({\n\ttype: 'UnaryExpression';\n\toperator: UnaryOperator;\n\targument: Expression;\n}) & Span;"; - impl<'a> Serialize for BinaryExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -730,9 +606,6 @@ impl<'a> Serialize for BinaryExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type BinaryExpression = ({\n\ttype: 'BinaryExpression';\n\tleft: Expression;\n\toperator: BinaryOperator;\n\tright: Expression;\n}) & Span;"; - impl<'a> Serialize for PrivateInExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -745,9 +618,6 @@ impl<'a> Serialize for PrivateInExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type PrivateInExpression = ({\n\ttype: 'PrivateInExpression';\n\tleft: PrivateIdentifier;\n\toperator: BinaryOperator;\n\tright: Expression;\n}) & Span;"; - impl<'a> Serialize for LogicalExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -760,9 +630,6 @@ impl<'a> Serialize for LogicalExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type LogicalExpression = ({\n\ttype: 'LogicalExpression';\n\tleft: Expression;\n\toperator: LogicalOperator;\n\tright: Expression;\n}) & Span;"; - impl<'a> Serialize for ConditionalExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -775,9 +642,6 @@ impl<'a> Serialize for ConditionalExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ConditionalExpression = ({\n\ttype: 'ConditionalExpression';\n\ttest: Expression;\n\tconsequent: Expression;\n\talternate: Expression;\n}) & Span;"; - impl<'a> Serialize for AssignmentExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -790,9 +654,6 @@ impl<'a> Serialize for AssignmentExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type AssignmentExpression = ({\n\ttype: 'AssignmentExpression';\n\toperator: AssignmentOperator;\n\tleft: AssignmentTarget;\n\tright: Expression;\n}) & Span;"; - impl<'a> Serialize for AssignmentTarget<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -811,9 +672,6 @@ impl<'a> Serialize for AssignmentTarget<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type AssignmentTarget = IdentifierReference | TSAsExpression | TSSatisfiesExpression | TSNonNullExpression | TSTypeAssertion | TSInstantiationExpression | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression | ArrayAssignmentTarget | ObjectAssignmentTarget;"; - impl<'a> Serialize for SimpleAssignmentTarget<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -840,9 +698,6 @@ impl<'a> Serialize for SimpleAssignmentTarget<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type SimpleAssignmentTarget = IdentifierReference | TSAsExpression | TSSatisfiesExpression | TSNonNullExpression | TSTypeAssertion | TSInstantiationExpression | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression;"; - impl<'a> Serialize for AssignmentTargetPattern<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -856,16 +711,6 @@ impl<'a> Serialize for AssignmentTargetPattern<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type AssignmentTargetPattern = ArrayAssignmentTarget | ObjectAssignmentTarget;"; - -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ArrayAssignmentTarget = ({\n\ttype: 'ArrayAssignmentTarget';\n\telements: Array;\n}) & Span;"; - -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ObjectAssignmentTarget = ({\n\ttype: 'ObjectAssignmentTarget';\n\tproperties: Array;\n}) & Span;"; - impl<'a> Serialize for AssignmentTargetRest<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -876,9 +721,6 @@ impl<'a> Serialize for AssignmentTargetRest<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type AssignmentTargetRest = ({\n\ttype: 'RestElement';\n\targument: AssignmentTarget;\n}) & Span;"; - impl<'a> Serialize for AssignmentTargetMaybeDefault<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -918,9 +760,6 @@ impl<'a> Serialize for AssignmentTargetMaybeDefault<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type AssignmentTargetMaybeDefault = AssignmentTargetWithDefault | IdentifierReference | TSAsExpression | TSSatisfiesExpression | TSNonNullExpression | TSTypeAssertion | TSInstantiationExpression | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression | ArrayAssignmentTarget | ObjectAssignmentTarget;"; - impl<'a> Serialize for AssignmentTargetWithDefault<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -932,9 +771,6 @@ impl<'a> Serialize for AssignmentTargetWithDefault<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type AssignmentTargetWithDefault = ({\n\ttype: 'AssignmentTargetWithDefault';\n\tbinding: AssignmentTarget;\n\tinit: Expression;\n}) & Span;"; - impl<'a> Serialize for AssignmentTargetProperty<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -948,9 +784,6 @@ impl<'a> Serialize for AssignmentTargetProperty<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type AssignmentTargetProperty = AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty;"; - impl<'a> Serialize for AssignmentTargetPropertyIdentifier<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -962,9 +795,6 @@ impl<'a> Serialize for AssignmentTargetPropertyIdentifier<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type AssignmentTargetPropertyIdentifier = ({\n\ttype: 'AssignmentTargetPropertyIdentifier';\n\tbinding: IdentifierReference;\n\tinit: (Expression) | null;\n}) & Span;"; - impl<'a> Serialize for AssignmentTargetPropertyProperty<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -976,9 +806,6 @@ impl<'a> Serialize for AssignmentTargetPropertyProperty<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type AssignmentTargetPropertyProperty = ({\n\ttype: 'AssignmentTargetPropertyProperty';\n\tname: PropertyKey;\n\tbinding: AssignmentTargetMaybeDefault;\n}) & Span;"; - impl<'a> Serialize for SequenceExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -989,9 +816,6 @@ impl<'a> Serialize for SequenceExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type SequenceExpression = ({\n\ttype: 'SequenceExpression';\n\texpressions: Array;\n}) & Span;"; - impl Serialize for Super { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1001,9 +825,6 @@ impl Serialize for Super { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type Super = ({\n\ttype: 'Super';\n}) & Span;"; - impl<'a> Serialize for AwaitExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1014,9 +835,6 @@ impl<'a> Serialize for AwaitExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type AwaitExpression = ({\n\ttype: 'AwaitExpression';\n\targument: Expression;\n}) & Span;"; - impl<'a> Serialize for ChainExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1027,9 +845,6 @@ impl<'a> Serialize for ChainExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ChainExpression = ({\n\ttype: 'ChainExpression';\n\texpression: ChainElement;\n}) & Span;"; - impl<'a> Serialize for ChainElement<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -1041,9 +856,6 @@ impl<'a> Serialize for ChainElement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ChainElement = CallExpression | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression;"; - impl<'a> Serialize for ParenthesizedExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1054,9 +866,6 @@ impl<'a> Serialize for ParenthesizedExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ParenthesizedExpression = ({\n\ttype: 'ParenthesizedExpression';\n\texpression: Expression;\n}) & Span;"; - impl<'a> Serialize for Statement<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -1096,9 +905,6 @@ impl<'a> Serialize for Statement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | IfStatement | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | WithStatement | VariableDeclaration | Function | Class | TSTypeAliasDeclaration | TSInterfaceDeclaration | TSEnumDeclaration | TSModuleDeclaration | TSImportEqualsDeclaration | ImportDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | TSExportAssignment | TSNamespaceExportDeclaration;"; - impl<'a> Serialize for Directive<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1110,9 +916,6 @@ impl<'a> Serialize for Directive<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type Directive = ({\n\ttype: 'Directive';\n\texpression: StringLiteral;\n\tdirective: string;\n}) & Span;"; - impl<'a> Serialize for Hashbang<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1123,10 +926,6 @@ impl<'a> Serialize for Hashbang<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type Hashbang = ({\n\ttype: 'Hashbang';\n\tvalue: string;\n}) & Span;"; - impl<'a> Serialize for BlockStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1137,9 +936,6 @@ impl<'a> Serialize for BlockStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type BlockStatement = ({\n\ttype: 'BlockStatement';\n\tbody: Array;\n}) & Span;"; - impl<'a> Serialize for Declaration<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -1155,9 +951,6 @@ impl<'a> Serialize for Declaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type Declaration = VariableDeclaration | Function | Class | TSTypeAliasDeclaration | TSInterfaceDeclaration | TSEnumDeclaration | TSModuleDeclaration | TSImportEqualsDeclaration;"; - impl<'a> Serialize for VariableDeclaration<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1170,9 +963,6 @@ impl<'a> Serialize for VariableDeclaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type VariableDeclaration = ({\n\ttype: 'VariableDeclaration';\n\tkind: VariableDeclarationKind;\n\tdeclarations: Array;\n\tdeclare: boolean;\n}) & Span;"; - impl Serialize for VariableDeclarationKind { fn serialize(&self, serializer: S) -> Result { match *self { @@ -1195,10 +985,6 @@ impl Serialize for VariableDeclarationKind { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type VariableDeclarationKind = 'var' | 'const' | 'let' | 'using' | 'await using';"; - impl<'a> Serialize for VariableDeclarator<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1211,9 +997,6 @@ impl<'a> Serialize for VariableDeclarator<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type VariableDeclarator = ({\n\ttype: 'VariableDeclarator';\n\tid: BindingPattern;\n\tinit: (Expression) | null;\n\tdefinite: boolean;\n}) & Span;"; - impl Serialize for EmptyStatement { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1223,10 +1006,6 @@ impl Serialize for EmptyStatement { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type EmptyStatement = ({\n\ttype: 'EmptyStatement';\n}) & Span;"; - impl<'a> Serialize for ExpressionStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1237,9 +1016,6 @@ impl<'a> Serialize for ExpressionStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ExpressionStatement = ({\n\ttype: 'ExpressionStatement';\n\texpression: Expression;\n}) & Span;"; - impl<'a> Serialize for IfStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1252,9 +1028,6 @@ impl<'a> Serialize for IfStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type IfStatement = ({\n\ttype: 'IfStatement';\n\ttest: Expression;\n\tconsequent: Statement;\n\talternate: (Statement) | null;\n}) & Span;"; - impl<'a> Serialize for DoWhileStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1266,9 +1039,6 @@ impl<'a> Serialize for DoWhileStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type DoWhileStatement = ({\n\ttype: 'DoWhileStatement';\n\tbody: Statement;\n\ttest: Expression;\n}) & Span;"; - impl<'a> Serialize for WhileStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1280,9 +1050,6 @@ impl<'a> Serialize for WhileStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type WhileStatement = ({\n\ttype: 'WhileStatement';\n\ttest: Expression;\n\tbody: Statement;\n}) & Span;"; - impl<'a> Serialize for ForStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1296,9 +1063,6 @@ impl<'a> Serialize for ForStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ForStatement = ({\n\ttype: 'ForStatement';\n\tinit: (ForStatementInit) | null;\n\ttest: (Expression) | null;\n\tupdate: (Expression) | null;\n\tbody: Statement;\n}) & Span;"; - impl<'a> Serialize for ForStatementInit<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -1349,9 +1113,6 @@ impl<'a> Serialize for ForStatementInit<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ForStatementInit = VariableDeclaration | BooleanLiteral | NullLiteral | NumericLiteral | BigIntLiteral | RegExpLiteral | StringLiteral | TemplateLiteral | IdentifierReference | MetaProperty | Super | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | Class | ConditionalExpression | Function | ImportExpression | LogicalExpression | NewExpression | ObjectExpression | ParenthesizedExpression | SequenceExpression | TaggedTemplateExpression | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | PrivateInExpression | JSXElement | JSXFragment | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | TSInstantiationExpression | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression;"; - impl<'a> Serialize for ForInStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1364,9 +1125,6 @@ impl<'a> Serialize for ForInStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ForInStatement = ({\n\ttype: 'ForInStatement';\n\tleft: ForStatementLeft;\n\tright: Expression;\n\tbody: Statement;\n}) & Span;"; - impl<'a> Serialize for ForStatementLeft<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -1386,9 +1144,6 @@ impl<'a> Serialize for ForStatementLeft<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ForStatementLeft = VariableDeclaration | IdentifierReference | TSAsExpression | TSSatisfiesExpression | TSNonNullExpression | TSTypeAssertion | TSInstantiationExpression | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression | ArrayAssignmentTarget | ObjectAssignmentTarget;"; - impl<'a> Serialize for ForOfStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1402,9 +1157,6 @@ impl<'a> Serialize for ForOfStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ForOfStatement = ({\n\ttype: 'ForOfStatement';\n\tawait: boolean;\n\tleft: ForStatementLeft;\n\tright: Expression;\n\tbody: Statement;\n}) & Span;"; - impl<'a> Serialize for ContinueStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1415,9 +1167,6 @@ impl<'a> Serialize for ContinueStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ContinueStatement = ({\n\ttype: 'ContinueStatement';\n\tlabel: (LabelIdentifier) | null;\n}) & Span;"; - impl<'a> Serialize for BreakStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1428,9 +1177,6 @@ impl<'a> Serialize for BreakStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type BreakStatement = ({\n\ttype: 'BreakStatement';\n\tlabel: (LabelIdentifier) | null;\n}) & Span;"; - impl<'a> Serialize for ReturnStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1441,9 +1187,6 @@ impl<'a> Serialize for ReturnStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ReturnStatement = ({\n\ttype: 'ReturnStatement';\n\targument: (Expression) | null;\n}) & Span;"; - impl<'a> Serialize for WithStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1455,9 +1198,6 @@ impl<'a> Serialize for WithStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type WithStatement = ({\n\ttype: 'WithStatement';\n\tobject: Expression;\n\tbody: Statement;\n}) & Span;"; - impl<'a> Serialize for SwitchStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1469,9 +1209,6 @@ impl<'a> Serialize for SwitchStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type SwitchStatement = ({\n\ttype: 'SwitchStatement';\n\tdiscriminant: Expression;\n\tcases: Array;\n}) & Span;"; - impl<'a> Serialize for SwitchCase<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1483,9 +1220,6 @@ impl<'a> Serialize for SwitchCase<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type SwitchCase = ({\n\ttype: 'SwitchCase';\n\ttest: (Expression) | null;\n\tconsequent: Array;\n}) & Span;"; - impl<'a> Serialize for LabeledStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1497,9 +1231,6 @@ impl<'a> Serialize for LabeledStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type LabeledStatement = ({\n\ttype: 'LabeledStatement';\n\tlabel: LabelIdentifier;\n\tbody: Statement;\n}) & Span;"; - impl<'a> Serialize for ThrowStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1510,9 +1241,6 @@ impl<'a> Serialize for ThrowStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ThrowStatement = ({\n\ttype: 'ThrowStatement';\n\targument: Expression;\n}) & Span;"; - impl<'a> Serialize for TryStatement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1525,9 +1253,6 @@ impl<'a> Serialize for TryStatement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TryStatement = ({\n\ttype: 'TryStatement';\n\tblock: BlockStatement;\n\thandler: (CatchClause) | null;\n\tfinalizer: (BlockStatement) | null;\n}) & Span;"; - impl<'a> Serialize for CatchClause<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1539,9 +1264,6 @@ impl<'a> Serialize for CatchClause<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type CatchClause = ({\n\ttype: 'CatchClause';\n\tparam: (CatchParameter) | null;\n\tbody: BlockStatement;\n}) & Span;"; - impl<'a> Serialize for CatchParameter<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1552,9 +1274,6 @@ impl<'a> Serialize for CatchParameter<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type CatchParameter = ({\n\ttype: 'CatchParameter';\n\tpattern: BindingPattern;\n}) & Span;"; - impl Serialize for DebuggerStatement { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1564,10 +1283,6 @@ impl Serialize for DebuggerStatement { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type DebuggerStatement = ({\n\ttype: 'DebuggerStatement';\n}) & Span;"; - impl<'a> Serialize for BindingPattern<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1578,9 +1293,6 @@ impl<'a> Serialize for BindingPattern<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type BindingPattern = ({\n\ttypeAnnotation: (TSTypeAnnotation) | null;\n\toptional: boolean;\n}) & (BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern);"; - impl<'a> Serialize for BindingPatternKind<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -1592,9 +1304,6 @@ impl<'a> Serialize for BindingPatternKind<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type BindingPatternKind = BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern;"; - impl<'a> Serialize for AssignmentPattern<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1606,12 +1315,6 @@ impl<'a> Serialize for AssignmentPattern<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type AssignmentPattern = ({\n\ttype: 'AssignmentPattern';\n\tleft: BindingPattern;\n\tright: Expression;\n}) & Span;"; - -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ObjectPattern = ({\n\ttype: 'ObjectPattern';\n\tproperties: Array;\n}) & Span;"; - impl<'a> Serialize for BindingProperty<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1625,12 +1328,6 @@ impl<'a> Serialize for BindingProperty<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type BindingProperty = ({\n\ttype: 'BindingProperty';\n\tkey: PropertyKey;\n\tvalue: BindingPattern;\n\tshorthand: boolean;\n\tcomputed: boolean;\n}) & Span;"; - -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ArrayPattern = ({\n\ttype: 'ArrayPattern';\n\telements: Array;\n}) & Span;"; - impl<'a> Serialize for BindingRestElement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1641,9 +1338,6 @@ impl<'a> Serialize for BindingRestElement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type BindingRestElement = ({\n\ttype: 'RestElement';\n\targument: BindingPattern;\n}) & Span;"; - impl<'a> Serialize for Function<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1662,9 +1356,6 @@ impl<'a> Serialize for Function<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type Function = ({\n\ttype: FunctionType;\n\tid: (BindingIdentifier) | null;\n\tgenerator: boolean;\n\tasync: boolean;\n\tdeclare: boolean;\n\ttypeParameters: (TSTypeParameterDeclaration) | null;\n\tthisParam: (TSThisParameter) | null;\n\tparams: FormalParameters;\n\treturnType: (TSTypeAnnotation) | null;\n\tbody: (FunctionBody) | null;\n}) & Span;"; - impl Serialize for FunctionType { fn serialize(&self, serializer: S) -> Result { match *self { @@ -1686,12 +1377,6 @@ impl Serialize for FunctionType { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type FunctionType = 'FunctionDeclaration' | 'FunctionExpression' | 'TSDeclareFunction' | 'TSEmptyBodyFunctionExpression';"; - -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type FormalParameters = ({\n\ttype: 'FormalParameters';\n\tkind: FormalParameterKind;\n\titems: Array;\n}) & Span;"; - impl<'a> Serialize for FormalParameter<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1706,9 +1391,6 @@ impl<'a> Serialize for FormalParameter<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type FormalParameter = ({\n\ttype: 'FormalParameter';\n\tdecorators: Array;\n\tpattern: BindingPattern;\n\taccessibility: (TSAccessibility) | null;\n\treadonly: boolean;\n\toverride: boolean;\n}) & Span;"; - impl Serialize for FormalParameterKind { fn serialize(&self, serializer: S) -> Result { match *self { @@ -1732,9 +1414,6 @@ impl Serialize for FormalParameterKind { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type FormalParameterKind = 'FormalParameter' | 'UniqueFormalParameters' | 'ArrowFormalParameters' | 'Signature';"; - impl<'a> Serialize for FunctionBody<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1746,9 +1425,6 @@ impl<'a> Serialize for FunctionBody<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type FunctionBody = ({\n\ttype: 'FunctionBody';\n\tdirectives: Array;\n\tstatements: Array;\n}) & Span;"; - impl<'a> Serialize for ArrowFunctionExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1764,9 +1440,6 @@ impl<'a> Serialize for ArrowFunctionExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ArrowFunctionExpression = ({\n\ttype: 'ArrowFunctionExpression';\n\texpression: boolean;\n\tasync: boolean;\n\ttypeParameters: (TSTypeParameterDeclaration) | null;\n\tparams: FormalParameters;\n\treturnType: (TSTypeAnnotation) | null;\n\tbody: FunctionBody;\n}) & Span;"; - impl<'a> Serialize for YieldExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1778,9 +1451,6 @@ impl<'a> Serialize for YieldExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type YieldExpression = ({\n\ttype: 'YieldExpression';\n\tdelegate: boolean;\n\targument: (Expression) | null;\n}) & Span;"; - impl<'a> Serialize for Class<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1799,9 +1469,6 @@ impl<'a> Serialize for Class<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type Class = ({\n\ttype: ClassType;\n\tdecorators: Array;\n\tid: (BindingIdentifier) | null;\n\ttypeParameters: (TSTypeParameterDeclaration) | null;\n\tsuperClass: (Expression) | null;\n\tsuperTypeParameters: (TSTypeParameterInstantiation) | null;\n\timplements: (Array) | null;\n\tbody: ClassBody;\n\tabstract: boolean;\n\tdeclare: boolean;\n}) & Span;"; - impl Serialize for ClassType { fn serialize(&self, serializer: S) -> Result { match *self { @@ -1815,10 +1482,6 @@ impl Serialize for ClassType { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type ClassType = 'ClassDeclaration' | 'ClassExpression';"; - impl<'a> Serialize for ClassBody<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1829,10 +1492,6 @@ impl<'a> Serialize for ClassBody<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type ClassBody = ({\n\ttype: 'ClassBody';\n\tbody: Array;\n}) & Span;"; - impl<'a> Serialize for ClassElement<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -1845,9 +1504,6 @@ impl<'a> Serialize for ClassElement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ClassElement = StaticBlock | MethodDefinition | PropertyDefinition | AccessorProperty | TSIndexSignature;"; - impl<'a> Serialize for MethodDefinition<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1866,9 +1522,6 @@ impl<'a> Serialize for MethodDefinition<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type MethodDefinition = ({\n\ttype: MethodDefinitionType;\n\tdecorators: Array;\n\tkey: PropertyKey;\n\tvalue: Function;\n\tkind: MethodDefinitionKind;\n\tcomputed: boolean;\n\tstatic: boolean;\n\toverride: boolean;\n\toptional: boolean;\n\taccessibility: (TSAccessibility) | null;\n}) & Span;"; - impl Serialize for MethodDefinitionType { fn serialize(&self, serializer: S) -> Result { match *self { @@ -1884,10 +1537,6 @@ impl Serialize for MethodDefinitionType { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type MethodDefinitionType = 'MethodDefinition' | 'TSAbstractMethodDefinition';"; - impl<'a> Serialize for PropertyDefinition<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1909,9 +1558,6 @@ impl<'a> Serialize for PropertyDefinition<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type PropertyDefinition = ({\n\ttype: PropertyDefinitionType;\n\tdecorators: Array;\n\tkey: PropertyKey;\n\tvalue: (Expression) | null;\n\tcomputed: boolean;\n\tstatic: boolean;\n\tdeclare: boolean;\n\toverride: boolean;\n\toptional: boolean;\n\tdefinite: boolean;\n\treadonly: boolean;\n\ttypeAnnotation: (TSTypeAnnotation) | null;\n\taccessibility: (TSAccessibility) | null;\n}) & Span;"; - impl Serialize for PropertyDefinitionType { fn serialize(&self, serializer: S) -> Result { match *self { @@ -1930,10 +1576,6 @@ impl Serialize for PropertyDefinitionType { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type PropertyDefinitionType = 'PropertyDefinition' | 'TSAbstractPropertyDefinition';"; - impl Serialize for MethodDefinitionKind { fn serialize(&self, serializer: S) -> Result { match *self { @@ -1953,10 +1595,6 @@ impl Serialize for MethodDefinitionKind { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type MethodDefinitionKind = 'constructor' | 'method' | 'get' | 'set';"; - impl<'a> Serialize for PrivateIdentifier<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1967,10 +1605,6 @@ impl<'a> Serialize for PrivateIdentifier<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type PrivateIdentifier = ({\n\ttype: 'PrivateIdentifier';\n\tname: string;\n}) & Span;"; - impl<'a> Serialize for StaticBlock<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -1981,10 +1615,6 @@ impl<'a> Serialize for StaticBlock<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type StaticBlock = ({\n\ttype: 'StaticBlock';\n\tbody: Array;\n}) & Span;"; - impl<'a> Serialize for ModuleDeclaration<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -2000,9 +1630,6 @@ impl<'a> Serialize for ModuleDeclaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ModuleDeclaration = ImportDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | TSExportAssignment | TSNamespaceExportDeclaration;"; - impl Serialize for AccessorPropertyType { fn serialize(&self, serializer: S) -> Result { match *self { @@ -2018,10 +1645,6 @@ impl Serialize for AccessorPropertyType { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type AccessorPropertyType = 'AccessorProperty' | 'TSAbstractAccessorProperty';"; - impl<'a> Serialize for AccessorProperty<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2039,9 +1662,6 @@ impl<'a> Serialize for AccessorProperty<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type AccessorProperty = ({\n\ttype: AccessorPropertyType;\n\tdecorators: Array;\n\tkey: PropertyKey;\n\tvalue: (Expression) | null;\n\tcomputed: boolean;\n\tstatic: boolean;\n\tdefinite: boolean;\n\ttypeAnnotation: (TSTypeAnnotation) | null;\n\taccessibility: (TSAccessibility) | null;\n}) & Span;"; - impl<'a> Serialize for ImportExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2053,9 +1673,6 @@ impl<'a> Serialize for ImportExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ImportExpression = ({\n\ttype: 'ImportExpression';\n\tsource: Expression;\n\targuments: Array;\n}) & Span;"; - impl<'a> Serialize for ImportDeclaration<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2069,9 +1686,6 @@ impl<'a> Serialize for ImportDeclaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ImportDeclaration = ({\n\ttype: 'ImportDeclaration';\n\tspecifiers: (Array) | null;\n\tsource: StringLiteral;\n\twithClause: (WithClause) | null;\n\timportKind: ImportOrExportKind;\n}) & Span;"; - impl<'a> Serialize for ImportDeclarationSpecifier<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -2086,9 +1700,6 @@ impl<'a> Serialize for ImportDeclarationSpecifier<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ImportDeclarationSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier;"; - impl<'a> Serialize for ImportSpecifier<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2101,9 +1712,6 @@ impl<'a> Serialize for ImportSpecifier<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ImportSpecifier = ({\n\ttype: 'ImportSpecifier';\n\timported: ModuleExportName;\n\tlocal: BindingIdentifier;\n\timportKind: ImportOrExportKind;\n}) & Span;"; - impl<'a> Serialize for ImportDefaultSpecifier<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2114,9 +1722,6 @@ impl<'a> Serialize for ImportDefaultSpecifier<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ImportDefaultSpecifier = ({\n\ttype: 'ImportDefaultSpecifier';\n\tlocal: BindingIdentifier;\n}) & Span;"; - impl<'a> Serialize for ImportNamespaceSpecifier<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2127,9 +1732,6 @@ impl<'a> Serialize for ImportNamespaceSpecifier<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ImportNamespaceSpecifier = ({\n\ttype: 'ImportNamespaceSpecifier';\n\tlocal: BindingIdentifier;\n}) & Span;"; - impl<'a> Serialize for WithClause<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2141,9 +1743,6 @@ impl<'a> Serialize for WithClause<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type WithClause = ({\n\ttype: 'WithClause';\n\tattributesKeyword: IdentifierName;\n\twithEntries: Array;\n}) & Span;"; - impl<'a> Serialize for ImportAttribute<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2155,9 +1754,6 @@ impl<'a> Serialize for ImportAttribute<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ImportAttribute = ({\n\ttype: 'ImportAttribute';\n\tkey: ImportAttributeKey;\n\tvalue: StringLiteral;\n}) & Span;"; - impl<'a> Serialize for ImportAttributeKey<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -2167,10 +1763,6 @@ impl<'a> Serialize for ImportAttributeKey<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type ImportAttributeKey = IdentifierName | StringLiteral;"; - impl<'a> Serialize for ExportNamedDeclaration<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2185,9 +1777,6 @@ impl<'a> Serialize for ExportNamedDeclaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ExportNamedDeclaration = ({\n\ttype: 'ExportNamedDeclaration';\n\tdeclaration: (Declaration) | null;\n\tspecifiers: Array;\n\tsource: (StringLiteral) | null;\n\texportKind: ImportOrExportKind;\n\twithClause: (WithClause) | null;\n}) & Span;"; - impl<'a> Serialize for ExportDefaultDeclaration<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2199,9 +1788,6 @@ impl<'a> Serialize for ExportDefaultDeclaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ExportDefaultDeclaration = ({\n\ttype: 'ExportDefaultDeclaration';\n\tdeclaration: ExportDefaultDeclarationKind;\n\texported: ModuleExportName;\n}) & Span;"; - impl<'a> Serialize for ExportAllDeclaration<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2215,9 +1801,6 @@ impl<'a> Serialize for ExportAllDeclaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ExportAllDeclaration = ({\n\ttype: 'ExportAllDeclaration';\n\texported: (ModuleExportName) | null;\n\tsource: StringLiteral;\n\twithClause: (WithClause) | null;\n\texportKind: ImportOrExportKind;\n}) & Span;"; - impl<'a> Serialize for ExportSpecifier<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2230,9 +1813,6 @@ impl<'a> Serialize for ExportSpecifier<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ExportSpecifier = ({\n\ttype: 'ExportSpecifier';\n\tlocal: ModuleExportName;\n\texported: ModuleExportName;\n\texportKind: ImportOrExportKind;\n}) & Span;"; - impl<'a> Serialize for ExportDefaultDeclarationKind<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -2329,9 +1909,6 @@ impl<'a> Serialize for ExportDefaultDeclarationKind<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ExportDefaultDeclarationKind = Function | Class | TSInterfaceDeclaration | BooleanLiteral | NullLiteral | NumericLiteral | BigIntLiteral | RegExpLiteral | StringLiteral | TemplateLiteral | IdentifierReference | MetaProperty | Super | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | Class | ConditionalExpression | Function | ImportExpression | LogicalExpression | NewExpression | ObjectExpression | ParenthesizedExpression | SequenceExpression | TaggedTemplateExpression | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | PrivateInExpression | JSXElement | JSXFragment | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | TSInstantiationExpression | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression;"; - impl<'a> Serialize for ModuleExportName<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -2342,10 +1919,6 @@ impl<'a> Serialize for ModuleExportName<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type ModuleExportName = IdentifierName | IdentifierReference | StringLiteral;"; - impl<'a> Serialize for TSThisParameter<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2357,9 +1930,6 @@ impl<'a> Serialize for TSThisParameter<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSThisParameter = ({\n\ttype: 'TSThisParameter';\n\tthisSpan: Span;\n\ttypeAnnotation: (TSTypeAnnotation) | null;\n}) & Span;"; - impl<'a> Serialize for TSEnumDeclaration<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2373,9 +1943,6 @@ impl<'a> Serialize for TSEnumDeclaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSEnumDeclaration = ({\n\ttype: 'TSEnumDeclaration';\n\tid: BindingIdentifier;\n\tmembers: Array;\n\tconst: boolean;\n\tdeclare: boolean;\n}) & Span;"; - impl<'a> Serialize for TSEnumMember<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2387,9 +1954,6 @@ impl<'a> Serialize for TSEnumMember<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSEnumMember = ({\n\ttype: 'TSEnumMember';\n\tid: TSEnumMemberName;\n\tinitializer: (Expression) | null;\n}) & Span;"; - impl<'a> Serialize for TSEnumMemberName<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -2443,9 +2007,6 @@ impl<'a> Serialize for TSEnumMemberName<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSEnumMemberName = IdentifierName | StringLiteral | TemplateLiteral | NumericLiteral | BooleanLiteral | NullLiteral | NumericLiteral | BigIntLiteral | RegExpLiteral | StringLiteral | TemplateLiteral | IdentifierReference | MetaProperty | Super | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | Class | ConditionalExpression | Function | ImportExpression | LogicalExpression | NewExpression | ObjectExpression | ParenthesizedExpression | SequenceExpression | TaggedTemplateExpression | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | PrivateInExpression | JSXElement | JSXFragment | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | TSInstantiationExpression | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression;"; - impl<'a> Serialize for TSTypeAnnotation<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2456,9 +2017,6 @@ impl<'a> Serialize for TSTypeAnnotation<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSTypeAnnotation = ({\n\ttype: 'TSTypeAnnotation';\n\ttypeAnnotation: TSType;\n}) & Span;"; - impl<'a> Serialize for TSLiteralType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2469,10 +2027,6 @@ impl<'a> Serialize for TSLiteralType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSLiteralType = ({\n\ttype: 'TSLiteralType';\n\tliteral: TSLiteral;\n}) & Span;"; - impl<'a> Serialize for TSLiteral<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -2488,9 +2042,6 @@ impl<'a> Serialize for TSLiteral<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSLiteral = BooleanLiteral | NullLiteral | NumericLiteral | BigIntLiteral | RegExpLiteral | StringLiteral | TemplateLiteral | UnaryExpression;"; - impl<'a> Serialize for TSType<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -2536,9 +2087,6 @@ impl<'a> Serialize for TSType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSType = TSAnyKeyword | TSBigIntKeyword | TSBooleanKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSArrayType | TSConditionalType | TSConstructorType | TSFunctionType | TSImportType | TSIndexedAccessType | TSInferType | TSIntersectionType | TSLiteralType | TSMappedType | TSNamedTupleMember | TSQualifiedName | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeLiteral | TSTypeOperator | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUnionType | TSParenthesizedType | JSDocNullableType | JSDocNonNullableType | JSDocUnknownType;"; - impl<'a> Serialize for TSConditionalType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2552,9 +2100,6 @@ impl<'a> Serialize for TSConditionalType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSConditionalType = ({\n\ttype: 'TSConditionalType';\n\tcheckType: TSType;\n\textendsType: TSType;\n\ttrueType: TSType;\n\tfalseType: TSType;\n}) & Span;"; - impl<'a> Serialize for TSUnionType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2565,10 +2110,6 @@ impl<'a> Serialize for TSUnionType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSUnionType = ({\n\ttype: 'TSUnionType';\n\ttypes: Array;\n}) & Span;"; - impl<'a> Serialize for TSIntersectionType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2579,9 +2120,6 @@ impl<'a> Serialize for TSIntersectionType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSIntersectionType = ({\n\ttype: 'TSIntersectionType';\n\ttypes: Array;\n}) & Span;"; - impl<'a> Serialize for TSParenthesizedType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2592,9 +2130,6 @@ impl<'a> Serialize for TSParenthesizedType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSParenthesizedType = ({\n\ttype: 'TSParenthesizedType';\n\ttypeAnnotation: TSType;\n}) & Span;"; - impl<'a> Serialize for TSTypeOperator<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2606,9 +2141,6 @@ impl<'a> Serialize for TSTypeOperator<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSTypeOperator = ({\n\ttype: 'TSTypeOperator';\n\toperator: TSTypeOperatorOperator;\n\ttypeAnnotation: TSType;\n}) & Span;"; - impl Serialize for TSTypeOperatorOperator { fn serialize(&self, serializer: S) -> Result { match *self { @@ -2625,10 +2157,6 @@ impl Serialize for TSTypeOperatorOperator { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSTypeOperatorOperator = 'keyof' | 'unique' | 'readonly';"; - impl<'a> Serialize for TSArrayType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2639,10 +2167,6 @@ impl<'a> Serialize for TSArrayType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSArrayType = ({\n\ttype: 'TSArrayType';\n\telementType: TSType;\n}) & Span;"; - impl<'a> Serialize for TSIndexedAccessType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2654,9 +2178,6 @@ impl<'a> Serialize for TSIndexedAccessType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSIndexedAccessType = ({\n\ttype: 'TSIndexedAccessType';\n\tobjectType: TSType;\n\tindexType: TSType;\n}) & Span;"; - impl<'a> Serialize for TSTupleType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2667,9 +2188,6 @@ impl<'a> Serialize for TSTupleType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSTupleType = ({\n\ttype: 'TSTupleType';\n\telementTypes: Array;\n}) & Span;"; - impl<'a> Serialize for TSNamedTupleMember<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2682,9 +2200,6 @@ impl<'a> Serialize for TSNamedTupleMember<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSNamedTupleMember = ({\n\ttype: 'TSNamedTupleMember';\n\telementType: TSTupleElement;\n\tlabel: IdentifierName;\n\toptional: boolean;\n}) & Span;"; - impl<'a> Serialize for TSOptionalType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2695,9 +2210,6 @@ impl<'a> Serialize for TSOptionalType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSOptionalType = ({\n\ttype: 'TSOptionalType';\n\ttypeAnnotation: TSType;\n}) & Span;"; - impl<'a> Serialize for TSRestType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2708,10 +2220,6 @@ impl<'a> Serialize for TSRestType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSRestType = ({\n\ttype: 'TSRestType';\n\ttypeAnnotation: TSType;\n}) & Span;"; - impl<'a> Serialize for TSTupleElement<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -2759,9 +2267,6 @@ impl<'a> Serialize for TSTupleElement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSTupleElement = TSOptionalType | TSRestType | TSAnyKeyword | TSBigIntKeyword | TSBooleanKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSArrayType | TSConditionalType | TSConstructorType | TSFunctionType | TSImportType | TSIndexedAccessType | TSInferType | TSIntersectionType | TSLiteralType | TSMappedType | TSNamedTupleMember | TSQualifiedName | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeLiteral | TSTypeOperator | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUnionType | TSParenthesizedType | JSDocNullableType | JSDocNonNullableType | JSDocUnknownType;"; - impl Serialize for TSAnyKeyword { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2771,10 +2276,6 @@ impl Serialize for TSAnyKeyword { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSAnyKeyword = ({\n\ttype: 'TSAnyKeyword';\n}) & Span;"; - impl Serialize for TSStringKeyword { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2784,10 +2285,6 @@ impl Serialize for TSStringKeyword { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSStringKeyword = ({\n\ttype: 'TSStringKeyword';\n}) & Span;"; - impl Serialize for TSBooleanKeyword { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2797,10 +2294,6 @@ impl Serialize for TSBooleanKeyword { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSBooleanKeyword = ({\n\ttype: 'TSBooleanKeyword';\n}) & Span;"; - impl Serialize for TSNumberKeyword { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2810,10 +2303,6 @@ impl Serialize for TSNumberKeyword { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSNumberKeyword = ({\n\ttype: 'TSNumberKeyword';\n}) & Span;"; - impl Serialize for TSNeverKeyword { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2823,10 +2312,6 @@ impl Serialize for TSNeverKeyword { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSNeverKeyword = ({\n\ttype: 'TSNeverKeyword';\n}) & Span;"; - impl Serialize for TSIntrinsicKeyword { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2836,10 +2321,6 @@ impl Serialize for TSIntrinsicKeyword { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSIntrinsicKeyword = ({\n\ttype: 'TSIntrinsicKeyword';\n}) & Span;"; - impl Serialize for TSUnknownKeyword { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2849,10 +2330,6 @@ impl Serialize for TSUnknownKeyword { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSUnknownKeyword = ({\n\ttype: 'TSUnknownKeyword';\n}) & Span;"; - impl Serialize for TSNullKeyword { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2862,10 +2339,6 @@ impl Serialize for TSNullKeyword { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSNullKeyword = ({\n\ttype: 'TSNullKeyword';\n}) & Span;"; - impl Serialize for TSUndefinedKeyword { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2875,10 +2348,6 @@ impl Serialize for TSUndefinedKeyword { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSUndefinedKeyword = ({\n\ttype: 'TSUndefinedKeyword';\n}) & Span;"; - impl Serialize for TSVoidKeyword { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2888,10 +2357,6 @@ impl Serialize for TSVoidKeyword { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSVoidKeyword = ({\n\ttype: 'TSVoidKeyword';\n}) & Span;"; - impl Serialize for TSSymbolKeyword { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2901,10 +2366,6 @@ impl Serialize for TSSymbolKeyword { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSSymbolKeyword = ({\n\ttype: 'TSSymbolKeyword';\n}) & Span;"; - impl Serialize for TSThisType { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2914,10 +2375,6 @@ impl Serialize for TSThisType { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSThisType = ({\n\ttype: 'TSThisType';\n}) & Span;"; - impl Serialize for TSObjectKeyword { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2927,10 +2384,6 @@ impl Serialize for TSObjectKeyword { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSObjectKeyword = ({\n\ttype: 'TSObjectKeyword';\n}) & Span;"; - impl Serialize for TSBigIntKeyword { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2940,10 +2393,6 @@ impl Serialize for TSBigIntKeyword { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSBigIntKeyword = ({\n\ttype: 'TSBigIntKeyword';\n}) & Span;"; - impl<'a> Serialize for TSTypeReference<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2955,9 +2404,6 @@ impl<'a> Serialize for TSTypeReference<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSTypeReference = ({\n\ttype: 'TSTypeReference';\n\ttypeName: TSTypeName;\n\ttypeParameters: (TSTypeParameterInstantiation) | null;\n}) & Span;"; - impl<'a> Serialize for TSTypeName<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -2967,10 +2413,6 @@ impl<'a> Serialize for TSTypeName<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSTypeName = IdentifierReference | TSQualifiedName;"; - impl<'a> Serialize for TSQualifiedName<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2982,9 +2424,6 @@ impl<'a> Serialize for TSQualifiedName<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSQualifiedName = ({\n\ttype: 'TSQualifiedName';\n\tleft: TSTypeName;\n\tright: IdentifierName;\n}) & Span;"; - impl<'a> Serialize for TSTypeParameterInstantiation<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -2995,9 +2434,6 @@ impl<'a> Serialize for TSTypeParameterInstantiation<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSTypeParameterInstantiation = ({\n\ttype: 'TSTypeParameterInstantiation';\n\tparams: Array;\n}) & Span;"; - impl<'a> Serialize for TSTypeParameter<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3013,9 +2449,6 @@ impl<'a> Serialize for TSTypeParameter<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSTypeParameter = ({\n\ttype: 'TSTypeParameter';\n\tname: BindingIdentifier;\n\tconstraint: (TSType) | null;\n\tdefault: (TSType) | null;\n\tin: boolean;\n\tout: boolean;\n\tconst: boolean;\n}) & Span;"; - impl<'a> Serialize for TSTypeParameterDeclaration<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3026,9 +2459,6 @@ impl<'a> Serialize for TSTypeParameterDeclaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSTypeParameterDeclaration = ({\n\ttype: 'TSTypeParameterDeclaration';\n\tparams: Array;\n}) & Span;"; - impl<'a> Serialize for TSTypeAliasDeclaration<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3042,9 +2472,6 @@ impl<'a> Serialize for TSTypeAliasDeclaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSTypeAliasDeclaration = ({\n\ttype: 'TSTypeAliasDeclaration';\n\tid: BindingIdentifier;\n\ttypeParameters: (TSTypeParameterDeclaration) | null;\n\ttypeAnnotation: TSType;\n\tdeclare: boolean;\n}) & Span;"; - impl Serialize for TSAccessibility { fn serialize(&self, serializer: S) -> Result { match *self { @@ -3061,10 +2488,6 @@ impl Serialize for TSAccessibility { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSAccessibility = 'private' | 'protected' | 'public';"; - impl<'a> Serialize for TSClassImplements<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3076,9 +2499,6 @@ impl<'a> Serialize for TSClassImplements<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSClassImplements = ({\n\ttype: 'TSClassImplements';\n\texpression: TSTypeName;\n\ttypeParameters: (TSTypeParameterInstantiation) | null;\n}) & Span;"; - impl<'a> Serialize for TSInterfaceDeclaration<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3093,9 +2513,6 @@ impl<'a> Serialize for TSInterfaceDeclaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSInterfaceDeclaration = ({\n\ttype: 'TSInterfaceDeclaration';\n\tid: BindingIdentifier;\n\textends: (Array) | null;\n\ttypeParameters: (TSTypeParameterDeclaration) | null;\n\tbody: TSInterfaceBody;\n\tdeclare: boolean;\n}) & Span;"; - impl<'a> Serialize for TSInterfaceBody<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3106,9 +2523,6 @@ impl<'a> Serialize for TSInterfaceBody<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSInterfaceBody = ({\n\ttype: 'TSInterfaceBody';\n\tbody: Array;\n}) & Span;"; - impl<'a> Serialize for TSPropertySignature<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3123,9 +2537,6 @@ impl<'a> Serialize for TSPropertySignature<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSPropertySignature = ({\n\ttype: 'TSPropertySignature';\n\tcomputed: boolean;\n\toptional: boolean;\n\treadonly: boolean;\n\tkey: PropertyKey;\n\ttypeAnnotation: (TSTypeAnnotation) | null;\n}) & Span;"; - impl<'a> Serialize for TSSignature<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -3138,9 +2549,6 @@ impl<'a> Serialize for TSSignature<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSSignature = TSIndexSignature | TSPropertySignature | TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSMethodSignature;"; - impl<'a> Serialize for TSIndexSignature<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3153,9 +2561,6 @@ impl<'a> Serialize for TSIndexSignature<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSIndexSignature = ({\n\ttype: 'TSIndexSignature';\n\tparameters: Array;\n\ttypeAnnotation: TSTypeAnnotation;\n\treadonly: boolean;\n}) & Span;"; - impl<'a> Serialize for TSCallSignatureDeclaration<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3169,9 +2574,6 @@ impl<'a> Serialize for TSCallSignatureDeclaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSCallSignatureDeclaration = ({\n\ttype: 'TSCallSignatureDeclaration';\n\ttypeParameters: (TSTypeParameterDeclaration) | null;\n\tthisParam: (TSThisParameter) | null;\n\tparams: FormalParameters;\n\treturnType: (TSTypeAnnotation) | null;\n}) & Span;"; - impl Serialize for TSMethodSignatureKind { fn serialize(&self, serializer: S) -> Result { match *self { @@ -3188,10 +2590,6 @@ impl Serialize for TSMethodSignatureKind { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSMethodSignatureKind = 'method' | 'get' | 'set';"; - impl<'a> Serialize for TSMethodSignature<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3209,9 +2607,6 @@ impl<'a> Serialize for TSMethodSignature<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSMethodSignature = ({\n\ttype: 'TSMethodSignature';\n\tkey: PropertyKey;\n\tcomputed: boolean;\n\toptional: boolean;\n\tkind: TSMethodSignatureKind;\n\ttypeParameters: (TSTypeParameterDeclaration) | null;\n\tthisParam: (TSThisParameter) | null;\n\tparams: FormalParameters;\n\treturnType: (TSTypeAnnotation) | null;\n}) & Span;"; - impl<'a> Serialize for TSConstructSignatureDeclaration<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3224,9 +2619,6 @@ impl<'a> Serialize for TSConstructSignatureDeclaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSConstructSignatureDeclaration = ({\n\ttype: 'TSConstructSignatureDeclaration';\n\ttypeParameters: (TSTypeParameterDeclaration) | null;\n\tparams: FormalParameters;\n\treturnType: (TSTypeAnnotation) | null;\n}) & Span;"; - impl<'a> Serialize for TSIndexSignatureName<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3238,9 +2630,6 @@ impl<'a> Serialize for TSIndexSignatureName<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSIndexSignatureName = ({\n\ttype: 'Identifier';\n\tname: string;\n\ttypeAnnotation: TSTypeAnnotation;\n}) & Span;"; - impl<'a> Serialize for TSInterfaceHeritage<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3252,9 +2641,6 @@ impl<'a> Serialize for TSInterfaceHeritage<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSInterfaceHeritage = ({\n\ttype: 'TSInterfaceHeritage';\n\texpression: Expression;\n\ttypeParameters: (TSTypeParameterInstantiation) | null;\n}) & Span;"; - impl<'a> Serialize for TSTypePredicate<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3267,9 +2653,6 @@ impl<'a> Serialize for TSTypePredicate<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSTypePredicate = ({\n\ttype: 'TSTypePredicate';\n\tparameterName: TSTypePredicateName;\n\tasserts: boolean;\n\ttypeAnnotation: (TSTypeAnnotation) | null;\n}) & Span;"; - impl<'a> Serialize for TSTypePredicateName<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -3279,10 +2662,6 @@ impl<'a> Serialize for TSTypePredicateName<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSTypePredicateName = IdentifierName | TSThisType;"; - impl<'a> Serialize for TSModuleDeclaration<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3296,9 +2675,6 @@ impl<'a> Serialize for TSModuleDeclaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSModuleDeclaration = ({\n\ttype: 'TSModuleDeclaration';\n\tid: TSModuleDeclarationName;\n\tbody: (TSModuleDeclarationBody) | null;\n\tkind: TSModuleDeclarationKind;\n\tdeclare: boolean;\n}) & Span;"; - impl Serialize for TSModuleDeclarationKind { fn serialize(&self, serializer: S) -> Result { match *self { @@ -3315,10 +2691,6 @@ impl Serialize for TSModuleDeclarationKind { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSModuleDeclarationKind = 'global' | 'module' | 'namespace';"; - impl<'a> Serialize for TSModuleDeclarationName<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -3328,10 +2700,6 @@ impl<'a> Serialize for TSModuleDeclarationName<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSModuleDeclarationName = BindingIdentifier | StringLiteral;"; - impl<'a> Serialize for TSModuleDeclarationBody<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -3341,13 +2709,6 @@ impl<'a> Serialize for TSModuleDeclarationBody<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSModuleDeclarationBody = TSModuleDeclaration | TSModuleBlock;"; - -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSModuleBlock = ({\n\ttype: 'TSModuleBlock';\n\tbody: Array;\n}) & Span;"; - impl<'a> Serialize for TSTypeLiteral<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3358,9 +2719,6 @@ impl<'a> Serialize for TSTypeLiteral<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSTypeLiteral = ({\n\ttype: 'TSTypeLiteral';\n\tmembers: Array;\n}) & Span;"; - impl<'a> Serialize for TSInferType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3371,9 +2729,6 @@ impl<'a> Serialize for TSInferType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSInferType = ({\n\ttype: 'TSInferType';\n\ttypeParameter: TSTypeParameter;\n}) & Span;"; - impl<'a> Serialize for TSTypeQuery<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3385,9 +2740,6 @@ impl<'a> Serialize for TSTypeQuery<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSTypeQuery = ({\n\ttype: 'TSTypeQuery';\n\texprName: TSTypeQueryExprName;\n\ttypeParameters: (TSTypeParameterInstantiation) | null;\n}) & Span;"; - impl<'a> Serialize for TSTypeQueryExprName<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -3398,10 +2750,6 @@ impl<'a> Serialize for TSTypeQueryExprName<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSTypeQueryExprName = TSImportType | IdentifierReference | TSQualifiedName;"; - impl<'a> Serialize for TSImportType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3416,9 +2764,6 @@ impl<'a> Serialize for TSImportType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSImportType = ({\n\ttype: 'TSImportType';\n\tisTypeOf: boolean;\n\tparameter: TSType;\n\tqualifier: (TSTypeName) | null;\n\tattributes: (TSImportAttributes) | null;\n\ttypeParameters: (TSTypeParameterInstantiation) | null;\n}) & Span;"; - impl<'a> Serialize for TSImportAttributes<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3430,9 +2775,6 @@ impl<'a> Serialize for TSImportAttributes<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSImportAttributes = ({\n\ttype: 'TSImportAttributes';\n\tattributesKeyword: IdentifierName;\n\telements: Array;\n}) & Span;"; - impl<'a> Serialize for TSImportAttribute<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3444,9 +2786,6 @@ impl<'a> Serialize for TSImportAttribute<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSImportAttribute = ({\n\ttype: 'TSImportAttribute';\n\tname: TSImportAttributeName;\n\tvalue: Expression;\n}) & Span;"; - impl<'a> Serialize for TSImportAttributeName<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -3456,10 +2795,6 @@ impl<'a> Serialize for TSImportAttributeName<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSImportAttributeName = IdentifierName | StringLiteral;"; - impl<'a> Serialize for TSFunctionType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3473,9 +2808,6 @@ impl<'a> Serialize for TSFunctionType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSFunctionType = ({\n\ttype: 'TSFunctionType';\n\ttypeParameters: (TSTypeParameterDeclaration) | null;\n\tthisParam: (TSThisParameter) | null;\n\tparams: FormalParameters;\n\treturnType: TSTypeAnnotation;\n}) & Span;"; - impl<'a> Serialize for TSConstructorType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3489,9 +2821,6 @@ impl<'a> Serialize for TSConstructorType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSConstructorType = ({\n\ttype: 'TSConstructorType';\n\tabstract: boolean;\n\ttypeParameters: (TSTypeParameterDeclaration) | null;\n\tparams: FormalParameters;\n\treturnType: TSTypeAnnotation;\n}) & Span;"; - impl<'a> Serialize for TSMappedType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3506,9 +2835,6 @@ impl<'a> Serialize for TSMappedType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSMappedType = ({\n\ttype: 'TSMappedType';\n\ttypeParameter: TSTypeParameter;\n\tnameType: (TSType) | null;\n\ttypeAnnotation: (TSType) | null;\n\toptional: TSMappedTypeModifierOperator;\n\treadonly: TSMappedTypeModifierOperator;\n}) & Span;"; - impl Serialize for TSMappedTypeModifierOperator { fn serialize(&self, serializer: S) -> Result { match *self { @@ -3528,10 +2854,6 @@ impl Serialize for TSMappedTypeModifierOperator { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type TSMappedTypeModifierOperator = 'true' | '+' | '-' | 'none';"; - impl<'a> Serialize for TSTemplateLiteralType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3543,9 +2865,6 @@ impl<'a> Serialize for TSTemplateLiteralType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSTemplateLiteralType = ({\n\ttype: 'TSTemplateLiteralType';\n\tquasis: Array;\n\ttypes: Array;\n}) & Span;"; - impl<'a> Serialize for TSAsExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3557,9 +2876,6 @@ impl<'a> Serialize for TSAsExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSAsExpression = ({\n\ttype: 'TSAsExpression';\n\texpression: Expression;\n\ttypeAnnotation: TSType;\n}) & Span;"; - impl<'a> Serialize for TSSatisfiesExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3571,9 +2887,6 @@ impl<'a> Serialize for TSSatisfiesExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSSatisfiesExpression = ({\n\ttype: 'TSSatisfiesExpression';\n\texpression: Expression;\n\ttypeAnnotation: TSType;\n}) & Span;"; - impl<'a> Serialize for TSTypeAssertion<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3585,9 +2898,6 @@ impl<'a> Serialize for TSTypeAssertion<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSTypeAssertion = ({\n\ttype: 'TSTypeAssertion';\n\texpression: Expression;\n\ttypeAnnotation: TSType;\n}) & Span;"; - impl<'a> Serialize for TSImportEqualsDeclaration<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3600,9 +2910,6 @@ impl<'a> Serialize for TSImportEqualsDeclaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSImportEqualsDeclaration = ({\n\ttype: 'TSImportEqualsDeclaration';\n\tid: BindingIdentifier;\n\tmoduleReference: TSModuleReference;\n\timportKind: ImportOrExportKind;\n}) & Span;"; - impl<'a> Serialize for TSModuleReference<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -3613,9 +2920,6 @@ impl<'a> Serialize for TSModuleReference<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSModuleReference = TSExternalModuleReference | IdentifierReference | TSQualifiedName;"; - impl<'a> Serialize for TSExternalModuleReference<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3626,9 +2930,6 @@ impl<'a> Serialize for TSExternalModuleReference<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSExternalModuleReference = ({\n\ttype: 'TSExternalModuleReference';\n\texpression: StringLiteral;\n}) & Span;"; - impl<'a> Serialize for TSNonNullExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3639,9 +2940,6 @@ impl<'a> Serialize for TSNonNullExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSNonNullExpression = ({\n\ttype: 'TSNonNullExpression';\n\texpression: Expression;\n}) & Span;"; - impl<'a> Serialize for Decorator<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3652,10 +2950,6 @@ impl<'a> Serialize for Decorator<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type Decorator = ({\n\ttype: 'Decorator';\n\texpression: Expression;\n}) & Span;"; - impl<'a> Serialize for TSExportAssignment<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3666,9 +2960,6 @@ impl<'a> Serialize for TSExportAssignment<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSExportAssignment = ({\n\ttype: 'TSExportAssignment';\n\texpression: Expression;\n}) & Span;"; - impl<'a> Serialize for TSNamespaceExportDeclaration<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3679,9 +2970,6 @@ impl<'a> Serialize for TSNamespaceExportDeclaration<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSNamespaceExportDeclaration = ({\n\ttype: 'TSNamespaceExportDeclaration';\n\tid: IdentifierName;\n}) & Span;"; - impl<'a> Serialize for TSInstantiationExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3693,9 +2981,6 @@ impl<'a> Serialize for TSInstantiationExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type TSInstantiationExpression = ({\n\ttype: 'TSInstantiationExpression';\n\texpression: Expression;\n\ttypeParameters: TSTypeParameterInstantiation;\n}) & Span;"; - impl Serialize for ImportOrExportKind { fn serialize(&self, serializer: S) -> Result { match *self { @@ -3709,9 +2994,6 @@ impl Serialize for ImportOrExportKind { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ImportOrExportKind = 'value' | 'type';"; - impl<'a> Serialize for JSDocNullableType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3723,9 +3005,6 @@ impl<'a> Serialize for JSDocNullableType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type JSDocNullableType = ({\n\ttype: 'JSDocNullableType';\n\ttypeAnnotation: TSType;\n\tpostfix: boolean;\n}) & Span;"; - impl<'a> Serialize for JSDocNonNullableType<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3737,9 +3016,6 @@ impl<'a> Serialize for JSDocNonNullableType<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type JSDocNonNullableType = ({\n\ttype: 'JSDocNonNullableType';\n\ttypeAnnotation: TSType;\n\tpostfix: boolean;\n}) & Span;"; - impl Serialize for JSDocUnknownType { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3749,10 +3025,6 @@ impl Serialize for JSDocUnknownType { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type JSDocUnknownType = ({\n\ttype: 'JSDocUnknownType';\n}) & Span;"; - impl<'a> Serialize for JSXElement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3765,9 +3037,6 @@ impl<'a> Serialize for JSXElement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type JSXElement = ({\n\ttype: 'JSXElement';\n\topeningElement: JSXOpeningElement;\n\tclosingElement: (JSXClosingElement) | null;\n\tchildren: Array;\n}) & Span;"; - impl<'a> Serialize for JSXOpeningElement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3781,9 +3050,6 @@ impl<'a> Serialize for JSXOpeningElement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type JSXOpeningElement = ({\n\ttype: 'JSXOpeningElement';\n\tselfClosing: boolean;\n\tname: JSXElementName;\n\tattributes: Array;\n\ttypeParameters: (TSTypeParameterInstantiation) | null;\n}) & Span;"; - impl<'a> Serialize for JSXClosingElement<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3794,9 +3060,6 @@ impl<'a> Serialize for JSXClosingElement<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type JSXClosingElement = ({\n\ttype: 'JSXClosingElement';\n\tname: JSXElementName;\n}) & Span;"; - impl<'a> Serialize for JSXFragment<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3809,9 +3072,6 @@ impl<'a> Serialize for JSXFragment<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type JSXFragment = ({\n\ttype: 'JSXFragment';\n\topeningFragment: JSXOpeningFragment;\n\tclosingFragment: JSXClosingFragment;\n\tchildren: Array;\n}) & Span;"; - impl Serialize for JSXOpeningFragment { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3821,10 +3081,6 @@ impl Serialize for JSXOpeningFragment { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type JSXOpeningFragment = ({\n\ttype: 'JSXOpeningFragment';\n}) & Span;"; - impl Serialize for JSXClosingFragment { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3834,10 +3090,6 @@ impl Serialize for JSXClosingFragment { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type JSXClosingFragment = ({\n\ttype: 'JSXClosingFragment';\n}) & Span;"; - impl<'a> Serialize for JSXNamespacedName<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3849,9 +3101,6 @@ impl<'a> Serialize for JSXNamespacedName<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type JSXNamespacedName = ({\n\ttype: 'JSXNamespacedName';\n\tnamespace: JSXIdentifier;\n\tproperty: JSXIdentifier;\n}) & Span;"; - impl<'a> Serialize for JSXMemberExpression<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3863,9 +3112,6 @@ impl<'a> Serialize for JSXMemberExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type JSXMemberExpression = ({\n\ttype: 'JSXMemberExpression';\n\tobject: JSXMemberExpressionObject;\n\tproperty: JSXIdentifier;\n}) & Span;"; - impl<'a> Serialize for JSXExpressionContainer<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3876,9 +3122,6 @@ impl<'a> Serialize for JSXExpressionContainer<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type JSXExpressionContainer = ({\n\ttype: 'JSXExpressionContainer';\n\texpression: JSXExpression;\n}) & Span;"; - impl<'a> Serialize for JSXExpression<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -3929,9 +3172,6 @@ impl<'a> Serialize for JSXExpression<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type JSXExpression = JSXEmptyExpression | BooleanLiteral | NullLiteral | NumericLiteral | BigIntLiteral | RegExpLiteral | StringLiteral | TemplateLiteral | IdentifierReference | MetaProperty | Super | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | Class | ConditionalExpression | Function | ImportExpression | LogicalExpression | NewExpression | ObjectExpression | ParenthesizedExpression | SequenceExpression | TaggedTemplateExpression | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | PrivateInExpression | JSXElement | JSXFragment | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | TSInstantiationExpression | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression;"; - impl Serialize for JSXEmptyExpression { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3941,10 +3181,6 @@ impl Serialize for JSXEmptyExpression { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type JSXEmptyExpression = ({\n\ttype: 'JSXEmptyExpression';\n}) & Span;"; - impl<'a> Serialize for JSXAttributeItem<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -3954,10 +3190,6 @@ impl<'a> Serialize for JSXAttributeItem<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type JSXAttributeItem = JSXAttribute | JSXSpreadAttribute;"; - impl<'a> Serialize for JSXAttribute<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3969,9 +3201,6 @@ impl<'a> Serialize for JSXAttribute<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type JSXAttribute = ({\n\ttype: 'JSXAttribute';\n\tname: JSXAttributeName;\n\tvalue: (JSXAttributeValue) | null;\n}) & Span;"; - impl<'a> Serialize for JSXSpreadAttribute<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -3982,9 +3211,6 @@ impl<'a> Serialize for JSXSpreadAttribute<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type JSXSpreadAttribute = ({\n\ttype: 'JSXSpreadAttribute';\n\targument: Expression;\n}) & Span;"; - impl<'a> Serialize for JSXAttributeName<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -3994,10 +3220,6 @@ impl<'a> Serialize for JSXAttributeName<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type JSXAttributeName = JSXIdentifier | JSXNamespacedName;"; - impl<'a> Serialize for JSXAttributeValue<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -4009,9 +3231,6 @@ impl<'a> Serialize for JSXAttributeValue<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type JSXAttributeValue = StringLiteral | JSXExpressionContainer | JSXElement | JSXFragment;"; - impl<'a> Serialize for JSXIdentifier<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -4022,10 +3241,6 @@ impl<'a> Serialize for JSXIdentifier<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type JSXIdentifier = ({\n\ttype: 'JSXIdentifier';\n\tname: string;\n}) & Span;"; - impl<'a> Serialize for JSXChild<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -4038,9 +3253,6 @@ impl<'a> Serialize for JSXChild<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type JSXChild = JSXText | JSXElement | JSXFragment | JSXExpressionContainer | JSXSpreadChild;"; - impl<'a> Serialize for JSXSpreadChild<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -4051,9 +3263,6 @@ impl<'a> Serialize for JSXSpreadChild<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type JSXSpreadChild = ({\n\ttype: 'JSXSpreadChild';\n\texpression: Expression;\n}) & Span;"; - impl<'a> Serialize for JSXText<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -4063,7 +3272,3 @@ impl<'a> Serialize for JSXText<'a> { map.end() } } - -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type JSXText = ({\n\ttype: 'JSXText';\n\tvalue: string;\n}) & Span;"; diff --git a/crates/oxc_regular_expression/src/generated/derive_estree.rs b/crates/oxc_regular_expression/src/generated/derive_estree.rs index 3e744dc59b825..4303e708af996 100644 --- a/crates/oxc_regular_expression/src/generated/derive_estree.rs +++ b/crates/oxc_regular_expression/src/generated/derive_estree.rs @@ -18,10 +18,6 @@ impl<'a> Serialize for Pattern<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type Pattern = ({\n\ttype: 'Pattern';\n\tbody: Disjunction;\n}) & Span;"; - impl<'a> Serialize for Disjunction<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -32,10 +28,6 @@ impl<'a> Serialize for Disjunction<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type Disjunction = ({\n\ttype: 'Disjunction';\n\tbody: Array;\n}) & Span;"; - impl<'a> Serialize for Alternative<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -46,10 +38,6 @@ impl<'a> Serialize for Alternative<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type Alternative = ({\n\ttype: 'Alternative';\n\tbody: Array;\n}) & Span;"; - impl<'a> Serialize for Term<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -69,9 +57,6 @@ impl<'a> Serialize for Term<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type Term = BoundaryAssertion | LookAroundAssertion | Quantifier | Character | Dot | CharacterClassEscape | UnicodePropertyEscape | CharacterClass | CapturingGroup | IgnoreGroup | IndexedReference | NamedReference;"; - impl Serialize for BoundaryAssertion { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -82,9 +67,6 @@ impl Serialize for BoundaryAssertion { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type BoundaryAssertion = ({\n\ttype: 'BoundaryAssertion';\n\tspan: Span;\n\tkind: BoundaryAssertionKind;\n});"; - impl Serialize for BoundaryAssertionKind { fn serialize(&self, serializer: S) -> Result { match *self { @@ -104,10 +86,6 @@ impl Serialize for BoundaryAssertionKind { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type BoundaryAssertionKind = 'start' | 'end' | 'boundary' | 'negativeBoundary';"; - impl<'a> Serialize for LookAroundAssertion<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -119,9 +97,6 @@ impl<'a> Serialize for LookAroundAssertion<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type LookAroundAssertion = ({\n\ttype: 'LookAroundAssertion';\n\tkind: LookAroundAssertionKind;\n\tbody: Disjunction;\n}) & Span;"; - impl Serialize for LookAroundAssertionKind { fn serialize(&self, serializer: S) -> Result { match *self { @@ -145,9 +120,6 @@ impl Serialize for LookAroundAssertionKind { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type LookAroundAssertionKind = 'lookahead' | 'negativeLookahead' | 'lookbehind' | 'negativeLookbehind';"; - impl<'a> Serialize for Quantifier<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -161,9 +133,6 @@ impl<'a> Serialize for Quantifier<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type Quantifier = ({\n\ttype: 'Quantifier';\n\tmin: number;\n\tmax: (number) | null;\n\tgreedy: boolean;\n\tbody: Term;\n}) & Span;"; - impl Serialize for Character { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -175,9 +144,6 @@ impl Serialize for Character { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type Character = ({\n\ttype: 'Character';\n\tkind: CharacterKind;\n\tvalue: number;\n}) & Span;"; - impl Serialize for CharacterKind { fn serialize(&self, serializer: S) -> Result { match *self { @@ -213,9 +179,6 @@ impl Serialize for CharacterKind { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type CharacterKind = 'controlLetter' | 'hexadecimalEscape' | 'identifier' | 'null' | 'octal1' | 'octal2' | 'octal3' | 'singleEscape' | 'symbol' | 'unicodeEscape';"; - impl Serialize for CharacterClassEscape { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -226,9 +189,6 @@ impl Serialize for CharacterClassEscape { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type CharacterClassEscape = ({\n\ttype: 'CharacterClassEscape';\n\tkind: CharacterClassEscapeKind;\n}) & Span;"; - impl Serialize for CharacterClassEscapeKind { fn serialize(&self, serializer: S) -> Result { match *self { @@ -254,9 +214,6 @@ impl Serialize for CharacterClassEscapeKind { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type CharacterClassEscapeKind = 'd' | 'negativeD' | 's' | 'negativeS' | 'w' | 'negativeW';"; - impl<'a> Serialize for UnicodePropertyEscape<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -270,9 +227,6 @@ impl<'a> Serialize for UnicodePropertyEscape<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type UnicodePropertyEscape = ({\n\ttype: 'UnicodePropertyEscape';\n\tnegative: boolean;\n\tstrings: boolean;\n\tname: string;\n\tvalue: (string) | null;\n}) & Span;"; - impl Serialize for Dot { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -282,9 +236,6 @@ impl Serialize for Dot { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type Dot = ({\n\ttype: 'Dot';\n}) & Span;"; - impl<'a> Serialize for CharacterClass<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -298,9 +249,6 @@ impl<'a> Serialize for CharacterClass<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type CharacterClass = ({\n\ttype: 'CharacterClass';\n\tnegative: boolean;\n\tstrings: boolean;\n\tkind: CharacterClassContentsKind;\n\tbody: Array;\n}) & Span;"; - impl Serialize for CharacterClassContentsKind { fn serialize(&self, serializer: S) -> Result { match *self { @@ -319,10 +267,6 @@ impl Serialize for CharacterClassContentsKind { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type CharacterClassContentsKind = 'union' | 'intersection' | 'subtraction';"; - impl<'a> Serialize for CharacterClassContents<'a> { fn serialize(&self, serializer: S) -> Result { match self { @@ -338,9 +282,6 @@ impl<'a> Serialize for CharacterClassContents<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type CharacterClassContents = CharacterClassRange | CharacterClassEscape | UnicodePropertyEscape | Character | CharacterClass | ClassStringDisjunction;"; - impl Serialize for CharacterClassRange { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -352,9 +293,6 @@ impl Serialize for CharacterClassRange { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type CharacterClassRange = ({\n\ttype: 'CharacterClassRange';\n\tmin: Character;\n\tmax: Character;\n}) & Span;"; - impl<'a> Serialize for ClassStringDisjunction<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -366,9 +304,6 @@ impl<'a> Serialize for ClassStringDisjunction<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ClassStringDisjunction = ({\n\ttype: 'ClassStringDisjunction';\n\tstrings: boolean;\n\tbody: Array;\n}) & Span;"; - impl<'a> Serialize for ClassString<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -380,9 +315,6 @@ impl<'a> Serialize for ClassString<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type ClassString = ({\n\ttype: 'ClassString';\n\tstrings: boolean;\n\tbody: Array;\n}) & Span;"; - impl<'a> Serialize for CapturingGroup<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -394,9 +326,6 @@ impl<'a> Serialize for CapturingGroup<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type CapturingGroup = ({\n\ttype: 'CapturingGroup';\n\tname: (string) | null;\n\tbody: Disjunction;\n}) & Span;"; - impl<'a> Serialize for IgnoreGroup<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -408,9 +337,6 @@ impl<'a> Serialize for IgnoreGroup<'a> { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type IgnoreGroup = ({\n\ttype: 'IgnoreGroup';\n\tmodifiers: (Modifiers) | null;\n\tbody: Disjunction;\n}) & Span;"; - impl Serialize for Modifiers { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -422,9 +348,6 @@ impl Serialize for Modifiers { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type Modifiers = ({\n\ttype: 'Modifiers';\n\tenabling: (Modifier) | null;\n\tdisabling: (Modifier) | null;\n}) & Span;"; - impl Serialize for Modifier { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -436,9 +359,6 @@ impl Serialize for Modifier { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type Modifier = ({\n\ttype: 'Modifier';\n\tignoreCase: boolean;\n\tmultiline: boolean;\n\tsticky: boolean;\n});"; - impl Serialize for IndexedReference { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -449,10 +369,6 @@ impl Serialize for IndexedReference { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type IndexedReference = ({\n\ttype: 'IndexedReference';\n\tindex: number;\n}) & Span;"; - impl<'a> Serialize for NamedReference<'a> { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -462,7 +378,3 @@ impl<'a> Serialize for NamedReference<'a> { map.end() } } - -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type NamedReference = ({\n\ttype: 'NamedReference';\n\tname: string;\n}) & Span;"; diff --git a/crates/oxc_span/src/generated/derive_estree.rs b/crates/oxc_span/src/generated/derive_estree.rs index 0350cbbfcdbf7..9009da579fb76 100644 --- a/crates/oxc_span/src/generated/derive_estree.rs +++ b/crates/oxc_span/src/generated/derive_estree.rs @@ -20,10 +20,6 @@ impl Serialize for Span { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type Span = ({\n\tstart: number;\n\tend: number;\n});"; - impl Serialize for SourceType { fn serialize(&self, serializer: S) -> Result { let mut map = serializer.serialize_map(None)?; @@ -34,9 +30,6 @@ impl Serialize for SourceType { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type SourceType = ({\n\tlanguage: Language;\n\tmoduleKind: ModuleKind;\n\tvariant: LanguageVariant;\n});"; - impl Serialize for Language { fn serialize(&self, serializer: S) -> Result { match *self { @@ -53,10 +46,6 @@ impl Serialize for Language { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type Language = 'javascript' | 'typescript' | 'typescriptDefinition';"; - impl Serialize for ModuleKind { fn serialize(&self, serializer: S) -> Result { match *self { @@ -69,10 +58,6 @@ impl Serialize for ModuleKind { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type ModuleKind = 'script' | 'module' | 'unambiguous';"; - impl Serialize for LanguageVariant { fn serialize(&self, serializer: S) -> Result { match *self { @@ -85,6 +70,3 @@ impl Serialize for LanguageVariant { } } } - -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type LanguageVariant = 'standard' | 'jsx';"; diff --git a/crates/oxc_syntax/src/generated/derive_estree.rs b/crates/oxc_syntax/src/generated/derive_estree.rs index f7c5997d4ecd5..1a21d445d7c3e 100644 --- a/crates/oxc_syntax/src/generated/derive_estree.rs +++ b/crates/oxc_syntax/src/generated/derive_estree.rs @@ -63,9 +63,6 @@ impl Serialize for AssignmentOperator { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type AssignmentOperator = '=' | '+=' | '-=' | '*=' | '/=' | '%=' | '<<=' | '>>=' | '>>>=' | '|=' | '^=' | '&=' | '&&=' | '||=' | '??=' | '**=';"; - impl Serialize for BinaryOperator { fn serialize(&self, serializer: S) -> Result { match *self { @@ -137,9 +134,6 @@ impl Serialize for BinaryOperator { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type BinaryOperator = '==' | '!=' | '===' | '!==' | '<' | '<=' | '>' | '>=' | '<<' | '>>' | '>>>' | '+' | '-' | '*' | '/' | '%' | '|' | '^' | '&' | 'in' | 'instanceof' | '**';"; - impl Serialize for LogicalOperator { fn serialize(&self, serializer: S) -> Result { match *self { @@ -154,9 +148,6 @@ impl Serialize for LogicalOperator { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type LogicalOperator = '||' | '&&' | '??';"; - impl Serialize for UnaryOperator { fn serialize(&self, serializer: S) -> Result { match *self { @@ -183,10 +174,6 @@ impl Serialize for UnaryOperator { } } -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = - "export type UnaryOperator = '-' | '+' | '!' | '~' | 'typeof' | 'void' | 'delete';"; - impl Serialize for UpdateOperator { fn serialize(&self, serializer: S) -> Result { match *self { @@ -199,6 +186,3 @@ impl Serialize for UpdateOperator { } } } - -#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] -const TS_APPEND_CONTENT: &'static str = "export type UpdateOperator = '++' | '--';"; diff --git a/tasks/ast_tools/src/derives/estree.rs b/tasks/ast_tools/src/derives/estree.rs index 57e6647fba2c1..8eabaa5f69a2c 100644 --- a/tasks/ast_tools/src/derives/estree.rs +++ b/tasks/ast_tools/src/derives/estree.rs @@ -1,5 +1,4 @@ use convert_case::{Case, Casing}; -use itertools::Itertools; use proc_macro2::TokenStream; use quote::quote; @@ -9,7 +8,7 @@ use crate::{ markers::ESTreeStructAttribute, schema::{ serialize::{enum_variant_name, get_type_tag}, - EnumDef, GetGenerics, GetIdent, StructDef, TypeDef, TypeName, + EnumDef, GetGenerics, GetIdent, StructDef, TypeDef, }, }; @@ -23,19 +22,6 @@ impl Derive for DeriveESTree { } fn derive(&mut self, def: &TypeDef, _: &LateCtx) -> TokenStream { - let ts_type_def = match def { - TypeDef::Enum(def) => typescript_enum(def), - TypeDef::Struct(def) => Some(typescript_struct(def)), - }; - let ts_type_def = if let Some(ts_type_def) = ts_type_def { - quote! { - #[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] - const TS_APPEND_CONTENT: &'static str = #ts_type_def; - } - } else { - TokenStream::new() - }; - if let TypeDef::Struct(def) = def { if def .markers @@ -43,7 +29,7 @@ impl Derive for DeriveESTree { .as_ref() .is_some_and(|e| e == &ESTreeStructAttribute::CustomSerialize) { - return ts_type_def; + return TokenStream::new(); } } @@ -60,9 +46,6 @@ impl Derive for DeriveESTree { #body } } - - ///@@line_break - #ts_type_def } } @@ -167,72 +150,3 @@ fn serialize_enum(def: &EnumDef) -> TokenStream { } } } - -// Untagged enums: "type Expression = BooleanLiteral | NullLiteral" -// Tagged enums: "type PropertyKind = 'init' | 'get' | 'set'" -fn typescript_enum(def: &EnumDef) -> Option { - if def.markers.estree.custom_ts_def { - return None; - } - - let union = if def.markers.estree.untagged { - def.all_variants().map(|var| type_to_string(var.fields[0].typ.name())).join(" | ") - } else { - def.all_variants().map(|var| format!("'{}'", enum_variant_name(var, def))).join(" | ") - }; - let ident = def.ident(); - Some(format!("export type {ident} = {union};")) -} - -fn typescript_struct(def: &StructDef) -> String { - let ident = def.ident(); - let mut fields = String::new(); - let mut extends = vec![]; - - if let Some(type_tag) = get_type_tag(def) { - fields.push_str(&format!("\n\ttype: '{type_tag}';")); - } - - for field in &def.fields { - if field.markers.derive_attributes.estree.skip { - continue; - } - let ty = match &field.markers.derive_attributes.tsify_type { - Some(ty) => ty.clone(), - None => type_to_string(field.typ.name()), - }; - - if field.markers.derive_attributes.estree.flatten { - extends.push(ty); - continue; - } - - let name = match &field.markers.derive_attributes.estree.rename { - Some(rename) => rename.to_string(), - None => field.name.clone().unwrap().to_case(Case::Camel), - }; - - fields.push_str(&format!("\n\t{name}: {ty};")); - } - let extends = - if extends.is_empty() { String::new() } else { format!(" & {}", extends.join(" & ")) }; - format!("export type {ident} = ({{{fields}\n}}){extends};") -} - -fn type_to_string(ty: &TypeName) -> String { - match ty { - TypeName::Ident(ident) => match ident.as_str() { - "f64" | "f32" | "usize" | "u64" | "u32" | "u16" | "u8" | "i64" | "i32" | "i16" - | "i8" => "number", - "bool" => "boolean", - "str" | "String" | "Atom" | "CompactStr" => "string", - ty => ty, - } - .to_string(), - TypeName::Vec(type_name) => format!("Array<{}>", type_to_string(type_name)), - TypeName::Box(type_name) | TypeName::Ref(type_name) | TypeName::Complex(type_name) => { - type_to_string(type_name) - } - TypeName::Opt(type_name) => format!("({}) | null", type_to_string(type_name)), - } -}