1 |
|
2 | import { CpuInfo } from 'os';
|
3 | import { SpawnSyncOptions } from 'child_process';
|
4 | export declare type BufferEncoding = 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'base64' | 'latin1' | 'binary' | 'hex';
|
5 | export declare type NodeCallback = (err?: Error, data?: any) => void;
|
6 | export declare type NodeAnyCallback = (...args: any[]) => void;
|
7 | export declare type LogCallback = (type: string, msg: string, meta: IMap<any>, info: {
|
8 | timestamp: string;
|
9 | args: any[];
|
10 | stackTrace?: IStacktraceFrame[];
|
11 | error?: Error;
|
12 | }) => void;
|
13 | export declare type CopyTuple = [string, string];
|
14 | export declare type StringBuilderAdd = (str: any, styles: string | string[]) => IStringBuilderMethods;
|
15 | export declare type StringBuilderRender = (char?: string) => string;
|
16 | export declare type StringBuilderJoin = (char?: string) => IStringBuilderMethods;
|
17 | export declare type StringBuilderFormat = (...args: any[]) => IStringBuilderMethods;
|
18 | export declare type Colors = 'white' | 'black' | 'red' | 'green' | 'blue' | 'yellow' | 'magenta' | 'gray';
|
19 | export interface IMap<T> {
|
20 | [key: string]: T;
|
21 | }
|
22 | export interface IMapAny {
|
23 | [key: string]: any;
|
24 | }
|
25 | export interface ICopy {
|
26 | src: string;
|
27 | dest: string;
|
28 | }
|
29 | export interface IStringBuilderMethods {
|
30 | add: StringBuilderAdd;
|
31 | join: StringBuilderJoin;
|
32 | format: StringBuilderFormat;
|
33 | render: StringBuilderRender;
|
34 | }
|
35 | export interface ITSNodeOptions {
|
36 | fast?: boolean | null;
|
37 | cache?: boolean | null;
|
38 | cacheDirectory?: string;
|
39 | compiler?: string;
|
40 | project?: boolean | string;
|
41 | ignore?: boolean | string | string[];
|
42 | ignoreWarnings?: number | string | Array<number | string>;
|
43 | disableWarnings?: boolean | null;
|
44 | getFile?: (path: string) => string;
|
45 | fileExists?: (path: string) => boolean;
|
46 | compilerOptions?: any;
|
47 | }
|
48 | export declare type NpmCommand = (...args: any[]) => any;
|
49 | export interface IUIOptions {
|
50 | text: string;
|
51 | width?: number;
|
52 | padding?: number | number[];
|
53 | align?: string;
|
54 | border?: boolean;
|
55 | }
|
56 | export interface ICpu extends CpuInfo {
|
57 | cores?: number;
|
58 | }
|
59 | export interface IExecMethods {
|
60 | command(cmd: string, args: string | string[], options?: boolean | SpawnSyncOptions): any;
|
61 | node(args: string | string[], options?: boolean | SpawnSyncOptions): any;
|
62 | npm(args: string | string[], options?: boolean | SpawnSyncOptions): any;
|
63 | }
|
64 | export interface ILoggerOptions {
|
65 | stream?: NodeJS.WritableStream;
|
66 | level?: string | number;
|
67 | depth?: number;
|
68 | colors?: boolean;
|
69 | errorExit?: boolean;
|
70 | errorCapture?: boolean;
|
71 | stackTrace?: boolean;
|
72 | prettyStack?: boolean;
|
73 | miniStack?: boolean;
|
74 | timestamp?: boolean | 'date' | 'time';
|
75 | colorMap?: {
|
76 | error?: Colors;
|
77 | warn?: Colors;
|
78 | info?: Colors;
|
79 | debug?: Colors;
|
80 | };
|
81 | onLogged?: LogCallback;
|
82 | }
|
83 | export interface IStacktraceFrame {
|
84 | method: string;
|
85 | filename: string;
|
86 | relative: string;
|
87 | line: number;
|
88 | column: number;
|
89 | }
|
90 | export interface IStacktraceResult {
|
91 | frames: IStacktraceFrame[];
|
92 | stack: string[];
|
93 | miniStack: string;
|
94 | }
|