subschema.d.ts 836 B

1234567891011121314151617181920212223242526272829
  1. import type { AnySchema } from "../types";
  2. import type { SchemaObjCxt, SchemaCxt } from "./index";
  3. import { Code, Name } from "./codegen";
  4. import { JSONType } from "./rules";
  5. export declare enum Type {
  6. Num = 0,
  7. Str = 1
  8. }
  9. export declare type SubschemaArgs = Partial<{
  10. keyword: string;
  11. schemaProp: string | number;
  12. schema: AnySchema;
  13. schemaPath: Code;
  14. errSchemaPath: string;
  15. topSchemaRef: Code;
  16. data: Name | Code;
  17. dataProp: Code | string | number;
  18. dataTypes: JSONType[];
  19. definedProperties: Set<string>;
  20. propertyName: Name;
  21. dataPropType: Type;
  22. jtdDiscriminator: string;
  23. jtdMetadata: boolean;
  24. compositeRule: true;
  25. createErrors: boolean;
  26. allErrors: boolean;
  27. }>;
  28. export declare function applySubschema(it: SchemaObjCxt, appl: SubschemaArgs, valid: Name): SchemaCxt;