@nuxt/schema-nightly 4.3.0-29465977.c4f46c64 → 4.3.0-29466366.fa21bb17

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.
@@ -1,297 +1,301 @@
1
+ //#region src/types/builder-env/vite.d.ts
1
2
  /**
2
- * Reference: https://github.com/vitejs/vite/blob/main/packages/vite/types/importMeta.d.ts
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
- [Symbol.toStringTag]: 'Module';
6
+ [Symbol.toStringTag]: "Module";
6
7
  };
7
8
  interface ViteHot {
8
- readonly data: any;
9
- accept(): void;
10
- accept(cb: (mod: ModuleNamespace | undefined) => void): void;
11
- accept(dep: string, cb: (mod: ModuleNamespace | undefined) => void): void;
12
- accept(deps: readonly string[], cb: (mods: Array<ModuleNamespace | undefined>) => void): void;
13
- acceptExports(exportNames: string | readonly string[], cb?: (mod: ModuleNamespace | undefined) => void): void;
14
- dispose(cb: (data: any) => void): void;
15
- prune(cb: (data: any) => void): void;
16
- invalidate(message?: string): void;
17
- on(event: any, cb: (payload: any) => void): void;
18
- send(event: any, data?: any): void;
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
- raw: string;
22
- url: string;
23
- worker: Worker;
22
+ raw: string;
23
+ url: string;
24
+ worker: Worker;
24
25
  }
25
26
  interface ImportGlobOptions<Eager extends boolean, AsType extends string> {
26
- /**
27
- * Import type for the import url.
28
- */
29
- as?: AsType;
30
- /**
31
- * Import as static or dynamic
32
- */
33
- eager?: Eager;
34
- /**
35
- * Import only the specific named export. Set to `default` to import the default export.
36
- */
37
- import?: string;
38
- /**
39
- * Custom queries
40
- */
41
- query?: string | Record<string, string | number | boolean>;
42
- /**
43
- * Search files also inside `node_modules/` and hidden directories (e.g. `.git/`). This might have impact on performance.
44
- */
45
- exhaustive?: boolean;
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
- * Import a list of files with a glob pattern.
50
- *
51
- * Overload 1: No generic provided, infer the type from `eager` and `as`
52
- */
53
- <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>>;
54
- /**
55
- * Import a list of files with a glob pattern.
56
- *
57
- * Overload 2: Module generic provided, infer the type from `eager: false`
58
- */
59
- <M>(glob: string | string[], options?: ImportGlobOptions<false, string>): Record<string, () => Promise<M>>;
60
- /**
61
- * Import a list of files with a glob pattern.
62
- *
63
- * Overload 3: Module generic provided, infer the type from `eager: true`
64
- */
65
- <M>(glob: string | string[], options: ImportGlobOptions<true, string>): 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>;
66
67
  }
67
68
  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>;
69
+ /**
70
+ * Eagerly import a list of files with a glob pattern.
71
+ *
72
+ * Overload 1: No generic provided, infer the type from `as`
73
+ */
74
+ <As extends string, T = (As extends keyof KnownAsTypeMap ? KnownAsTypeMap[As] : unknown)>(glob: string | string[], options?: Omit<ImportGlobOptions<boolean, As>, "eager">): Record<string, T>;
75
+ /**
76
+ * Eagerly import a list of files with a glob pattern.
77
+ *
78
+ * Overload 2: Module generic provided
79
+ */
80
+ <M>(glob: string | string[], options?: Omit<ImportGlobOptions<boolean, string>, "eager">): Record<string, M>;
80
81
  }
81
82
  interface ViteImportMeta {
82
- /** Vite client HMR API - see https://vite.dev/guide/api-hmr */
83
- readonly hot?: ViteHot;
84
- /** vite glob import utility - https://vite.dev/guide/features.html#glob-import */
85
- glob: ImportGlobFunction;
86
- /**
87
- * @deprecated Use `import.meta.glob('*', { eager: true })` instead
88
- */
89
- globEager: ImportGlobEagerFunction;
83
+ /** Vite client HMR API - see https://vite.dev/guide/api-hmr */
84
+ readonly hot?: ViteHot;
85
+ /** vite glob import utility - https://vite.dev/guide/features.html#glob-import */
86
+ glob: ImportGlobFunction;
87
+ /**
88
+ * @deprecated Use `import.meta.glob('*', { eager: true })` instead
89
+ */
90
+ globEager: ImportGlobEagerFunction;
90
91
  }
91
-
92
+ //#endregion
93
+ //#region src/types/builder-env/webpack.d.ts
92
94
  /**
93
- * Reference: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/webpack-env/index.d.ts
94
- */
95
+ * Reference: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/webpack-env/index.d.ts
96
+ */
95
97
  type WebpackModuleId = string | number;
96
98
  interface HotNotifierInfo {
97
- type: 'self-declined' | 'declined' | 'unaccepted' | 'accepted' | 'disposed' | 'accept-errored' | 'self-accept-errored' | 'self-accept-error-handler-errored';
98
- /**
99
- * The module in question.
100
- */
101
- moduleId: number;
102
- /**
103
- * For errors: the module id owning the accept handler.
104
- */
105
- dependencyId?: number | undefined;
106
- /**
107
- * For declined/accepted/unaccepted: the chain from where the update was propagated.
108
- */
109
- chain?: number[] | undefined;
110
- /**
111
- * For declined: the module id of the declining parent
112
- */
113
- parentId?: number | undefined;
114
- /**
115
- * For accepted: the modules that are outdated and will be disposed
116
- */
117
- outdatedModules?: number[] | undefined;
118
- /**
119
- * For accepted: The location of accept handlers that will handle the update
120
- */
121
- outdatedDependencies?: {
122
- [dependencyId: number]: number[];
123
- } | undefined;
124
- /**
125
- * For errors: the thrown error
126
- */
127
- error?: Error | undefined;
128
- /**
129
- * For self-accept-error-handler-errored: the error thrown by the module
130
- * before the error handler tried to handle it.
131
- */
132
- originalError?: Error | undefined;
99
+ type: "self-declined" | "declined" | "unaccepted" | "accepted" | "disposed" | "accept-errored" | "self-accept-errored" | "self-accept-error-handler-errored";
100
+ /**
101
+ * The module in question.
102
+ */
103
+ moduleId: number;
104
+ /**
105
+ * For errors: the module id owning the accept handler.
106
+ */
107
+ dependencyId?: number | undefined;
108
+ /**
109
+ * For declined/accepted/unaccepted: the chain from where the update was propagated.
110
+ */
111
+ chain?: number[] | undefined;
112
+ /**
113
+ * For declined: the module id of the declining parent
114
+ */
115
+ parentId?: number | undefined;
116
+ /**
117
+ * For accepted: the modules that are outdated and will be disposed
118
+ */
119
+ outdatedModules?: number[] | undefined;
120
+ /**
121
+ * For accepted: The location of accept handlers that will handle the update
122
+ */
123
+ outdatedDependencies?: {
124
+ [dependencyId: number]: number[];
125
+ } | undefined;
126
+ /**
127
+ * For errors: the thrown error
128
+ */
129
+ error?: Error | undefined;
130
+ /**
131
+ * For self-accept-error-handler-errored: the error thrown by the module
132
+ * before the error handler tried to handle it.
133
+ */
134
+ originalError?: Error | undefined;
133
135
  }
134
136
  interface AcceptOptions {
135
- /**
136
- * If true the update process continues even if some modules are not accepted (and would bubble to the entry point).
137
- */
138
- ignoreUnaccepted?: boolean | undefined;
139
- /**
140
- * Ignore changes made to declined modules.
141
- */
142
- ignoreDeclined?: boolean | undefined;
143
- /**
144
- * Ignore errors throw in accept handlers, error handlers and while reevaluating module.
145
- */
146
- ignoreErrored?: boolean | undefined;
147
- /**
148
- * Notifier for declined modules.
149
- */
150
- onDeclined?: ((info: HotNotifierInfo) => void) | undefined;
151
- /**
152
- * Notifier for unaccepted modules.
153
- */
154
- onUnaccepted?: ((info: HotNotifierInfo) => void) | undefined;
155
- /**
156
- * Notifier for accepted modules.
157
- */
158
- onAccepted?: ((info: HotNotifierInfo) => void) | undefined;
159
- /**
160
- * Notifier for disposed modules.
161
- */
162
- onDisposed?: ((info: HotNotifierInfo) => void) | undefined;
163
- /**
164
- * Notifier for errors.
165
- */
166
- onErrored?: ((info: HotNotifierInfo) => void) | undefined;
167
- /**
168
- * Indicates that apply() is automatically called by check function
169
- */
170
- autoApply?: boolean | undefined;
137
+ /**
138
+ * If true the update process continues even if some modules are not accepted (and would bubble to the entry point).
139
+ */
140
+ ignoreUnaccepted?: boolean | undefined;
141
+ /**
142
+ * Ignore changes made to declined modules.
143
+ */
144
+ ignoreDeclined?: boolean | undefined;
145
+ /**
146
+ * Ignore errors throw in accept handlers, error handlers and while reevaluating module.
147
+ */
148
+ ignoreErrored?: boolean | undefined;
149
+ /**
150
+ * Notifier for declined modules.
151
+ */
152
+ onDeclined?: ((info: HotNotifierInfo) => void) | undefined;
153
+ /**
154
+ * Notifier for unaccepted modules.
155
+ */
156
+ onUnaccepted?: ((info: HotNotifierInfo) => void) | undefined;
157
+ /**
158
+ * Notifier for accepted modules.
159
+ */
160
+ onAccepted?: ((info: HotNotifierInfo) => void) | undefined;
161
+ /**
162
+ * Notifier for disposed modules.
163
+ */
164
+ onDisposed?: ((info: HotNotifierInfo) => void) | undefined;
165
+ /**
166
+ * Notifier for errors.
167
+ */
168
+ onErrored?: ((info: HotNotifierInfo) => void) | undefined;
169
+ /**
170
+ * Indicates that apply() is automatically called by check function
171
+ */
172
+ autoApply?: boolean | undefined;
171
173
  }
172
174
  interface WebpackHot {
173
- /**
174
- * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced.
175
- * @param dependencies
176
- * @param callback
177
- * @param errorHandler
178
- */
179
- accept(dependencies: string[], callback?: (updatedDependencies: WebpackModuleId[]) => void, errorHandler?: (err: Error) => void): void;
180
- /**
181
- * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced.
182
- * @param dependency
183
- * @param callback
184
- * @param errorHandler
185
- */
186
- accept(dependency: string, callback?: () => void, errorHandler?: (err: Error) => void): void;
187
- /**
188
- * Accept code updates for this module without notification of parents.
189
- * This should only be used if the module doesn’t export anything.
190
- * The errHandler can be used to handle errors that occur while loading the updated module.
191
- * @param errHandler
192
- */
193
- accept(errHandler?: (err: Error) => void): void;
194
- /**
195
- * Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline".
196
- */
197
- decline(dependencies: string[]): void;
198
- /**
199
- * Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline".
200
- */
201
- decline(dependency: string): void;
202
- /**
203
- * Flag the current module as not update-able. If updated the update code would fail with code "decline".
204
- */
205
- decline(): void;
206
- /**
207
- * Add a one time handler, which is executed when the current module code is replaced.
208
- * Here you should destroy/remove any persistent resource you have claimed/created.
209
- * If you want to transfer state to the new module, add it to data object.
210
- * The data will be available at module.hot.data on the new module.
211
- * @param callback
212
- */
213
- dispose(callback: (data: any) => void): void;
214
- dispose(callback: <T>(data: T) => void): void;
215
- /**
216
- * Add a one time handler, which is executed when the current module code is replaced.
217
- * Here you should destroy/remove any persistent resource you have claimed/created.
218
- * If you want to transfer state to the new module, add it to data object.
219
- * The data will be available at module.hot.data on the new module.
220
- * @param callback
221
- */
222
- addDisposeHandler(callback: (data: any) => void): void;
223
- addDisposeHandler<T>(callback: (data: T) => void): void;
224
- /**
225
- * Remove a handler.
226
- * 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.
227
- * @param callback
228
- */
229
- removeDisposeHandler(callback: (data: any) => void): void;
230
- removeDisposeHandler<T>(callback: (data: T) => void): void;
231
- /**
232
- * Throws an exceptions if status() is not idle.
233
- * Check all currently loaded modules for updates and apply updates if found.
234
- * If no update was found, the callback is called with null.
235
- * If autoApply is truthy the callback will be called with all modules that were disposed.
236
- * apply() is automatically called with autoApply as options parameter.
237
- * If autoApply is not set the callback will be called with all modules that will be disposed on apply().
238
- * @param autoApply
239
- * @param callback
240
- */
241
- check(autoApply: boolean, callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
242
- /**
243
- * Throws an exceptions if status() is not idle.
244
- * Check all currently loaded modules for updates and apply updates if found.
245
- * If no update was found, the callback is called with null.
246
- * The callback will be called with all modules that will be disposed on apply().
247
- * @param callback
248
- */
249
- check(callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
250
- /**
251
- * If status() != "ready" it throws an error.
252
- * Continue the update process.
253
- * @param options
254
- * @param callback
255
- */
256
- apply(options: AcceptOptions, callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
257
- /**
258
- * If status() != "ready" it throws an error.
259
- * Continue the update process.
260
- * @param callback
261
- */
262
- apply(callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
263
- /**
264
- * Return one of idle, check, watch, watch-delay, prepare, ready, dispose, apply, abort or fail.
265
- */
266
- status(): string;
267
- /** Register a callback on status change. */
268
- status(callback: (status: string) => void): void;
269
- /** Register a callback on status change. */
270
- addStatusHandler(callback: (status: string) => void): void;
271
- /**
272
- * Remove a registered status change handler.
273
- * @param callback
274
- */
275
- removeStatusHandler(callback: (status: string) => void): void;
276
- active: boolean;
277
- data: any;
175
+ /**
176
+ * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced.
177
+ * @param dependencies
178
+ * @param callback
179
+ * @param errorHandler
180
+ */
181
+ accept(dependencies: string[], callback?: (updatedDependencies: WebpackModuleId[]) => void, errorHandler?: (err: Error) => void): void;
182
+ /**
183
+ * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced.
184
+ * @param dependency
185
+ * @param callback
186
+ * @param errorHandler
187
+ */
188
+ accept(dependency: string, callback?: () => void, errorHandler?: (err: Error) => void): void;
189
+ /**
190
+ * Accept code updates for this module without notification of parents.
191
+ * This should only be used if the module doesn’t export anything.
192
+ * The errHandler can be used to handle errors that occur while loading the updated module.
193
+ * @param errHandler
194
+ */
195
+ accept(errHandler?: (err: Error) => void): void;
196
+ /**
197
+ * Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline".
198
+ */
199
+ decline(dependencies: string[]): void;
200
+ /**
201
+ * Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline".
202
+ */
203
+ decline(dependency: string): void;
204
+ /**
205
+ * Flag the current module as not update-able. If updated the update code would fail with code "decline".
206
+ */
207
+ decline(): void;
208
+ /**
209
+ * Add a one time handler, which is executed when the current module code is replaced.
210
+ * Here you should destroy/remove any persistent resource you have claimed/created.
211
+ * If you want to transfer state to the new module, add it to data object.
212
+ * The data will be available at module.hot.data on the new module.
213
+ * @param callback
214
+ */
215
+ dispose(callback: (data: any) => void): void;
216
+ dispose(callback: <T>(data: T) => void): void;
217
+ /**
218
+ * Add a one time handler, which is executed when the current module code is replaced.
219
+ * Here you should destroy/remove any persistent resource you have claimed/created.
220
+ * If you want to transfer state to the new module, add it to data object.
221
+ * The data will be available at module.hot.data on the new module.
222
+ * @param callback
223
+ */
224
+ addDisposeHandler(callback: (data: any) => void): void;
225
+ addDisposeHandler<T>(callback: (data: T) => void): void;
226
+ /**
227
+ * Remove a handler.
228
+ * 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.
229
+ * @param callback
230
+ */
231
+ removeDisposeHandler(callback: (data: any) => void): void;
232
+ removeDisposeHandler<T>(callback: (data: T) => void): void;
233
+ /**
234
+ * Throws an exceptions if status() is not idle.
235
+ * Check all currently loaded modules for updates and apply updates if found.
236
+ * If no update was found, the callback is called with null.
237
+ * If autoApply is truthy the callback will be called with all modules that were disposed.
238
+ * apply() is automatically called with autoApply as options parameter.
239
+ * If autoApply is not set the callback will be called with all modules that will be disposed on apply().
240
+ * @param autoApply
241
+ * @param callback
242
+ */
243
+ check(autoApply: boolean, callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
244
+ /**
245
+ * Throws an exceptions if status() is not idle.
246
+ * Check all currently loaded modules for updates and apply updates if found.
247
+ * If no update was found, the callback is called with null.
248
+ * The callback will be called with all modules that will be disposed on apply().
249
+ * @param callback
250
+ */
251
+ check(callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
252
+ /**
253
+ * If status() != "ready" it throws an error.
254
+ * Continue the update process.
255
+ * @param options
256
+ * @param callback
257
+ */
258
+ apply(options: AcceptOptions, callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
259
+ /**
260
+ * If status() != "ready" it throws an error.
261
+ * Continue the update process.
262
+ * @param callback
263
+ */
264
+ apply(callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
265
+ /**
266
+ * Return one of idle, check, watch, watch-delay, prepare, ready, dispose, apply, abort or fail.
267
+ */
268
+ status(): string;
269
+ /** Register a callback on status change. */
270
+ status(callback: (status: string) => void): void;
271
+ /** Register a callback on status change. */
272
+ addStatusHandler(callback: (status: string) => void): void;
273
+ /**
274
+ * Remove a registered status change handler.
275
+ * @param callback
276
+ */
277
+ removeStatusHandler(callback: (status: string) => void): void;
278
+ active: boolean;
279
+ data: any;
278
280
  }
279
281
  interface WebpackImportMeta {
280
- /** an alias for `module.hot` - see https://webpack.js.org/api/hot-module-replacement/ */
281
- webpackHot?: WebpackHot | undefined;
282
- /** the webpack major version as number */
283
- webpack?: number;
282
+ /** an alias for `module.hot` - see https://webpack.js.org/api/hot-module-replacement/ */
283
+ webpackHot?: WebpackHot | undefined;
284
+ /** the webpack major version as number */
285
+ webpack?: number;
284
286
  }
285
-
287
+ //#endregion
288
+ //#region src/types/builder-env/index.d.ts
286
289
  type BundlerImportMeta = ViteImportMeta & WebpackImportMeta;
287
290
  declare global {
288
- interface ImportMeta extends BundlerImportMeta {
289
- /** the `file:` url of the current file (similar to `__filename` but as file url) */
290
- url: string;
291
- readonly env: Record<string, string | boolean | undefined>;
292
- }
291
+ interface ImportMeta extends BundlerImportMeta {
292
+ /** the `file:` url of the current file (similar to `__filename` but as file url) */
293
+ url: string;
294
+ readonly env: Record<string, string | boolean | undefined>;
295
+ }
293
296
  }
294
-
297
+ //#endregion
298
+ //#region src/builder-env.d.ts
295
299
  declare const builders: readonly ["vite", "webpack"];
296
-
297
- export { builders };
300
+ //#endregion
301
+ export { builders };
@@ -1,3 +1,5 @@
1
+ //#region src/builder-env.ts
1
2
  const builders = ["vite", "webpack"];
2
3
 
3
- export { builders };
4
+ //#endregion
5
+ export { builders };