mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
refactor(ast): shorten manual TS defs (#2638)
Does the same thing, just (in my opinion) a little bit more readable.
This commit is contained in:
parent
308b780ff6
commit
6b5723cdbe
8 changed files with 16 additions and 40 deletions
|
|
@ -14,11 +14,8 @@ use serde::Serialize;
|
|||
|
||||
use super::{jsx::*, literal::*, ts::*};
|
||||
|
||||
#[cfg_attr(
|
||||
all(feature = "serde", feature = "wasm"),
|
||||
wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)
|
||||
)]
|
||||
#[allow(dead_code)]
|
||||
#[cfg(all(feature = "serde", feature = "wasm"))]
|
||||
#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)]
|
||||
const TS_APPEND_CONTENT: &'static str = r#"
|
||||
export interface BindingIdentifier extends Span { type: "Identifier", name: Atom }
|
||||
export interface IdentifierReference extends Span { type: "Identifier", name: Atom }
|
||||
|
|
|
|||
|
|
@ -163,11 +163,8 @@ bitflags! {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
all(feature = "serde", feature = "wasm"),
|
||||
wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)
|
||||
)]
|
||||
#[allow(dead_code)]
|
||||
#[cfg(all(feature = "serde", feature = "wasm"))]
|
||||
#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)]
|
||||
const TS_APPEND_CONTENT: &'static str = r#"
|
||||
export type RegExpFlags = {
|
||||
G: 1,
|
||||
|
|
|
|||
|
|
@ -14,11 +14,8 @@ use crate::{
|
|||
#[cfg(feature = "serde")]
|
||||
use serde::Serialize;
|
||||
|
||||
#[cfg_attr(
|
||||
all(feature = "serde", feature = "wasm"),
|
||||
wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)
|
||||
)]
|
||||
#[allow(dead_code)]
|
||||
#[cfg(all(feature = "serde", feature = "wasm"))]
|
||||
#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)]
|
||||
const TS_APPEND_CONTENT: &'static str = r#"
|
||||
export type IndexVec<I, T> = Array<T>;
|
||||
"#;
|
||||
|
|
|
|||
|
|
@ -5,11 +5,8 @@ use serde::{Serialize, Serializer};
|
|||
|
||||
use compact_str::CompactString;
|
||||
|
||||
#[cfg_attr(
|
||||
all(feature = "serde", feature = "wasm"),
|
||||
wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)
|
||||
)]
|
||||
#[allow(dead_code)]
|
||||
#[cfg(all(feature = "serde", feature = "wasm"))]
|
||||
#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)]
|
||||
const TS_APPEND_CONTENT: &'static str = r#"
|
||||
export type Atom = string;
|
||||
export type CompactStr = string;
|
||||
|
|
|
|||
|
|
@ -5,11 +5,8 @@ define_index_type! {
|
|||
pub struct AstNodeId = usize;
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
all(feature = "serde", feature = "wasm"),
|
||||
wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)
|
||||
)]
|
||||
#[allow(dead_code)]
|
||||
#[cfg(all(feature = "serde", feature = "wasm"))]
|
||||
#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)]
|
||||
const TS_APPEND_CONTENT: &'static str = r#"
|
||||
export type AstNodeId = number;
|
||||
export type NodeFlags = {
|
||||
|
|
|
|||
|
|
@ -7,11 +7,8 @@ define_index_type! {
|
|||
pub struct ReferenceId = u32;
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
all(feature = "serde", feature = "wasm"),
|
||||
wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)
|
||||
)]
|
||||
#[allow(dead_code)]
|
||||
#[cfg(all(feature = "serde", feature = "wasm"))]
|
||||
#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)]
|
||||
const TS_APPEND_CONTENT: &'static str = r#"
|
||||
export type ReferenceId = number;
|
||||
export type ReferenceFlag = {
|
||||
|
|
|
|||
|
|
@ -5,11 +5,8 @@ define_index_type! {
|
|||
pub struct ScopeId = u32;
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
all(feature = "serde", feature = "wasm"),
|
||||
wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)
|
||||
)]
|
||||
#[allow(dead_code)]
|
||||
#[cfg(all(feature = "serde", feature = "wasm"))]
|
||||
#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)]
|
||||
const TS_APPEND_CONTENT: &'static str = r#"
|
||||
export type ScopeId = number;
|
||||
"#;
|
||||
|
|
|
|||
|
|
@ -8,11 +8,8 @@ define_index_type! {
|
|||
pub struct SymbolId = u32;
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
all(feature = "serde", feature = "wasm"),
|
||||
wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)
|
||||
)]
|
||||
#[allow(dead_code)]
|
||||
#[cfg(all(feature = "serde", feature = "wasm"))]
|
||||
#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)]
|
||||
const TS_APPEND_CONTENT: &'static str = r#"
|
||||
export type SymbolId = number;
|
||||
export type SymbolFlags = unknown;
|
||||
|
|
|
|||
Loading…
Reference in a new issue