diff --git a/types/index.d.ts b/types/index.d.ts index eac5837..7a11e6a 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -13,7 +13,7 @@ export interface ChalkOptions { level?: Level; } -export interface ChalkConstructor extends Chalk { +export interface ChalkConstructor { new (options?: ChalkOptions): Chalk; (options?: ChalkOptions): Chalk; } @@ -28,8 +28,6 @@ export interface ColorSupport { export interface Chalk { (...text: string[]): string; (text: TemplateStringsArray, ...placeholders: string[]): string; - new (options?: ChalkOptions): Chalk; - (options: ChalkOptions): Chalk; constructor: ChalkConstructor; enabled: boolean; level: Level; diff --git a/types/test.ts b/types/test.ts index 16652ee..2e39415 100644 --- a/types/test.ts +++ b/types/test.ts @@ -28,10 +28,12 @@ chalk.level = Level.Ansi256; chalk.level === Level.Ansi256; -let chalkInstance = new chalk(); -chalkInstance = new chalk.constructor(); +let chalkInstance = new chalk.constructor(); chalkInstance = chalk.constructor(); +chalkInstance.blue('foo'); +chalkInstance`foo`; + let x = 'imastring'; x = chalk();