1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import type { AggregatedResult } from '@jest/test-result';
|
9 | import type { Config } from '@jest/types';
|
10 | declare type TestSuiteInfo = {
|
11 | config: Config.ProjectConfig;
|
12 | duration?: number;
|
13 | testPath: string;
|
14 | };
|
15 | export declare type JestHookExposedFS = {
|
16 | projects: Array<{
|
17 | config: Config.ProjectConfig;
|
18 | testPaths: Array<Config.Path>;
|
19 | }>;
|
20 | };
|
21 | export declare type FileChange = (fs: JestHookExposedFS) => void;
|
22 | export declare type ShouldRunTestSuite = (testSuiteInfo: TestSuiteInfo) => Promise<boolean>;
|
23 | export declare type TestRunComplete = (results: AggregatedResult) => void;
|
24 | export declare type JestHookSubscriber = {
|
25 | onFileChange: (fn: FileChange) => void;
|
26 | onTestRunComplete: (fn: TestRunComplete) => void;
|
27 | shouldRunTestSuite: (fn: ShouldRunTestSuite) => void;
|
28 | };
|
29 | export declare type JestHookEmitter = {
|
30 | onFileChange: (fs: JestHookExposedFS) => void;
|
31 | onTestRunComplete: (results: AggregatedResult) => void;
|
32 | shouldRunTestSuite: (testSuiteInfo: TestSuiteInfo) => Promise<boolean> | boolean;
|
33 | };
|
34 | export declare type UsageData = {
|
35 | key: string;
|
36 | prompt: string;
|
37 | };
|
38 | export declare type AllowedConfigOptions = Partial<Pick<Config.GlobalConfig, 'bail' | 'changedSince' | 'collectCoverage' | 'collectCoverageFrom' | 'collectCoverageOnlyFrom' | 'coverageDirectory' | 'coverageReporters' | 'findRelatedTests' | 'nonFlagArgs' | 'notify' | 'notifyMode' | 'onlyFailures' | 'reporters' | 'testNamePattern' | 'testPathPattern' | 'updateSnapshot' | 'verbose'> & {
|
39 | mode: 'watch' | 'watchAll';
|
40 | }>;
|
41 | export declare type UpdateConfigCallback = (config?: AllowedConfigOptions) => void;
|
42 | export interface WatchPlugin {
|
43 | isInternal?: boolean;
|
44 | apply?: (hooks: JestHookSubscriber) => void;
|
45 | getUsageInfo?: (globalConfig: Config.GlobalConfig) => UsageData | null;
|
46 | onKey?: (value: string) => void;
|
47 | run?: (globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback) => Promise<void | boolean>;
|
48 | }
|
49 | export interface WatchPluginClass {
|
50 | new (options: {
|
51 | config: Record<string, unknown>;
|
52 | stdin: NodeJS.ReadStream;
|
53 | stdout: NodeJS.WriteStream;
|
54 | }): WatchPlugin;
|
55 | }
|
56 | export declare type ScrollOptions = {
|
57 | offset: number;
|
58 | max: number;
|
59 | };
|
60 | export {};
|