mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(ast): temporary fix tsify not generating some typings (#2611)
seems like a bug in tsify
This commit is contained in:
parent
1db307abbf
commit
49778abb80
5 changed files with 24 additions and 33 deletions
|
|
@ -12,8 +12,7 @@ use oxc_syntax::{
|
|||
#[cfg(feature = "serde")]
|
||||
use serde::Serialize;
|
||||
|
||||
#[allow(clippy::wildcard_imports)]
|
||||
use crate::ast::*;
|
||||
use super::{jsx::*, literal::*, ts::*};
|
||||
|
||||
#[cfg_attr(
|
||||
all(feature = "serde", feature = "wasm"),
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
//! [`JSDoc`](https://github.com/microsoft/TypeScript/blob/54a554d8af2657630307cbfa8a3e4f3946e36507/src/compiler/types.ts#L393)
|
||||
|
||||
use oxc_span::Span;
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::ast::TSType;
|
||||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
|
||||
pub struct JSDocNullableType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
pub type_annotation: TSType<'a>,
|
||||
pub postfix: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
|
||||
pub struct JSDocUnknownType {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
}
|
||||
|
|
@ -5,8 +5,7 @@ use oxc_span::{Atom, Span};
|
|||
#[cfg(feature = "serde")]
|
||||
use serde::Serialize;
|
||||
|
||||
#[allow(clippy::wildcard_imports)]
|
||||
use crate::ast::*;
|
||||
use super::{js::*, literal::*, ts::*};
|
||||
|
||||
// 1.2 JSX Elements
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
//! AST Definitions
|
||||
|
||||
mod js;
|
||||
mod jsdoc;
|
||||
mod jsx;
|
||||
mod literal;
|
||||
mod ts;
|
||||
|
||||
pub use self::{js::*, jsdoc::*, jsx::*, literal::*, ts::*};
|
||||
pub use self::{js::*, jsx::*, literal::*, ts::*};
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@ use oxc_span::{Atom, GetSpan, Span};
|
|||
#[cfg(feature = "serde")]
|
||||
use serde::Serialize;
|
||||
|
||||
#[allow(clippy::wildcard_imports)]
|
||||
use crate::ast::*;
|
||||
use super::{js::*, literal::*};
|
||||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
|
|
@ -1058,3 +1057,23 @@ impl ImportOrExportKind {
|
|||
matches!(self, Self::Type)
|
||||
}
|
||||
}
|
||||
|
||||
// [`JSDoc`](https://github.com/microsoft/TypeScript/blob/54a554d8af2657630307cbfa8a3e4f3946e36507/src/compiler/types.ts#L393)
|
||||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
|
||||
pub struct JSDocNullableType<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
pub type_annotation: TSType<'a>,
|
||||
pub postfix: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
|
||||
pub struct JSDocUnknownType {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue