@@ -6,6 +6,7 @@ import type { SerializedDiffOptions } from '@vitest/utils/diff'
6
6
import type { AliasOptions , ConfigEnv , DepOptimizationConfig , ServerOptions , UserConfig as ViteUserConfig } from 'vite'
7
7
import type { ViteNodeServerOptions } from 'vite-node'
8
8
import type { ChaiConfig } from '../../integrations/chai/config'
9
+ import type { SerializedConfig } from '../../runtime/config'
9
10
import type { EnvironmentOptions } from '../../types/environment'
10
11
import type { Arrayable , ErrorWithDiff , ParsedStack , ProvidedContext } from '../../types/general'
11
12
import type { HappyDOMOptions } from '../../types/happy-dom-options'
@@ -225,6 +226,14 @@ type ReporterWithOptions<Name extends ReporterName = ReporterName> =
225
226
: [ Name , Partial < BuiltinReporterOptions [ Name ] > ]
226
227
: [ Name , Record < string , unknown > ]
227
228
229
+ export interface ResolveSnapshotPathHandlerContext { config : SerializedConfig }
230
+
231
+ export type ResolveSnapshotPathHandler = (
232
+ testPath : string ,
233
+ snapExtension : string ,
234
+ context : ResolveSnapshotPathHandlerContext
235
+ ) => string
236
+
228
237
export interface InlineConfig {
229
238
/**
230
239
* Name of the project. Will be used to display in the reporter.
@@ -574,7 +583,7 @@ export interface InlineConfig {
574
583
/**
575
584
* Resolve custom snapshot path
576
585
*/
577
- resolveSnapshotPath ?: ( path : string , extension : string ) => string
586
+ resolveSnapshotPath ?: ResolveSnapshotPathHandler
578
587
579
588
/**
580
589
* Path to a custom snapshot environment module that has a default export of `SnapshotEnvironment` object.
0 commit comments