yerpc icon indicating copy to clipboard operation
yerpc copied to clipboard

Typescript: Also allow undefined for `Option<T>`?

Open Simon-Laux opened this issue 3 years ago • 1 comments

currently its translated to T | null, which is not very convenient for functions with optional arguments. actually it already accepts undefined, just the typescript types don't allow it yet.

example:

// in js I can do:
await client.getChatlistEntries(3)
// but in ts I need to do this:
await client.getChatlistEntries(3, null, null, null)

Simon-Laux avatar Apr 20 '22 20:04 Simon-Laux

I don't see the option in typescript-type-def to tweak it, looks like it should be upstreamed to https://github.com/dbeckwith/rust-typescript-type-def/

link2xt avatar Sep 06 '23 21:09 link2xt