WXL
4 天以前 3bd962a6d7f61239c020e2dbbeb7341e5b842dd1
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
39
40
41
42
43
44
45
// This file is an augmentation to the built-in ImportMeta interface
// Thus cannot contain any top-level imports
// <https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation>
 
/* eslint-disable @typescript-eslint/consistent-type-imports */
 
// Duplicate of import('../src/node/importGlob').GlobOptions in order to
// avoid breaking the production client type. Because this file is referenced
// in vite/client.d.ts and in production src/node/importGlob.ts doesn't exist.
interface GlobOptions {
  as?: string
  /**
   * @deprecated
   */
  assert?: {
    type: string
  }
}
 
interface ImportMeta {
  url: string
 
  readonly hot?: import('./hot').ViteHotContext
 
  readonly env: ImportMetaEnv
 
  glob<Module = { [key: string]: any }>(
    pattern: string,
    options?: GlobOptions
  ): Record<string, () => Promise<Module>>
 
  globEager<Module = { [key: string]: any }>(
    pattern: string,
    options?: GlobOptions
  ): Record<string, Module>
}
 
interface ImportMetaEnv {
  [key: string]: any
  BASE_URL: string
  MODE: string
  DEV: boolean
  PROD: boolean
  SSR: boolean
}