@alexlit/lint-kit 117.3.1 → 117.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/package.json +1 -1
  2. package/packages/config-eslint/package.json +7 -11
  3. package/packages/config-eslint/plugins/no-await-in-promise.js +1 -1
  4. package/packages/config-eslint/utils/create-config.js +3 -3
  5. package/packages/config-hooks/package.json +2 -2
  6. package/scripts/.config.sh +1 -1
  7. package/packages/config-eslint/node_modules/@eslint/eslintrc/LICENSE +0 -19
  8. package/packages/config-eslint/node_modules/@eslint/eslintrc/README.md +0 -126
  9. package/packages/config-eslint/node_modules/@eslint/eslintrc/conf/config-schema.js +0 -79
  10. package/packages/config-eslint/node_modules/@eslint/eslintrc/conf/environments.js +0 -215
  11. package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs +0 -1143
  12. package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map +0 -1
  13. package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +0 -4371
  14. package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map +0 -1
  15. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js +0 -532
  16. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/config-array.js +0 -510
  17. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js +0 -124
  18. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js +0 -145
  19. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js +0 -238
  20. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/index.js +0 -19
  21. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js +0 -225
  22. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array-factory.js +0 -1155
  23. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/flat-compat.js +0 -318
  24. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/index-universal.js +0 -29
  25. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/index.js +0 -58
  26. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/ajv.js +0 -191
  27. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/config-ops.js +0 -135
  28. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/config-validator.js +0 -370
  29. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js +0 -63
  30. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/naming.js +0 -96
  31. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js +0 -42
  32. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/types.js +0 -149
  33. package/packages/config-eslint/node_modules/@eslint/eslintrc/package.json +0 -82
  34. package/packages/config-eslint/node_modules/@eslint/eslintrc/universal.js +0 -9
  35. package/packages/config-eslint/node_modules/ajv/.tonic_example.js +0 -20
  36. package/packages/config-eslint/node_modules/ajv/LICENSE +0 -22
  37. package/packages/config-eslint/node_modules/ajv/README.md +0 -1497
  38. package/packages/config-eslint/node_modules/ajv/dist/ajv.bundle.js +0 -7189
  39. package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js +0 -3
  40. package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js.map +0 -1
  41. package/packages/config-eslint/node_modules/ajv/lib/ajv.d.ts +0 -397
  42. package/packages/config-eslint/node_modules/ajv/lib/ajv.js +0 -506
  43. package/packages/config-eslint/node_modules/ajv/lib/cache.js +0 -26
  44. package/packages/config-eslint/node_modules/ajv/lib/compile/async.js +0 -90
  45. package/packages/config-eslint/node_modules/ajv/lib/compile/equal.js +0 -5
  46. package/packages/config-eslint/node_modules/ajv/lib/compile/error_classes.js +0 -34
  47. package/packages/config-eslint/node_modules/ajv/lib/compile/formats.js +0 -142
  48. package/packages/config-eslint/node_modules/ajv/lib/compile/index.js +0 -387
  49. package/packages/config-eslint/node_modules/ajv/lib/compile/resolve.js +0 -270
  50. package/packages/config-eslint/node_modules/ajv/lib/compile/rules.js +0 -66
  51. package/packages/config-eslint/node_modules/ajv/lib/compile/schema_obj.js +0 -9
  52. package/packages/config-eslint/node_modules/ajv/lib/compile/ucs2length.js +0 -20
  53. package/packages/config-eslint/node_modules/ajv/lib/compile/util.js +0 -239
  54. package/packages/config-eslint/node_modules/ajv/lib/data.js +0 -49
  55. package/packages/config-eslint/node_modules/ajv/lib/definition_schema.js +0 -37
  56. package/packages/config-eslint/node_modules/ajv/lib/dot/_limit.jst +0 -113
  57. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitItems.jst +0 -12
  58. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitLength.jst +0 -12
  59. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitProperties.jst +0 -12
  60. package/packages/config-eslint/node_modules/ajv/lib/dot/allOf.jst +0 -32
  61. package/packages/config-eslint/node_modules/ajv/lib/dot/anyOf.jst +0 -46
  62. package/packages/config-eslint/node_modules/ajv/lib/dot/coerce.def +0 -51
  63. package/packages/config-eslint/node_modules/ajv/lib/dot/comment.jst +0 -9
  64. package/packages/config-eslint/node_modules/ajv/lib/dot/const.jst +0 -11
  65. package/packages/config-eslint/node_modules/ajv/lib/dot/contains.jst +0 -55
  66. package/packages/config-eslint/node_modules/ajv/lib/dot/custom.jst +0 -191
  67. package/packages/config-eslint/node_modules/ajv/lib/dot/defaults.def +0 -47
  68. package/packages/config-eslint/node_modules/ajv/lib/dot/definitions.def +0 -203
  69. package/packages/config-eslint/node_modules/ajv/lib/dot/dependencies.jst +0 -79
  70. package/packages/config-eslint/node_modules/ajv/lib/dot/enum.jst +0 -30
  71. package/packages/config-eslint/node_modules/ajv/lib/dot/errors.def +0 -194
  72. package/packages/config-eslint/node_modules/ajv/lib/dot/format.jst +0 -106
  73. package/packages/config-eslint/node_modules/ajv/lib/dot/if.jst +0 -73
  74. package/packages/config-eslint/node_modules/ajv/lib/dot/items.jst +0 -98
  75. package/packages/config-eslint/node_modules/ajv/lib/dot/missing.def +0 -39
  76. package/packages/config-eslint/node_modules/ajv/lib/dot/multipleOf.jst +0 -22
  77. package/packages/config-eslint/node_modules/ajv/lib/dot/not.jst +0 -43
  78. package/packages/config-eslint/node_modules/ajv/lib/dot/oneOf.jst +0 -54
  79. package/packages/config-eslint/node_modules/ajv/lib/dot/pattern.jst +0 -14
  80. package/packages/config-eslint/node_modules/ajv/lib/dot/properties.jst +0 -245
  81. package/packages/config-eslint/node_modules/ajv/lib/dot/propertyNames.jst +0 -52
  82. package/packages/config-eslint/node_modules/ajv/lib/dot/ref.jst +0 -85
  83. package/packages/config-eslint/node_modules/ajv/lib/dot/required.jst +0 -108
  84. package/packages/config-eslint/node_modules/ajv/lib/dot/uniqueItems.jst +0 -62
  85. package/packages/config-eslint/node_modules/ajv/lib/dot/validate.jst +0 -276
  86. package/packages/config-eslint/node_modules/ajv/lib/dotjs/README.md +0 -3
  87. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limit.js +0 -163
  88. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitItems.js +0 -80
  89. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitLength.js +0 -85
  90. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitProperties.js +0 -80
  91. package/packages/config-eslint/node_modules/ajv/lib/dotjs/allOf.js +0 -42
  92. package/packages/config-eslint/node_modules/ajv/lib/dotjs/anyOf.js +0 -73
  93. package/packages/config-eslint/node_modules/ajv/lib/dotjs/comment.js +0 -14
  94. package/packages/config-eslint/node_modules/ajv/lib/dotjs/const.js +0 -56
  95. package/packages/config-eslint/node_modules/ajv/lib/dotjs/contains.js +0 -81
  96. package/packages/config-eslint/node_modules/ajv/lib/dotjs/custom.js +0 -228
  97. package/packages/config-eslint/node_modules/ajv/lib/dotjs/dependencies.js +0 -168
  98. package/packages/config-eslint/node_modules/ajv/lib/dotjs/enum.js +0 -66
  99. package/packages/config-eslint/node_modules/ajv/lib/dotjs/format.js +0 -150
  100. package/packages/config-eslint/node_modules/ajv/lib/dotjs/if.js +0 -103
  101. package/packages/config-eslint/node_modules/ajv/lib/dotjs/index.js +0 -33
  102. package/packages/config-eslint/node_modules/ajv/lib/dotjs/items.js +0 -140
  103. package/packages/config-eslint/node_modules/ajv/lib/dotjs/multipleOf.js +0 -80
  104. package/packages/config-eslint/node_modules/ajv/lib/dotjs/not.js +0 -84
  105. package/packages/config-eslint/node_modules/ajv/lib/dotjs/oneOf.js +0 -73
  106. package/packages/config-eslint/node_modules/ajv/lib/dotjs/pattern.js +0 -75
  107. package/packages/config-eslint/node_modules/ajv/lib/dotjs/properties.js +0 -335
  108. package/packages/config-eslint/node_modules/ajv/lib/dotjs/propertyNames.js +0 -81
  109. package/packages/config-eslint/node_modules/ajv/lib/dotjs/ref.js +0 -124
  110. package/packages/config-eslint/node_modules/ajv/lib/dotjs/required.js +0 -270
  111. package/packages/config-eslint/node_modules/ajv/lib/dotjs/uniqueItems.js +0 -86
  112. package/packages/config-eslint/node_modules/ajv/lib/dotjs/validate.js +0 -482
  113. package/packages/config-eslint/node_modules/ajv/lib/keyword.js +0 -146
  114. package/packages/config-eslint/node_modules/ajv/lib/refs/data.json +0 -17
  115. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-04.json +0 -149
  116. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-06.json +0 -154
  117. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-07.json +0 -168
  118. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-secure.json +0 -94
  119. package/packages/config-eslint/node_modules/ajv/package.json +0 -106
  120. package/packages/config-eslint/node_modules/ajv/scripts/.eslintrc.yml +0 -3
  121. package/packages/config-eslint/node_modules/ajv/scripts/bundle.js +0 -61
  122. package/packages/config-eslint/node_modules/ajv/scripts/compile-dots.js +0 -73
  123. package/packages/config-eslint/node_modules/ajv/scripts/info +0 -10
  124. package/packages/config-eslint/node_modules/ajv/scripts/prepare-tests +0 -12
  125. package/packages/config-eslint/node_modules/ajv/scripts/publish-built-version +0 -32
  126. package/packages/config-eslint/node_modules/ajv/scripts/travis-gh-pages +0 -23
  127. package/packages/config-eslint/node_modules/eslint-visitor-keys/LICENSE +0 -201
  128. package/packages/config-eslint/node_modules/eslint-visitor-keys/README.md +0 -105
  129. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs +0 -384
  130. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts +0 -27
  131. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/index.d.ts +0 -16
  132. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts +0 -12
  133. package/packages/config-eslint/node_modules/eslint-visitor-keys/lib/index.js +0 -65
  134. package/packages/config-eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.js +0 -315
  135. package/packages/config-eslint/node_modules/eslint-visitor-keys/package.json +0 -74
  136. package/packages/config-eslint/node_modules/espree/LICENSE +0 -25
  137. package/packages/config-eslint/node_modules/espree/README.md +0 -244
  138. package/packages/config-eslint/node_modules/espree/dist/espree.cjs +0 -883
  139. package/packages/config-eslint/node_modules/espree/espree.js +0 -177
  140. package/packages/config-eslint/node_modules/espree/lib/espree.js +0 -349
  141. package/packages/config-eslint/node_modules/espree/lib/features.js +0 -27
  142. package/packages/config-eslint/node_modules/espree/lib/options.js +0 -123
  143. package/packages/config-eslint/node_modules/espree/lib/token-translator.js +0 -263
  144. package/packages/config-eslint/node_modules/espree/lib/version.js +0 -3
  145. package/packages/config-eslint/node_modules/espree/package.json +0 -86
  146. package/packages/config-eslint/node_modules/globals/globals.json +0 -1998
  147. package/packages/config-eslint/node_modules/globals/index.d.ts +0 -2077
  148. package/packages/config-eslint/node_modules/globals/index.js +0 -2
  149. package/packages/config-eslint/node_modules/globals/license +0 -9
  150. package/packages/config-eslint/node_modules/globals/package.json +0 -58
  151. package/packages/config-eslint/node_modules/globals/readme.md +0 -44
  152. package/packages/config-eslint/node_modules/json-schema-traverse/.eslintrc.yml +0 -27
  153. package/packages/config-eslint/node_modules/json-schema-traverse/.travis.yml +0 -8
  154. package/packages/config-eslint/node_modules/json-schema-traverse/LICENSE +0 -21
  155. package/packages/config-eslint/node_modules/json-schema-traverse/README.md +0 -83
  156. package/packages/config-eslint/node_modules/json-schema-traverse/index.js +0 -89
  157. package/packages/config-eslint/node_modules/json-schema-traverse/package.json +0 -43
  158. package/packages/config-eslint/node_modules/json-schema-traverse/spec/.eslintrc.yml +0 -6
  159. package/packages/config-eslint/node_modules/json-schema-traverse/spec/fixtures/schema.js +0 -125
  160. package/packages/config-eslint/node_modules/json-schema-traverse/spec/index.spec.js +0 -171
@@ -1,397 +0,0 @@
1
- declare var ajv: {
2
- (options?: ajv.Options): ajv.Ajv;
3
- new(options?: ajv.Options): ajv.Ajv;
4
- ValidationError: typeof AjvErrors.ValidationError;
5
- MissingRefError: typeof AjvErrors.MissingRefError;
6
- $dataMetaSchema: object;
7
- }
8
-
9
- declare namespace AjvErrors {
10
- class ValidationError extends Error {
11
- constructor(errors: Array<ajv.ErrorObject>);
12
-
13
- message: string;
14
- errors: Array<ajv.ErrorObject>;
15
- ajv: true;
16
- validation: true;
17
- }
18
-
19
- class MissingRefError extends Error {
20
- constructor(baseId: string, ref: string, message?: string);
21
- static message: (baseId: string, ref: string) => string;
22
-
23
- message: string;
24
- missingRef: string;
25
- missingSchema: string;
26
- }
27
- }
28
-
29
- declare namespace ajv {
30
- type ValidationError = AjvErrors.ValidationError;
31
-
32
- type MissingRefError = AjvErrors.MissingRefError;
33
-
34
- interface Ajv {
35
- /**
36
- * Validate data using schema
37
- * Schema will be compiled and cached (using serialized JSON as key, [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize by default).
38
- * @param {string|object|Boolean} schemaKeyRef key, ref or schema object
39
- * @param {Any} data to be validated
40
- * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).
41
- */
42
- validate(schemaKeyRef: object | string | boolean, data: any): boolean | PromiseLike<any>;
43
- /**
44
- * Create validating function for passed schema.
45
- * @param {object|Boolean} schema schema object
46
- * @return {Function} validating function
47
- */
48
- compile(schema: object | boolean): ValidateFunction;
49
- /**
50
- * Creates validating function for passed schema with asynchronous loading of missing schemas.
51
- * `loadSchema` option should be a function that accepts schema uri and node-style callback.
52
- * @this Ajv
53
- * @param {object|Boolean} schema schema object
54
- * @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped
55
- * @param {Function} callback optional node-style callback, it is always called with 2 parameters: error (or null) and validating function.
56
- * @return {PromiseLike<ValidateFunction>} validating function
57
- */
58
- compileAsync(schema: object | boolean, meta?: Boolean, callback?: (err: Error, validate: ValidateFunction) => any): PromiseLike<ValidateFunction>;
59
- /**
60
- * Adds schema to the instance.
61
- * @param {object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored.
62
- * @param {string} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
63
- * @return {Ajv} this for method chaining
64
- */
65
- addSchema(schema: Array<object> | object, key?: string): Ajv;
66
- /**
67
- * Add schema that will be used to validate other schemas
68
- * options in META_IGNORE_OPTIONS are alway set to false
69
- * @param {object} schema schema object
70
- * @param {string} key optional schema key
71
- * @return {Ajv} this for method chaining
72
- */
73
- addMetaSchema(schema: object, key?: string): Ajv;
74
- /**
75
- * Validate schema
76
- * @param {object|Boolean} schema schema to validate
77
- * @return {Boolean} true if schema is valid
78
- */
79
- validateSchema(schema: object | boolean): boolean;
80
- /**
81
- * Get compiled schema from the instance by `key` or `ref`.
82
- * @param {string} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id).
83
- * @return {Function} schema validating function (with property `schema`). Returns undefined if keyRef can't be resolved to an existing schema.
84
- */
85
- getSchema(keyRef: string): ValidateFunction | undefined;
86
- /**
87
- * Remove cached schema(s).
88
- * If no parameter is passed all schemas but meta-schemas are removed.
89
- * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
90
- * Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
91
- * @param {string|object|RegExp|Boolean} schemaKeyRef key, ref, pattern to match key/ref or schema object
92
- * @return {Ajv} this for method chaining
93
- */
94
- removeSchema(schemaKeyRef?: object | string | RegExp | boolean): Ajv;
95
- /**
96
- * Add custom format
97
- * @param {string} name format name
98
- * @param {string|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid)
99
- * @return {Ajv} this for method chaining
100
- */
101
- addFormat(name: string, format: FormatValidator | FormatDefinition): Ajv;
102
- /**
103
- * Define custom keyword
104
- * @this Ajv
105
- * @param {string} keyword custom keyword, should be a valid identifier, should be different from all standard, custom and macro keywords.
106
- * @param {object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`.
107
- * @return {Ajv} this for method chaining
108
- */
109
- addKeyword(keyword: string, definition: KeywordDefinition): Ajv;
110
- /**
111
- * Get keyword definition
112
- * @this Ajv
113
- * @param {string} keyword pre-defined or custom keyword.
114
- * @return {object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise.
115
- */
116
- getKeyword(keyword: string): object | boolean;
117
- /**
118
- * Remove keyword
119
- * @this Ajv
120
- * @param {string} keyword pre-defined or custom keyword.
121
- * @return {Ajv} this for method chaining
122
- */
123
- removeKeyword(keyword: string): Ajv;
124
- /**
125
- * Validate keyword
126
- * @this Ajv
127
- * @param {object} definition keyword definition object
128
- * @param {boolean} throwError true to throw exception if definition is invalid
129
- * @return {boolean} validation result
130
- */
131
- validateKeyword(definition: KeywordDefinition, throwError: boolean): boolean;
132
- /**
133
- * Convert array of error message objects to string
134
- * @param {Array<object>} errors optional array of validation errors, if not passed errors from the instance are used.
135
- * @param {object} options optional options with properties `separator` and `dataVar`.
136
- * @return {string} human readable string with all errors descriptions
137
- */
138
- errorsText(errors?: Array<ErrorObject> | null, options?: ErrorsTextOptions): string;
139
- errors?: Array<ErrorObject> | null;
140
- _opts: Options;
141
- }
142
-
143
- interface CustomLogger {
144
- log(...args: any[]): any;
145
- warn(...args: any[]): any;
146
- error(...args: any[]): any;
147
- }
148
-
149
- interface ValidateFunction {
150
- (
151
- data: any,
152
- dataPath?: string,
153
- parentData?: object | Array<any>,
154
- parentDataProperty?: string | number,
155
- rootData?: object | Array<any>
156
- ): boolean | PromiseLike<any>;
157
- schema?: object | boolean;
158
- errors?: null | Array<ErrorObject>;
159
- refs?: object;
160
- refVal?: Array<any>;
161
- root?: ValidateFunction | object;
162
- $async?: true;
163
- source?: object;
164
- }
165
-
166
- interface Options {
167
- $data?: boolean;
168
- allErrors?: boolean;
169
- verbose?: boolean;
170
- jsonPointers?: boolean;
171
- uniqueItems?: boolean;
172
- unicode?: boolean;
173
- format?: false | string;
174
- formats?: object;
175
- keywords?: object;
176
- unknownFormats?: true | string[] | 'ignore';
177
- schemas?: Array<object> | object;
178
- schemaId?: '$id' | 'id' | 'auto';
179
- missingRefs?: true | 'ignore' | 'fail';
180
- extendRefs?: true | 'ignore' | 'fail';
181
- loadSchema?: (uri: string, cb?: (err: Error, schema: object) => void) => PromiseLike<object | boolean>;
182
- removeAdditional?: boolean | 'all' | 'failing';
183
- useDefaults?: boolean | 'empty' | 'shared';
184
- coerceTypes?: boolean | 'array';
185
- strictDefaults?: boolean | 'log';
186
- strictKeywords?: boolean | 'log';
187
- strictNumbers?: boolean;
188
- async?: boolean | string;
189
- transpile?: string | ((code: string) => string);
190
- meta?: boolean | object;
191
- validateSchema?: boolean | 'log';
192
- addUsedSchema?: boolean;
193
- inlineRefs?: boolean | number;
194
- passContext?: boolean;
195
- loopRequired?: number;
196
- ownProperties?: boolean;
197
- multipleOfPrecision?: boolean | number;
198
- errorDataPath?: string,
199
- messages?: boolean;
200
- sourceCode?: boolean;
201
- processCode?: (code: string, schema: object) => string;
202
- cache?: object;
203
- logger?: CustomLogger | false;
204
- nullable?: boolean;
205
- serialize?: ((schema: object | boolean) => any) | false;
206
- }
207
-
208
- type FormatValidator = string | RegExp | ((data: string) => boolean | PromiseLike<any>);
209
- type NumberFormatValidator = ((data: number) => boolean | PromiseLike<any>);
210
-
211
- interface NumberFormatDefinition {
212
- type: "number",
213
- validate: NumberFormatValidator;
214
- compare?: (data1: number, data2: number) => number;
215
- async?: boolean;
216
- }
217
-
218
- interface StringFormatDefinition {
219
- type?: "string",
220
- validate: FormatValidator;
221
- compare?: (data1: string, data2: string) => number;
222
- async?: boolean;
223
- }
224
-
225
- type FormatDefinition = NumberFormatDefinition | StringFormatDefinition;
226
-
227
- interface KeywordDefinition {
228
- type?: string | Array<string>;
229
- async?: boolean;
230
- $data?: boolean;
231
- errors?: boolean | string;
232
- metaSchema?: object;
233
- // schema: false makes validate not to expect schema (ValidateFunction)
234
- schema?: boolean;
235
- statements?: boolean;
236
- dependencies?: Array<string>;
237
- modifying?: boolean;
238
- valid?: boolean;
239
- // one and only one of the following properties should be present
240
- validate?: SchemaValidateFunction | ValidateFunction;
241
- compile?: (schema: any, parentSchema: object, it: CompilationContext) => ValidateFunction;
242
- macro?: (schema: any, parentSchema: object, it: CompilationContext) => object | boolean;
243
- inline?: (it: CompilationContext, keyword: string, schema: any, parentSchema: object) => string;
244
- }
245
-
246
- interface CompilationContext {
247
- level: number;
248
- dataLevel: number;
249
- dataPathArr: string[];
250
- schema: any;
251
- schemaPath: string;
252
- baseId: string;
253
- async: boolean;
254
- opts: Options;
255
- formats: {
256
- [index: string]: FormatDefinition | undefined;
257
- };
258
- keywords: {
259
- [index: string]: KeywordDefinition | undefined;
260
- };
261
- compositeRule: boolean;
262
- validate: (schema: object) => boolean;
263
- util: {
264
- copy(obj: any, target?: any): any;
265
- toHash(source: string[]): { [index: string]: true | undefined };
266
- equal(obj: any, target: any): boolean;
267
- getProperty(str: string): string;
268
- schemaHasRules(schema: object, rules: any): string;
269
- escapeQuotes(str: string): string;
270
- toQuotedString(str: string): string;
271
- getData(jsonPointer: string, dataLevel: number, paths: string[]): string;
272
- escapeJsonPointer(str: string): string;
273
- unescapeJsonPointer(str: string): string;
274
- escapeFragment(str: string): string;
275
- unescapeFragment(str: string): string;
276
- };
277
- self: Ajv;
278
- }
279
-
280
- interface SchemaValidateFunction {
281
- (
282
- schema: any,
283
- data: any,
284
- parentSchema?: object,
285
- dataPath?: string,
286
- parentData?: object | Array<any>,
287
- parentDataProperty?: string | number,
288
- rootData?: object | Array<any>
289
- ): boolean | PromiseLike<any>;
290
- errors?: Array<ErrorObject>;
291
- }
292
-
293
- interface ErrorsTextOptions {
294
- separator?: string;
295
- dataVar?: string;
296
- }
297
-
298
- interface ErrorObject {
299
- keyword: string;
300
- dataPath: string;
301
- schemaPath: string;
302
- params: ErrorParameters;
303
- // Added to validation errors of propertyNames keyword schema
304
- propertyName?: string;
305
- // Excluded if messages set to false.
306
- message?: string;
307
- // These are added with the `verbose` option.
308
- schema?: any;
309
- parentSchema?: object;
310
- data?: any;
311
- }
312
-
313
- type ErrorParameters = RefParams | LimitParams | AdditionalPropertiesParams |
314
- DependenciesParams | FormatParams | ComparisonParams |
315
- MultipleOfParams | PatternParams | RequiredParams |
316
- TypeParams | UniqueItemsParams | CustomParams |
317
- PatternRequiredParams | PropertyNamesParams |
318
- IfParams | SwitchParams | NoParams | EnumParams;
319
-
320
- interface RefParams {
321
- ref: string;
322
- }
323
-
324
- interface LimitParams {
325
- limit: number;
326
- }
327
-
328
- interface AdditionalPropertiesParams {
329
- additionalProperty: string;
330
- }
331
-
332
- interface DependenciesParams {
333
- property: string;
334
- missingProperty: string;
335
- depsCount: number;
336
- deps: string;
337
- }
338
-
339
- interface FormatParams {
340
- format: string
341
- }
342
-
343
- interface ComparisonParams {
344
- comparison: string;
345
- limit: number | string;
346
- exclusive: boolean;
347
- }
348
-
349
- interface MultipleOfParams {
350
- multipleOf: number;
351
- }
352
-
353
- interface PatternParams {
354
- pattern: string;
355
- }
356
-
357
- interface RequiredParams {
358
- missingProperty: string;
359
- }
360
-
361
- interface TypeParams {
362
- type: string;
363
- }
364
-
365
- interface UniqueItemsParams {
366
- i: number;
367
- j: number;
368
- }
369
-
370
- interface CustomParams {
371
- keyword: string;
372
- }
373
-
374
- interface PatternRequiredParams {
375
- missingPattern: string;
376
- }
377
-
378
- interface PropertyNamesParams {
379
- propertyName: string;
380
- }
381
-
382
- interface IfParams {
383
- failingKeyword: string;
384
- }
385
-
386
- interface SwitchParams {
387
- caseIndex: number;
388
- }
389
-
390
- interface NoParams { }
391
-
392
- interface EnumParams {
393
- allowedValues: Array<any>;
394
- }
395
- }
396
-
397
- export = ajv;