UNPKG

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).

24 lines (23 loc) 1.06 kB
import type { JSONSchema } from '../json-schema/index.js'; import { AtomicSchemaObject, type LogicalCombination, type LogicalCombinationOfLiterals } from '../atomic-schema/index.js'; import { type ExtractionPlugin } from '../plugin/index.js'; import { type JSONSchemaType } from '../json-schema-type/index.js'; export declare class MultipleOfAtomicSchema extends AtomicSchemaObject { readonly multipleOf: number; constructor(multipleOf: number); negate(): LogicalCombinationOfLiterals; toJSONSchema(): { multipleOf: number; }; } export declare class TypeAtomicSchema extends AtomicSchemaObject { readonly type: readonly JSONSchemaType[]; constructor(type?: string | string[] | undefined); negate(): false | TypeAtomicSchema; toJSONSchema(): { type: JSONSchemaType[]; }; } export declare function getTypeArray(schema: JSONSchema & object): string[]; export declare function typeArrayToLogicalCombination(typeArray: string[]): LogicalCombination; export declare const typeExtraction: ExtractionPlugin;