@@ -3,6 +3,7 @@ import type {
33 CoverageOptions ,
44 CoverageProvider ,
55 NormalizedCoverageOptions ,
6+ ProjectConfig ,
67 RstestConfig ,
78} from './types' ;
89
@@ -31,7 +32,7 @@ export type RstestConfigExport =
3132
3233/**
3334 * This function helps you to autocomplete configuration types.
34- * It accepts a Rsbuild config object, or a function that returns a config.
35+ * It accepts a Rstest config object, or a function that returns a config.
3536 */
3637export function defineConfig ( config : RstestConfig ) : RstestConfig ;
3738export function defineConfig ( config : RstestConfigSyncFn ) : RstestConfigSyncFn ;
@@ -41,6 +42,28 @@ export function defineConfig(config: RstestConfigExport) {
4142 return config ;
4243}
4344
45+ type ProjectConfigAsyncFn = ( ) => Promise < ProjectConfig > ;
46+
47+ type ProjectConfigSyncFn = ( ) => ProjectConfig ;
48+
49+ type RstestProjectConfigExport =
50+ | ProjectConfig
51+ | ProjectConfigSyncFn
52+ | ProjectConfigAsyncFn ;
53+
54+ /**
55+ * This function helps you to autocomplete configuration types.
56+ * It accepts a Rstest project config object, or a function that returns a config.
57+ */
58+ export function defineProject ( config : ProjectConfig ) : ProjectConfig ;
59+ export function defineProject ( config : ProjectConfigSyncFn ) : ProjectConfigSyncFn ;
60+ export function defineProject (
61+ config : ProjectConfigAsyncFn ,
62+ ) : ProjectConfigAsyncFn ;
63+ export function defineProject ( config : RstestProjectConfigExport ) {
64+ return config ;
65+ }
66+
4467export type {
4568 ProjectConfig ,
4669 Reporter ,
0 commit comments