Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f823be
commit 4e9a25e
Showing
14 changed files
with
193 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/babel-generator/test/fixtures/flow/opaque-type-alias/actual.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
opaque type ID = string; | ||
opaque type Foo<T> = Bar<T>; | ||
opaque type Maybe<T> = _Maybe<T, *>; | ||
export opaque type Foo = number; | ||
|
||
opaque type union = | ||
| {type: "A"} | ||
| {type: "B"} | ||
; | ||
|
||
opaque type overloads = | ||
& ((x: string) => number) | ||
& ((x: number) => string) | ||
; |
10 changes: 10 additions & 0 deletions
10
packages/babel-generator/test/fixtures/flow/opaque-type-alias/expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
opaque type ID = string; | ||
opaque type Foo<T> = Bar<T>; | ||
opaque type Maybe<T> = _Maybe<T, *>; | ||
export opaque type Foo = number; | ||
opaque type union = { | ||
type: "A" | ||
} | { | ||
type: "B" | ||
}; | ||
opaque type overloads = (x: string) => number & (x: number) => string; |
15 changes: 15 additions & 0 deletions
15
...el-plugin-transform-flow-comments/test/fixtures/flow-comments/opaque-type-alias/actual.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
function a() {} | ||
opaque type A = number; | ||
opaque type B = { | ||
name: string; | ||
}; | ||
|
||
opaque type union = | ||
| {type: "A"} | ||
| {type: "B"} | ||
; | ||
|
||
opaque type overloads = | ||
& ((x: string) => number) | ||
& ((x: number) => string) | ||
; |
16 changes: 16 additions & 0 deletions
16
...-plugin-transform-flow-comments/test/fixtures/flow-comments/opaque-type-alias/expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
function a() {} | ||
/*:: opaque type A = number;*/ | ||
|
||
/*:: opaque type B = { | ||
name: string; | ||
};*/ | ||
|
||
/*:: opaque type union = | ||
| {type: "A"} | ||
| {type: "B"} | ||
;*/ | ||
|
||
/*:: opaque type overloads = | ||
& ((x: string) => number) | ||
& ((x: number) => string) | ||
;*/ |
16 changes: 16 additions & 0 deletions
16
...in-transform-flow-strip-types/test/fixtures/strip-types/strip-opaque-type-alias/actual.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
opaque type ID = string; | ||
opaque type Foo<T> = Bar<T> | ||
export opaque type Foo = number; | ||
|
||
opaque type union = | ||
| {type: "A"} | ||
| {type: "B"} | ||
; | ||
|
||
opaque type overloads = | ||
& ((x: string) => number) | ||
& ((x: number) => string) | ||
; | ||
|
||
declare opaque type Foo: Bar; | ||
declare export opaque type Foo: Bar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.