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).
29 lines (28 loc) • 1.27 kB
TypeScript
import { AtomicSchemaObject, type LogicalCombinationOfLiterals } from '../atomic-schema/index.js';
import type { ExtractionPlugin, ConjunctionSchema } from '../plugin/index.js';
export declare const internalRefKey: unique symbol;
export declare abstract class RefAtomicSchemaBase extends AtomicSchemaObject {
protected readonly [internalRefKey]: string;
constructor($ref: string);
negate(): LogicalCombinationOfLiterals;
}
export type RefAtomicSchemaJSON = {
$ref: string;
};
export declare class RefAtomicSchema extends RefAtomicSchemaBase {
get $ref(): string;
toJSONSchema(): RefAtomicSchemaJSON;
}
export declare const refExtraction: ExtractionPlugin;
export type RefConjunctionSchemaAllOfElement = RefAtomicSchemaJSON | {
not: RefAtomicSchemaJSON;
};
export type RefConjunctionSchemaAllOf = RefConjunctionSchemaAllOfElement[];
export type RefConjunctionSchema = {
allOf?: RefConjunctionSchemaAllOf;
};
export declare const refSimplification: {
readonly appliesToJSONSchemaType: undefined;
readonly mergeableKeywords: [];
readonly simplify: ({ atomicSchemasByConstructor, negatedAtomicSchemasByConstructor, }: import("../plugin/plugin.js").SimplificationPluginArguments) => ConjunctionSchema<RefConjunctionSchema>;
};