-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathindex.d.ts
279 lines (267 loc) · 9.31 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
declare const figureSet: {
readonly tick: string;
readonly info: string;
readonly warning: string;
readonly cross: string;
readonly square: string;
readonly squareSmall: string;
readonly squareSmallFilled: string;
readonly squareDarkShade: string;
readonly squareMediumShade: string;
readonly squareLightShade: string;
readonly squareTop: string;
readonly squareBottom: string;
readonly squareLeft: string;
readonly squareRight: string;
readonly squareCenter: string;
readonly circle: string;
readonly circleFilled: string;
readonly circleDotted: string;
readonly circleDouble: string;
readonly circleCircle: string;
readonly circleCross: string;
readonly circlePipe: string;
readonly circleQuestionMark: string;
readonly radioOn: string;
readonly radioOff: string;
readonly checkboxOn: string;
readonly checkboxOff: string;
readonly checkboxCircleOn: string;
readonly checkboxCircleOff: string;
readonly questionMarkPrefix: string;
readonly bullet: string;
readonly dot: string;
readonly ellipsis: string;
readonly pointer: string;
readonly pointerSmall: string;
readonly triangleUp: string;
readonly triangleUpSmall: string;
readonly triangleUpOutline: string;
readonly triangleDown: string;
readonly triangleDownSmall: string;
readonly triangleLeft: string;
readonly triangleLeftSmall: string;
readonly triangleRight: string;
readonly triangleRightSmall: string;
readonly lozenge: string;
readonly lozengeOutline: string;
readonly home: string;
readonly hamburger: string;
readonly smiley: string;
readonly mustache: string;
readonly heart: string;
readonly star: string;
readonly play: string;
readonly musicNote: string;
readonly musicNoteBeamed: string;
readonly nodejs: string;
readonly arrowUp: string;
readonly arrowDown: string;
readonly arrowLeft: string;
readonly arrowRight: string;
readonly arrowLeftRight: string;
readonly arrowUpDown: string;
readonly almostEqual: string;
readonly notEqual: string;
readonly lessOrEqual: string;
readonly greaterOrEqual: string;
readonly identical: string;
readonly infinity: string;
readonly subscriptZero: string;
readonly subscriptOne: string;
readonly subscriptTwo: string;
readonly subscriptThree: string;
readonly subscriptFour: string;
readonly subscriptFive: string;
readonly subscriptSix: string;
readonly subscriptSeven: string;
readonly subscriptEight: string;
readonly subscriptNine: string;
readonly oneHalf: string;
readonly oneThird: string;
readonly oneQuarter: string;
readonly oneFifth: string;
readonly oneSixth: string;
readonly oneSeventh: string;
readonly oneEighth: string;
readonly oneNinth: string;
readonly oneTenth: string;
readonly twoThirds: string;
readonly twoFifths: string;
readonly threeQuarters: string;
readonly threeFifths: string;
readonly threeEighths: string;
readonly fourFifths: string;
readonly fiveSixths: string;
readonly fiveEighths: string;
readonly sevenEighth: string;
readonly line: string;
readonly lineBold: string;
readonly lineDouble: string;
readonly lineDashed0: string;
readonly lineDashed1: string;
readonly lineDashed2: string;
readonly lineDashed3: string;
readonly lineDashed4: string;
readonly lineDashed5: string;
readonly lineDashed6: string;
readonly lineDashed7: string;
readonly lineDashed8: string;
readonly lineDashed9: string;
readonly lineDashed10: string;
readonly lineDashed11: string;
readonly lineDashed12: string;
readonly lineDashed13: string;
readonly lineDashed14: string;
readonly lineDashed15: string;
readonly lineVertical: string;
readonly lineVerticalBold: string;
readonly lineVerticalDouble: string;
readonly lineVerticalDashed0: string;
readonly lineVerticalDashed1: string;
readonly lineVerticalDashed2: string;
readonly lineVerticalDashed3: string;
readonly lineVerticalDashed4: string;
readonly lineVerticalDashed5: string;
readonly lineVerticalDashed6: string;
readonly lineVerticalDashed7: string;
readonly lineVerticalDashed8: string;
readonly lineVerticalDashed9: string;
readonly lineVerticalDashed10: string;
readonly lineVerticalDashed11: string;
readonly lineDownLeft: string;
readonly lineDownLeftArc: string;
readonly lineDownBoldLeftBold: string;
readonly lineDownBoldLeft: string;
readonly lineDownLeftBold: string;
readonly lineDownDoubleLeftDouble: string;
readonly lineDownDoubleLeft: string;
readonly lineDownLeftDouble: string;
readonly lineDownRight: string;
readonly lineDownRightArc: string;
readonly lineDownBoldRightBold: string;
readonly lineDownBoldRight: string;
readonly lineDownRightBold: string;
readonly lineDownDoubleRightDouble: string;
readonly lineDownDoubleRight: string;
readonly lineDownRightDouble: string;
readonly lineUpLeft: string;
readonly lineUpLeftArc: string;
readonly lineUpBoldLeftBold: string;
readonly lineUpBoldLeft: string;
readonly lineUpLeftBold: string;
readonly lineUpDoubleLeftDouble: string;
readonly lineUpDoubleLeft: string;
readonly lineUpLeftDouble: string;
readonly lineUpRight: string;
readonly lineUpRightArc: string;
readonly lineUpBoldRightBold: string;
readonly lineUpBoldRight: string;
readonly lineUpRightBold: string;
readonly lineUpDoubleRightDouble: string;
readonly lineUpDoubleRight: string;
readonly lineUpRightDouble: string;
readonly lineUpDownLeft: string;
readonly lineUpBoldDownBoldLeftBold: string;
readonly lineUpBoldDownBoldLeft: string;
readonly lineUpDownLeftBold: string;
readonly lineUpBoldDownLeftBold: string;
readonly lineUpDownBoldLeftBold: string;
readonly lineUpDownBoldLeft: string;
readonly lineUpBoldDownLeft: string;
readonly lineUpDoubleDownDoubleLeftDouble: string;
readonly lineUpDoubleDownDoubleLeft: string;
readonly lineUpDownLeftDouble: string;
readonly lineUpDownRight: string;
readonly lineUpBoldDownBoldRightBold: string;
readonly lineUpBoldDownBoldRight: string;
readonly lineUpDownRightBold: string;
readonly lineUpBoldDownRightBold: string;
readonly lineUpDownBoldRightBold: string;
readonly lineUpDownBoldRight: string;
readonly lineUpBoldDownRight: string;
readonly lineUpDoubleDownDoubleRightDouble: string;
readonly lineUpDoubleDownDoubleRight: string;
readonly lineUpDownRightDouble: string;
readonly lineDownLeftRight: string;
readonly lineDownBoldLeftBoldRightBold: string;
readonly lineDownLeftBoldRightBold: string;
readonly lineDownBoldLeftRight: string;
readonly lineDownBoldLeftBoldRight: string;
readonly lineDownBoldLeftRightBold: string;
readonly lineDownLeftRightBold: string;
readonly lineDownLeftBoldRight: string;
readonly lineDownDoubleLeftDoubleRightDouble: string;
readonly lineDownDoubleLeftRight: string;
readonly lineDownLeftDoubleRightDouble: string;
readonly lineUpLeftRight: string;
readonly lineUpBoldLeftBoldRightBold: string;
readonly lineUpLeftBoldRightBold: string;
readonly lineUpBoldLeftRight: string;
readonly lineUpBoldLeftBoldRight: string;
readonly lineUpBoldLeftRightBold: string;
readonly lineUpLeftRightBold: string;
readonly lineUpLeftBoldRight: string;
readonly lineUpDoubleLeftDoubleRightDouble: string;
readonly lineUpDoubleLeftRight: string;
readonly lineUpLeftDoubleRightDouble: string;
readonly lineUpDownLeftRight: string;
readonly lineUpBoldDownBoldLeftBoldRightBold: string;
readonly lineUpDownBoldLeftBoldRightBold: string;
readonly lineUpBoldDownLeftBoldRightBold: string;
readonly lineUpBoldDownBoldLeftRightBold: string;
readonly lineUpBoldDownBoldLeftBoldRight: string;
readonly lineUpBoldDownLeftRight: string;
readonly lineUpDownBoldLeftRight: string;
readonly lineUpDownLeftBoldRight: string;
readonly lineUpDownLeftRightBold: string;
readonly lineUpBoldDownBoldLeftRight: string;
readonly lineUpDownLeftBoldRightBold: string;
readonly lineUpBoldDownLeftBoldRight: string;
readonly lineUpBoldDownLeftRightBold: string;
readonly lineUpDownBoldLeftBoldRight: string;
readonly lineUpDownBoldLeftRightBold: string;
readonly lineUpDoubleDownDoubleLeftDoubleRightDouble: string;
readonly lineUpDoubleDownDoubleLeftRight: string;
readonly lineUpDownLeftDoubleRightDouble: string;
readonly lineCross: string;
readonly lineBackslash: string;
readonly lineSlash: string;
};
type FigureSet = typeof figureSet;
/**
Symbols to use when the terminal supports Unicode symbols.
*/
export const mainSymbols: FigureSet;
/**
Symbols to use when the terminal does not support Unicode symbols.
*/
export const fallbackSymbols: FigureSet;
/**
Symbols to use on any terminal.
*/
export default figureSet;
export type Options = {
/**
Whether to replace symbols with fallbacks.
This can be set to `true` to always use fallback symbols, whether the terminal has poor Unicode support or not.
@default `true` if the terminal has poor Unicode support
*/
readonly useFallback?: boolean;
};
/**
Returns the input with replaced fallback symbols if the terminal has poor Unicode support.
@param string - String where the Unicode symbols will be replaced with fallback symbols depending on the terminal.
@returns The input with replaced fallback Unicode symbols.
@example
```
import figures, {replaceSymbols} from 'figures';
console.log(replaceSymbols('✔ check'));
// On terminals with Unicode symbols: ✔ check
// On other terminals: √ check
console.log(replaceSymbols('✔ check', {useFallback: true}));
// On terminals with Unicode symbols: √ check
// On other terminals: √ check
```
*/
export function replaceSymbols(string: string, options?: Options): string;