Skip to content

Commit 15ff3a2

Browse files
authored
docs: update import.meta.glob jsdocs (#9709)
1 parent 095e920 commit 15ff3a2

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

packages/vite/types/importGlob.d.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ export interface KnownAsTypeMap {
3838

3939
export interface ImportGlobFunction {
4040
/**
41-
* 1. No generic provided, infer the type from `eager` and `as`
41+
* Import a list of files with a glob pattern.
42+
*
43+
* Overload 1: No generic provided, infer the type from `eager` and `as`
4244
*/
4345
<
4446
Eager extends boolean,
@@ -51,14 +53,18 @@ export interface ImportGlobFunction {
5153
? Record<string, T>
5254
: Record<string, () => Promise<T>>
5355
/**
54-
* 2. Module generic provided, infer the type from `eager: false`
56+
* Import a list of files with a glob pattern.
57+
*
58+
* Overload 2: Module generic provided, infer the type from `eager: false`
5559
*/
5660
<M>(
5761
glob: string | string[],
5862
options?: ImportGlobOptions<false, string>
5963
): Record<string, () => Promise<M>>
6064
/**
61-
* 3. Module generic provided, infer the type from `eager: true`
65+
* Import a list of files with a glob pattern.
66+
*
67+
* Overload 3: Module generic provided, infer the type from `eager: true`
6268
*/
6369
<M>(
6470
glob: string | string[],
@@ -68,7 +74,9 @@ export interface ImportGlobFunction {
6874

6975
export interface ImportGlobEagerFunction {
7076
/**
71-
* 1. No generic provided, infer the type from `as`
77+
* Eagerly import a list of files with a glob pattern.
78+
*
79+
* Overload 1: No generic provided, infer the type from `as`
7280
*/
7381
<
7482
As extends string,
@@ -78,7 +86,9 @@ export interface ImportGlobEagerFunction {
7886
options?: Omit<ImportGlobOptions<boolean, As>, 'eager'>
7987
): Record<string, T>
8088
/**
81-
* 2. Module generic provided
89+
* Eagerly import a list of files with a glob pattern.
90+
*
91+
* Overload 2: Module generic provided
8292
*/
8393
<M>(
8494
glob: string | string[],

0 commit comments

Comments
 (0)