-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert
@babel/template
from Flow to TS (#12317)
Co-authored-by: Bogdan Savluk <savluk.bogdan@gmail.com> Co-authored-by: Nicol貌 Ribaudo <nicolo.ribaudo@gmail.com>
- Loading branch information
1 parent
07607fa
commit 6654c04
Showing
27 changed files
with
747 additions
and
406 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
declare module "@babel/template" { | ||
declare type PublicOpts = { | ||
placeholderWhitelist?: ?Set<string>, | ||
placeholderPattern?: ?(RegExp | false), | ||
preserveComments?: ?boolean, | ||
syntacticPlaceholders?: ?boolean, | ||
}; | ||
|
||
declare type PublicReplacements = { [string]: mixed } | Array<mixed>; | ||
|
||
declare type TemplateBuilder<T> = { | ||
ast: { | ||
(tpl: string, opts: ?PublicOpts): T, | ||
(tpl: Array<string>, ...args: Array<mixed>): T, | ||
}, | ||
(opts: PublicOpts): TemplateBuilder<T>, | ||
(tpl: string, opts: ?PublicOpts): (?PublicReplacements) => T, | ||
(tpl: Array<string>, ...args: Array<mixed>): (?PublicReplacements) => T, | ||
}; | ||
|
||
declare type Smart = TemplateBuilder< | ||
Array<BabelNodeStatement> | BabelNodeStatement | ||
>; | ||
declare type Statement = TemplateBuilder<BabelNodeStatement>; | ||
declare type Statements = TemplateBuilder<Array<BabelNodeStatement>>; | ||
declare type Expression = TemplateBuilder<BabelNodeExpression>; | ||
declare type Program = TemplateBuilder<BabelNodeProgram>; | ||
|
||
declare export default Smart & { | ||
smart: Smart, | ||
statement: Statement, | ||
statements: Statements, | ||
expression: Expression, | ||
program: Program, | ||
}; | ||
} |
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.