UNPKG

flowjv

Version:

Flow based approach to JSON validation!

24 lines (23 loc) 769 B
import { IFlowSchema } from "./index"; import { IJSONExpression } from ".."; import { IObjectType } from "./flow/composite/object"; import { ISimpleType } from "./flow/simple"; import { getDependencies } from "../jsonexpression"; import { IArrayType } from "./flow/composite/array"; declare type ICondPath = { expr: IJSONExpression; value: string | boolean | number; }[]; export interface IBlockDetails { condPath: ICondPath; schema: ISimpleType | IObjectType | IArrayType; deps: ReturnType<typeof getDependencies>; } export interface IBlocks { [path: string]: { items: IBlockDetails[] | undefined; deps: IBlockDetails["deps"]; } | undefined; } export declare function compileSchema(schema: IFlowSchema): IBlocks; export {};