UNPKG

1.1 kBJavaScriptView Raw
1/**
2 * Copyright 2017-present, Callstack.
3 * All rights reserved.
4 *
5 * types.js
6 *
7 * @flow
8 */
9
10type Choice = {
11 value: string | boolean | number,
12 description: string,
13};
14
15export type CommandOption = {
16 name: string,
17 description: string,
18 parse?: Function,
19 default?: any,
20 example?: string,
21 choices?: Array<Choice>,
22};
23
24export type Command = {
25 name: string,
26 description: string,
27 action: (args: Object) => void | Promise<void>,
28 options?: Array<CommandOption>,
29 adjustOptions?: (options: Object) => void,
30};
31
32export type WebpackStats = {
33 hasWarnings: () => boolean,
34 hasErrors: () => boolean,
35 toJson: ({ [key: string]: any }) => { [key: string]: any },
36};
37
38type LoggerPrint = (...args: any[]) => void;
39
40export type Logger = {
41 info: LoggerPrint,
42 warn: LoggerPrint,
43 error: LoggerPrint,
44 done: LoggerPrint,
45 debug: LoggerPrint,
46 reset: () => Logger,
47};
48
49export type ReactNativeStackFrame = {
50 lineNumber: number,
51 column: number,
52 file: string,
53 methodName: string,
54};
55
56export type ReactNativeStack = Array<ReactNativeStackFrame>;
57
58export type Platform = string;