-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathindex.d.mts
More file actions
57 lines (48 loc) · 1.46 KB
/
index.d.mts
File metadata and controls
57 lines (48 loc) · 1.46 KB
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
49
50
51
52
53
54
55
56
57
export type Template = Array<unknown>;
export type EvaluationCallback = (
type: "pre" | "post",
valid: boolean,
instruction: unknown[],
evaluatePath: string,
instanceLocation: string,
annotation: unknown
) => void;
export type StandardOutputFormat = 'flag' | 'basic';
export interface StandardOutputErrorEntry {
keywordLocation: string;
absoluteKeywordLocation: string;
instanceLocation: string;
error: string;
}
export interface StandardOutputAnnotationEntry {
keywordLocation: string;
absoluteKeywordLocation: string;
instanceLocation: string;
annotation: unknown[];
}
export type StandardOutputFlagResult = { valid: boolean };
export type StandardOutputBasicResult =
| { valid: true; annotations?: StandardOutputAnnotationEntry[] }
| { valid: false; errors: StandardOutputErrorEntry[] };
export type StandardOutputResult =
| StandardOutputFlagResult
| StandardOutputBasicResult;
export declare class Blaze {
static reviver(
key: string,
value: unknown,
context: { source: string }
): unknown;
constructor(template: Template);
validate(instance: unknown, format: 'flag'): StandardOutputFlagResult;
validate(instance: unknown, format: 'basic'): StandardOutputBasicResult;
validate(instance: unknown, callback?: EvaluationCallback): boolean;
}
export declare function describe(
valid: boolean,
instruction: unknown[],
evaluatePath: string,
instanceLocation: string,
instance: unknown,
annotation: unknown
): string;