-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[🔥AUDIT🔥] [rg.audit.2] Add flowgen type defs (#618)
🖍 _This is an audit!_ 🖍 ## Summary: Added flowgen.d.ts to fix typecheck. Issue: FEI-4960 ## Test plan: `yarn typecheck` Author: somewhatabstract Auditors: #typescript, #frontend-infra Required Reviewers: Approved By: Checks: ⌛ Lint, typecheck, and coverage check (ubuntu-latest, 16.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 16.x), ✅ gerald, ⏭ dependabot, ⌛ Analyze (javascript) Pull Request URL: #618
- Loading branch information
1 parent
0299cc9
commit 47f9756
Showing
2 changed files
with
41 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
--- |
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,39 @@ | ||
// Adapted from https://github.com/joarwilk/flowgen/blob/master/index.js.flow | ||
|
||
declare module "flowgen" { | ||
export type Options = { | ||
jsdoc?: boolean; | ||
interfaceRecords?: boolean; | ||
moduleExports?: boolean; | ||
quiet?: boolean; | ||
inexact?: boolean; | ||
}; | ||
|
||
export type Compiler = { | ||
compileTest(path: string, target: string): void; | ||
compileDefinitionString( | ||
string: string, | ||
options?: Options, | ||
mapSourceCode?: ( | ||
source: string | void, | ||
fileName: string, | ||
) => string | void, | ||
): string; | ||
compileDefinitionFile( | ||
path: string, | ||
options?: Options, | ||
mapSourceCode?: ( | ||
source: string | void, | ||
fileName: string, | ||
) => string | void, | ||
): string; | ||
|
||
// Low-level exports | ||
reset(options?: Options): void; | ||
setChecker(checker: any /* ts.TypeChecker */): void; | ||
compile(sourceFile: any /* ts.SourceFile */): string; | ||
}; | ||
|
||
export function beautify(str: string): string; | ||
export const compiler: Compiler; | ||
} |