-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
211 lines (153 loc) · 5.47 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
// @ts-ignore
import { Buffer } from 'buffer'
// @ts-ignore
import { WritableStream } from 'stream'
// @ts-ignore
import NodeJS from 'NodeJS'
import { Chalk } from "chalk"
import { StringJs, StringJsConstructor } from "./string"
export type ChalkLike = string|Chalk|Function
export type StringLike = ''|string|String|StringExtra|StringJs
export interface StringExtraInspector {
(value:any, options?:StringExtraOptions): StringLike
}
export interface StringExtraChalk {
// Modifiers.
readonly reset: StringExtra
readonly bold: StringExtra
readonly dim: StringExtra
readonly italic: StringExtra
readonly underline: StringExtra
readonly inverse: StringExtra
readonly hidden: StringExtra
readonly strikethrough: StringExtra
// Foreground.
readonly black: StringExtra
readonly red: StringExtra
readonly green: StringExtra
readonly yellow: StringExtra
readonly blue: StringExtra
readonly magenta: StringExtra
readonly cyan: StringExtra
readonly white: StringExtra
readonly gray: StringExtra
readonly grey: StringExtra
// The "blackBright" style doesn't actually exist currently.
// @see https://github.com/chalk/ansi-styles/issues/48
// @see https://github.com/chalk/chalk/issues/257
// readonly blackBright: StringExtra
readonly redBright: StringExtra
readonly greenBright: StringExtra
readonly yellowBright: StringExtra
readonly blueBright: StringExtra
readonly magentaBright: StringExtra
readonly cyanBright: StringExtra
readonly whiteBright: StringExtra
// Background.
readonly bgBlack: StringExtra
readonly bgRed: StringExtra
readonly bgGreen: StringExtra
readonly bgYellow: StringExtra
readonly bgBlue: StringExtra
readonly bgMagenta: StringExtra
readonly bgCyan: StringExtra
readonly bgWhite: StringExtra
readonly bgBlackBright: StringExtra
readonly bgRedBright: StringExtra
readonly bgGreenBright: StringExtra
readonly bgYellowBright: StringExtra
readonly bgBlueBright: StringExtra
readonly bgMagentaBright: StringExtra
readonly bgCyanBright: StringExtra
readonly bgWhiteBright: StringExtra
// Custom styles.
readonly america: StringExtra
readonly christmas: StringExtra
readonly header: StringExtra
readonly rainbow: StringExtra
readonly zebra: StringExtra
}
export interface StringExtraOptions {
activeStyle: string
args: any[]
argStyle: ChalkLike
color: boolean
encoding: string
inspector: StringExtraInspector
inspectorOptions: Object
nullAsEmptyString: boolean
prefix: StringLike
prefixDelimiter: StringLike
style: ChalkLike
styleSpaces: boolean
suffix: StringLike
suffixDelimiter: StringLike
}
export interface StringExtraStaticDeprecated {
/**
* @deprecated since 1.0.2. Use StringExtra.create instead.
*/
S(value:any, ...args:any[]): StringExtra
}
export interface StringExtraConstructor extends StringExtraStaticDeprecated, StringJsConstructor {
new (value:any, options?:StringExtraOptions): StringExtra
create(value:any, options?:StringExtraOptions): StringExtra
createRoot(value:any, options?:StringExtraOptions): StringExtra
cloneInstance(instance:StringLike|any): StringExtra
cloneRootInstance(instance:StringLike|any): StringExtra
deprecated(value:any, options?:StringExtraOptions): StringExtra
escapeRegExp(string:string): string
hookStream(...streams:(WritableStream|NodeJS.WriteStream)[]): void
unhookStream(...streams:(WritableStream|NodeJS.WriteStream)[]): void
defaultOptions: StringExtraOptions
defaultStyles: {[key: string]: string[]}
inspectProperties: Symbol
sprintfPlaceholders: RegExp
StringExtra: StringExtra
StringJs: StringJs
}
export interface StringExtraDeprecated {
/**
* @deprecated Use appropriate setter/getter option methods instead.
*/
config(name?:string, value?:any): StringExtra|any
/**
* @deprecated Use appropriate setter/getter option methods instead.
*/
config(option?:StringExtraOptions): StringExtra|any
/**
* @deprecated Use appropriate setter/getter option methods instead.
*/
option(name?:string, value?:any): StringExtra|any
/**
* @deprecated Use appropriate setter/getter option methods instead.
*/
option(option?:StringExtraOptions): StringExtra|any
}
export interface StringExtra extends StringExtraDeprecated, StringExtraChalk, StringJs {
(value?:any, ...args:any[]): StringExtra
constructor: StringExtraConstructor
argStyle: StringExtra
b: Buffer
rawLength: number
resetStyle: StringExtra
args(...args:any): StringExtra
attachCustomInspector(): void
clone(): StringExtra
cloneRoot(): StringExtra
customInspector(): string
extractPlaceholders(value:any): string[]
format(value:any, args:any[], options:{}): string
formatTheme(value:string, theme:ChalkLike[]): string
getOption(name:string):any
getOptions(): StringExtraOptions
inspect(): StringExtra
prefix(value:StringLike, delimiter?: StringLike): StringExtra
setOption(name:string, value:any): StringExtra
setOptions(options:StringExtraOptions): StringExtra
style(style:ChalkLike, reset?:boolean): StringExtra
suffix(value:StringLike, delimiter?: StringLike): StringExtra
resetFormatted(): StringExtra
}
declare function StringExtraFactory(value:any, ...args:any[]): StringExtra
export default StringExtraFactory