pub trait VariableFieldTypes: PartialEq + Eq + Debug + Clone + 'static {
    type OptionalExpression: PartialEq + Eq + Debug + Clone + Sync + Send;

    // Required methods
    fn optional_expression_from_reader(
        reader: &mut impl TokenReader<TSXToken, Span>,
        state: &mut ParsingState,
        settings: &ParseSettings
    ) -> Result<Self::OptionalExpression, ParseError>;
    fn optional_expression_to_string_from_buffer<T: ToString>(
        optional_expression: &Self::OptionalExpression,
        buf: &mut T,
        settings: &ToStringSettingsAndData,
        depth: u8
    );
    fn optional_expression_get_position(
        optional_expression: &Self::OptionalExpression
    ) -> Option<Cow<'_, Span>>;
}
Expand description

Variable field can be used in type annotations but cannot have a value

TODO value assignment this is VariableOrFieldAccess thingy

TODO could have get_optional_expression_as_option(&Self::OptionalExpression) -> Option

Required Associated Types§

Required Methods§

Implementors§