flowgen
Version:
Generate flowtype definition files from TypeScript
36 lines (30 loc) • 868 B
Flow
// @flow strict
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: $FlowFixMe /* ts.TypeChecker */): void,
compile(sourceFile: $FlowFixMe /* ts.SourceFile */): string,
|};
declare type Flowgen = {|
beautify(str: string): string,
compiler: Compiler,
|};
declare export default Flowgen;