Struct stc_ts_type_checker::Checker
source · [−]pub struct Checker<L>where
L: LoadModule,{
pub(crate) cm: Arc<SourceMap>,
pub(crate) handler: Arc<Handler>,
pub(crate) module_types: RwLock<FxHashMap<ModuleId, Arc<OnceCell<Type>>>>,
pub(crate) declared_modules: DashMap<String, ModuleId, FxBuildHasher>,
pub(crate) dts_modules: Arc<DashMap<ModuleId, RModule, FxBuildHasher>>,
pub(crate) module_loader: L,
pub(crate) started: Arc<DashSet<ModuleId, FxBuildHasher>>,
pub(crate) errors: Mutex<Vec<Error>>,
pub(crate) env: Env,
pub(crate) debugger: Option<Debugger>,
}
Expand description
Onc instance per swc::Compiler
Fields
cm: Arc<SourceMap>
handler: Arc<Handler>
module_types: RwLock<FxHashMap<ModuleId, Arc<OnceCell<Type>>>>
Cache
declared_modules: DashMap<String, ModuleId, FxBuildHasher>
dts_modules: Arc<DashMap<ModuleId, RModule, FxBuildHasher>>
Information required to generate .d.ts
files.
module_loader: L
started: Arc<DashSet<ModuleId, FxBuildHasher>>
Modules which are being processed or analyzed.
errors: Mutex<Vec<Error>>
env: Env
debugger: Option<Debugger>
Implementations
sourceimpl<L> Checker<L>where
L: LoadModule,
impl<L> Checker<L>where
L: LoadModule,
fn try_loading_typing_of_one_package(&self, dir: &Path)
fn load_typings_from_dir(&self, dir: &Path, types: Option<&[String]>)
sourceimpl<L> Checker<L>where
L: LoadModule,
impl<L> Checker<L>where
L: LoadModule,
sourceimpl<L> Checker<L>where
L: LoadModule,
impl<L> Checker<L>where
L: LoadModule,
sourcepub fn take_dts(&self, id: ModuleId) -> Option<Module>
pub fn take_dts(&self, id: ModuleId) -> Option<Module>
Removes dts module from self
and return it.
pub fn module_loader(&self) -> &L
sourcepub fn check(&self, entry: Arc<FileName>) -> ModuleId
pub fn check(&self, entry: Arc<FileName>) -> ModuleId
After calling this method, you can get errors using .take_errors()
pub fn take_errors(&mut self) -> Vec<Error>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
sourcepub(crate) fn analyze_module(
&self,
starter: Option<Arc<FileName>>,
path: Arc<FileName>
) -> Type
pub(crate) fn analyze_module(
&self,
starter: Option<Arc<FileName>>,
path: Arc<FileName>
) -> Type
Analyzes one module.
pub(crate) fn analyze_non_circular_module(
&self,
module_id: ModuleId,
path: Arc<FileName>
) -> Type
Trait Implementations
sourceimpl<L> Load for Checker<L>where
L: LoadModule,
impl<L> Load for Checker<L>where
L: LoadModule,
fn module_id(
&self,
base: &Arc<FileName>,
module_specifier: &str
) -> Option<ModuleId>
sourcefn is_in_same_circular_group(
&self,
base: &Arc<FileName>,
module_specifier: &str
) -> bool
fn is_in_same_circular_group(
&self,
base: &Arc<FileName>,
module_specifier: &str
) -> bool
Note: This method called within a thread
sourcefn load_circular_dep(
&self,
base: &Arc<FileName>,
dep: &str,
_partial: &ModuleTypeData
) -> VResult<Type>
fn load_circular_dep(
&self,
base: &Arc<FileName>,
dep: &str,
_partial: &ModuleTypeData
) -> VResult<Type>
This method can be called multiple time for same module. Read more
sourcefn load_non_circular_dep(&self, base: &Arc<FileName>, dep: &str) -> VResult<Type>
fn load_non_circular_dep(&self, base: &Arc<FileName>, dep: &str) -> VResult<Type>
Note: This method is called in parallel. Read more
sourcefn declare_module(&self, name: &JsWord, module: Type) -> ModuleId
fn declare_module(&self, name: &JsWord, module: Type) -> ModuleId
Auto Trait Implementations
impl<L> !RefUnwindSafe for Checker<L>
impl<L> Send for Checker<L>
impl<L> Sync for Checker<L>
impl<L> Unpin for Checker<L>where
L: Unpin,
impl<L> !UnwindSafe for Checker<L>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more