source: trip-planner-front/node_modules/ajv/dist/compile/util.d.ts@ e29cc2e

Last change on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.2 KB
Line 
1import type { AnySchema, EvaluatedProperties, EvaluatedItems } from "../types";
2import type { SchemaCxt, SchemaObjCxt } from ".";
3import { Code, Name, CodeGen } from "./codegen";
4import type { Rule, ValidationRules } from "./rules";
5export declare function toHash<T extends string = string>(arr: T[]): {
6 [K in T]?: true;
7};
8export declare function alwaysValidSchema(it: SchemaCxt, schema: AnySchema): boolean | void;
9export declare function checkUnknownRules(it: SchemaCxt, schema?: AnySchema): void;
10export declare function schemaHasRules(schema: AnySchema, rules: {
11 [Key in string]?: boolean | Rule;
12}): boolean;
13export declare function schemaHasRulesButRef(schema: AnySchema, RULES: ValidationRules): boolean;
14export declare function schemaRefOrVal({ topSchemaRef, schemaPath }: SchemaObjCxt, schema: unknown, keyword: string, $data?: string | false): Code | number | boolean;
15export declare function unescapeFragment(str: string): string;
16export declare function escapeFragment(str: string | number): string;
17export declare function escapeJsonPointer(str: string | number): string;
18export declare function unescapeJsonPointer(str: string): string;
19export declare function eachItem<T>(xs: T | T[], f: (x: T) => void): void;
20declare type SomeEvaluated = EvaluatedProperties | EvaluatedItems;
21declare type MergeEvaluatedFunc<T extends SomeEvaluated> = (gen: CodeGen, from: Name | T, to: Name | Exclude<T, true> | undefined, toName?: typeof Name) => Name | T;
22interface MergeEvaluated {
23 props: MergeEvaluatedFunc<EvaluatedProperties>;
24 items: MergeEvaluatedFunc<EvaluatedItems>;
25}
26export declare const mergeEvaluated: MergeEvaluated;
27export declare function evaluatedPropsToName(gen: CodeGen, ps?: EvaluatedProperties): Name;
28export declare function setEvaluated(gen: CodeGen, props: Name, ps: {
29 [K in string]?: true;
30}): void;
31export declare function useFunc(gen: CodeGen, f: {
32 code: string;
33}): Name;
34export declare enum Type {
35 Num = 0,
36 Str = 1
37}
38export declare function getErrorPath(dataProp: Name | string | number, dataPropType?: Type, jsPropertySyntax?: boolean): Code | string;
39export declare function checkStrictMode(it: SchemaCxt, msg: string, mode?: boolean | "log"): void;
40export {};
Note: See TracBrowser for help on using the repository browser.