Add all available flow-typed libdefs (#548)

Summary:
Generated with `flow-typed install --skip --overwrite`.

Test Plan:
Amazingly, `yarn flow` passes. Go team.

wchargin-branch: add-libdefs
This commit is contained in:
William Chargin 2018-07-27 17:23:24 -07:00 committed by GitHub
parent 49da7cfdb0
commit 24a950629a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 463 additions and 0 deletions

114
flow-typed/npm/chalk_v1.x.x.js vendored Normal file
View File

@ -0,0 +1,114 @@
// flow-typed signature: f965116cdb881170be8c42b10554e195
// flow-typed version: da30fe6876/chalk_v1.x.x/flow_>=v0.25.x
type $npm$chalk$StyleElement = {
open: string,
close: string
};
type $npm$chalk$Chain = $npm$chalk$Style & ((...text: any[]) => string);
type $npm$chalk$Style = {
// General
reset: $npm$chalk$Chain,
bold: $npm$chalk$Chain,
dim: $npm$chalk$Chain,
italic: $npm$chalk$Chain,
underline: $npm$chalk$Chain,
inverse: $npm$chalk$Chain,
strikethrough: $npm$chalk$Chain,
// Text colors
black: $npm$chalk$Chain,
red: $npm$chalk$Chain,
green: $npm$chalk$Chain,
yellow: $npm$chalk$Chain,
blue: $npm$chalk$Chain,
magenta: $npm$chalk$Chain,
cyan: $npm$chalk$Chain,
white: $npm$chalk$Chain,
gray: $npm$chalk$Chain,
grey: $npm$chalk$Chain,
// Background colors
bgBlack: $npm$chalk$Chain,
bgRed: $npm$chalk$Chain,
bgGreen: $npm$chalk$Chain,
bgYellow: $npm$chalk$Chain,
bgBlue: $npm$chalk$Chain,
bgMagenta: $npm$chalk$Chain,
bgCyan: $npm$chalk$Chain,
bgWhite: $npm$chalk$Chain
};
type $npm$chalk$StyleMap = {
// General
reset: $npm$chalk$StyleElement,
bold: $npm$chalk$StyleElement,
dim: $npm$chalk$StyleElement,
italic: $npm$chalk$StyleElement,
underline: $npm$chalk$StyleElement,
inverse: $npm$chalk$StyleElement,
strikethrough: $npm$chalk$StyleElement,
// Text colors
black: $npm$chalk$StyleElement,
red: $npm$chalk$StyleElement,
green: $npm$chalk$StyleElement,
yellow: $npm$chalk$StyleElement,
blue: $npm$chalk$StyleElement,
magenta: $npm$chalk$StyleElement,
cyan: $npm$chalk$StyleElement,
white: $npm$chalk$StyleElement,
gray: $npm$chalk$StyleElement,
// Background colors
bgBlack: $npm$chalk$StyleElement,
bgRed: $npm$chalk$StyleElement,
bgGreen: $npm$chalk$StyleElement,
bgYellow: $npm$chalk$StyleElement,
bgBlue: $npm$chalk$StyleElement,
bgMagenta: $npm$chalk$StyleElement,
bgCyan: $npm$chalk$StyleElement,
bgWhite: $npm$chalk$StyleElement
};
declare module "chalk" {
declare var enabled: boolean;
declare var supportsColor: boolean;
declare var styles: $npm$chalk$StyleMap;
declare function stripColor(value: string): any;
declare function hasColor(str: string): boolean;
// General
declare var reset: $npm$chalk$Chain;
declare var bold: $npm$chalk$Chain;
declare var dim: $npm$chalk$Chain;
declare var italic: $npm$chalk$Chain;
declare var underline: $npm$chalk$Chain;
declare var inverse: $npm$chalk$Chain;
declare var strikethrough: $npm$chalk$Chain;
// Text colors
declare var black: $npm$chalk$Chain;
declare var red: $npm$chalk$Chain;
declare var green: $npm$chalk$Chain;
declare var yellow: $npm$chalk$Chain;
declare var blue: $npm$chalk$Chain;
declare var magenta: $npm$chalk$Chain;
declare var cyan: $npm$chalk$Chain;
declare var white: $npm$chalk$Chain;
declare var gray: $npm$chalk$Chain;
declare var grey: $npm$chalk$Chain;
// Background colors
declare var bgBlack: $npm$chalk$Chain;
declare var bgRed: $npm$chalk$Chain;
declare var bgGreen: $npm$chalk$Chain;
declare var bgYellow: $npm$chalk$Chain;
declare var bgBlue: $npm$chalk$Chain;
declare var bgMagenta: $npm$chalk$Chain;
declare var bgCyan: $npm$chalk$Chain;
declare var bgWhite: $npm$chalk$Chain;
}

17
flow-typed/npm/dotenv_v4.x.x.js vendored Normal file
View File

@ -0,0 +1,17 @@
// flow-typed signature: cf11c66b2c3d752c24fdf3eae1b44e1c
// flow-typed version: 21e1db763b/dotenv_v4.x.x/flow_>=v0.34.x
declare module "dotenv" {
declare type DotenvOptions = {
encoding?: string,
path?: string
};
declare function config(options?: DotenvOptions): boolean;
declare module.exports: {
config: typeof config,
load: typeof config,
parse: (src: string | Buffer) => { [string]: string }
}
}

128
flow-typed/npm/enzyme_v3.x.x.js vendored Normal file
View File

@ -0,0 +1,128 @@
// flow-typed signature: 7be2af8800fdadaea6ac0404d256bafc
// flow-typed version: 6ce6a0467c/enzyme_v3.x.x/flow_>=v0.53.x
import * as React from "react";
declare module "enzyme" {
declare type PredicateFunction<T: Wrapper> = (
wrapper: T,
index: number
) => boolean;
declare type NodeOrNodes = React.Node | Array<React.Node>;
declare type EnzymeSelector = string | Class<React.Component<*, *>> | Object;
// CheerioWrapper is a type alias for an actual cheerio instance
// TODO: Reference correct type from cheerio's type declarations
declare type CheerioWrapper = any;
declare class Wrapper {
find(selector: EnzymeSelector): this,
findWhere(predicate: PredicateFunction<this>): this,
filter(selector: EnzymeSelector): this,
filterWhere(predicate: PredicateFunction<this>): this,
hostNodes(): this,
contains(nodeOrNodes: NodeOrNodes): boolean,
containsMatchingElement(node: React.Node): boolean,
containsAllMatchingElements(nodes: NodeOrNodes): boolean,
containsAnyMatchingElements(nodes: NodeOrNodes): boolean,
dive(option?: { context?: Object }): this,
exists(): boolean,
isEmptyRender(): boolean,
matchesElement(node: React.Node): boolean,
hasClass(className: string): boolean,
is(selector: EnzymeSelector): boolean,
isEmpty(): boolean,
not(selector: EnzymeSelector): this,
children(selector?: EnzymeSelector): this,
childAt(index: number): this,
parents(selector?: EnzymeSelector): this,
parent(): this,
closest(selector: EnzymeSelector): this,
render(): CheerioWrapper,
unmount(): this,
text(): string,
html(): string,
get(index: number): React.Node,
getDOMNode(): HTMLElement | HTMLInputElement,
at(index: number): this,
first(): this,
last(): this,
state(key?: string): any,
context(key?: string): any,
props(): Object,
prop(key: string): any,
key(): string,
simulate(event: string, ...args: Array<any>): this,
setState(state: {}, callback?: Function): this,
setProps(props: {}): this,
setContext(context: Object): this,
instance(): React.Component<*, *>,
update(): this,
debug(options?: Object): string,
type(): string | Function | null,
name(): string,
forEach(fn: (node: this, index: number) => mixed): this,
map<T>(fn: (node: this, index: number) => T): Array<T>,
reduce<T>(
fn: (value: T, node: this, index: number) => T,
initialValue?: T
): Array<T>,
reduceRight<T>(
fn: (value: T, node: this, index: number) => T,
initialValue?: T
): Array<T>,
some(selector: EnzymeSelector): boolean,
someWhere(predicate: PredicateFunction<this>): boolean,
every(selector: EnzymeSelector): boolean,
everyWhere(predicate: PredicateFunction<this>): boolean,
length: number
}
declare class ReactWrapper extends Wrapper {
constructor(nodes: NodeOrNodes, root: any, options?: ?Object): ReactWrapper,
mount(): this,
ref(refName: string): this,
detach(): void
}
declare class ShallowWrapper extends Wrapper {
constructor(
nodes: NodeOrNodes,
root: any,
options?: ?Object
): ShallowWrapper,
equals(node: React.Node): boolean,
shallow(options?: { context?: Object }): ShallowWrapper,
getElement(): React.Node,
getElements(): Array<React.Node>
}
declare function shallow(
node: React.Node,
options?: { context?: Object, disableLifecycleMethods?: boolean }
): ShallowWrapper;
declare function mount(
node: React.Node,
options?: {
context?: Object,
attachTo?: HTMLElement,
childContextTypes?: Object
}
): ReactWrapper;
declare function render(
node: React.Node,
options?: { context?: Object }
): CheerioWrapper;
declare module.exports: {
configure(options: {
Adapter?: any,
disableLifecycleMethods?: boolean
}): void,
render: typeof render,
mount: typeof mount,
shallow: typeof shallow,
ShallowWrapper: typeof ShallowWrapper,
ReactWrapper: typeof ReactWrapper
};
}

View File

@ -0,0 +1,7 @@
// flow-typed signature: 47370d221401bec823c43c3598266e26
// flow-typed version: ec28077c25/isomorphic-fetch_v2.x.x/flow_>=v0.25.x
declare module 'isomorphic-fetch' {
declare module.exports: (input: string | Request | URL, init?: RequestOptions) => Promise<Response>;
}

13
flow-typed/npm/mkdirp_v0.5.x.js vendored Normal file
View File

@ -0,0 +1,13 @@
// flow-typed signature: 82aa0feffc2bbd64dce3bec492f5d601
// flow-typed version: 3315d89a00/mkdirp_v0.5.x/flow_>=v0.25.0
declare module 'mkdirp' {
declare type Options = number | { mode?: number; fs?: mixed };
declare type Callback = (err: ?Error, path: ?string) => void;
declare module.exports: {
(path: string, options?: Options | Callback, callback?: Callback): void;
sync(path: string, options?: Options): void;
};
}

View File

@ -0,0 +1,6 @@
// flow-typed signature: 6b26bd45f602f11945a41846caafb9a1
// flow-typed version: da30fe6876/object-assign_v4.x.x/flow_>=v0.25.x
declare module "object-assign" {
declare module.exports: (target: any, ...sources: Array<any>) => Object;
}

178
flow-typed/npm/prettier_v1.x.x.js vendored Normal file
View File

@ -0,0 +1,178 @@
// flow-typed signature: 4eed8da2dc730dc33e7710b465eaa44b
// flow-typed version: cc7a557b34/prettier_v1.x.x/flow_>=v0.56.x
declare module "prettier" {
declare type AST = Object;
declare type Doc = Object;
declare type FastPath = Object;
declare type PrettierParserName =
| "babylon"
| "flow"
| "typescript"
| "postcss"
| "css"
| "less"
| "scss"
| "json"
| "graphql"
| "markdown"
| "vue";
declare type PrettierParser = {
[name: PrettierParserName]: (text: string, options?: Object) => AST
};
declare type CustomParser = (
text: string,
parsers: PrettierParser,
options: Options
) => AST;
declare type Options = {|
printWidth?: number,
tabWidth?: number,
useTabs?: boolean,
semi?: boolean,
singleQuote?: boolean,
trailingComma?: "none" | "es5" | "all",
bracketSpacing?: boolean,
jsxBracketSameLine?: boolean,
arrowParens?: "avoid" | "always",
rangeStart?: number,
rangeEnd?: number,
parser?: PrettierParserName | CustomParser,
filepath?: string,
requirePragma?: boolean,
insertPragma?: boolean,
proseWrap?: "always" | "never" | "preserve",
plugins?: Array<string | Plugin>
|};
declare type Plugin = {
languages: SupportLanguage,
parsers: { [parserName: string]: Parser },
printers: { [astFormat: string]: Printer }
};
declare type Parser = {
parse: (
text: string,
parsers: { [parserName: string]: Parser },
options: Object
) => AST,
astFormat: string
};
declare type Printer = {
print: (
path: FastPath,
options: Object,
print: (path: FastPath) => Doc
) => Doc,
embed: (
path: FastPath,
print: (path: FastPath) => Doc,
textToDoc: (text: string, options: Object) => Doc,
options: Object
) => ?Doc
};
declare type CursorOptions = {|
cursorOffset: number,
printWidth?: $PropertyType<Options, "printWidth">,
tabWidth?: $PropertyType<Options, "tabWidth">,
useTabs?: $PropertyType<Options, "useTabs">,
semi?: $PropertyType<Options, "semi">,
singleQuote?: $PropertyType<Options, "singleQuote">,
trailingComma?: $PropertyType<Options, "trailingComma">,
bracketSpacing?: $PropertyType<Options, "bracketSpacing">,
jsxBracketSameLine?: $PropertyType<Options, "jsxBracketSameLine">,
arrowParens?: $PropertyType<Options, "arrowParens">,
parser?: $PropertyType<Options, "parser">,
filepath?: $PropertyType<Options, "filepath">,
requirePragma?: $PropertyType<Options, "requirePragma">,
insertPragma?: $PropertyType<Options, "insertPragma">,
proseWrap?: $PropertyType<Options, "proseWrap">,
plugins?: $PropertyType<Options, "plugins">
|};
declare type CursorResult = {|
formatted: string,
cursorOffset: number
|};
declare type ResolveConfigOptions = {|
useCache?: boolean,
config?: string,
editorconfig?: boolean
|};
declare type SupportLanguage = {
name: string,
since: string,
parsers: Array<string>,
group?: string,
tmScope: string,
aceMode: string,
codemirrorMode: string,
codemirrorMimeType: string,
aliases?: Array<string>,
extensions: Array<string>,
filenames?: Array<string>,
linguistLanguageId: number,
vscodeLanguageIds: Array<string>
};
declare type SupportOption = {|
since: string,
type: "int" | "boolean" | "choice" | "path",
deprecated?: string,
redirect?: SupportOptionRedirect,
description: string,
oppositeDescription?: string,
default: SupportOptionValue,
range?: SupportOptionRange,
choices?: SupportOptionChoice
|};
declare type SupportOptionRedirect = {|
options: string,
value: SupportOptionValue
|};
declare type SupportOptionRange = {|
start: number,
end: number,
step: number
|};
declare type SupportOptionChoice = {|
value: boolean | string,
description?: string,
since?: string,
deprecated?: string,
redirect?: SupportOptionValue
|};
declare type SupportOptionValue = number | boolean | string;
declare type SupportInfo = {|
languages: Array<SupportLanguage>,
options: Array<SupportOption>
|};
declare type Prettier = {|
format: (source: string, options?: Options) => string,
check: (source: string, options?: Options) => boolean,
formatWithCursor: (source: string, options: CursorOptions) => CursorResult,
resolveConfig: {
(filePath: string, options?: ResolveConfigOptions): Promise<?Options>,
sync(filePath: string, options?: ResolveConfigOptions): Promise<?Options>
},
clearConfigCache: () => void,
getSupportInfo: (version?: string) => SupportInfo
|};
declare export default Prettier;
}