flowjv
Version:
Flow based approach to JSON validation!
21 lines (20 loc) • 807 B
TypeScript
import { IExpression, IJSONExpressionData } from "../../../jsonexpression";
import { IObjectProperty } from ".";
import { IFlowOptions } from "../..";
export declare type IObjectIfBlock = {
type: "if";
blockId?: string;
cond: IExpression;
true: IObjectProperty[];
false?: IObjectProperty[];
};
export declare const ifLogic: (config: IObjectIfBlock, data: IJSONExpressionData<any, any>, options?: IFlowOptions | undefined) => IObjectProperty[] | undefined;
export declare type IObjectSwitchBlock = {
type: "switch";
blockId?: string;
cond: IExpression;
cases: {
[key: string]: IObjectProperty[];
};
};
export declare const switchLogic: (config: IObjectSwitchBlock, data: IJSONExpressionData<any, any>, options?: IFlowOptions | undefined) => IObjectProperty[];