|
1 | | -import { JSONSchema4, JSONSchema4Type, JSONSchema6, JSONSchema6Type } from "json-schema"; |
| 1 | +import { JSONSchema4, JSONSchema4Type, JSONSchema6, JSONSchema6Type, JSONSchema7, JSONSchema7Type } from "json-schema"; |
2 | 2 |
|
3 | 3 | export = $RefParser; |
4 | 4 |
|
@@ -173,7 +173,7 @@ declare class $RefParser { |
173 | 173 | // eslint-disable-next-line no-redeclare |
174 | 174 | declare namespace $RefParser { |
175 | 175 |
|
176 | | - export type JSONSchema = JSONSchema4 | JSONSchema6; |
| 176 | + export type JSONSchema = JSONSchema4 | JSONSchema6 | JSONSchema7; |
177 | 177 | export type SchemaCallback = (err: Error | null, schema?: JSONSchema) => any; |
178 | 178 | export type $RefsCallback = (err: Error | null, $refs?: $Refs) => any; |
179 | 179 |
|
@@ -208,7 +208,7 @@ declare namespace $RefParser { |
208 | 208 | file?: Partial<ResolverOptions> | boolean; |
209 | 209 | http?: HTTPResolverOptions | boolean; |
210 | 210 | } & { |
211 | | - [key: string]: Partial<ResolverOptions> | boolean; |
| 211 | + [key: string]: Partial<ResolverOptions> | HTTPResolverOptions | boolean | undefined; |
212 | 212 | }; |
213 | 213 |
|
214 | 214 | /** |
@@ -284,7 +284,7 @@ declare namespace $RefParser { |
284 | 284 | read( |
285 | 285 | file: FileInfo, |
286 | 286 | callback?: (error: Error | null, data: string | null) => any |
287 | | - ): string | Buffer | Promise<string | Buffer>; |
| 287 | + ): string | Buffer | JSONSchema | Promise<string | Buffer | JSONSchema>; |
288 | 288 | } |
289 | 289 |
|
290 | 290 | export interface ParserOptions { |
@@ -395,15 +395,15 @@ declare namespace $RefParser { |
395 | 395 | * |
396 | 396 | * @param $ref The JSON Reference path, optionally with a JSON Pointer in the hash |
397 | 397 | */ |
398 | | - public get($ref: string): JSONSchema4Type | JSONSchema6Type |
| 398 | + public get($ref: string): JSONSchema4Type | JSONSchema6Type | JSONSchema7Type |
399 | 399 |
|
400 | 400 | /** |
401 | 401 | * Sets the value at the given path in the schema. If the property, or any of its parents, don't exist, they will be created. |
402 | 402 | * |
403 | 403 | * @param $ref The JSON Reference path, optionally with a JSON Pointer in the hash |
404 | 404 | * @param value The value to assign. Can be anything (object, string, number, etc.) |
405 | 405 | */ |
406 | | - public set($ref: string, value: JSONSchema4Type | JSONSchema6Type): void |
| 406 | + public set($ref: string, value: JSONSchema4Type | JSONSchema6Type | JSONSchema7Type): void |
407 | 407 | } |
408 | 408 |
|
409 | 409 | export type JSONParserErrorType = "EUNKNOWN" | "EPARSER" | "EUNMATCHEDPARSER" | "ERESOLVER" | "EUNMATCHEDRESOLVER" | "EMISSINGPOINTER" | "EINVALIDPOINTER"; |
|
0 commit comments