fix(types): optional chalkOptions, Extended -> Ansi256
This commit is contained in:
parent
98b42414b4
commit
64f592b70c
3 changed files with 14 additions and 10 deletions
6
types/index.d.ts
vendored
6
types/index.d.ts
vendored
|
|
@ -4,7 +4,7 @@
|
||||||
export const enum Level {
|
export const enum Level {
|
||||||
None = 0,
|
None = 0,
|
||||||
Basic = 1,
|
Basic = 1,
|
||||||
Extended = 2,
|
Ansi256 = 2,
|
||||||
TrueColor = 3
|
TrueColor = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -14,8 +14,8 @@ export interface ChalkOptions {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Chalk {
|
export interface Chalk {
|
||||||
new (options: ChalkOptions): Chalk;
|
new (options?: ChalkOptions): Chalk;
|
||||||
(options: ChalkOptions): Chalk;
|
(options?: ChalkOptions): Chalk;
|
||||||
(...text: string[]): string;
|
(...text: string[]): string;
|
||||||
(text: TemplateStringsArray, ...placeholders: string[]): string;
|
(text: TemplateStringsArray, ...placeholders: string[]): string;
|
||||||
constructor: Chalk;
|
constructor: Chalk;
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,13 @@ ctx`foo`;
|
||||||
|
|
||||||
chalk.enabled = true;
|
chalk.enabled = true;
|
||||||
chalk.level = 1;
|
chalk.level = 1;
|
||||||
chalk.level = Level.Extended;
|
chalk.level = Level.Ansi256;
|
||||||
|
|
||||||
chalk.level === Level.Extended;
|
chalk.level === Level.Ansi256;
|
||||||
|
|
||||||
|
let chalkInstance = new chalk();
|
||||||
|
chalkInstance = new chalk.constructor();
|
||||||
|
chalkInstance = chalk.constructor();
|
||||||
|
|
||||||
chalk.enabled;
|
chalk.enabled;
|
||||||
chalk.level;
|
chalk.level;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue