版博士V2.0程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. export { assertTypes, clone, createDefer, deepClone, getOwnProperties, getType, isObject, noop, objectAttr, parseRegexp, slash, toArray } from './helpers.js';
  2. export { ArgumentsType, Arrayable, Awaitable, Constructable, DeepMerge, MergeInsertions, MutableArray, Nullable } from './types.js';
  3. import { PrettyFormatOptions } from 'pretty-format';
  4. import util from 'util';
  5. declare function stringify(object: unknown, maxDepth?: number, { maxLength, ...options }?: PrettyFormatOptions & {
  6. maxLength?: number;
  7. }): string;
  8. declare function getSafeTimers(): {
  9. nextTick: any;
  10. setTimeout: any;
  11. setInterval: any;
  12. clearInterval: any;
  13. clearTimeout: any;
  14. setImmediate: any;
  15. clearImmediate: any;
  16. };
  17. declare function setSafeTimers(): void;
  18. declare function shuffle<T>(array: T[], seed?: number): T[];
  19. declare function format(...args: any[]): string;
  20. declare function utilInspect(item: unknown, options?: util.InspectOptions): string;
  21. declare function loupeInspect(obj: unknown): string;
  22. declare function objDisplay(obj: unknown): string;
  23. declare const SAFE_TIMERS_SYMBOL: unique symbol;
  24. declare const SAFE_COLORS_SYMBOL: unique symbol;
  25. declare const colorsMap: {
  26. readonly bold: readonly ["\u001B[1m", "\u001B[22m", "\u001B[22m\u001B[1m"];
  27. readonly dim: readonly ["\u001B[2m", "\u001B[22m", "\u001B[22m\u001B[2m"];
  28. readonly italic: readonly ["\u001B[3m", "\u001B[23m"];
  29. readonly underline: readonly ["\u001B[4m", "\u001B[24m"];
  30. readonly inverse: readonly ["\u001B[7m", "\u001B[27m"];
  31. readonly hidden: readonly ["\u001B[8m", "\u001B[28m"];
  32. readonly strikethrough: readonly ["\u001B[9m", "\u001B[29m"];
  33. readonly black: readonly ["\u001B[30m", "\u001B[39m"];
  34. readonly red: readonly ["\u001B[31m", "\u001B[39m"];
  35. readonly green: readonly ["\u001B[32m", "\u001B[39m"];
  36. readonly yellow: readonly ["\u001B[33m", "\u001B[39m"];
  37. readonly blue: readonly ["\u001B[34m", "\u001B[39m"];
  38. readonly magenta: readonly ["\u001B[35m", "\u001B[39m"];
  39. readonly cyan: readonly ["\u001B[36m", "\u001B[39m"];
  40. readonly white: readonly ["\u001B[37m", "\u001B[39m"];
  41. readonly gray: readonly ["\u001B[90m", "\u001B[39m"];
  42. readonly bgBlack: readonly ["\u001B[40m", "\u001B[49m"];
  43. readonly bgRed: readonly ["\u001B[41m", "\u001B[49m"];
  44. readonly bgGreen: readonly ["\u001B[42m", "\u001B[49m"];
  45. readonly bgYellow: readonly ["\u001B[43m", "\u001B[49m"];
  46. readonly bgBlue: readonly ["\u001B[44m", "\u001B[49m"];
  47. readonly bgMagenta: readonly ["\u001B[45m", "\u001B[49m"];
  48. readonly bgCyan: readonly ["\u001B[46m", "\u001B[49m"];
  49. readonly bgWhite: readonly ["\u001B[47m", "\u001B[49m"];
  50. };
  51. type ColorName = keyof typeof colorsMap;
  52. type ColorsMethods = {
  53. [Key in ColorName]: (input: unknown) => string;
  54. };
  55. type Colors = ColorsMethods & {
  56. isColorSupported: boolean;
  57. reset: (input: unknown) => string;
  58. };
  59. declare function getDefaultColors(): Colors;
  60. declare function getColors(): Colors;
  61. declare function createColors(isTTY?: boolean): Colors;
  62. declare function setupColors(colors: Colors): void;
  63. interface ErrorOptions {
  64. message?: string;
  65. stackTraceLimit?: number;
  66. }
  67. /**
  68. * Get original stacktrace without source map support the most performant way.
  69. * - Create only 1 stack frame.
  70. * - Rewrite prepareStackTrace to bypass "support-stack-trace" (usually takes ~250ms).
  71. */
  72. declare function createSimpleStackTrace(options?: ErrorOptions): string;
  73. export { SAFE_COLORS_SYMBOL, SAFE_TIMERS_SYMBOL, createColors, createSimpleStackTrace, format, getColors, getDefaultColors, getSafeTimers, loupeInspect, objDisplay, setSafeTimers, setupColors, shuffle, stringify, utilInspect };