diff --git a/types/index.d.ts b/types/index.d.ts index 6e0acc5..a711115 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -8,22 +8,22 @@ declare function chalk(text: TemplateStringsArray, ...placeholders: string[]): s declare namespace chalk { - export enum ChalkLevel { - Disabled = 0, + export enum Level { + None = 0, Basic = 1, Extended = 2, TrueColor = 3 } - interface ChalkConstructorOptions { + interface ConstructorOptions { enabled?: boolean; - level?: ChalkLevel; + level?: Level; } - export function constructor(options?: ChalkConstructorOptions): typeof chalk; + export function constructor(options?: ConstructorOptions): typeof chalk; export let enabled: boolean; - export let level: ChalkLevel; + export let level: Level; export const supportsColor: boolean; export const hex: (color: string) => typeof chalk; diff --git a/types/test.ts b/types/test.ts index c2f20b9..53a6df6 100644 --- a/types/test.ts +++ b/types/test.ts @@ -5,7 +5,6 @@ chalk.red('foo'); chalk.bgRed('foo'); const name = 'Josh'; -const number = 0; chalk`Hello {bold.red ${name}}`; chalk.red`foo`; @@ -18,12 +17,12 @@ chalk.underline.red.bgGreen('foo'); chalk.grey('foo'); chalk.constructor({level: 1}); -const ctx = chalk.constructor({level: chalk.ChalkLevel.TrueColor }); +const ctx = chalk.constructor({level: chalk.Level.TrueColor }); ctx('foo'); ctx.red('foo'); ctx`foo`; -chalk.level === chalk.ChalkLevel.Extended; +chalk.level === chalk.Level.Extended; chalk.enabled; chalk.supportsColor;