mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
refactor(ast): import Tsify to shorten code (#2665)
Pure refactor. Import `tsify::Tsify` in files that use it, so then shorten a load of: ```diff - #[cfg_attr(feature = "wasm", derive(tsify::Tsify))] + #[cfg_attr(feature = "wasm", derive(Tsify))] ```
This commit is contained in:
parent
d47f0e247d
commit
cba1e2f338
9 changed files with 267 additions and 249 deletions
|
|
@ -11,6 +11,8 @@ use oxc_syntax::{
|
|||
};
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::Serialize;
|
||||
#[cfg(feature = "wasm")]
|
||||
use tsify::Tsify;
|
||||
|
||||
use super::{jsx::*, literal::*, ts::*};
|
||||
|
||||
|
|
@ -33,7 +35,7 @@ export interface FormalParameterRest extends Span {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct Program<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -58,7 +60,7 @@ impl<'a> Program<'a> {
|
|||
/// Expression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum Expression<'a> {
|
||||
BooleanLiteral(Box<'a, BooleanLiteral>),
|
||||
NullLiteral(Box<'a, NullLiteral>),
|
||||
|
|
@ -390,7 +392,7 @@ pub struct LabelIdentifier<'a> {
|
|||
/// This Expression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ThisExpression {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -399,7 +401,7 @@ pub struct ThisExpression {
|
|||
/// <https://tc39.es/ecma262/#prod-ArrayLiteral>
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ArrayExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -412,7 +414,7 @@ pub struct ArrayExpression<'a> {
|
|||
/// Array Expression Element
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum ArrayExpressionElement<'a> {
|
||||
SpreadElement(Box<'a, SpreadElement<'a>>),
|
||||
Expression(Expression<'a>),
|
||||
|
|
@ -430,7 +432,7 @@ impl<'a> ArrayExpressionElement<'a> {
|
|||
/// Object Expression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ObjectExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -447,7 +449,7 @@ impl<'a> ObjectExpression<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum ObjectPropertyKind<'a> {
|
||||
ObjectProperty(Box<'a, ObjectProperty<'a>>),
|
||||
SpreadProperty(Box<'a, SpreadElement<'a>>),
|
||||
|
|
@ -455,7 +457,7 @@ pub enum ObjectPropertyKind<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ObjectProperty<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -470,7 +472,7 @@ pub struct ObjectProperty<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum PropertyKey<'a> {
|
||||
Identifier(Box<'a, IdentifierName<'a>>),
|
||||
PrivateIdentifier(Box<'a, PrivateIdentifier<'a>>),
|
||||
|
|
@ -543,7 +545,7 @@ impl<'a> PropertyKey<'a> {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "lowercase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum PropertyKind {
|
||||
Init,
|
||||
Get,
|
||||
|
|
@ -555,7 +557,7 @@ pub enum PropertyKind {
|
|||
/// This is interpreted by interleaving the expression elements in between the quasi elements.
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TemplateLiteral<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -576,7 +578,7 @@ impl<'a> TemplateLiteral<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TaggedTemplateExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -587,7 +589,7 @@ pub struct TaggedTemplateExpression<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TemplateElement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -598,7 +600,7 @@ pub struct TemplateElement<'a> {
|
|||
/// See [template-strings-cooked-vs-raw](https://exploringjs.com/impatient-js/ch_template-literals.html#template-strings-cooked-vs-raw)
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TemplateElementValue<'a> {
|
||||
/// A raw interpretation where backslashes do not have special meaning.
|
||||
/// For example, \t produces two characters – a backslash and a t.
|
||||
|
|
@ -614,7 +616,7 @@ pub struct TemplateElementValue<'a> {
|
|||
/// <https://tc39.es/ecma262/#prod-MemberExpression>
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum MemberExpression<'a> {
|
||||
/// `MemberExpression[?Yield, ?Await] [ Expression[+In, ?Yield, ?Await] ]`
|
||||
ComputedMemberExpression(ComputedMemberExpression<'a>),
|
||||
|
|
@ -709,7 +711,7 @@ impl<'a> MemberExpression<'a> {
|
|||
/// `MemberExpression[?Yield, ?Await] [ Expression[+In, ?Yield, ?Await] ]`
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ComputedMemberExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -721,7 +723,7 @@ pub struct ComputedMemberExpression<'a> {
|
|||
/// `MemberExpression[?Yield, ?Await] . IdentifierName`
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct StaticMemberExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -733,7 +735,7 @@ pub struct StaticMemberExpression<'a> {
|
|||
/// `MemberExpression[?Yield, ?Await] . PrivateIdentifier`
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct PrivateFieldExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -745,7 +747,7 @@ pub struct PrivateFieldExpression<'a> {
|
|||
/// Call Expression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct CallExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -799,7 +801,7 @@ impl<'a> CallExpression<'a> {
|
|||
/// New Expression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct NewExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -811,7 +813,7 @@ pub struct NewExpression<'a> {
|
|||
/// Meta Property `new.target` | `import.meta`
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct MetaProperty<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -822,7 +824,7 @@ pub struct MetaProperty<'a> {
|
|||
/// Spread Element
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct SpreadElement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -832,7 +834,7 @@ pub struct SpreadElement<'a> {
|
|||
/// Argument
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum Argument<'a> {
|
||||
SpreadElement(Box<'a, SpreadElement<'a>>),
|
||||
Expression(Expression<'a>),
|
||||
|
|
@ -847,7 +849,7 @@ impl Argument<'_> {
|
|||
/// Update Expression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct UpdateExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -859,7 +861,7 @@ pub struct UpdateExpression<'a> {
|
|||
/// Unary Expression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct UnaryExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -870,7 +872,7 @@ pub struct UnaryExpression<'a> {
|
|||
/// Binary Expression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct BinaryExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -882,7 +884,7 @@ pub struct BinaryExpression<'a> {
|
|||
/// Private Identifier in Shift Expression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct PrivateInExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -894,7 +896,7 @@ pub struct PrivateInExpression<'a> {
|
|||
/// Binary Logical Operators
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct LogicalExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -906,7 +908,7 @@ pub struct LogicalExpression<'a> {
|
|||
/// Conditional Expression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ConditionalExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -918,7 +920,7 @@ pub struct ConditionalExpression<'a> {
|
|||
/// Assignment Expression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct AssignmentExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -930,7 +932,7 @@ pub struct AssignmentExpression<'a> {
|
|||
/// Destructuring Assignment
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum AssignmentTarget<'a> {
|
||||
SimpleAssignmentTarget(SimpleAssignmentTarget<'a>),
|
||||
AssignmentTargetPattern(AssignmentTargetPattern<'a>),
|
||||
|
|
@ -955,7 +957,7 @@ impl<'a> AssignmentTarget<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum SimpleAssignmentTarget<'a> {
|
||||
AssignmentTargetIdentifier(Box<'a, IdentifierReference<'a>>),
|
||||
MemberAssignmentTarget(Box<'a, MemberExpression<'a>>),
|
||||
|
|
@ -979,7 +981,7 @@ impl<'a> SimpleAssignmentTarget<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum AssignmentTargetPattern<'a> {
|
||||
ArrayAssignmentTarget(Box<'a, ArrayAssignmentTarget<'a>>),
|
||||
ObjectAssignmentTarget(Box<'a, ObjectAssignmentTarget<'a>>),
|
||||
|
|
@ -987,7 +989,7 @@ pub enum AssignmentTargetPattern<'a> {
|
|||
|
||||
// See serializer in serialize.rs
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ArrayAssignmentTarget<'a> {
|
||||
#[cfg_attr(feature = "wasm", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1012,7 +1014,7 @@ impl<'a> ArrayAssignmentTarget<'a> {
|
|||
|
||||
// See serializer in serialize.rs
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ObjectAssignmentTarget<'a> {
|
||||
#[cfg_attr(feature = "wasm", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1053,7 +1055,7 @@ pub struct AssignmentTargetRest<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum AssignmentTargetMaybeDefault<'a> {
|
||||
AssignmentTarget(AssignmentTarget<'a>),
|
||||
AssignmentTargetWithDefault(Box<'a, AssignmentTargetWithDefault<'a>>),
|
||||
|
|
@ -1079,7 +1081,7 @@ impl<'a> AssignmentTargetMaybeDefault<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct AssignmentTargetWithDefault<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1089,7 +1091,7 @@ pub struct AssignmentTargetWithDefault<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum AssignmentTargetProperty<'a> {
|
||||
AssignmentTargetPropertyIdentifier(Box<'a, AssignmentTargetPropertyIdentifier<'a>>),
|
||||
AssignmentTargetPropertyProperty(Box<'a, AssignmentTargetPropertyProperty<'a>>),
|
||||
|
|
@ -1098,7 +1100,7 @@ pub enum AssignmentTargetProperty<'a> {
|
|||
/// Assignment Property - Identifier Reference
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct AssignmentTargetPropertyIdentifier<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1109,7 +1111,7 @@ pub struct AssignmentTargetPropertyIdentifier<'a> {
|
|||
/// Assignment Property - Property Name
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct AssignmentTargetPropertyProperty<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1120,7 +1122,7 @@ pub struct AssignmentTargetPropertyProperty<'a> {
|
|||
/// Sequence Expression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct SequenceExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1129,7 +1131,7 @@ pub struct SequenceExpression<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct Super {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1138,7 +1140,7 @@ pub struct Super {
|
|||
/// Await Expression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct AwaitExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1147,7 +1149,7 @@ pub struct AwaitExpression<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ChainExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1156,7 +1158,7 @@ pub struct ChainExpression<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum ChainElement<'a> {
|
||||
CallExpression(Box<'a, CallExpression<'a>>),
|
||||
MemberExpression(Box<'a, MemberExpression<'a>>),
|
||||
|
|
@ -1165,7 +1167,7 @@ pub enum ChainElement<'a> {
|
|||
/// Parenthesized Expression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ParenthesizedExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1175,7 +1177,7 @@ pub struct ParenthesizedExpression<'a> {
|
|||
/// Statements
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum Statement<'a> {
|
||||
// Statements
|
||||
BlockStatement(Box<'a, BlockStatement<'a>>),
|
||||
|
|
@ -1217,7 +1219,7 @@ impl<'a> Statement<'a> {
|
|||
/// Directive Prologue
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct Directive<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1231,7 +1233,7 @@ pub struct Directive<'a> {
|
|||
/// Hashbang
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct Hashbang<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1241,7 +1243,7 @@ pub struct Hashbang<'a> {
|
|||
/// Block Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct BlockStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1251,7 +1253,7 @@ pub struct BlockStatement<'a> {
|
|||
/// Declarations and the Variable Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum Declaration<'a> {
|
||||
VariableDeclaration(Box<'a, VariableDeclaration<'a>>),
|
||||
FunctionDeclaration(Box<'a, Function<'a>>),
|
||||
|
|
@ -1291,7 +1293,7 @@ impl<'a> Declaration<'a> {
|
|||
/// Variable Declaration
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct VariableDeclaration<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1309,7 +1311,7 @@ impl<'a> VariableDeclaration<'a> {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "lowercase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum VariableDeclarationKind {
|
||||
Var,
|
||||
Const,
|
||||
|
|
@ -1347,7 +1349,7 @@ impl fmt::Display for VariableDeclarationKind {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct VariableDeclarator<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1362,7 +1364,7 @@ pub struct VariableDeclarator<'a> {
|
|||
/// * <https://github.com/tc39/proposal-explicit-resource-management>
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct UsingDeclaration<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1374,7 +1376,7 @@ pub struct UsingDeclaration<'a> {
|
|||
/// Empty Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct EmptyStatement {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1383,7 +1385,7 @@ pub struct EmptyStatement {
|
|||
/// Expression Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ExpressionStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1393,7 +1395,7 @@ pub struct ExpressionStatement<'a> {
|
|||
/// If Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct IfStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1405,7 +1407,7 @@ pub struct IfStatement<'a> {
|
|||
/// Do-While Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct DoWhileStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1416,7 +1418,7 @@ pub struct DoWhileStatement<'a> {
|
|||
/// While Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct WhileStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1427,7 +1429,7 @@ pub struct WhileStatement<'a> {
|
|||
/// For Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ForStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1439,7 +1441,7 @@ pub struct ForStatement<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum ForStatementInit<'a> {
|
||||
VariableDeclaration(Box<'a, VariableDeclaration<'a>>),
|
||||
Expression(Expression<'a>),
|
||||
|
|
@ -1464,7 +1466,7 @@ impl<'a> ForStatementInit<'a> {
|
|||
/// For-In Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ForInStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1476,7 +1478,7 @@ pub struct ForInStatement<'a> {
|
|||
/// For-Of Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ForOfStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1488,7 +1490,7 @@ pub struct ForOfStatement<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum ForStatementLeft<'a> {
|
||||
VariableDeclaration(Box<'a, VariableDeclaration<'a>>),
|
||||
AssignmentTarget(AssignmentTarget<'a>),
|
||||
|
|
@ -1506,7 +1508,7 @@ impl<'a> ForStatementLeft<'a> {
|
|||
/// Continue Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ContinueStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1516,7 +1518,7 @@ pub struct ContinueStatement<'a> {
|
|||
/// Break Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct BreakStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1526,7 +1528,7 @@ pub struct BreakStatement<'a> {
|
|||
/// Return Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ReturnStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1536,7 +1538,7 @@ pub struct ReturnStatement<'a> {
|
|||
/// With Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct WithStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1547,7 +1549,7 @@ pub struct WithStatement<'a> {
|
|||
/// Switch Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct SwitchStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1557,7 +1559,7 @@ pub struct SwitchStatement<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct SwitchCase<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1574,7 +1576,7 @@ impl<'a> SwitchCase<'a> {
|
|||
/// Labelled Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct LabeledStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1585,7 +1587,7 @@ pub struct LabeledStatement<'a> {
|
|||
/// Throw Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ThrowStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1595,7 +1597,7 @@ pub struct ThrowStatement<'a> {
|
|||
/// Try Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TryStatement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1606,7 +1608,7 @@ pub struct TryStatement<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct CatchClause<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1617,7 +1619,7 @@ pub struct CatchClause<'a> {
|
|||
/// Debugger Statement
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct DebuggerStatement {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1627,7 +1629,7 @@ pub struct DebuggerStatement {
|
|||
/// * <https://tc39.es/ecma262/#prod-BindingPattern>
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct BindingPattern<'a> {
|
||||
// Flatten the attributes because estree has no `BindingPattern`
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
|
|
@ -1648,7 +1650,7 @@ impl<'a> BindingPattern<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum BindingPatternKind<'a> {
|
||||
/// `const a = 1`
|
||||
BindingIdentifier(Box<'a, BindingIdentifier<'a>>),
|
||||
|
|
@ -1679,7 +1681,7 @@ impl<'a> BindingPatternKind<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct AssignmentPattern<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1689,7 +1691,7 @@ pub struct AssignmentPattern<'a> {
|
|||
|
||||
// See serializer in serialize.rs
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ObjectPattern<'a> {
|
||||
#[cfg_attr(feature = "wasm", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1711,7 +1713,7 @@ impl<'a> ObjectPattern<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct BindingProperty<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1723,7 +1725,7 @@ pub struct BindingProperty<'a> {
|
|||
|
||||
// See serializer in serialize.rs
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ArrayPattern<'a> {
|
||||
#[cfg_attr(feature = "wasm", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1757,7 +1759,7 @@ pub struct BindingRestElement<'a> {
|
|||
/// Function Definitions
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct Function<'a> {
|
||||
pub r#type: FunctionType,
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
|
|
@ -1821,7 +1823,7 @@ impl<'a> Function<'a> {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum FunctionType {
|
||||
FunctionDeclaration,
|
||||
FunctionExpression,
|
||||
|
|
@ -1833,7 +1835,7 @@ pub enum FunctionType {
|
|||
/// <https://tc39.es/ecma262/#prod-FormalParameters>
|
||||
// See serializer in serialize.rs
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct FormalParameters<'a> {
|
||||
#[cfg_attr(feature = "wasm", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1852,7 +1854,7 @@ impl<'a> FormalParameters<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct FormalParameter<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1865,7 +1867,7 @@ pub struct FormalParameter<'a> {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum FormalParameterKind {
|
||||
/// <https://tc39.es/ecma262/#prod-FormalParameters>
|
||||
FormalParameter,
|
||||
|
|
@ -1892,7 +1894,7 @@ impl<'a> FormalParameters<'a> {
|
|||
/// <https://tc39.es/ecma262/#prod-FunctionBody>
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct FunctionBody<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1909,7 +1911,7 @@ impl<'a> FunctionBody<'a> {
|
|||
/// Arrow Function Definitions
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ArrowFunctionExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1939,7 +1941,7 @@ impl<'a> ArrowFunctionExpression<'a> {
|
|||
/// Generator Function Definitions
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct YieldExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1950,7 +1952,7 @@ pub struct YieldExpression<'a> {
|
|||
/// Class Definitions
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct Class<'a> {
|
||||
pub r#type: ClassType,
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
|
|
@ -1986,7 +1988,7 @@ impl<'a> Class<'a> {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum ClassType {
|
||||
ClassDeclaration,
|
||||
ClassExpression,
|
||||
|
|
@ -1994,7 +1996,7 @@ pub enum ClassType {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ClassBody<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -2003,7 +2005,7 @@ pub struct ClassBody<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum ClassElement<'a> {
|
||||
StaticBlock(Box<'a, StaticBlock<'a>>),
|
||||
MethodDefinition(Box<'a, MethodDefinition<'a>>),
|
||||
|
|
@ -2104,7 +2106,7 @@ impl<'a> ClassElement<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct MethodDefinition<'a> {
|
||||
pub r#type: MethodDefinitionType,
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
|
|
@ -2122,7 +2124,7 @@ pub struct MethodDefinition<'a> {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum MethodDefinitionType {
|
||||
MethodDefinition,
|
||||
TSAbstractMethodDefinition,
|
||||
|
|
@ -2130,7 +2132,7 @@ pub enum MethodDefinitionType {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct PropertyDefinition<'a> {
|
||||
pub r#type: PropertyDefinitionType,
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
|
|
@ -2151,7 +2153,7 @@ pub struct PropertyDefinition<'a> {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum PropertyDefinitionType {
|
||||
PropertyDefinition,
|
||||
TSAbstractPropertyDefinition,
|
||||
|
|
@ -2159,7 +2161,7 @@ pub enum PropertyDefinitionType {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "lowercase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum MethodDefinitionKind {
|
||||
Constructor,
|
||||
Method,
|
||||
|
|
@ -2181,7 +2183,7 @@ impl MethodDefinitionKind {
|
|||
|
||||
#[derive(Debug, Clone, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct PrivateIdentifier<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -2196,7 +2198,7 @@ impl<'a> PrivateIdentifier<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct StaticBlock<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -2205,7 +2207,7 @@ pub struct StaticBlock<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum ModuleDeclaration<'a> {
|
||||
/// import hello from './world.js';
|
||||
/// import * as t from './world.js';
|
||||
|
|
@ -2269,7 +2271,7 @@ impl<'a> ModuleDeclaration<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct AccessorProperty<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -2282,7 +2284,7 @@ pub struct AccessorProperty<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ImportExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -2292,7 +2294,7 @@ pub struct ImportExpression<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ImportDeclaration<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -2307,7 +2309,7 @@ pub struct ImportDeclaration<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum ImportDeclarationSpecifier<'a> {
|
||||
/// import {imported} from "source"
|
||||
/// import {imported as local} from "source"
|
||||
|
|
@ -2322,7 +2324,7 @@ pub enum ImportDeclarationSpecifier<'a> {
|
|||
// import {imported as local} from "source"
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ImportSpecifier<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -2334,7 +2336,7 @@ pub struct ImportSpecifier<'a> {
|
|||
// import local from "source"
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ImportDefaultSpecifier<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -2344,7 +2346,7 @@ pub struct ImportDefaultSpecifier<'a> {
|
|||
// import * as local from "source"
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ImportNamespaceSpecifier<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -2353,7 +2355,7 @@ pub struct ImportNamespaceSpecifier<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct WithClause<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -2363,7 +2365,7 @@ pub struct WithClause<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ImportAttribute<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -2373,7 +2375,7 @@ pub struct ImportAttribute<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum ImportAttributeKey<'a> {
|
||||
Identifier(IdentifierName<'a>),
|
||||
StringLiteral(StringLiteral<'a>),
|
||||
|
|
@ -2390,7 +2392,7 @@ impl<'a> ImportAttributeKey<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ExportNamedDeclaration<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -2416,7 +2418,7 @@ impl<'a> ExportNamedDeclaration<'a> {
|
|||
/// export default AssignmentExpression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ExportDefaultDeclaration<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -2432,7 +2434,7 @@ impl<'a> ExportDefaultDeclaration<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ExportAllDeclaration<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -2450,7 +2452,7 @@ impl<'a> ExportAllDeclaration<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct ExportSpecifier<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -2467,7 +2469,7 @@ impl<'a> ExportSpecifier<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum ExportDefaultDeclarationKind<'a> {
|
||||
Expression(Expression<'a>),
|
||||
FunctionDeclaration(Box<'a, Function<'a>>),
|
||||
|
|
@ -2497,7 +2499,7 @@ impl<'a> ExportDefaultDeclarationKind<'a> {
|
|||
/// * <https://github.com/tc39/ecma262/pull/2154>
|
||||
#[derive(Debug, Clone, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum ModuleExportName<'a> {
|
||||
Identifier(IdentifierName<'a>),
|
||||
StringLiteral(StringLiteral<'a>),
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ use oxc_allocator::{Box, Vec};
|
|||
use oxc_span::{Atom, Span};
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::Serialize;
|
||||
#[cfg(feature = "wasm")]
|
||||
use tsify::Tsify;
|
||||
|
||||
use super::{js::*, literal::*, ts::*};
|
||||
|
||||
|
|
@ -12,7 +14,7 @@ use super::{js::*, literal::*, ts::*};
|
|||
/// JSX Element
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSXElement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -24,7 +26,7 @@ pub struct JSXElement<'a> {
|
|||
/// JSX Opening Element
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSXOpeningElement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -37,7 +39,7 @@ pub struct JSXOpeningElement<'a> {
|
|||
/// JSX Closing Element
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSXClosingElement<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -47,7 +49,7 @@ pub struct JSXClosingElement<'a> {
|
|||
/// JSX Fragment
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSXFragment<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -58,7 +60,7 @@ pub struct JSXFragment<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSXOpeningFragment {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -66,7 +68,7 @@ pub struct JSXOpeningFragment {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSXClosingFragment {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -75,7 +77,7 @@ pub struct JSXClosingFragment {
|
|||
/// JSX Element Name
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum JSXElementName<'a> {
|
||||
/// `<Apple />`
|
||||
Identifier(JSXIdentifier<'a>),
|
||||
|
|
@ -88,7 +90,7 @@ pub enum JSXElementName<'a> {
|
|||
/// JSX Namespaced Name
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSXNamespacedName<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -105,7 +107,7 @@ impl<'a> std::fmt::Display for JSXNamespacedName<'a> {
|
|||
/// JSX Member Expression
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSXMemberExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -124,7 +126,7 @@ impl<'a> JSXMemberExpression<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum JSXMemberExpressionObject<'a> {
|
||||
Identifier(JSXIdentifier<'a>),
|
||||
MemberExpression(Box<'a, JSXMemberExpression<'a>>),
|
||||
|
|
@ -132,7 +134,7 @@ pub enum JSXMemberExpressionObject<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSXExpressionContainer<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -141,7 +143,7 @@ pub struct JSXExpressionContainer<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum JSXExpression<'a> {
|
||||
Expression(Expression<'a>),
|
||||
EmptyExpression(JSXEmptyExpression),
|
||||
|
|
@ -149,7 +151,7 @@ pub enum JSXExpression<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSXEmptyExpression {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -160,7 +162,7 @@ pub struct JSXEmptyExpression {
|
|||
/// JSX Attributes
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum JSXAttributeItem<'a> {
|
||||
Attribute(Box<'a, JSXAttribute<'a>>),
|
||||
SpreadAttribute(Box<'a, JSXSpreadAttribute<'a>>),
|
||||
|
|
@ -169,7 +171,7 @@ pub enum JSXAttributeItem<'a> {
|
|||
/// JSX Attribute
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSXAttribute<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -186,7 +188,7 @@ impl<'a> JSXAttribute<'a> {
|
|||
/// JSX Spread Attribute
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSXSpreadAttribute<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -196,7 +198,7 @@ pub struct JSXSpreadAttribute<'a> {
|
|||
/// JSX Attribute Name
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum JSXAttributeName<'a> {
|
||||
Identifier(JSXIdentifier<'a>),
|
||||
NamespacedName(Box<'a, JSXNamespacedName<'a>>),
|
||||
|
|
@ -205,7 +207,7 @@ pub enum JSXAttributeName<'a> {
|
|||
/// JSX Attribute Value
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum JSXAttributeValue<'a> {
|
||||
StringLiteral(StringLiteral<'a>),
|
||||
ExpressionContainer(JSXExpressionContainer<'a>),
|
||||
|
|
@ -215,7 +217,7 @@ pub enum JSXAttributeValue<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSXIdentifier<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -227,7 +229,7 @@ pub struct JSXIdentifier<'a> {
|
|||
/// JSX Child
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum JSXChild<'a> {
|
||||
Text(JSXText<'a>),
|
||||
Element(Box<'a, JSXElement<'a>>),
|
||||
|
|
@ -238,7 +240,7 @@ pub enum JSXChild<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSXSpreadChild<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -247,7 +249,7 @@ pub struct JSXSpreadChild<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSXText<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
|
|||
|
|
@ -10,10 +10,12 @@ use oxc_span::{Atom, Span};
|
|||
use oxc_syntax::{BigintBase, NumberBase};
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::Serialize;
|
||||
#[cfg(feature = "wasm")]
|
||||
use tsify::Tsify;
|
||||
|
||||
#[derive(Debug, Clone, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct BooleanLiteral {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -36,7 +38,7 @@ impl BooleanLiteral {
|
|||
|
||||
#[derive(Debug, Clone)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct NullLiteral {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -56,7 +58,7 @@ impl NullLiteral {
|
|||
|
||||
#[derive(Debug, Clone)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct NumericLiteral<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -107,7 +109,7 @@ impl<'a> Hash for NumericLiteral<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct BigIntLiteral<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -124,7 +126,7 @@ impl<'a> BigIntLiteral<'a> {
|
|||
|
||||
#[derive(Debug, Clone, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct RegExpLiteral<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -136,7 +138,7 @@ pub struct RegExpLiteral<'a> {
|
|||
|
||||
#[derive(Debug, Clone, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct RegExp<'a> {
|
||||
pub pattern: Atom<'a>,
|
||||
pub flags: RegExpFlags,
|
||||
|
|
@ -228,12 +230,12 @@ impl fmt::Display for RegExpFlags {
|
|||
|
||||
#[derive(Debug, Clone, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct EmptyObject;
|
||||
|
||||
#[derive(Debug, Clone, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct StringLiteral<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ use oxc_allocator::{Box, Vec};
|
|||
use oxc_span::{Atom, GetSpan, Span};
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::Serialize;
|
||||
#[cfg(feature = "wasm")]
|
||||
use tsify::Tsify;
|
||||
|
||||
use super::{js::*, literal::*};
|
||||
|
||||
|
|
@ -22,7 +24,7 @@ export interface TSIndexSignatureName extends Span {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSThisParameter<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -35,7 +37,7 @@ pub struct TSThisParameter<'a> {
|
|||
/// `const_opt` enum `BindingIdentifier` { `EnumBody_opt` }
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSEnumDeclaration<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -47,7 +49,7 @@ pub struct TSEnumDeclaration<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSEnumMember<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -57,7 +59,7 @@ pub struct TSEnumMember<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSEnumMemberName<'a> {
|
||||
Identifier(IdentifierName<'a>),
|
||||
StringLiteral(StringLiteral<'a>),
|
||||
|
|
@ -69,7 +71,7 @@ pub enum TSEnumMemberName<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSTypeAnnotation<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -78,7 +80,7 @@ pub struct TSTypeAnnotation<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSLiteralType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -87,7 +89,7 @@ pub struct TSLiteralType<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged, rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSLiteral<'a> {
|
||||
BooleanLiteral(Box<'a, BooleanLiteral>),
|
||||
NullLiteral(Box<'a, NullLiteral>),
|
||||
|
|
@ -101,7 +103,7 @@ pub enum TSLiteral<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged, rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSType<'a> {
|
||||
// Keyword
|
||||
TSAnyKeyword(Box<'a, TSAnyKeyword>),
|
||||
|
|
@ -165,7 +167,7 @@ impl<'a> TSType<'a> {
|
|||
/// <https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#handbook-content>
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSConditionalType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -180,7 +182,7 @@ pub struct TSConditionalType<'a> {
|
|||
/// <https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes-func.html#unions>
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSUnionType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -192,7 +194,7 @@ pub struct TSUnionType<'a> {
|
|||
/// <https://www.typescriptlang.org/docs/handbook/2/objects.html#intersection-types>
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSIntersectionType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -204,7 +206,7 @@ pub struct TSIntersectionType<'a> {
|
|||
/// <https://www.typescriptlang.org/docs/handbook/2/keyof-types.html>
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSTypeOperator<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -214,7 +216,7 @@ pub struct TSTypeOperator<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "lowercase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSTypeOperatorOperator {
|
||||
Keyof,
|
||||
Unique,
|
||||
|
|
@ -226,7 +228,7 @@ pub enum TSTypeOperatorOperator {
|
|||
/// <https://www.typescriptlang.org/docs/handbook/2/objects.html#the-array-type>
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSArrayType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -238,7 +240,7 @@ pub struct TSArrayType<'a> {
|
|||
/// <https://www.typescriptlang.org/docs/handbook/2/indexed-access-types.html#handbook-content>
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSIndexedAccessType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -251,7 +253,7 @@ pub struct TSIndexedAccessType<'a> {
|
|||
/// <https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types>
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSTupleType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -260,7 +262,7 @@ pub struct TSTupleType<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSNamedTupleMember<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -271,7 +273,7 @@ pub struct TSNamedTupleMember<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSOptionalType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -280,7 +282,7 @@ pub struct TSOptionalType<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSRestType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -289,7 +291,7 @@ pub struct TSRestType<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged, rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSTupleElement<'a> {
|
||||
TSType(TSType<'a>),
|
||||
TSOptionalType(Box<'a, TSOptionalType<'a>>),
|
||||
|
|
@ -299,7 +301,7 @@ pub enum TSTupleElement<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSAnyKeyword {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -307,7 +309,7 @@ pub struct TSAnyKeyword {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSStringKeyword {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -315,7 +317,7 @@ pub struct TSStringKeyword {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSBooleanKeyword {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -323,7 +325,7 @@ pub struct TSBooleanKeyword {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSNumberKeyword {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -331,7 +333,7 @@ pub struct TSNumberKeyword {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSNeverKeyword {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -339,7 +341,7 @@ pub struct TSNeverKeyword {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSUnknownKeyword {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -347,7 +349,7 @@ pub struct TSUnknownKeyword {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSNullKeyword {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -355,7 +357,7 @@ pub struct TSNullKeyword {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSUndefinedKeyword {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -363,7 +365,7 @@ pub struct TSUndefinedKeyword {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSVoidKeyword {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -371,7 +373,7 @@ pub struct TSVoidKeyword {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSSymbolKeyword {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -379,7 +381,7 @@ pub struct TSSymbolKeyword {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSThisType {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -387,7 +389,7 @@ pub struct TSThisType {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSObjectKeyword {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -395,7 +397,7 @@ pub struct TSObjectKeyword {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSBigIntKeyword {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -406,7 +408,7 @@ pub struct TSBigIntKeyword {
|
|||
/// type E = D.c.b.a;
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSTypeReference<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -419,7 +421,7 @@ pub struct TSTypeReference<'a> {
|
|||
/// NamespaceName . IdentifierReference
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSTypeName<'a> {
|
||||
IdentifierReference(Box<'a, IdentifierReference<'a>>),
|
||||
QualifiedName(Box<'a, TSQualifiedName<'a>>),
|
||||
|
|
@ -462,7 +464,7 @@ impl GetSpan for TSTypeName<'_> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSQualifiedName<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -472,7 +474,7 @@ pub struct TSQualifiedName<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSTypeParameterInstantiation<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -481,7 +483,7 @@ pub struct TSTypeParameterInstantiation<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSTypeParameter<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -495,7 +497,7 @@ pub struct TSTypeParameter<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSTypeParameterDeclaration<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -504,7 +506,7 @@ pub struct TSTypeParameterDeclaration<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSTypeAliasDeclaration<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -517,7 +519,7 @@ pub struct TSTypeAliasDeclaration<'a> {
|
|||
|
||||
#[derive(Debug, Hash, Clone, PartialEq, Eq, Copy)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "lowercase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSAccessibility {
|
||||
Private,
|
||||
Protected,
|
||||
|
|
@ -526,7 +528,7 @@ pub enum TSAccessibility {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSClassImplements<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -539,7 +541,7 @@ pub struct TSClassImplements<'a> {
|
|||
/// interface `BindingIdentifier` `TypeParameters_opt` `InterfaceExtendsClause_opt` `ObjectType`
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSInterfaceDeclaration<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -553,7 +555,7 @@ pub struct TSInterfaceDeclaration<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSInterfaceBody<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -562,7 +564,7 @@ pub struct TSInterfaceBody<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSPropertySignature<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -575,7 +577,7 @@ pub struct TSPropertySignature<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged, rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSSignature<'a> {
|
||||
TSIndexSignature(Box<'a, TSIndexSignature<'a>>),
|
||||
TSPropertySignature(Box<'a, TSPropertySignature<'a>>),
|
||||
|
|
@ -586,7 +588,7 @@ pub enum TSSignature<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSIndexSignature<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -597,7 +599,7 @@ pub struct TSIndexSignature<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSCallSignatureDeclaration<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -609,7 +611,7 @@ pub struct TSCallSignatureDeclaration<'a> {
|
|||
|
||||
#[derive(Debug, Clone, Copy, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "lowercase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSMethodSignatureKind {
|
||||
Method,
|
||||
Get,
|
||||
|
|
@ -618,7 +620,7 @@ pub enum TSMethodSignatureKind {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSMethodSignature<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -634,7 +636,7 @@ pub struct TSMethodSignature<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSConstructSignatureDeclaration<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -658,7 +660,7 @@ pub struct TSIndexSignatureName<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSInterfaceHeritage<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -668,7 +670,7 @@ pub struct TSInterfaceHeritage<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSTypePredicate<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -679,7 +681,7 @@ pub struct TSTypePredicate<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged, rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSTypePredicateName<'a> {
|
||||
Identifier(IdentifierName<'a>),
|
||||
This(TSThisType),
|
||||
|
|
@ -687,7 +689,7 @@ pub enum TSTypePredicateName<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSModuleDeclaration<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -709,7 +711,7 @@ pub struct TSModuleDeclaration<'a> {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "lowercase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSModuleDeclarationKind {
|
||||
Global,
|
||||
Module,
|
||||
|
|
@ -718,7 +720,7 @@ pub enum TSModuleDeclarationKind {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSModuleDeclarationName<'a> {
|
||||
Identifier(IdentifierName<'a>),
|
||||
StringLiteral(StringLiteral<'a>),
|
||||
|
|
@ -735,7 +737,7 @@ impl<'a> TSModuleDeclarationName<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSModuleDeclarationBody<'a> {
|
||||
TSModuleDeclaration(Box<'a, TSModuleDeclaration<'a>>),
|
||||
TSModuleBlock(Box<'a, TSModuleBlock<'a>>),
|
||||
|
|
@ -743,7 +745,7 @@ pub enum TSModuleDeclarationBody<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSModuleBlock<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -752,7 +754,7 @@ pub struct TSModuleBlock<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSTypeLiteral<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -761,7 +763,7 @@ pub struct TSTypeLiteral<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSInferType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -770,7 +772,7 @@ pub struct TSInferType<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSTypeQuery<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -780,7 +782,7 @@ pub struct TSTypeQuery<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSTypeQueryExprName<'a> {
|
||||
TSTypeName(TSTypeName<'a>),
|
||||
TSImportType(TSImportType<'a>),
|
||||
|
|
@ -788,7 +790,7 @@ pub enum TSTypeQueryExprName<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSImportType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -800,7 +802,7 @@ pub struct TSImportType<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSImportAttributes<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -809,7 +811,7 @@ pub struct TSImportAttributes<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSImportAttribute<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -819,7 +821,7 @@ pub struct TSImportAttribute<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSImportAttributeName<'a> {
|
||||
Identifier(IdentifierName<'a>),
|
||||
StringLiteral(StringLiteral<'a>),
|
||||
|
|
@ -827,7 +829,7 @@ pub enum TSImportAttributeName<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSFunctionType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -839,7 +841,7 @@ pub struct TSFunctionType<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSConstructorType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -851,7 +853,7 @@ pub struct TSConstructorType<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSMappedType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -864,7 +866,7 @@ pub struct TSMappedType<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSMappedTypeModifierOperator {
|
||||
True,
|
||||
#[cfg_attr(feature = "serde", serde(rename = "+"))]
|
||||
|
|
@ -876,7 +878,7 @@ pub enum TSMappedTypeModifierOperator {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSTemplateLiteralType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -886,7 +888,7 @@ pub struct TSTemplateLiteralType<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSAsExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -896,7 +898,7 @@ pub struct TSAsExpression<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSSatisfiesExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -906,7 +908,7 @@ pub struct TSSatisfiesExpression<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSTypeAssertion<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -916,7 +918,7 @@ pub struct TSTypeAssertion<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSImportEqualsDeclaration<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -927,7 +929,7 @@ pub struct TSImportEqualsDeclaration<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged, rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum TSModuleReference<'a> {
|
||||
TypeName(TSTypeName<'a>),
|
||||
ExternalModuleReference(TSExternalModuleReference<'a>),
|
||||
|
|
@ -935,7 +937,7 @@ pub enum TSModuleReference<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSExternalModuleReference<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -944,7 +946,7 @@ pub struct TSExternalModuleReference<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSNonNullExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -953,7 +955,7 @@ pub struct TSNonNullExpression<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct Decorator<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -983,7 +985,7 @@ impl<'a> Decorator<'a> {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum ModifierKind {
|
||||
Abstract,
|
||||
Accessor,
|
||||
|
|
@ -1004,7 +1006,7 @@ pub enum ModifierKind {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct Modifier {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1013,7 +1015,7 @@ pub struct Modifier {
|
|||
|
||||
#[derive(Debug, Default, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(transparent))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct Modifiers<'a>(Option<Vec<'a, Modifier>>);
|
||||
|
||||
impl<'a> Modifiers<'a> {
|
||||
|
|
@ -1045,7 +1047,7 @@ impl<'a> Modifiers<'a> {
|
|||
/// `export = foo`
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSExportAssignment<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1057,7 +1059,7 @@ pub struct TSExportAssignment<'a> {
|
|||
/// `export as namespace foo`
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSNamespaceExportDeclaration<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1066,7 +1068,7 @@ pub struct TSNamespaceExportDeclaration<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct TSInstantiationExpression<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1076,7 +1078,7 @@ pub struct TSInstantiationExpression<'a> {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum ImportOrExportKind {
|
||||
Value,
|
||||
Type,
|
||||
|
|
@ -1096,7 +1098,7 @@ impl ImportOrExportKind {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSDocNullableType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
@ -1106,7 +1108,7 @@ pub struct JSDocNullableType<'a> {
|
|||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct JSDocUnknownType {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
use oxc_span::{CompactStr, Span};
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::Serialize;
|
||||
#[cfg(feature = "wasm")]
|
||||
use tsify::Tsify;
|
||||
|
||||
use crate::{symbol::SymbolId, AstNodeId};
|
||||
|
||||
|
|
@ -8,7 +10,7 @@ pub use oxc_syntax::reference::{ReferenceFlag, ReferenceId};
|
|||
|
||||
#[derive(Debug, Clone)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct Reference {
|
||||
span: Span,
|
||||
/// The name of the identifier that was referred to
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use crate::{
|
|||
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::Serialize;
|
||||
#[cfg(feature = "wasm")]
|
||||
use tsify::Tsify;
|
||||
|
||||
#[cfg(feature = "wasm")]
|
||||
#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)]
|
||||
|
|
@ -25,7 +27,7 @@ export type IndexVec<I, T> = Array<T>;
|
|||
/// `SoA` (Struct of Arrays) for memory efficiency.
|
||||
#[derive(Debug, Default)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct SymbolTable {
|
||||
pub spans: IndexVec<SymbolId, Span>,
|
||||
pub names: IndexVec<SymbolId, CompactStr>,
|
||||
|
|
|
|||
|
|
@ -2,11 +2,13 @@ use std::path::Path;
|
|||
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::Serialize;
|
||||
#[cfg(feature = "wasm")]
|
||||
use tsify::Tsify;
|
||||
|
||||
/// Source Type for JavaScript vs TypeScript / Script vs Module / JSX
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub struct SourceType {
|
||||
/// JavaScript or TypeScript, default JavaScript
|
||||
language: Language,
|
||||
|
|
@ -25,7 +27,7 @@ pub struct SourceType {
|
|||
/// JavaScript or TypeScript
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum Language {
|
||||
JavaScript,
|
||||
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
|
||||
|
|
@ -37,7 +39,7 @@ pub enum Language {
|
|||
/// Script or Module
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum ModuleKind {
|
||||
Script,
|
||||
Module,
|
||||
|
|
@ -46,7 +48,7 @@ pub enum ModuleKind {
|
|||
/// JSX for JavaScript and TypeScript
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum LanguageVariant {
|
||||
Standard,
|
||||
Jsx,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ use std::hash::{Hash, Hasher};
|
|||
use miette::{SourceOffset, SourceSpan};
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::Serialize;
|
||||
#[cfg(feature = "wasm")]
|
||||
use tsify::Tsify;
|
||||
|
||||
/// An Empty span useful for creating AST nodes.
|
||||
pub const SPAN: Span = Span::new(0, 0);
|
||||
|
|
@ -14,7 +16,7 @@ pub const SPAN: Span = Span::new(0, 0);
|
|||
/// NOTE: `u32` is sufficient for "all" reasonable programs. Larger than u32 is a 4GB JS file.
|
||||
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
#[non_exhaustive] // disallow struct expression constructor `Span {}`
|
||||
pub struct Span {
|
||||
pub start: u32,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
#[cfg(feature = "serde")]
|
||||
use serde::Serialize;
|
||||
#[cfg(feature = "wasm")]
|
||||
use tsify::Tsify;
|
||||
|
||||
use crate::precedence::{GetPrecedence, Precedence};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum AssignmentOperator {
|
||||
#[cfg_attr(feature = "serde", serde(rename = "="))]
|
||||
Assign,
|
||||
|
|
@ -84,7 +86,7 @@ impl AssignmentOperator {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum BinaryOperator {
|
||||
#[cfg_attr(feature = "serde", serde(rename = "=="))]
|
||||
Equality,
|
||||
|
|
@ -271,7 +273,7 @@ impl GetPrecedence for BinaryOperator {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum LogicalOperator {
|
||||
#[cfg_attr(feature = "serde", serde(rename = "||"))]
|
||||
Or,
|
||||
|
|
@ -303,7 +305,7 @@ impl GetPrecedence for LogicalOperator {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum UnaryOperator {
|
||||
#[cfg_attr(feature = "serde", serde(rename = "-"))]
|
||||
UnaryNegation,
|
||||
|
|
@ -349,7 +351,7 @@ impl UnaryOperator {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
|
||||
#[cfg_attr(feature = "wasm", derive(Tsify))]
|
||||
pub enum UpdateOperator {
|
||||
#[cfg_attr(feature = "serde", serde(rename = "++"))]
|
||||
Increment,
|
||||
|
|
|
|||
Loading…
Reference in a new issue