subschema.d.ts 771 B

1234567891011121314151617181920212223242526
  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. strictSchema: boolean;
  14. schemaPath: Code;
  15. errSchemaPath: string;
  16. topSchemaRef: Code;
  17. data: Name | Code;
  18. dataProp: Code | string | number;
  19. dataTypes: JSONType[];
  20. propertyName: Name;
  21. dataPropType: Type;
  22. compositeRule: true;
  23. createErrors: boolean;
  24. allErrors: boolean;
  25. }>;
  26. export declare function applySubschema(it: SchemaObjCxt, appl: SubschemaArgs, valid: Name): SchemaCxt;