1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import type {Config} from '@jest/types';
|
8 | import type {Options} from 'yargs';
|
9 |
|
10 | export declare const createDidYouMeanMessage: (
|
11 | unrecognized: string,
|
12 | allowedOptions: Array<string>,
|
13 | ) => string;
|
14 |
|
15 | declare type DeprecatedOptionFunc = (arg: Record<string, unknown>) => string;
|
16 |
|
17 | export declare type DeprecatedOptions = Record<string, DeprecatedOptionFunc>;
|
18 |
|
19 | export declare const format: (value: unknown) => string;
|
20 |
|
21 | export declare const logValidationWarning: (
|
22 | name: string,
|
23 | message: string,
|
24 | comment?: string | null,
|
25 | ) => void;
|
26 |
|
27 | export declare function multipleValidOptions<T extends Array<unknown>>(
|
28 | ...args: T
|
29 | ): T[number];
|
30 |
|
31 | declare type Title = {
|
32 | deprecation?: string;
|
33 | error?: string;
|
34 | warning?: string;
|
35 | };
|
36 |
|
37 | export declare const validate: (
|
38 | config: Record<string, unknown>,
|
39 | options: ValidationOptions,
|
40 | ) => {
|
41 | hasDeprecationWarnings: boolean;
|
42 | isValid: boolean;
|
43 | };
|
44 |
|
45 | export declare function validateCLIOptions(
|
46 | argv: Config.Argv,
|
47 | options?: Record<string, Options> & {
|
48 | deprecationEntries?: DeprecatedOptions;
|
49 | },
|
50 | rawArgv?: Array<string>,
|
51 | ): boolean;
|
52 |
|
53 | export declare class ValidationError extends Error {
|
54 | name: string;
|
55 | message: string;
|
56 | constructor(name: string, message: string, comment?: string | null);
|
57 | }
|
58 |
|
59 | declare type ValidationOptions = {
|
60 | comment?: string;
|
61 | condition?: (option: unknown, validOption: unknown) => boolean;
|
62 | deprecate?: (
|
63 | config: Record<string, unknown>,
|
64 | option: string,
|
65 | deprecatedOptions: DeprecatedOptions,
|
66 | options: ValidationOptions,
|
67 | ) => boolean;
|
68 | deprecatedConfig?: DeprecatedOptions;
|
69 | error?: (
|
70 | option: string,
|
71 | received: unknown,
|
72 | defaultValue: unknown,
|
73 | options: ValidationOptions,
|
74 | path?: Array<string>,
|
75 | ) => void;
|
76 | exampleConfig: Record<string, unknown>;
|
77 | recursive?: boolean;
|
78 | recursiveDenylist?: Array<string>;
|
79 | title?: Title;
|
80 | unknown?: (
|
81 | config: Record<string, unknown>,
|
82 | exampleConfig: Record<string, unknown>,
|
83 | option: string,
|
84 | options: ValidationOptions,
|
85 | path?: Array<string>,
|
86 | ) => void;
|
87 | };
|
88 |
|
89 | export {};
|