index.d.ts 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // Type definitions for winston 3.0
  2. // Project: https://github.com/winstonjs/winston
  3. /// <reference types="node" />
  4. declare namespace winston {
  5. interface AbstractConfigSetLevels {
  6. [key: string]: number;
  7. }
  8. interface AbstractConfigSetColors {
  9. [key: string]: string | string[];
  10. }
  11. interface AbstractConfigSet {
  12. levels: AbstractConfigSetLevels;
  13. colors: AbstractConfigSetColors;
  14. }
  15. interface CliConfigSetLevels extends AbstractConfigSetLevels {
  16. error: number;
  17. warn: number;
  18. help: number;
  19. data: number;
  20. info: number;
  21. debug: number;
  22. prompt: number;
  23. verbose: number;
  24. input: number;
  25. silly: number;
  26. }
  27. interface CliConfigSetColors extends AbstractConfigSetColors {
  28. error: string | string[];
  29. warn: string | string[];
  30. help: string | string[];
  31. data: string | string[];
  32. info: string | string[];
  33. debug: string | string[];
  34. prompt: string | string[];
  35. verbose: string | string[];
  36. input: string | string[];
  37. silly: string | string[];
  38. }
  39. interface NpmConfigSetLevels extends AbstractConfigSetLevels {
  40. error: number;
  41. warn: number;
  42. info: number;
  43. http: number;
  44. verbose: number;
  45. debug: number;
  46. silly: number;
  47. }
  48. interface NpmConfigSetColors extends AbstractConfigSetColors {
  49. error: string | string[];
  50. warn: string | string[];
  51. info: string | string[];
  52. verbose: string | string[];
  53. debug: string | string[];
  54. silly: string | string[];
  55. }
  56. interface SyslogConfigSetLevels extends AbstractConfigSetLevels {
  57. emerg: number;
  58. alert: number;
  59. crit: number;
  60. error: number;
  61. warning: number;
  62. notice: number;
  63. info: number;
  64. debug: number;
  65. }
  66. interface SyslogConfigSetColors extends AbstractConfigSetColors {
  67. emerg: string | string[];
  68. alert: string | string[];
  69. crit: string | string[];
  70. error: string | string[];
  71. warning: string | string[];
  72. notice: string | string[];
  73. info: string | string[];
  74. debug: string | string[];
  75. }
  76. interface Config {
  77. allColors: AbstractConfigSetColors;
  78. cli: { levels: CliConfigSetLevels, colors: CliConfigSetColors };
  79. npm: { levels: NpmConfigSetLevels, colors: NpmConfigSetColors };
  80. syslog: { levels: SyslogConfigSetLevels, colors: SyslogConfigSetColors };
  81. addColors(colors: AbstractConfigSetColors): void;
  82. }
  83. }
  84. declare const winston: winston.Config;
  85. export = winston;