pub struct Config {
    pub import_not_used_as_values: ImportsNotUsedAsValues,
    pub use_define_for_class_fields: bool,
    pub no_empty_export: bool,
    pub pragma: Option<String>,
    pub pragma_frag: Option<String>,
    pub ts_enum_config: TSEnumConfig,
}

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::es2022::class_properties() pass to get this backward-compatible output.

no_empty_export: bool

Don’t create export {}. By default, strip creates export {} for modules to preserve module context.

https://github.com/swc-project/swc/issues/1698

pragma: Option<String>

Note: this pass handle jsx directives in comments

pragma_frag: Option<String>

Note: this pass handle jsx directives in comments

ts_enum_config: TSEnumConfig

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more