File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
jscomp/gentype_tests/typescript-react-example/src Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,14 @@ export type fromPayload = { readonly x: number; readonly s: string };
15
15
// tslint:disable-next-line:interface-over-type-literal
16
16
export type toPayload = { readonly result : string } ;
17
17
18
+ // tslint:disable-next-line:interface-over-type-literal
19
+ export type settledResult < a > =
20
+ { TAG : "fulfilled" ; readonly value : a }
21
+ | { TAG : "rejected" ; readonly reason : unknown } ;
22
+
23
+ // tslint:disable-next-line:interface-over-type-literal
24
+ export type settled = settledResult < string > ;
25
+
18
26
export const convert : ( _1 :Promise < fromPayload > ) => Promise < toPayload > = TestPromiseBS . convert ;
19
27
20
28
export const barx : ( _1 :{ readonly x ?: Promise < ( undefined | string ) > } , _2 :void ) => boolean = TestPromiseBS . barx ;
Original file line number Diff line number Diff line change @@ -11,3 +11,11 @@ type fromPayload = {
11
11
@genType let convert = Js .Promise .then_ (({s }) => Js .Promise .resolve ({result : s }))
12
12
13
13
@genType let barx = (~x = Js .Promise .resolve (Some ("a" )), ()) => x == x
14
+
15
+ @genType
16
+ @tag ("status" )
17
+ type settledResult <+ 'a > =
18
+ | @as ("fulfilled" ) Fulfilled ({value : 'a }) | @as ("rejected" ) Rejected ({reason : unknown })
19
+
20
+ @genType
21
+ type settled = settledResult <string >
You can’t perform that action at this time.
0 commit comments