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