UNPKG

1.06 kBTypeScriptView Raw
1import type { WriteStream } from 'node:tty';
2type Log = (format?: any, ...params: any[]) => void;
3type IOStream = NodeJS.WritableStream & Pick<WriteStream, 'isTTY' | 'rows' | 'columns'> & Pick<Partial<WriteStream>, 'hasColors' | 'clearLine' | 'getColorDepth'>;
4export interface IConsole {
5 readonly log: Log;
6 readonly error: Log;
7 readonly info: Log;
8 readonly warn: Log;
9 readonly stderrChannel: Channel;
10 readonly stdoutChannel: Channel;
11}
12export declare const console: IConsole;
13export declare function log(...p: Parameters<typeof console.log>): void;
14export declare function error(...p: Parameters<typeof console.error>): void;
15export interface Channel {
16 stream: IOStream;
17 write: (msg: string) => void;
18 writeLine: (msg: string) => void;
19 clearLine: (dir: -1 | 0 | 1, callback?: () => void) => boolean;
20 printLine: (format?: any, ...params: any[]) => void;
21 getColorLevel: () => 0 | 1 | 2 | 3;
22}
23export declare function getColorLevel(stream: IOStream): 0 | 1 | 2 | 3;
24export {};
25//# sourceMappingURL=console.d.ts.map
\No newline at end of file