diff --git a/.changeset/breezy-baboons-play.md b/.changeset/breezy-baboons-play.md new file mode 100644 index 00000000..a845151c --- /dev/null +++ b/.changeset/breezy-baboons-play.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/build-settings/flowgen.d.ts b/build-settings/flowgen.d.ts new file mode 100644 index 00000000..f83f7460 --- /dev/null +++ b/build-settings/flowgen.d.ts @@ -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; +}