CustomConsole.d.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. /// <reference types="node" />
  8. import { Console } from 'console';
  9. import type { LogMessage, LogType } from './types';
  10. declare type Formatter = (type: LogType, message: LogMessage) => string;
  11. export default class CustomConsole extends Console {
  12. private _stdout;
  13. private _stderr;
  14. private _formatBuffer;
  15. private _counters;
  16. private _timers;
  17. private _groupDepth;
  18. Console: NodeJS.ConsoleConstructor;
  19. constructor(stdout: NodeJS.WriteStream, stderr: NodeJS.WriteStream, formatBuffer?: Formatter);
  20. private _log;
  21. private _logError;
  22. assert(value: unknown, message?: string | Error): asserts value;
  23. count(label?: string): void;
  24. countReset(label?: string): void;
  25. debug(firstArg: unknown, ...args: Array<unknown>): void;
  26. dir(firstArg: unknown, ...args: Array<unknown>): void;
  27. dirxml(firstArg: unknown, ...args: Array<unknown>): void;
  28. error(firstArg: unknown, ...args: Array<unknown>): void;
  29. group(title?: string, ...args: Array<unknown>): void;
  30. groupCollapsed(title?: string, ...args: Array<unknown>): void;
  31. groupEnd(): void;
  32. info(firstArg: unknown, ...args: Array<unknown>): void;
  33. log(firstArg: unknown, ...args: Array<unknown>): void;
  34. time(label?: string): void;
  35. timeEnd(label?: string): void;
  36. timeLog(label?: string, ...data: Array<unknown>): void;
  37. warn(firstArg: unknown, ...args: Array<unknown>): void;
  38. getBuffer(): undefined;
  39. }
  40. export {};