index.d.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. declare namespace cliBoxes {
  2. /**
  3. Style of the box border.
  4. */
  5. interface BoxStyle {
  6. readonly topLeft: string;
  7. readonly topRight: string;
  8. readonly bottomLeft: string;
  9. readonly bottomRight: string;
  10. readonly horizontal: string;
  11. readonly vertical: string;
  12. }
  13. /**
  14. All box styles.
  15. */
  16. interface Boxes {
  17. /**
  18. @example
  19. ```
  20. ┌────┐
  21. │ │
  22. └────┘
  23. ```
  24. */
  25. readonly single: BoxStyle;
  26. /**
  27. @example
  28. ```
  29. ╔════╗
  30. ║ ║
  31. ╚════╝
  32. ```
  33. */
  34. readonly double: BoxStyle;
  35. /**
  36. @example
  37. ```
  38. ╭────╮
  39. │ │
  40. ╰────╯
  41. ```
  42. */
  43. readonly round: BoxStyle;
  44. /**
  45. @example
  46. ```
  47. ┏━━━━┓
  48. ┃ ┃
  49. ┗━━━━┛
  50. ```
  51. */
  52. readonly bold: BoxStyle;
  53. /**
  54. @example
  55. ```
  56. ╓────╖
  57. ║ ║
  58. ╙────╜
  59. ```
  60. */
  61. readonly singleDouble: BoxStyle;
  62. /**
  63. @example
  64. ```
  65. ╒════╕
  66. │ │
  67. ╘════╛
  68. ```
  69. */
  70. readonly doubleSingle: BoxStyle;
  71. /**
  72. @example
  73. ```
  74. +----+
  75. | |
  76. +----+
  77. ```
  78. */
  79. readonly classic: BoxStyle;
  80. }
  81. }
  82. /**
  83. Boxes for use in the terminal.
  84. @example
  85. ```
  86. import cliBoxes = require('cli-boxes');
  87. console.log(cliBoxes.single);
  88. // {
  89. // topLeft: '┌',
  90. // topRight: '┐',
  91. // bottomRight: '┘',
  92. // bottomLeft: '└',
  93. // vertical: '│',
  94. // horizontal: '─'
  95. // }
  96. ```
  97. */
  98. declare const cliBoxes: cliBoxes.Boxes & {
  99. // TODO: Remove this for the next major release
  100. default: typeof cliBoxes;
  101. };
  102. export = cliBoxes;