Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate chalk.constructor() in favor of new chalk.Instance() #322

Merged
merged 10 commits into from
Mar 12, 2019
Prev Previous commit
Next Next commit
Update type definitions
  • Loading branch information
tom-sherman committed Jan 26, 2019
commit 08f9e5f3e347f1f57277ca058aa057f1a7dadc12
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ export interface Options {
level?: Level;
}

export interface Constructor {
export interface Instance {
/**
* Return a new Chalk instance.
*/
@@ -75,7 +75,7 @@ export interface Chalk {
/**
* Return a new Chalk instance.
*/
constructor: Constructor;
instance: Instance;

/**
* Enable or disable Chalk.
2 changes: 1 addition & 1 deletion index.js.flow
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ export type ColorSupport = {|
export interface Chalk {
(...text: string[]): string,
(text: TemplateStringsArray, ...placeholders: mixed[]): string,
constructor(options?: Options): Chalk,
instance(options?: Options): Chalk,
enabled: boolean,
level: Level,
rgb(red: number, green: number, blue: number): Chalk,