Skip to content

Commit

Permalink
fix(types): allow passing extra arguments (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
posva authored and pi0 committed Mar 29, 2019
1 parent dfc9d27 commit d29fc46
Showing 1 changed file with 48 additions and 48 deletions.
96 changes: 48 additions & 48 deletions types/consola.d.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
declare interface ConsolaReporter {
log: (logObj: any, { async, stdout, stderr }: any) => void
log: (logObj: any, { async, stdout, stderr }: any) => void
}

declare class Consola {
// Built-in log levels
static fatal (message: any): void;
static error (message: any): void;
static warn (message: any): void;
static log (message: any): void;
static info (message: any): void;
static start (message: any): void;
static success (message: any): void;
static ready (message: any): void;
static debug (message: any): void;
static trace(message: any): void;

// Create
static create(options: any): (typeof Consola);
static withDefaults(defaults: any): (typeof Consola);

static withTag(tag: string): (typeof Consola);
static withScope(tag: string): (typeof Consola);

// Reporter
static addReporter(reporter: ConsolaReporter): (typeof Consola);
static setReporters(reporters: Array<ConsolaReporter>): (typeof Consola);

static removeReporter(reporter: any): (typeof Consola);
static remove(reporter: any): (typeof Consola);
static clear(reporter: any): (typeof Consola);

// Wrappers
static wrapAll(): void;
static restoreAll(): void;
static wrapConsole(): void;
static restoreConsole(): void;
static wrapStd(): void;
static restoreStd(): void;

// Pause/Resume
static pauseLogs(): void;
static pause(): void;

static resumeLogs(): void;
static resume(): void;

// Mock
static mockTypes(mockFn: any): any;
static mock(mockFn: any): any;
// Built-in log levels
static fatal(message: any, ...args: any[]): void
static error(message: any, ...args: any[]): void
static warn(message: any, ...args: any[]): void
static log(message: any, ...args: any[]): void
static info(message: any, ...args: any[]): void
static start(message: any, ...args: any[]): void
static success(message: any, ...args: any[]): void
static ready(message: any, ...args: any[]): void
static debug(message: any, ...args: any[]): void
static trace(message: any, ...args: any[]): void

// Create
static create(options: any): typeof Consola
static withDefaults(defaults: any): typeof Consola

static withTag(tag: string): typeof Consola
static withScope(tag: string): typeof Consola

// Reporter
static addReporter(reporter: ConsolaReporter): typeof Consola
static setReporters(reporters: Array<ConsolaReporter>): typeof Consola

static removeReporter(reporter: any): typeof Consola
static remove(reporter: any): typeof Consola
static clear(reporter: any): typeof Consola

// Wrappers
static wrapAll(): void
static restoreAll(): void
static wrapConsole(): void
static restoreConsole(): void
static wrapStd(): void
static restoreStd(): void

// Pause/Resume
static pauseLogs(): void
static pause(): void

static resumeLogs(): void
static resume(): void

// Mock
static mockTypes(mockFn: any): any
static mock(mockFn: any): any
}

declare module "consola" {
export default Consola;
declare module 'consola' {
export default Consola
}

0 comments on commit d29fc46

Please sign in to comment.