Skip to content

Commit

Permalink
[rg.audit.2] Add flowgen type defs
Browse files Browse the repository at this point in the history
  • Loading branch information
somewhatabstract committed Apr 3, 2023
1 parent 0299cc9 commit d6e17e9
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .changeset/breezy-baboons-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
39 changes: 39 additions & 0 deletions build-settings/flowgen.d.ts
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;
}

0 comments on commit d6e17e9

Please sign in to comment.