Skip to content

Commit

Permalink
Merge pull request ajv-validator#865 from jsdevel/adding-logger-to-ts
Browse files Browse the repository at this point in the history
Adding logger to typescript Options declaration.
  • Loading branch information
epoberezkin committed Oct 28, 2018
2 parents d5edde4 + ae68416 commit 2acd5f3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/ajv.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ declare namespace ajv {
errors?: Array<ErrorObject>;
}

interface CustomLogger {
log(...args: any[]): any;
warn(...args: any[]): any;
error(...args: any[]): any;
}

interface ValidateFunction {
(
data: any,
Expand Down Expand Up @@ -157,6 +163,7 @@ declare namespace ajv {
sourceCode?: boolean;
processCode?: (code: string) => string;
cache?: object;
logger?: CustomLogger | false
}

type FormatValidator = string | RegExp | ((data: string) => boolean | PromiseLike<any>);
Expand Down

0 comments on commit 2acd5f3

Please sign in to comment.