1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import vinyl = require('vinyl');
|
9 | import chalk from 'chalk';
|
10 | import through2 = require('through2');
|
11 |
|
12 | export { vinyl as File };
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | export function replaceExtension(npath: string, ext: string): string;
|
18 |
|
19 | export const colors: typeof chalk;
|
20 |
|
21 | export const date: {
|
22 | (now?: Date | string, mask?: string, convertLocalTimeToUTC?: boolean): any;
|
23 | masks: any;
|
24 | };
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | export function log(message?: any, ...optionalParams: any[]): void;
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 | export function template(tmpl: string): (opt: { file: { path: string } }) => string;
|
38 | export function template(tmpl: string, opt: { file: { path: string } }): string;
|
39 |
|
40 | export const env: any;
|
41 |
|
42 | export function beep(): void;
|
43 |
|
44 |
|
45 |
|
46 |
|
47 | export const noop: typeof through2;
|
48 |
|
49 | export function isStream(obj: any): boolean;
|
50 |
|
51 | export function isBuffer(obj: any): boolean;
|
52 |
|
53 | export function isNull(obj: any): boolean;
|
54 |
|
55 | export const linefeed: string;
|
56 |
|
57 | export function combine(streams: NodeJS.ReadWriteStream[]): () => NodeJS.ReadWriteStream;
|
58 | export function combine(...streams: NodeJS.ReadWriteStream[]): () => NodeJS.ReadWriteStream;
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | export function buffer(cb?: (err: Error, data: any[]) => void): NodeJS.ReadWriteStream;
|
65 |
|
66 | export class PluginError implements Error, PluginErrorOptions {
|
67 | constructor(options?: PluginErrorOptions);
|
68 | constructor(pluginName: string, options?: PluginErrorOptions);
|
69 | constructor(pluginName: string, message: string | Error, options?: PluginErrorOptions);
|
70 | /**
|
71 | * The module name of your plugin.
|
72 | */
|
73 | name: string;
|
74 | /**
|
75 | * Can be a string or an existing error.
|
76 | */
|
77 | message: any;
|
78 | fileName: string;
|
79 | lineNumber: number;
|
80 | /**
|
81 | * You need to include the message along with this stack. If you pass an
|
82 | * error in as the message the stack will be pulled from that, otherwise one
|
83 | * will be created.
|
84 | */
|
85 | stack: string;
|
86 | /**
|
87 | * By default the stack will not be shown. Set this to true if you think the
|
88 | * stack is important for your error.
|
89 | */
|
90 | showStack: boolean;
|
91 | /**
|
92 | * Error properties will be included in err.toString(). Can be omitted by
|
93 | * setting this to false.
|
94 | */
|
95 | showProperties: boolean;
|
96 | plugin: string;
|
97 | error: Error;
|
98 | }
|
99 |
|
100 | export interface PluginErrorOptions {
|
101 | /**
|
102 | * The module name of your plugin.
|
103 | */
|
104 | name?: string | undefined;
|
105 | /**
|
106 | * Can be a string or an existing error.
|
107 | */
|
108 | message?: any;
|
109 | fileName?: string | undefined;
|
110 | lineNumber?: number | undefined;
|
111 | /**
|
112 | * You need to include the message along with this stack. If you pass an
|
113 | * error in as the message the stack will be pulled from that, otherwise one
|
114 | * will be created.
|
115 | */
|
116 | stack?: string | undefined;
|
117 | /**
|
118 | * By default the stack will not be shown. Set this to true if you think the
|
119 | * stack is important for your error.
|
120 | */
|
121 | showStack?: boolean | undefined;
|
122 | /**
|
123 | * Error properties will be included in err.toString(). Can be omitted by
|
124 | * setting this to false.
|
125 | */
|
126 | showProperties?: boolean | undefined;
|
127 | plugin?: string | undefined;
|
128 | error?: Error | undefined;
|
129 | }
|