json-schema-describes-subset
Version:
Tools for static JSON schema analysis, including functions to determine if one schema describes a subset of another or if a schema describes the empty set or to convert a schema to its disjunctive normal form (DNF).
14 lines (13 loc) • 987 B
TypeScript
import type { JSONSchema } from '../json-schema/index.js';
import type { InstancesByConstructor } from '../utils/instances-by-constructor/index.js';
export declare function getNegatedConstValuesFromNegatedAtomicSchemasByConstructor<ConstType>(negatedAtomicSchemasByConstructor: InstancesByConstructor, filterPredicate: (value: unknown, index: number, array: unknown[]) => value is ConstType): ConstType[];
export declare function getUniqueNegatedConstSchemas<ConstType>(schemaDescribesEmptySet: (schema: JSONSchema) => boolean | null, negatedConstValues: ConstType[]): {
not: {
const: ConstType;
};
}[];
export declare function getUniqueNegatedConstSchemasFromNegatedAtomicSchemasByConstructor<ConstType>(schemaDescribesEmptySet: (schema: JSONSchema) => boolean | null, negatedAtomicSchemasByConstructor: InstancesByConstructor, filterPredicate: (value: unknown, index: number, array: unknown[]) => value is ConstType): {
not: {
const: ConstType;
};
}[];