Struct swc_ecma_transforms_typescript::strip::Config[][src]

pub struct Config {
    pub import_not_used_as_values: ImportsNotUsedAsValues,
    pub use_define_for_class_fields: bool,
}

Fields

import_not_used_as_values: ImportsNotUsedAsValuesuse_define_for_class_fields: bool

Align the semantics of TS class fields with TC39 class fields. Defaults to false.

See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#the-usedefineforclassfields-flag-and-the-declare-property-modifier.

When running tsc with configuration "target": "ESNext", "useDefineForClassFields": true, TS class fields are preserved as JS class fields. We target ESNext, so this our behavior with use_define_for_class_fields: true.

When running tsc with configuration "target": "<ES6-ES2020>", "useDefineForClassFields": true, TS class fields are transformed to Object.defineProperty() statements. You must additionally apply the swc_ecmascript::transforms::compat::es2020::class_properties() pass to get this backward-compatible output.

Trait Implementations

impl Debug for Config[src]

impl Default for Config[src]

impl<'de> Deserialize<'de> for Config[src]

impl Serialize for Config[src]

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Node for T where
    T: Any + ?Sized
[src]

impl<T> Send for T where
    T: ?Sized
[src]

impl<T> Sync for T where
    T: ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.