-
Notifications
You must be signed in to change notification settings - Fork 662
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow TS interfaces to extend qualified identifiers, Translate $Array…
…Like to ArrayLike Summary: Adds two thinkgs to `flow-api-translator`: 1. Support for translating interfaces extending qualified names 2. Changing Flow's `$ArrayLike` to TS's `ArrayLike` Those changes were originally made in `xplat/hermes/tools/hermes-parser/js`: D70316488, D70387099. Reviewed By: pieterv Differential Revision: D70545344 fbshipit-source-id: 950c40d63ebe6de0e17e779ee0d9ab1aa99774f5
- Loading branch information
1 parent
41f59f7
commit 6ac3b5c
Showing
5 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...api-translator/__tests__/flowDefToTSDef/fixtures/interface/extends/qualified-name/spec.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,11 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow strict-local | ||
* @format | ||
*/ | ||
|
||
interface Foo extends Bar.Baz {} |
16 changes: 16 additions & 0 deletions
16
.../__tests__/flowDefToTSDef/fixtures/interface/extends/qualified-name/translate-result.shot
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 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`flowDefToTSDef interface/extends/qualified-name 1`] = ` | ||
"/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* | ||
* @format | ||
*/ | ||
|
||
interface Foo extends Bar.Baz {} | ||
" | ||
`; |
11 changes: 11 additions & 0 deletions
11
.../flow-api-translator/__tests__/flowDefToTSDef/fixtures/types/utilities/$ArrayLike/spec.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,11 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow strict-local | ||
* @format | ||
*/ | ||
|
||
type T = $ArrayLike<Foo>; |
16 changes: 16 additions & 0 deletions
16
...slator/__tests__/flowDefToTSDef/fixtures/types/utilities/$ArrayLike/translate-result.shot
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 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`flowDefToTSDef types/utilities/$ArrayLike 1`] = ` | ||
"/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* | ||
* @format | ||
*/ | ||
|
||
type T = ArrayLike<Foo>; | ||
" | ||
`; |
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