Spaces:
Running
Running
File size: 1,722 Bytes
1df763a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
import type { AnySchema } from "../../types";
import type { SchemaObjCxt } from "..";
import { Code, Name } from "../codegen";
import { Type } from "../util";
import type { JSONType } from "../rules";
export interface SubschemaContext {
schema: AnySchema;
schemaPath: Code;
errSchemaPath: string;
topSchemaRef?: Code;
errorPath?: Code;
dataLevel?: number;
dataTypes?: JSONType[];
data?: Name;
parentData?: Name;
parentDataProperty?: Code | number;
dataNames?: Name[];
dataPathArr?: (Code | number)[];
propertyName?: Name;
jtdDiscriminator?: string;
jtdMetadata?: boolean;
compositeRule?: true;
createErrors?: boolean;
allErrors?: boolean;
}
export type SubschemaArgs = Partial<{
keyword: string;
schemaProp: string | number;
schema: AnySchema;
schemaPath: Code;
errSchemaPath: string;
topSchemaRef: Code;
data: Name | Code;
dataProp: Code | string | number;
dataTypes: JSONType[];
definedProperties: Set<string>;
propertyName: Name;
dataPropType: Type;
jtdDiscriminator: string;
jtdMetadata: boolean;
compositeRule: true;
createErrors: boolean;
allErrors: boolean;
}>;
export declare function getSubschema(it: SchemaObjCxt, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }: SubschemaArgs): SubschemaContext;
export declare function extendSubschemaData(subschema: SubschemaContext, it: SchemaObjCxt, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }: SubschemaArgs): void;
export declare function extendSubschemaMode(subschema: SubschemaContext, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }: SubschemaArgs): void;
|