UNPKG

1.11 kBTypeScriptView Raw
1// This file is an augmentation to the built-in ImportMeta interface
2// Thus cannot contain any top-level imports
3// <https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation>
4
5/* eslint-disable @typescript-eslint/consistent-type-imports */
6
7// Duplicate of import('../src/node/importGlob').GlobOptions in order to
8// avoid breaking the production client type. Because this file is referenced
9// in vite/client.d.ts and in production src/node/importGlob.ts doesn't exist.
10interface GlobOptions {
11 as?: string
12 /**
13 * @deprecated
14 */
15 assert?: {
16 type: string
17 }
18}
19
20interface ImportMeta {
21 url: string
22
23 readonly hot?: import('./hot').ViteHotContext
24
25 readonly env: ImportMetaEnv
26
27 glob<Module = { [key: string]: any }>(
28 pattern: string,
29 options?: GlobOptions
30 ): Record<string, () => Promise<Module>>
31
32 globEager<Module = { [key: string]: any }>(
33 pattern: string,
34 options?: GlobOptions
35 ): Record<string, Module>
36}
37
38interface ImportMetaEnv {
39 [key: string]: any
40 BASE_URL: string
41 MODE: string
42 DEV: boolean
43 PROD: boolean
44 SSR: boolean
45}