Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support inner not, not in simple types #61

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions declarations/ValidationError.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ export default ValidationError;
export type JSONSchema6 = import('json-schema').JSONSchema6;
export type JSONSchema7 = import('json-schema').JSONSchema7;
export type Schema =
| import('json-schema').JSONSchema4
| import('json-schema').JSONSchema6
| import('json-schema').JSONSchema7;
| (import('json-schema').JSONSchema4 & import('./validate').Extend)
| (import('json-schema').JSONSchema6 & import('./validate').Extend)
| (import('json-schema').JSONSchema7 & import('./validate').Extend);
export type ValidationErrorConfiguration = {
name?: string | undefined;
baseDataPath?: string | undefined;
Expand All @@ -31,9 +31,9 @@ declare class ValidationError extends Error {
children?: import('ajv').ErrorObject[] | undefined;
})[],
schema:
| import('json-schema').JSONSchema4
| import('json-schema').JSONSchema6
| import('json-schema').JSONSchema7,
| (import('json-schema').JSONSchema4 & import('./validate').Extend)
| (import('json-schema').JSONSchema6 & import('./validate').Extend)
| (import('json-schema').JSONSchema7 & import('./validate').Extend),
configuration?: import('./validate').ValidationErrorConfiguration
);
/** @type {Array<SchemaUtilErrorObject>} */
Expand All @@ -53,19 +53,20 @@ declare class ValidationError extends Error {
getSchemaPart(
path: string
):
| import('json-schema').JSONSchema4
| import('json-schema').JSONSchema6
| import('json-schema').JSONSchema7;
| (import('json-schema').JSONSchema4 & import('./validate').Extend)
| (import('json-schema').JSONSchema6 & import('./validate').Extend)
| (import('json-schema').JSONSchema7 & import('./validate').Extend);
/**
* @param {Schema} schema
* @param {Array<Object>} prevSchemas
* @returns {string}
*/
formatSchema(
schema:
| import('json-schema').JSONSchema4
| import('json-schema').JSONSchema6
| import('json-schema').JSONSchema7,
| (import('json-schema').JSONSchema4 & import('./validate').Extend)
| (import('json-schema').JSONSchema6 & import('./validate').Extend)
| (import('json-schema').JSONSchema7 & import('./validate').Extend),
logic?: boolean,
prevSchemas?: Object[]
): string;
/**
Expand All @@ -76,22 +77,23 @@ declare class ValidationError extends Error {
*/
getSchemaPartText(
schemaPart?:
| import('json-schema').JSONSchema4
| import('json-schema').JSONSchema6
| import('json-schema').JSONSchema7
| (import('json-schema').JSONSchema4 & import('./validate').Extend)
| (import('json-schema').JSONSchema6 & import('./validate').Extend)
| (import('json-schema').JSONSchema7 & import('./validate').Extend)
| undefined,
additionalPath?: boolean | string[] | undefined,
needDot?: boolean | undefined
needDot?: boolean | undefined,
logic?: boolean
): string;
/**
* @param {Schema=} schemaPart
* @returns {string}
*/
getSchemaPartDescription(
schemaPart?:
| import('json-schema').JSONSchema4
| import('json-schema').JSONSchema6
| import('json-schema').JSONSchema7
| (import('json-schema').JSONSchema4 & import('./validate').Extend)
| (import('json-schema').JSONSchema6 & import('./validate').Extend)
| (import('json-schema').JSONSchema7 & import('./validate').Extend)
| undefined
): string;
/**
Expand Down
18 changes: 18 additions & 0 deletions declarations/util/hints.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export function stringHints(
schema:
| (import('json-schema').JSONSchema4 & import('../validate').Extend)
| (import('json-schema').JSONSchema6 & import('../validate').Extend)
| (import('json-schema').JSONSchema7 & import('../validate').Extend),
logic: boolean
): string[];
export function numberHints(
schema:
| (import('json-schema').JSONSchema4 & import('../validate').Extend)
| (import('json-schema').JSONSchema6 & import('../validate').Extend)
| (import('json-schema').JSONSchema7 & import('../validate').Extend),
logic: boolean
): string[];
export type Schema =
| (import('json-schema').JSONSchema4 & import('../validate').Extend)
| (import('json-schema').JSONSchema6 & import('../validate').Extend)
| (import('json-schema').JSONSchema7 & import('../validate').Extend);
18 changes: 12 additions & 6 deletions declarations/validate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ export type JSONSchema4 = import('json-schema').JSONSchema4;
export type JSONSchema6 = import('json-schema').JSONSchema6;
export type JSONSchema7 = import('json-schema').JSONSchema7;
export type ErrorObject = Ajv.ErrorObject;
export type Extend = {
formatMinimum?: number | undefined;
formatMaximum?: number | undefined;
formatExclusiveMinimum?: boolean | undefined;
formatExclusiveMaximum?: boolean | undefined;
};
export type Schema =
| import('json-schema').JSONSchema4
| import('json-schema').JSONSchema6
| import('json-schema').JSONSchema7;
| (import('json-schema').JSONSchema4 & Extend)
| (import('json-schema').JSONSchema6 & Extend)
| (import('json-schema').JSONSchema7 & Extend);
export type SchemaUtilErrorObject = Ajv.ErrorObject & {
children?: Ajv.ErrorObject[] | undefined;
};
Expand All @@ -29,9 +35,9 @@ export type ValidationErrorConfiguration = {
*/
declare function validate(
schema:
| import('json-schema').JSONSchema4
| import('json-schema').JSONSchema6
| import('json-schema').JSONSchema7,
| (import('json-schema').JSONSchema4 & Extend)
| (import('json-schema').JSONSchema6 & Extend)
| (import('json-schema').JSONSchema7 & Extend),
options: object | object[],
configuration?: ValidationErrorConfiguration | undefined
): void;
Expand Down
Loading