@@ -6,6 +6,7 @@ import type { SerializedDiffOptions } from '@vitest/utils/diff'
66import type { AliasOptions , ConfigEnv , DepOptimizationConfig , ServerOptions , UserConfig as ViteUserConfig } from 'vite'
77import type { ViteNodeServerOptions } from 'vite-node'
88import type { ChaiConfig } from '../../integrations/chai/config'
9+ import type { SerializedConfig } from '../../runtime/config'
910import type { EnvironmentOptions } from '../../types/environment'
1011import type { Arrayable , ErrorWithDiff , ParsedStack , ProvidedContext } from '../../types/general'
1112import type { HappyDOMOptions } from '../../types/happy-dom-options'
@@ -225,6 +226,14 @@ type ReporterWithOptions<Name extends ReporterName = ReporterName> =
225226 : [ Name , Partial < BuiltinReporterOptions [ Name ] > ]
226227 : [ Name , Record < string , unknown > ]
227228
229+ export interface ResolveSnapshotPathHandlerContext { config : SerializedConfig }
230+
231+ export type ResolveSnapshotPathHandler = (
232+ testPath : string ,
233+ snapExtension : string ,
234+ context : ResolveSnapshotPathHandlerContext
235+ ) => string
236+
228237export interface InlineConfig {
229238 /**
230239 * Name of the project. Will be used to display in the reporter.
@@ -574,7 +583,7 @@ export interface InlineConfig {
574583 /**
575584 * Resolve custom snapshot path
576585 */
577- resolveSnapshotPath ?: ( path : string , extension : string ) => string
586+ resolveSnapshotPath ?: ResolveSnapshotPathHandler
578587
579588 /**
580589 * Path to a custom snapshot environment module that has a default export of `SnapshotEnvironment` object.
0 commit comments