Skip to content

Commit 55480ad

Browse files
committed
Add genType test.
1 parent 2054cb7 commit 55480ad

File tree

6 files changed

+21
-5
lines changed

6 files changed

+21
-5
lines changed

jscomp/gentype_tests/typescript-react-example/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/gentype_tests/typescript-react-example/src/Docstrings.bs.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/gentype_tests/typescript-react-example/src/Hooks.bs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/gentype_tests/typescript-react-example/src/TestPromise.gen.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ export type fromPayload = { readonly x: number; readonly s: string };
1515
// tslint:disable-next-line:interface-over-type-literal
1616
export type toPayload = { readonly result: string };
1717

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+
1826
export const convert: (_1:Promise<fromPayload>) => Promise<toPayload> = TestPromiseBS.convert;
1927

2028
export const barx: (_1:{ readonly x?: Promise<(undefined | string)> }, _2:void) => boolean = TestPromiseBS.barx;

jscomp/gentype_tests/typescript-react-example/src/TestPromise.res

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@ type fromPayload = {
1111
@genType let convert = Js.Promise.then_(({s}) => Js.Promise.resolve({result: s}))
1212

1313
@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>

jscomp/gentype_tests/typescript-react-example/src/Uncurried.bs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)