aboutsummaryrefslogtreecommitdiffstats
path: root/vanilla/node_modules/vitest/dist/chunks/plugin.d.CtqpEehP.d.ts
blob: 4955bd832af243c8c6d194cf28ad1ed19ecd6049 (plain) (blame)
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
import { DevEnvironment } from 'vite';
import { V as Vitest, T as TestProject, b as TestProjectConfiguration } from './reporters.d.CWXNI2jG.js';

/**
* Generate a unique cache identifier.
*
* Return `false` to disable caching of the file.
* @experimental
*/
interface CacheKeyIdGenerator {
	(context: CacheKeyIdGeneratorContext): string | undefined | null | false;
}
/**
* @experimental
*/
interface CacheKeyIdGeneratorContext {
	environment: DevEnvironment;
	id: string;
	sourceCode: string;
}

interface VitestPluginContext {
	vitest: Vitest;
	project: TestProject;
	injectTestProjects: (config: TestProjectConfiguration | TestProjectConfiguration[]) => Promise<TestProject[]>;
	/**
	* Define a generator that will be applied before hashing the cache key.
	*
	* Use this to make sure Vitest generates correct hash. It is a good idea
	* to define this function if your plugin can be registered with different options.
	*
	* This is called only if `experimental.fsModuleCache` is defined.
	* @experimental
	*/
	experimental_defineCacheKeyGenerator: (callback: CacheKeyIdGenerator) => void;
}

export type { CacheKeyIdGenerator as C, VitestPluginContext as V, CacheKeyIdGeneratorContext as a };