diff options
Diffstat (limited to 'tools/node_modules/eslint/node_modules/ajv/lib/ajv.d.ts')
-rw-r--r-- | tools/node_modules/eslint/node_modules/ajv/lib/ajv.d.ts | 60 |
1 files changed, 33 insertions, 27 deletions
diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/ajv.d.ts b/tools/node_modules/eslint/node_modules/ajv/lib/ajv.d.ts index 763a09be65..6593d0788d 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/ajv.d.ts +++ b/tools/node_modules/eslint/node_modules/ajv/lib/ajv.d.ts @@ -1,12 +1,36 @@ declare var ajv: { (options?: ajv.Options): ajv.Ajv; - new (options?: ajv.Options): ajv.Ajv; - ValidationError: ValidationError; - MissingRefError: MissingRefError; + new(options?: ajv.Options): ajv.Ajv; + ValidationError: typeof AjvErrors.ValidationError; + MissingRefError: typeof AjvErrors.MissingRefError; $dataMetaSchema: object; } +declare namespace AjvErrors { + class ValidationError extends Error { + constructor(errors: Array<ajv.ErrorObject>); + + message: string; + errors: Array<ajv.ErrorObject>; + ajv: true; + validation: true; + } + + class MissingRefError extends Error { + constructor(baseId: string, ref: string, message?: string); + static message: (baseId: string, ref: string) => string; + + message: string; + missingRef: string; + missingSchema: string; + } +} + declare namespace ajv { + type ValidationError = AjvErrors.ValidationError; + + type MissingRefError = AjvErrors.MissingRefError; + interface Ajv { /** * Validate data using schema @@ -268,11 +292,11 @@ declare namespace ajv { } type ErrorParameters = RefParams | LimitParams | AdditionalPropertiesParams | - DependenciesParams | FormatParams | ComparisonParams | - MultipleOfParams | PatternParams | RequiredParams | - TypeParams | UniqueItemsParams | CustomParams | - PatternRequiredParams | PropertyNamesParams | - IfParams | SwitchParams | NoParams | EnumParams; + DependenciesParams | FormatParams | ComparisonParams | + MultipleOfParams | PatternParams | RequiredParams | + TypeParams | UniqueItemsParams | CustomParams | + PatternRequiredParams | PropertyNamesParams | + IfParams | SwitchParams | NoParams | EnumParams; interface RefParams { ref: string; @@ -344,29 +368,11 @@ declare namespace ajv { caseIndex: number; } - interface NoParams {} + interface NoParams { } interface EnumParams { allowedValues: Array<any>; } } -declare class ValidationError extends Error { - constructor(errors: Array<ajv.ErrorObject>); - - message: string; - errors: Array<ajv.ErrorObject>; - ajv: true; - validation: true; -} - -declare class MissingRefError extends Error { - constructor(baseId: string, ref: string, message?: string); - static message: (baseId: string, ref: string) => string; - - message: string; - missingRef: string; - missingSchema: string; -} - export = ajv; |