diff --git a/types/index.d.ts b/types/index.d.ts index 6d2c710..7505746 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -4,7 +4,7 @@ export const enum Level { None = 0, Basic = 1, - Extended = 2, + Ansi256 = 2, TrueColor = 3 } @@ -14,8 +14,8 @@ export interface ChalkOptions { } export interface Chalk { - new (options: ChalkOptions): Chalk; - (options: ChalkOptions): Chalk; + new (options?: ChalkOptions): Chalk; + (options?: ChalkOptions): Chalk; (...text: string[]): string; (text: TemplateStringsArray, ...placeholders: string[]): string; constructor: Chalk; diff --git a/types/test.ts b/types/test.ts index fad1ae4..01509fd 100644 --- a/types/test.ts +++ b/types/test.ts @@ -24,9 +24,13 @@ ctx`foo`; chalk.enabled = true; 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.level; diff --git a/types/tsconfig.json b/types/tsconfig.json index af436cc..b73840f 100644 --- a/types/tsconfig.json +++ b/types/tsconfig.json @@ -1,9 +1,9 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", - "noImplicitAny": true, - "noEmit": true, - "allowJs": true + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noEmit": true, + "allowJs": true } }