Struct stc_ts_file_analyzer::analyzer::expr::AccessPropertyOpts
source · [−]pub(crate) struct AccessPropertyOpts {Show 13 fields
pub do_not_validate_type_of_computed_prop: bool,
pub disallow_indexing_array_with_string: bool,
pub disallow_creating_indexed_type_from_ty_els: bool,
pub disallow_indexing_class_with_computed: bool,
pub return_rest_tuple_element_as_is: bool,
pub use_undefined_for_tuple_index_error: bool,
pub for_validation_of_indexed_access_type: bool,
pub disallow_inexact: bool,
pub check_for_undefined_or_null: bool,
pub is_key_computed: bool,
pub is_in_union: bool,
pub do_not_use_any_for_object: bool,
pub use_last_element_for_tuple_on_out_of_bound: bool,
}
Expand description
All fields defaults to default value of the type. (false
for bool).
Fields
do_not_validate_type_of_computed_prop: bool
disallow_indexing_array_with_string: bool
disallow_creating_indexed_type_from_ty_els: bool
If true
, access_property
will not produce types like Array['b']
interface F {
foo: string;
bar: number;
}
var obj11: F | string;
obj11.foo; // Error TS2339
disallow_indexing_class_with_computed: bool
return_rest_tuple_element_as_is: bool
If true, Type::Rest is returned as is.
use_undefined_for_tuple_index_error: bool
Note: If it’s in l-value context, access_property
will return
undefined even if this field is false
.
for_validation_of_indexed_access_type: bool
disallow_inexact: bool
If true
, access_property
will not return undefined for object
literal types created with a spread.
This is true for destructuring variable declarations.
check_for_undefined_or_null: bool
Check if obj
is undefined or null
is_key_computed: bool
true
means that the provided Key is crated from a computed key.
is_in_union: bool
true
means parent type is union
do_not_use_any_for_object: bool
use_last_element_for_tuple_on_out_of_bound: bool
Used for rest elements or Type::Rest.
Trait Implementations
sourceimpl Clone for AccessPropertyOpts
impl Clone for AccessPropertyOpts
sourcefn clone(&self) -> AccessPropertyOpts
fn clone(&self) -> AccessPropertyOpts
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for AccessPropertyOpts
impl Debug for AccessPropertyOpts
sourceimpl Default for AccessPropertyOpts
impl Default for AccessPropertyOpts
sourcefn default() -> AccessPropertyOpts
fn default() -> AccessPropertyOpts
Returns the “default value” for a type. Read more
impl Copy for AccessPropertyOpts
Auto Trait Implementations
impl RefUnwindSafe for AccessPropertyOpts
impl Send for AccessPropertyOpts
impl Sync for AccessPropertyOpts
impl Unpin for AccessPropertyOpts
impl UnwindSafe for AccessPropertyOpts
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