pub struct TsConfig { /* private fields */ }Expand description
Partial tsconfig.json metadata.
Implementations§
Source§impl TsConfig
impl TsConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates empty tsconfig metadata.
Examples found in repository?
examples/basic_usage.rs (line 9)
4fn main() -> Result<(), Box<dyn std::error::Error>> {
5 let options = CompilerOptions::new()
6 .with_target("es2022".parse::<TsTarget>()?)
7 .with_module_resolution(TsModuleResolution::Bundler)
8 .with_strictness(TsStrictness::Strict);
9 let config = TsConfig::new()
10 .with_compiler_options(options)
11 .with_include(TsConfigInclude::new("src")?);
12
13 assert_eq!(config.include().len(), 1);
14 Ok(())
15}Sourcepub fn with_extends(self, extends: TsConfigExtends) -> Self
pub fn with_extends(self, extends: TsConfigExtends) -> Self
Sets the extends metadata.
Sourcepub fn with_compiler_options(self, compiler_options: CompilerOptions) -> Self
pub fn with_compiler_options(self, compiler_options: CompilerOptions) -> Self
Sets compiler options metadata.
Examples found in repository?
examples/basic_usage.rs (line 10)
4fn main() -> Result<(), Box<dyn std::error::Error>> {
5 let options = CompilerOptions::new()
6 .with_target("es2022".parse::<TsTarget>()?)
7 .with_module_resolution(TsModuleResolution::Bundler)
8 .with_strictness(TsStrictness::Strict);
9 let config = TsConfig::new()
10 .with_compiler_options(options)
11 .with_include(TsConfigInclude::new("src")?);
12
13 assert_eq!(config.include().len(), 1);
14 Ok(())
15}Sourcepub fn with_include(self, include: TsConfigInclude) -> Self
pub fn with_include(self, include: TsConfigInclude) -> Self
Adds an include pattern.
Examples found in repository?
examples/basic_usage.rs (line 11)
4fn main() -> Result<(), Box<dyn std::error::Error>> {
5 let options = CompilerOptions::new()
6 .with_target("es2022".parse::<TsTarget>()?)
7 .with_module_resolution(TsModuleResolution::Bundler)
8 .with_strictness(TsStrictness::Strict);
9 let config = TsConfig::new()
10 .with_compiler_options(options)
11 .with_include(TsConfigInclude::new("src")?);
12
13 assert_eq!(config.include().len(), 1);
14 Ok(())
15}Sourcepub fn with_exclude(self, exclude: TsConfigExclude) -> Self
pub fn with_exclude(self, exclude: TsConfigExclude) -> Self
Adds an exclude pattern.
Sourcepub const fn extends(&self) -> Option<&TsConfigExtends>
pub const fn extends(&self) -> Option<&TsConfigExtends>
Returns extends metadata.
Sourcepub const fn compiler_options(&self) -> &CompilerOptions
pub const fn compiler_options(&self) -> &CompilerOptions
Returns compiler options metadata.
Sourcepub fn include(&self) -> &[TsConfigInclude]
pub fn include(&self) -> &[TsConfigInclude]
Returns include patterns.
Examples found in repository?
examples/basic_usage.rs (line 13)
4fn main() -> Result<(), Box<dyn std::error::Error>> {
5 let options = CompilerOptions::new()
6 .with_target("es2022".parse::<TsTarget>()?)
7 .with_module_resolution(TsModuleResolution::Bundler)
8 .with_strictness(TsStrictness::Strict);
9 let config = TsConfig::new()
10 .with_compiler_options(options)
11 .with_include(TsConfigInclude::new("src")?);
12
13 assert_eq!(config.include().len(), 1);
14 Ok(())
15}Sourcepub fn exclude(&self) -> &[TsConfigExclude]
pub fn exclude(&self) -> &[TsConfigExclude]
Returns exclude patterns.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TsConfig
impl<'de> Deserialize<'de> for TsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TsConfig
impl StructuralPartialEq for TsConfig
Auto Trait Implementations§
impl Freeze for TsConfig
impl RefUnwindSafe for TsConfig
impl Send for TsConfig
impl Sync for TsConfig
impl Unpin for TsConfig
impl UnsafeUnpin for TsConfig
impl UnwindSafe for TsConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more