vite 4.0.0-alpha.5 → 4.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import type {
2
2
  ErrorPayload,
3
3
  FullReloadPayload,
4
4
  PrunePayload,
5
- UpdatePayload
5
+ UpdatePayload,
6
6
  } from './hmrPayload'
7
7
 
8
8
  export interface CustomEventMap {
package/types/hot.d.ts CHANGED
@@ -12,22 +12,21 @@ export interface ViteHotContext {
12
12
  accept(dep: string, cb: (mod: ModuleNamespace | undefined) => void): void
13
13
  accept(
14
14
  deps: readonly string[],
15
- cb: (mods: Array<ModuleNamespace | undefined>) => void
15
+ cb: (mods: Array<ModuleNamespace | undefined>) => void,
16
16
  ): void
17
17
 
18
- acceptExports(exportNames: string | readonly string[]): void
19
18
  acceptExports(
20
19
  exportNames: string | readonly string[],
21
- cb: (mod: ModuleNamespace | undefined) => void
20
+ cb?: (mod: ModuleNamespace | undefined) => void,
22
21
  ): void
23
22
 
24
23
  dispose(cb: (data: any) => void): void
25
- decline(): void
24
+ prune(cb: (data: any) => void): void
26
25
  invalidate(message?: string): void
27
26
 
28
27
  on<T extends string>(
29
28
  event: T,
30
- cb: (payload: InferCustomEventPayload<T>) => void
29
+ cb: (payload: InferCustomEventPayload<T>) => void,
31
30
  ): void
32
31
  send<T extends string>(event: T, data?: InferCustomEventPayload<T>): void
33
32
  }
@@ -1,6 +1,6 @@
1
1
  export interface ImportGlobOptions<
2
2
  Eager extends boolean,
3
- AsType extends string
3
+ AsType extends string,
4
4
  > {
5
5
  /**
6
6
  * Import type for the import url.
@@ -45,10 +45,10 @@ export interface ImportGlobFunction {
45
45
  <
46
46
  Eager extends boolean,
47
47
  As extends string,
48
- T = As extends keyof KnownAsTypeMap ? KnownAsTypeMap[As] : unknown
48
+ T = As extends keyof KnownAsTypeMap ? KnownAsTypeMap[As] : unknown,
49
49
  >(
50
50
  glob: string | string[],
51
- options?: ImportGlobOptions<Eager, As>
51
+ options?: ImportGlobOptions<Eager, As>,
52
52
  ): (Eager extends true ? true : false) extends true
53
53
  ? Record<string, T>
54
54
  : Record<string, () => Promise<T>>
@@ -59,7 +59,7 @@ export interface ImportGlobFunction {
59
59
  */
60
60
  <M>(
61
61
  glob: string | string[],
62
- options?: ImportGlobOptions<false, string>
62
+ options?: ImportGlobOptions<false, string>,
63
63
  ): Record<string, () => Promise<M>>
64
64
  /**
65
65
  * Import a list of files with a glob pattern.
@@ -68,7 +68,7 @@ export interface ImportGlobFunction {
68
68
  */
69
69
  <M>(
70
70
  glob: string | string[],
71
- options: ImportGlobOptions<true, string>
71
+ options: ImportGlobOptions<true, string>,
72
72
  ): Record<string, M>
73
73
  }
74
74
 
@@ -80,10 +80,10 @@ export interface ImportGlobEagerFunction {
80
80
  */
81
81
  <
82
82
  As extends string,
83
- T = As extends keyof KnownAsTypeMap ? KnownAsTypeMap[As] : unknown
83
+ T = As extends keyof KnownAsTypeMap ? KnownAsTypeMap[As] : unknown,
84
84
  >(
85
85
  glob: string | string[],
86
- options?: Omit<ImportGlobOptions<boolean, As>, 'eager'>
86
+ options?: Omit<ImportGlobOptions<boolean, As>, 'eager'>,
87
87
  ): Record<string, T>
88
88
  /**
89
89
  * Eagerly import a list of files with a glob pattern.
@@ -92,6 +92,6 @@ export interface ImportGlobEagerFunction {
92
92
  */
93
93
  <M>(
94
94
  glob: string | string[],
95
- options?: Omit<ImportGlobOptions<boolean, string>, 'eager'>
95
+ options?: Omit<ImportGlobOptions<boolean, string>, 'eager'>,
96
96
  ): Record<string, M>
97
97
  }