1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import type {Config} from '@jest/types';
|
8 | import type {DeprecatedOptions} from 'jest-validate';
|
9 |
|
10 | declare type AllOptions = Config.ProjectConfig & Config.GlobalConfig;
|
11 |
|
12 | declare namespace constants {
|
13 | export {
|
14 | NODE_MODULES,
|
15 | DEFAULT_JS_PATTERN,
|
16 | PACKAGE_JSON,
|
17 | JEST_CONFIG_BASE_NAME,
|
18 | JEST_CONFIG_EXT_CJS,
|
19 | JEST_CONFIG_EXT_MJS,
|
20 | JEST_CONFIG_EXT_JS,
|
21 | JEST_CONFIG_EXT_TS,
|
22 | JEST_CONFIG_EXT_JSON,
|
23 | JEST_CONFIG_EXT_ORDER,
|
24 | };
|
25 | }
|
26 | export {constants};
|
27 |
|
28 | declare const DEFAULT_JS_PATTERN = '\\.[jt]sx?$';
|
29 |
|
30 | export declare const defaults: Config.DefaultOptions;
|
31 |
|
32 | export declare const deprecationEntries: DeprecatedOptions;
|
33 |
|
34 | export declare const descriptions: {
|
35 | [key in keyof Config.InitialOptions]: string;
|
36 | };
|
37 |
|
38 | export declare const isJSONString: (
|
39 | text?: JSONString | string,
|
40 | ) => text is JSONString;
|
41 |
|
42 | declare const JEST_CONFIG_BASE_NAME = 'jest.config';
|
43 |
|
44 | declare const JEST_CONFIG_EXT_CJS = '.cjs';
|
45 |
|
46 | declare const JEST_CONFIG_EXT_JS = '.js';
|
47 |
|
48 | declare const JEST_CONFIG_EXT_JSON = '.json';
|
49 |
|
50 | declare const JEST_CONFIG_EXT_MJS = '.mjs';
|
51 |
|
52 | declare const JEST_CONFIG_EXT_ORDER: readonly string[];
|
53 |
|
54 | declare const JEST_CONFIG_EXT_TS = '.ts';
|
55 |
|
56 | declare type JSONString = string & {
|
57 | readonly $$type: never;
|
58 | };
|
59 |
|
60 | declare const NODE_MODULES: string;
|
61 |
|
62 | export declare function normalize(
|
63 | initialOptions: Config.InitialOptions,
|
64 | argv: Config.Argv,
|
65 | configPath?: string | null,
|
66 | projectIndex?: number,
|
67 | isProjectOptions?: boolean,
|
68 | ): Promise<{
|
69 | hasDeprecationWarnings: boolean;
|
70 | options: AllOptions;
|
71 | }>;
|
72 |
|
73 | declare const PACKAGE_JSON = 'package.json';
|
74 |
|
75 | declare type ReadConfig = {
|
76 | configPath: string | null | undefined;
|
77 | globalConfig: Config.GlobalConfig;
|
78 | hasDeprecationWarnings: boolean;
|
79 | projectConfig: Config.ProjectConfig;
|
80 | };
|
81 |
|
82 | export declare function readConfig(
|
83 | argv: Config.Argv,
|
84 | packageRootOrConfig: string | Config.InitialOptions,
|
85 | skipArgvConfigOption?: boolean,
|
86 | parentConfigDirname?: string | null,
|
87 | projectIndex?: number,
|
88 | skipMultipleConfigError?: boolean,
|
89 | ): Promise<ReadConfig>;
|
90 |
|
91 | export declare function readConfigs(
|
92 | argv: Config.Argv,
|
93 | projectPaths: Array<string>,
|
94 | ): Promise<{
|
95 | globalConfig: Config.GlobalConfig;
|
96 | configs: Array<Config.ProjectConfig>;
|
97 | hasDeprecationWarnings: boolean;
|
98 | }>;
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 | export declare function readInitialOptions(
|
107 | config?: string,
|
108 | {
|
109 | packageRootOrConfig,
|
110 | parentConfigDirname,
|
111 | readFromCwd,
|
112 | skipMultipleConfigError,
|
113 | }?: ReadJestConfigOptions,
|
114 | ): Promise<{
|
115 | config: Config.InitialOptions;
|
116 | configPath: string | null;
|
117 | }>;
|
118 |
|
119 | export declare interface ReadJestConfigOptions {
|
120 | |
121 |
|
122 |
|
123 | packageRootOrConfig?: string | Config.InitialOptions;
|
124 | |
125 |
|
126 |
|
127 |
|
128 | parentConfigDirname?: null | string;
|
129 | |
130 |
|
131 |
|
132 |
|
133 |
|
134 | readFromCwd?: boolean;
|
135 | |
136 |
|
137 |
|
138 |
|
139 | skipMultipleConfigError?: boolean;
|
140 | }
|
141 |
|
142 | export declare const replaceRootDirInPath: (
|
143 | rootDir: string,
|
144 | filePath: string,
|
145 | ) => string;
|
146 |
|
147 | export {};
|