@nuxt/schema-nightly 5.0.0-29354479.c2e19985 β 5.0.0-29550727.fea006dd
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.
- package/README.md +15 -13
- package/builder-env.d.ts +1 -1
- package/dist/builder-env.d.mts +257 -271
- package/dist/builder-env.mjs +2 -1
- package/dist/index.d.mts +2816 -2722
- package/dist/index.mjs +989 -1308
- package/package.json +34 -41
- package/dist/builder-env.d.ts +0 -297
- package/dist/index.d.ts +0 -2854
package/README.md
CHANGED
|
@@ -1,37 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
<a href="https://nuxt.com"><img width="830" height="213" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/banner.svg" alt="Nuxt banner"></a>
|
|
2
2
|
|
|
3
3
|
# Nuxt
|
|
4
4
|
|
|
5
5
|
<p>
|
|
6
|
-
<a href="https://
|
|
7
|
-
<a href="https://
|
|
8
|
-
<a href="https://github.com/nuxt/nuxt/
|
|
6
|
+
<a href="https://npmx.dev/package/nuxt"><img src="https://npmx.dev/api/registry/badge/version/nuxt" alt="Version"></a>
|
|
7
|
+
<a href="https://npmx.dev/package/nuxt"><img src="https://npmx.dev/api/registry/badge/downloads/nuxt" alt="Downloads"></a>
|
|
8
|
+
<a href="https://github.com/nuxt/nuxt/blob/main/LICENSE"><img src="https://img.shields.io/github/license/nuxt/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="License"></a>
|
|
9
|
+
<a href="https://nuxt.com/modules"><img src="https://img.shields.io/badge/dynamic/json?url=https://nuxt.com/api/v1/modules&query=$.stats.modules&label=Modules&style=flat&colorA=18181B&colorB=28CF8D" alt="Modules"></a>
|
|
9
10
|
<a href="https://nuxt.com"><img src="https://img.shields.io/badge/Nuxt%20Docs-18181B?logo=nuxt" alt="Website"></a>
|
|
10
11
|
<a href="https://chat.nuxt.dev"><img src="https://img.shields.io/badge/Nuxt%20Discord-18181B?logo=discord" alt="Discord"></a>
|
|
11
|
-
<a href="https://securityscorecards.dev/"><img src="https://api.securityscorecards.dev/projects/github.com/nuxt/nuxt/badge" alt="Nuxt openssf scorecard score"></a>
|
|
12
|
+
<a href="https://securityscorecards.dev/viewer/?uri=github.com/nuxt/nuxt"><img src="https://api.securityscorecards.dev/projects/github.com/nuxt/nuxt/badge" alt="Nuxt openssf scorecard score"></a>
|
|
13
|
+
<a href="https://deepwiki.com/nuxt/nuxt"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
|
|
12
14
|
</p>
|
|
13
15
|
|
|
14
16
|
Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.
|
|
15
17
|
|
|
16
18
|
It provides a number of features that make it easy to build fast, SEO-friendly, and scalable web applications, including:
|
|
17
|
-
- Server-side rendering,
|
|
19
|
+
- Server-side rendering, static site generation, hybrid rendering and edge-side rendering
|
|
18
20
|
- Automatic routing with code-splitting and pre-fetching
|
|
19
21
|
- Data fetching and state management
|
|
20
|
-
-
|
|
22
|
+
- Search engine optimization and defining meta tags
|
|
21
23
|
- Auto imports of components, composables and utils
|
|
22
24
|
- TypeScript with zero configuration
|
|
23
|
-
- Go
|
|
24
|
-
- Extensible with [
|
|
25
|
+
- Go full-stack with our server/ directory
|
|
26
|
+
- Extensible with [300+ modules](https://nuxt.com/modules)
|
|
25
27
|
- Deployment to a variety of [hosting platforms](https://nuxt.com/deploy)
|
|
26
28
|
- ...[and much more](https://nuxt.com) π
|
|
27
29
|
|
|
28
30
|
### Table of Contents
|
|
29
31
|
|
|
30
32
|
- π [Getting Started](#getting-started)
|
|
31
|
-
- π» [
|
|
33
|
+
- π» [Vue Development](#vue-development)
|
|
32
34
|
- π [Documentation](#documentation)
|
|
33
35
|
- π§© [Modules](#modules)
|
|
34
|
-
- β€οΈ
|
|
36
|
+
- β€οΈ [Contribute](#contribute)
|
|
35
37
|
- π [Local Development](#local-development)
|
|
36
38
|
- π [Professional Support](#professional-support)
|
|
37
39
|
- π [Follow Us](#follow-us)
|
|
@@ -109,9 +111,9 @@ Follow the docs to [Set Up Your Local Development Environment](https://nuxt.com/
|
|
|
109
111
|
## <a name="follow-us">π Follow Us</a>
|
|
110
112
|
|
|
111
113
|
<p valign="center">
|
|
112
|
-
<a href="https://go.nuxt.com/discord"><img width="
|
|
114
|
+
<a href="https://go.nuxt.com/discord"><img width="20" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/discord.svg" alt="Discord"></a> <a href="https://go.nuxt.com/x"><img width="20" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/twitter.svg" alt="Twitter"></a> <a href="https://go.nuxt.com/github"><img width="20" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/github.svg" alt="GitHub"></a> <a href="https://go.nuxt.com/bluesky"><img width="20" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/bluesky.svg" alt="Bluesky"></a>
|
|
113
115
|
</p>
|
|
114
116
|
|
|
115
117
|
## <a name="license">βοΈ License</a>
|
|
116
118
|
|
|
117
|
-
[MIT](https://github.com/nuxt/nuxt/
|
|
119
|
+
[MIT](https://github.com/nuxt/nuxt/blob/main/LICENSE)
|
package/builder-env.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './dist/builder-env'
|
|
1
|
+
export * from './dist/builder-env.mts'
|
package/dist/builder-env.d.mts
CHANGED
|
@@ -1,297 +1,283 @@
|
|
|
1
|
+
//#region src/types/builder-env/vite.d.ts
|
|
1
2
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
* Reference: https://github.com/vitejs/vite/blob/main/packages/vite/types/importMeta.d.ts
|
|
4
|
+
*/
|
|
4
5
|
type ModuleNamespace = Record<string, any> & {
|
|
5
|
-
|
|
6
|
+
[Symbol.toStringTag]: "Module";
|
|
6
7
|
};
|
|
7
8
|
interface ViteHot {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
readonly data: any;
|
|
10
|
+
accept(): void;
|
|
11
|
+
accept(cb: (mod: ModuleNamespace | undefined) => void): void;
|
|
12
|
+
accept(dep: string, cb: (mod: ModuleNamespace | undefined) => void): void;
|
|
13
|
+
accept(deps: readonly string[], cb: (mods: Array<ModuleNamespace | undefined>) => void): void;
|
|
14
|
+
acceptExports(exportNames: string | readonly string[], cb?: (mod: ModuleNamespace | undefined) => void): void;
|
|
15
|
+
dispose(cb: (data: any) => void): void;
|
|
16
|
+
prune(cb: (data: any) => void): void;
|
|
17
|
+
invalidate(message?: string): void;
|
|
18
|
+
on(event: any, cb: (payload: any) => void): void;
|
|
19
|
+
send(event: any, data?: any): void;
|
|
19
20
|
}
|
|
20
21
|
interface KnownAsTypeMap {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
raw: string;
|
|
23
|
+
url: string;
|
|
24
|
+
worker: Worker;
|
|
24
25
|
}
|
|
25
26
|
interface ImportGlobOptions<Eager extends boolean, AsType extends string> {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Import type for the import url.
|
|
29
|
+
*/
|
|
30
|
+
as?: AsType;
|
|
31
|
+
/**
|
|
32
|
+
* Import as static or dynamic
|
|
33
|
+
*/
|
|
34
|
+
eager?: Eager;
|
|
35
|
+
/**
|
|
36
|
+
* Import only the specific named export. Set to `default` to import the default export.
|
|
37
|
+
*/
|
|
38
|
+
import?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Custom queries
|
|
41
|
+
*/
|
|
42
|
+
query?: string | Record<string, string | number | boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* Search files also inside `node_modules/` and hidden directories (e.g. `.git/`). This might have impact on performance.
|
|
45
|
+
*/
|
|
46
|
+
exhaustive?: boolean;
|
|
46
47
|
}
|
|
47
48
|
interface ImportGlobFunction {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
interface ImportGlobEagerFunction {
|
|
68
|
-
/**
|
|
69
|
-
* Eagerly import a list of files with a glob pattern.
|
|
70
|
-
*
|
|
71
|
-
* Overload 1: No generic provided, infer the type from `as`
|
|
72
|
-
*/
|
|
73
|
-
<As extends string, T = As extends keyof KnownAsTypeMap ? KnownAsTypeMap[As] : unknown>(glob: string | string[], options?: Omit<ImportGlobOptions<boolean, As>, 'eager'>): Record<string, T>;
|
|
74
|
-
/**
|
|
75
|
-
* Eagerly import a list of files with a glob pattern.
|
|
76
|
-
*
|
|
77
|
-
* Overload 2: Module generic provided
|
|
78
|
-
*/
|
|
79
|
-
<M>(glob: string | string[], options?: Omit<ImportGlobOptions<boolean, string>, 'eager'>): Record<string, M>;
|
|
49
|
+
/**
|
|
50
|
+
* Import a list of files with a glob pattern.
|
|
51
|
+
*
|
|
52
|
+
* Overload 1: No generic provided, infer the type from `eager` and `as`
|
|
53
|
+
*/
|
|
54
|
+
<Eager extends boolean, As extends string, T = (As extends keyof KnownAsTypeMap ? KnownAsTypeMap[As] : unknown)>(glob: string | string[], options?: ImportGlobOptions<Eager, As>): (Eager extends true ? true : false) extends true ? Record<string, T> : Record<string, () => Promise<T>>;
|
|
55
|
+
/**
|
|
56
|
+
* Import a list of files with a glob pattern.
|
|
57
|
+
*
|
|
58
|
+
* Overload 2: Module generic provided, infer the type from `eager: false`
|
|
59
|
+
*/
|
|
60
|
+
<M>(glob: string | string[], options?: ImportGlobOptions<false, string>): Record<string, () => Promise<M>>;
|
|
61
|
+
/**
|
|
62
|
+
* Import a list of files with a glob pattern.
|
|
63
|
+
*
|
|
64
|
+
* Overload 3: Module generic provided, infer the type from `eager: true`
|
|
65
|
+
*/
|
|
66
|
+
<M>(glob: string | string[], options: ImportGlobOptions<true, string>): Record<string, M>;
|
|
80
67
|
}
|
|
81
68
|
interface ViteImportMeta {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* @deprecated Use `import.meta.glob('*', { eager: true })` instead
|
|
88
|
-
*/
|
|
89
|
-
globEager: ImportGlobEagerFunction;
|
|
69
|
+
/** Vite client HMR API - see https://vite.dev/guide/api-hmr */
|
|
70
|
+
readonly hot?: ViteHot;
|
|
71
|
+
/** vite glob import utility - https://vite.dev/guide/features.html#glob-import */
|
|
72
|
+
glob: ImportGlobFunction;
|
|
90
73
|
}
|
|
91
|
-
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/types/builder-env/webpack.d.ts
|
|
92
76
|
/**
|
|
93
|
-
|
|
94
|
-
|
|
77
|
+
* Reference: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/webpack-env/index.d.ts
|
|
78
|
+
*/
|
|
95
79
|
type WebpackModuleId = string | number;
|
|
96
80
|
interface HotNotifierInfo {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
81
|
+
type: "self-declined" | "declined" | "unaccepted" | "accepted" | "disposed" | "accept-errored" | "self-accept-errored" | "self-accept-error-handler-errored";
|
|
82
|
+
/**
|
|
83
|
+
* The module in question.
|
|
84
|
+
*/
|
|
85
|
+
moduleId: number;
|
|
86
|
+
/**
|
|
87
|
+
* For errors: the module id owning the accept handler.
|
|
88
|
+
*/
|
|
89
|
+
dependencyId?: number | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* For declined/accepted/unaccepted: the chain from where the update was propagated.
|
|
92
|
+
*/
|
|
93
|
+
chain?: number[] | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* For declined: the module id of the declining parent
|
|
96
|
+
*/
|
|
97
|
+
parentId?: number | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* For accepted: the modules that are outdated and will be disposed
|
|
100
|
+
*/
|
|
101
|
+
outdatedModules?: number[] | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* For accepted: The location of accept handlers that will handle the update
|
|
104
|
+
*/
|
|
105
|
+
outdatedDependencies?: {
|
|
106
|
+
[dependencyId: number]: number[];
|
|
107
|
+
} | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* For errors: the thrown error
|
|
110
|
+
*/
|
|
111
|
+
error?: Error | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* For self-accept-error-handler-errored: the error thrown by the module
|
|
114
|
+
* before the error handler tried to handle it.
|
|
115
|
+
*/
|
|
116
|
+
originalError?: Error | undefined;
|
|
133
117
|
}
|
|
134
118
|
interface AcceptOptions {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
119
|
+
/**
|
|
120
|
+
* If true the update process continues even if some modules are not accepted (and would bubble to the entry point).
|
|
121
|
+
*/
|
|
122
|
+
ignoreUnaccepted?: boolean | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* Ignore changes made to declined modules.
|
|
125
|
+
*/
|
|
126
|
+
ignoreDeclined?: boolean | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* Ignore errors throw in accept handlers, error handlers and while reevaluating module.
|
|
129
|
+
*/
|
|
130
|
+
ignoreErrored?: boolean | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* Notifier for declined modules.
|
|
133
|
+
*/
|
|
134
|
+
onDeclined?: ((info: HotNotifierInfo) => void) | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* Notifier for unaccepted modules.
|
|
137
|
+
*/
|
|
138
|
+
onUnaccepted?: ((info: HotNotifierInfo) => void) | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* Notifier for accepted modules.
|
|
141
|
+
*/
|
|
142
|
+
onAccepted?: ((info: HotNotifierInfo) => void) | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* Notifier for disposed modules.
|
|
145
|
+
*/
|
|
146
|
+
onDisposed?: ((info: HotNotifierInfo) => void) | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Notifier for errors.
|
|
149
|
+
*/
|
|
150
|
+
onErrored?: ((info: HotNotifierInfo) => void) | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* Indicates that apply() is automatically called by check function
|
|
153
|
+
*/
|
|
154
|
+
autoApply?: boolean | undefined;
|
|
171
155
|
}
|
|
172
156
|
interface WebpackHot {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
157
|
+
/**
|
|
158
|
+
* Accept code updates for the specified dependencies. The callback is called when dependencies were replaced.
|
|
159
|
+
* @param dependencies
|
|
160
|
+
* @param callback
|
|
161
|
+
* @param errorHandler
|
|
162
|
+
*/
|
|
163
|
+
accept(dependencies: string[], callback?: (updatedDependencies: WebpackModuleId[]) => void, errorHandler?: (err: Error) => void): void;
|
|
164
|
+
/**
|
|
165
|
+
* Accept code updates for the specified dependencies. The callback is called when dependencies were replaced.
|
|
166
|
+
* @param dependency
|
|
167
|
+
* @param callback
|
|
168
|
+
* @param errorHandler
|
|
169
|
+
*/
|
|
170
|
+
accept(dependency: string, callback?: () => void, errorHandler?: (err: Error) => void): void;
|
|
171
|
+
/**
|
|
172
|
+
* Accept code updates for this module without notification of parents.
|
|
173
|
+
* This should only be used if the module doesnβt export anything.
|
|
174
|
+
* The errHandler can be used to handle errors that occur while loading the updated module.
|
|
175
|
+
* @param errHandler
|
|
176
|
+
*/
|
|
177
|
+
accept(errHandler?: (err: Error) => void): void;
|
|
178
|
+
/**
|
|
179
|
+
* Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline".
|
|
180
|
+
*/
|
|
181
|
+
decline(dependencies: string[]): void;
|
|
182
|
+
/**
|
|
183
|
+
* Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline".
|
|
184
|
+
*/
|
|
185
|
+
decline(dependency: string): void;
|
|
186
|
+
/**
|
|
187
|
+
* Flag the current module as not update-able. If updated the update code would fail with code "decline".
|
|
188
|
+
*/
|
|
189
|
+
decline(): void;
|
|
190
|
+
/**
|
|
191
|
+
* Add a one time handler, which is executed when the current module code is replaced.
|
|
192
|
+
* Here you should destroy/remove any persistent resource you have claimed/created.
|
|
193
|
+
* If you want to transfer state to the new module, add it to data object.
|
|
194
|
+
* The data will be available at module.hot.data on the new module.
|
|
195
|
+
* @param callback
|
|
196
|
+
*/
|
|
197
|
+
dispose(callback: (data: any) => void): void;
|
|
198
|
+
dispose(callback: <T>(data: T) => void): void;
|
|
199
|
+
/**
|
|
200
|
+
* Add a one time handler, which is executed when the current module code is replaced.
|
|
201
|
+
* Here you should destroy/remove any persistent resource you have claimed/created.
|
|
202
|
+
* If you want to transfer state to the new module, add it to data object.
|
|
203
|
+
* The data will be available at module.hot.data on the new module.
|
|
204
|
+
* @param callback
|
|
205
|
+
*/
|
|
206
|
+
addDisposeHandler(callback: (data: any) => void): void;
|
|
207
|
+
addDisposeHandler<T>(callback: (data: T) => void): void;
|
|
208
|
+
/**
|
|
209
|
+
* Remove a handler.
|
|
210
|
+
* This can useful to add a temporary dispose handler. You could i. e. replace code while in the middle of a multi-step async function.
|
|
211
|
+
* @param callback
|
|
212
|
+
*/
|
|
213
|
+
removeDisposeHandler(callback: (data: any) => void): void;
|
|
214
|
+
removeDisposeHandler<T>(callback: (data: T) => void): void;
|
|
215
|
+
/**
|
|
216
|
+
* Throws an exceptions if status() is not idle.
|
|
217
|
+
* Check all currently loaded modules for updates and apply updates if found.
|
|
218
|
+
* If no update was found, the callback is called with null.
|
|
219
|
+
* If autoApply is truthy the callback will be called with all modules that were disposed.
|
|
220
|
+
* apply() is automatically called with autoApply as options parameter.
|
|
221
|
+
* If autoApply is not set the callback will be called with all modules that will be disposed on apply().
|
|
222
|
+
* @param autoApply
|
|
223
|
+
* @param callback
|
|
224
|
+
*/
|
|
225
|
+
check(autoApply: boolean, callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
|
|
226
|
+
/**
|
|
227
|
+
* Throws an exceptions if status() is not idle.
|
|
228
|
+
* Check all currently loaded modules for updates and apply updates if found.
|
|
229
|
+
* If no update was found, the callback is called with null.
|
|
230
|
+
* The callback will be called with all modules that will be disposed on apply().
|
|
231
|
+
* @param callback
|
|
232
|
+
*/
|
|
233
|
+
check(callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
|
|
234
|
+
/**
|
|
235
|
+
* If status() != "ready" it throws an error.
|
|
236
|
+
* Continue the update process.
|
|
237
|
+
* @param options
|
|
238
|
+
* @param callback
|
|
239
|
+
*/
|
|
240
|
+
apply(options: AcceptOptions, callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
|
|
241
|
+
/**
|
|
242
|
+
* If status() != "ready" it throws an error.
|
|
243
|
+
* Continue the update process.
|
|
244
|
+
* @param callback
|
|
245
|
+
*/
|
|
246
|
+
apply(callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
|
|
247
|
+
/**
|
|
248
|
+
* Return one of idle, check, watch, watch-delay, prepare, ready, dispose, apply, abort or fail.
|
|
249
|
+
*/
|
|
250
|
+
status(): string;
|
|
251
|
+
/** Register a callback on status change. */
|
|
252
|
+
status(callback: (status: string) => void): void;
|
|
253
|
+
/** Register a callback on status change. */
|
|
254
|
+
addStatusHandler(callback: (status: string) => void): void;
|
|
255
|
+
/**
|
|
256
|
+
* Remove a registered status change handler.
|
|
257
|
+
* @param callback
|
|
258
|
+
*/
|
|
259
|
+
removeStatusHandler(callback: (status: string) => void): void;
|
|
260
|
+
active: boolean;
|
|
261
|
+
data: any;
|
|
278
262
|
}
|
|
279
263
|
interface WebpackImportMeta {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
264
|
+
/** an alias for `module.hot` - see https://webpack.js.org/api/hot-module-replacement/ */
|
|
265
|
+
webpackHot?: WebpackHot | undefined;
|
|
266
|
+
/** the webpack major version as number */
|
|
267
|
+
webpack?: number;
|
|
284
268
|
}
|
|
285
|
-
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/types/builder-env/index.d.ts
|
|
286
271
|
type BundlerImportMeta = ViteImportMeta & WebpackImportMeta;
|
|
272
|
+
//#endregion
|
|
273
|
+
//#region src/builder-env.d.ts
|
|
287
274
|
declare global {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
275
|
+
interface ImportMeta extends BundlerImportMeta {
|
|
276
|
+
/** the `file:` url of the current file (similar to `__filename` but as file url) */
|
|
277
|
+
url: string;
|
|
278
|
+
readonly env: Record<string, string | boolean | undefined>;
|
|
279
|
+
}
|
|
293
280
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
export { builders };
|
|
281
|
+
declare const builders: readonly ["vite", "webpack"];
|
|
282
|
+
//#endregion
|
|
283
|
+
export { builders };
|
package/dist/builder-env.mjs
CHANGED