pub struct WebIdlTypeChecker {
pub webidl_result: WebIdlResult,
pub error_collector: TypeErrorCollector,
pub type_inference: TypeInference,
}Expand description
WebIDL 类型检查器
用于检查 TypeScript 类型与 WebIDL 类型之间的兼容性。
Fields§
§webidl_result: WebIdlResultWebIDL 解析结果
error_collector: TypeErrorCollector类型错误收集器
type_inference: TypeInference类型推断器
Implementations§
Source§impl WebIdlTypeChecker
impl WebIdlTypeChecker
Sourcepub fn new(webidl_result: WebIdlResult) -> Self
pub fn new(webidl_result: WebIdlResult) -> Self
Sourcepub fn check_type_compatibility_detailed(
&self,
ts_type: &str,
webidl_type: &str,
) -> TypeCompatibilityResult
pub fn check_type_compatibility_detailed( &self, ts_type: &str, webidl_type: &str, ) -> TypeCompatibilityResult
Sourcepub fn check_function_type_compatibility(
&self,
ts_type: &str,
webidl_type: &str,
) -> TypeCompatibilityResult
pub fn check_function_type_compatibility( &self, ts_type: &str, webidl_type: &str, ) -> TypeCompatibilityResult
Sourcepub fn check_object_type_compatibility(
&self,
ts_type: &str,
webidl_type: &str,
) -> TypeCompatibilityResult
pub fn check_object_type_compatibility( &self, ts_type: &str, webidl_type: &str, ) -> TypeCompatibilityResult
Sourcepub fn check_array_type_compatibility(
&self,
ts_type: &str,
webidl_type: &str,
) -> TypeCompatibilityResult
pub fn check_array_type_compatibility( &self, ts_type: &str, webidl_type: &str, ) -> TypeCompatibilityResult
Sourcepub fn check_type_compatibility(&self, ts_type: &str, webidl_type: &str) -> bool
pub fn check_type_compatibility(&self, ts_type: &str, webidl_type: &str) -> bool
Sourcepub fn validate_webidl_types(&self) -> bool
pub fn validate_webidl_types(&self) -> bool
Sourcepub fn validate_and_collect_errors(&mut self) -> &TypeErrorCollector
pub fn validate_and_collect_errors(&mut self) -> &TypeErrorCollector
Auto Trait Implementations§
impl Freeze for WebIdlTypeChecker
impl RefUnwindSafe for WebIdlTypeChecker
impl Send for WebIdlTypeChecker
impl Sync for WebIdlTypeChecker
impl Unpin for WebIdlTypeChecker
impl UnsafeUnpin for WebIdlTypeChecker
impl UnwindSafe for WebIdlTypeChecker
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