You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently support Option<T> which can be represented as undefined or null in TypeScript. We also support Option<Option<T>> which lets one represent a field that can either be null or undefined (i.e. double optional pattern https://docs.rs/serde_with/latest/serde_with/rust/double_option/).
I'm wondering if there's any way we can create our own representation of double optional as:
enumMaybe<T>{Null,Undefined,Value(T)}
Such that it will have the following TypeScript representation:
structSomething{field:Maybe<u32>,}
interfaceSomething{field?: number|null;}
Without using Option<Option<T>>. Is this possible?
The text was updated successfully, but these errors were encountered:
We currently support
Option<T>
which can be represented asundefined
ornull
in TypeScript. We also supportOption<Option<T>>
which lets one represent a field that can either benull
orundefined
(i.e. double optional pattern https://docs.rs/serde_with/latest/serde_with/rust/double_option/).I'm wondering if there's any way we can create our own representation of double optional as:
Such that it will have the following TypeScript representation:
Without using
Option<Option<T>>
. Is this possible?The text was updated successfully, but these errors were encountered: