@dtwo/schema 3.0.0-rc.13

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.
@@ -0,0 +1,1937 @@
1
+ import { TransitionProps, KeepAliveProps } from 'kdu';
2
+ import { RouterOptions as RouterOptions$1, RouterHistory } from 'kdu-router';
3
+ import { UnimportOptions, InlinePreset, Import } from 'unimport';
4
+ import { CompilerOptions } from '@kdujs/compiler-core';
5
+ import { Hookable } from 'hookable';
6
+ import { Ignore } from 'ignore';
7
+ import { TSConfig, readPackageJSON } from 'pkg-types';
8
+ import { Server } from 'node:http';
9
+ import { Server as Server$1 } from 'node:https';
10
+ import { InlineConfig, WiteDevServer, UserConfig, ServerOptions } from 'wite';
11
+ import { Manifest } from 'kdu-bundle-renderer';
12
+ import { EventHandler } from 'h3';
13
+ import { Configuration, Compiler, Stats, WebpackError } from 'webpack';
14
+ import { HoleConfig, Hole, HoleEventHandler, HoleDevEventHandler } from 'holepack';
15
+ import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
16
+ import { PluginVisualizerOptions } from 'rollup-plugin-visualizer';
17
+ import { PluginOptions } from 'mini-css-extract-plugin';
18
+ import { BasePluginOptions, DefinedDefaultMinimizerAndOptions } from 'terser-webpack-plugin';
19
+ import { BasePluginOptions as BasePluginOptions$1, DefinedDefaultMinimizerAndOptions as DefinedDefaultMinimizerAndOptions$1 } from 'css-minimizer-webpack-plugin';
20
+ import { Options } from 'webpack-dev-middleware';
21
+ import { IncomingMessage, ServerResponse } from 'http';
22
+ import { MiddlewareOptions, ClientOptions } from 'webpack-hot-middleware';
23
+ import { Options as Options$1 } from '@witejs/plugin-kdu';
24
+ import { MergeHead, Head } from '@unhead/schema';
25
+ import * as untyped from 'untyped';
26
+
27
+ interface WiteHot {
28
+ readonly data: any;
29
+ accept(): void;
30
+ accept(cb: (mod: any) => void): void;
31
+ accept(dep: string, cb: (mod: any) => void): void;
32
+ accept(deps: readonly string[], cb: (mods: any[]) => void): void;
33
+ dispose(cb: (data: any) => void): void;
34
+ decline(): void;
35
+ invalidate(): void;
36
+ on(event: any, cb: (payload: any) => void): void;
37
+ send(event: any, data?: any): void;
38
+ }
39
+ interface WiteGlobOptions {
40
+ as?: string;
41
+ eager?: boolean;
42
+ import?: string;
43
+ query?: string | Record<string, string | number | boolean>;
44
+ exhaustive?: boolean;
45
+ }
46
+ interface WiteImportMeta {
47
+ /** Wite client HMR API - see https://witejs.web.app/guide/api-hmr.html */
48
+ readonly hot?: WiteHot;
49
+ /** wite glob import utility - https://witejs.web.app/guide/features.html#glob-import */
50
+ glob(glob: string | string[], options?: WiteGlobOptions): Record<string, () => Promise<Record<string, any>>>;
51
+ }
52
+
53
+ /**
54
+ * Reference: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/webpack-env/index.d.ts
55
+ */
56
+ type WebpackModuleId = string | number;
57
+ interface HotNotifierInfo {
58
+ type: 'self-declined' | 'declined' | 'unaccepted' | 'accepted' | 'disposed' | 'accept-errored' | 'self-accept-errored' | 'self-accept-error-handler-errored';
59
+ /**
60
+ * The module in question.
61
+ */
62
+ moduleId: number;
63
+ /**
64
+ * For errors: the module id owning the accept handler.
65
+ */
66
+ dependencyId?: number | undefined;
67
+ /**
68
+ * For declined/accepted/unaccepted: the chain from where the update was propagated.
69
+ */
70
+ chain?: number[] | undefined;
71
+ /**
72
+ * For declined: the module id of the declining parent
73
+ */
74
+ parentId?: number | undefined;
75
+ /**
76
+ * For accepted: the modules that are outdated and will be disposed
77
+ */
78
+ outdatedModules?: number[] | undefined;
79
+ /**
80
+ * For accepted: The location of accept handlers that will handle the update
81
+ */
82
+ outdatedDependencies?: {
83
+ [dependencyId: number]: number[];
84
+ } | undefined;
85
+ /**
86
+ * For errors: the thrown error
87
+ */
88
+ error?: Error | undefined;
89
+ /**
90
+ * For self-accept-error-handler-errored: the error thrown by the module
91
+ * before the error handler tried to handle it.
92
+ */
93
+ originalError?: Error | undefined;
94
+ }
95
+ interface AcceptOptions {
96
+ /**
97
+ * If true the update process continues even if some modules are not accepted (and would bubble to the entry point).
98
+ */
99
+ ignoreUnaccepted?: boolean | undefined;
100
+ /**
101
+ * Ignore changes made to declined modules.
102
+ */
103
+ ignoreDeclined?: boolean | undefined;
104
+ /**
105
+ * Ignore errors throw in accept handlers, error handlers and while reevaluating module.
106
+ */
107
+ ignoreErrored?: boolean | undefined;
108
+ /**
109
+ * Notifier for declined modules.
110
+ */
111
+ onDeclined?: ((info: HotNotifierInfo) => void) | undefined;
112
+ /**
113
+ * Notifier for unaccepted modules.
114
+ */
115
+ onUnaccepted?: ((info: HotNotifierInfo) => void) | undefined;
116
+ /**
117
+ * Notifier for accepted modules.
118
+ */
119
+ onAccepted?: ((info: HotNotifierInfo) => void) | undefined;
120
+ /**
121
+ * Notifier for disposed modules.
122
+ */
123
+ onDisposed?: ((info: HotNotifierInfo) => void) | undefined;
124
+ /**
125
+ * Notifier for errors.
126
+ */
127
+ onErrored?: ((info: HotNotifierInfo) => void) | undefined;
128
+ /**
129
+ * Indicates that apply() is automatically called by check function
130
+ */
131
+ autoApply?: boolean | undefined;
132
+ }
133
+ interface WebpackHot {
134
+ /**
135
+ * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced.
136
+ *
137
+ * @param dependencies
138
+ * @param callback
139
+ * @param errorHandler
140
+ */
141
+ accept(dependencies: string[], callback?: (updatedDependencies: WebpackModuleId[]) => void, errorHandler?: (err: Error) => void): void;
142
+ /**
143
+ * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced.
144
+ *
145
+ * @param dependency
146
+ * @param callback
147
+ * @param errorHandler
148
+ */
149
+ accept(dependency: string, callback?: () => void, errorHandler?: (err: Error) => void): void;
150
+ /**
151
+ * Accept code updates for this module without notification of parents.
152
+ * This should only be used if the module doesn’t export anything.
153
+ * The errHandler can be used to handle errors that occur while loading the updated module.
154
+ *
155
+ * @param errHandler
156
+ */
157
+ accept(errHandler?: (err: Error) => void): void;
158
+ /**
159
+ * Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline".
160
+ */
161
+ decline(dependencies: string[]): void;
162
+ /**
163
+ * Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline".
164
+ */
165
+ decline(dependency: string): void;
166
+ /**
167
+ * Flag the current module as not update-able. If updated the update code would fail with code "decline".
168
+ */
169
+ decline(): void;
170
+ /**
171
+ * Add a one time handler, which is executed when the current module code is replaced.
172
+ * Here you should destroy/remove any persistent resource you have claimed/created.
173
+ * If you want to transfer state to the new module, add it to data object.
174
+ * The data will be available at module.hot.data on the new module.
175
+ *
176
+ * @param callback
177
+ */
178
+ dispose(callback: (data: any) => void): void;
179
+ dispose(callback: <T>(data: T) => void): void;
180
+ /**
181
+ * Add a one time handler, which is executed when the current module code is replaced.
182
+ * Here you should destroy/remove any persistent resource you have claimed/created.
183
+ * If you want to transfer state to the new module, add it to data object.
184
+ * The data will be available at module.hot.data on the new module.
185
+ *
186
+ * @param callback
187
+ */
188
+ addDisposeHandler(callback: (data: any) => void): void;
189
+ addDisposeHandler<T>(callback: (data: T) => void): void;
190
+ /**
191
+ * Remove a handler.
192
+ * 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.
193
+ *
194
+ * @param callback
195
+ */
196
+ removeDisposeHandler(callback: (data: any) => void): void;
197
+ removeDisposeHandler<T>(callback: (data: T) => void): void;
198
+ /**
199
+ * Throws an exceptions if status() is not idle.
200
+ * Check all currently loaded modules for updates and apply updates if found.
201
+ * If no update was found, the callback is called with null.
202
+ * If autoApply is truthy the callback will be called with all modules that were disposed.
203
+ * apply() is automatically called with autoApply as options parameter.
204
+ * If autoApply is not set the callback will be called with all modules that will be disposed on apply().
205
+ *
206
+ * @param autoApply
207
+ * @param callback
208
+ */
209
+ check(autoApply: boolean, callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
210
+ /**
211
+ * Throws an exceptions if status() is not idle.
212
+ * Check all currently loaded modules for updates and apply updates if found.
213
+ * If no update was found, the callback is called with null.
214
+ * The callback will be called with all modules that will be disposed on apply().
215
+ *
216
+ * @param callback
217
+ */
218
+ check(callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
219
+ /**
220
+ * If status() != "ready" it throws an error.
221
+ * Continue the update process.
222
+ *
223
+ * @param options
224
+ * @param callback
225
+ */
226
+ apply(options: AcceptOptions, callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
227
+ /**
228
+ * If status() != "ready" it throws an error.
229
+ * Continue the update process.
230
+ *
231
+ * @param callback
232
+ */
233
+ apply(callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void;
234
+ /**
235
+ * Return one of idle, check, watch, watch-delay, prepare, ready, dispose, apply, abort or fail.
236
+ */
237
+ status(): string;
238
+ /** Register a callback on status change. */
239
+ status(callback: (status: string) => void): void;
240
+ /** Register a callback on status change. */
241
+ addStatusHandler(callback: (status: string) => void): void;
242
+ /**
243
+ * Remove a registered status change handler.
244
+ *
245
+ * @param callback
246
+ */
247
+ removeStatusHandler(callback: (status: string) => void): void;
248
+ active: boolean;
249
+ data: any;
250
+ }
251
+ interface WebpackImportMeta {
252
+ /** an alias for `module.hot` - see https://webpack.js.org/api/hot-module-replacement/ */
253
+ webpackHot?: WebpackHot | undefined;
254
+ /** the webpack major version as number */
255
+ webpack?: number;
256
+ }
257
+
258
+ type BundlerImportMeta = WiteImportMeta & WebpackImportMeta;
259
+ declare global {
260
+ interface ImportMeta extends BundlerImportMeta {
261
+ /** the `file:` url of the current file (similar to `__filename` but as file url) */
262
+ url: string;
263
+ readonly env: Record<string, string | boolean | undefined>;
264
+ }
265
+ }
266
+
267
+ interface DtwoCompatibility {
268
+ /**
269
+ * Required dtwo version in semver format.
270
+ *
271
+ * @example `^2.14.0` or `>=3.0.0-27219851.6e49637`.
272
+ *
273
+ */
274
+ dtwo?: string;
275
+ /**
276
+ * Bridge constraint for Dtwo 2 support.
277
+ *
278
+ * - `true`: When using Dtwo 2, using bridge module is required.
279
+ * - `false`: When using Dtwo 2, using bridge module is not supported.
280
+ */
281
+ bridge?: boolean;
282
+ }
283
+ interface DtwoCompatibilityIssue {
284
+ name: string;
285
+ message: string;
286
+ }
287
+ interface DtwoCompatibilityIssues extends Array<DtwoCompatibilityIssue> {
288
+ /**
289
+ * Return formatted error message.
290
+ */
291
+ toString(): string;
292
+ }
293
+
294
+ interface Component {
295
+ pascalName: string;
296
+ kebabName: string;
297
+ export: string;
298
+ filePath: string;
299
+ shortPath: string;
300
+ chunkName: string;
301
+ prefetch: boolean;
302
+ preload: boolean;
303
+ global?: boolean;
304
+ mode?: 'client' | 'server' | 'all';
305
+ }
306
+ interface ScanDir {
307
+ /**
308
+ * Path (absolute or relative) to the directory containing your components.
309
+ * You can use Dtwo aliases (~ or @) to refer to directories inside project or directly use an npm package path similar to require.
310
+ */
311
+ path: string;
312
+ /**
313
+ * Accept Pattern that will be run against specified path.
314
+ */
315
+ pattern?: string | string[];
316
+ /**
317
+ * Ignore patterns that will be run against specified path.
318
+ */
319
+ ignore?: string[];
320
+ /**
321
+ * Prefix all matched components.
322
+ */
323
+ prefix?: string;
324
+ /**
325
+ * Prefix component name by its path.
326
+ */
327
+ pathPrefix?: boolean;
328
+ /**
329
+ * Ignore scanning this directory if set to `true`
330
+ */
331
+ enabled?: boolean;
332
+ /**
333
+ * These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by Webpack via its magic comments.
334
+ * Learn more on Webpack documentation: https://webpack.js.org/api/module-methods/#magic-comments
335
+ */
336
+ prefetch?: boolean;
337
+ /**
338
+ * These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by Webpack via its magic comments.
339
+ * Learn more on Webpack documentation: https://webpack.js.org/api/module-methods/#magic-comments
340
+ */
341
+ preload?: boolean;
342
+ /**
343
+ * This flag indicates, component should be loaded async (with a separate chunk) regardless of using Lazy prefix or not.
344
+ */
345
+ isAsync?: boolean;
346
+ extendComponent?: (component: Component) => Promise<Component | void> | (Component | void);
347
+ /**
348
+ * If enabled, registers components to be globally available.
349
+ *
350
+ */
351
+ global?: boolean;
352
+ }
353
+ interface ComponentsDir extends ScanDir {
354
+ /**
355
+ * Watch specified path for changes, including file additions and file deletions.
356
+ */
357
+ watch?: boolean;
358
+ /**
359
+ * Extensions supported by Dtwo builder.
360
+ */
361
+ extensions?: string[];
362
+ /**
363
+ * Transpile specified path using build.transpile.
364
+ * By default ('auto') it will set transpile: true if node_modules/ is in path.
365
+ */
366
+ transpile?: 'auto' | boolean;
367
+ }
368
+ interface ComponentsOptions {
369
+ dirs: (string | ComponentsDir)[];
370
+ /**
371
+ * The default value for whether to globally register components.
372
+ *
373
+ * When components are registered globally, they will still be directly imported where used,
374
+ * but they can also be used dynamically, for example `<component :is="`icon-${myIcon}`">`.
375
+ *
376
+ * This can be overridden by an individual component directory entry.
377
+ *
378
+ * @default false
379
+ */
380
+ global?: boolean;
381
+ loader?: boolean;
382
+ transform?: {
383
+ exclude?: RegExp[];
384
+ include?: RegExp[];
385
+ };
386
+ }
387
+
388
+ type RouterOptions = Partial<Omit<RouterOptions$1, 'history' | 'routes'>> & {
389
+ history?: (baseURL?: string) => RouterHistory;
390
+ routes?: (_routes: RouterOptions$1['routes']) => RouterOptions$1['routes'];
391
+ hashMode?: boolean;
392
+ };
393
+ type RouterConfig = RouterOptions;
394
+ /**
395
+ * Only JSON serializable router options are configurable from dtwo config
396
+ */
397
+ type RouterConfigSerializable = Pick<RouterConfig, 'linkActiveClass' | 'linkExactActiveClass' | 'end' | 'sensitive' | 'strict' | 'hashMode'>;
398
+
399
+ interface ImportsOptions extends UnimportOptions {
400
+ /**
401
+ * Enable implicit auto import from Kdu, Dtwo and module contributed utilities.
402
+ * Generate global TypeScript definitions.
403
+ *
404
+ * @default true
405
+ */
406
+ autoImport?: boolean;
407
+ /**
408
+ * Directories to scan for auto imports.
409
+ *
410
+ * @default ['./composables', './utils']
411
+ */
412
+ dirs?: string[];
413
+ /**
414
+ * Assign auto imported utilities to `globalThis` instead of using built time transformation.
415
+ *
416
+ * @default false
417
+ */
418
+ global?: boolean;
419
+ transform?: {
420
+ exclude?: RegExp[];
421
+ include?: RegExp[];
422
+ };
423
+ }
424
+
425
+ type HookResult = Promise<void> | void;
426
+ type TSReference = {
427
+ types: string;
428
+ } | {
429
+ path: string;
430
+ };
431
+ type WatchEvent = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir';
432
+ type DtwoPage = {
433
+ name?: string;
434
+ path: string;
435
+ file: string;
436
+ meta?: Record<string, any>;
437
+ alias?: string[] | string;
438
+ redirect?: string;
439
+ children?: DtwoPage[];
440
+ };
441
+ type DtwoMiddleware = {
442
+ name: string;
443
+ path: string;
444
+ global?: boolean;
445
+ };
446
+ type DtwoLayout = {
447
+ name: string;
448
+ file: string;
449
+ };
450
+ interface ImportPresetWithDeprecation extends InlinePreset {
451
+ }
452
+ interface GenerateAppOptions {
453
+ filter?: (template: ResolvedDtwoTemplate<any>) => boolean;
454
+ }
455
+ interface DtwoHooks {
456
+ 'kit:compatibility': (compatibility: DtwoCompatibility, issues: DtwoCompatibilityIssues) => HookResult;
457
+ 'ready': (dtwo: Dtwo) => HookResult;
458
+ 'close': (dtwo: Dtwo) => HookResult;
459
+ 'modules:before': () => HookResult;
460
+ 'modules:done': () => HookResult;
461
+ 'app:resolve': (app: DtwoApp) => HookResult;
462
+ 'app:templates': (app: DtwoApp) => HookResult;
463
+ 'app:templatesGenerated': (app: DtwoApp) => HookResult;
464
+ 'build:before': () => HookResult;
465
+ 'build:done': () => HookResult;
466
+ 'build:manifest': (manifest: Manifest) => HookResult;
467
+ 'builder:generateApp': (options?: GenerateAppOptions) => HookResult;
468
+ 'builder:watch': (event: WatchEvent, path: string) => HookResult;
469
+ 'pages:extend': (pages: DtwoPage[]) => HookResult;
470
+ 'server:devHandler': (handler: EventHandler) => HookResult;
471
+ 'imports:sources': (presets: ImportPresetWithDeprecation[]) => HookResult;
472
+ 'imports:extend': (imports: Import[]) => HookResult;
473
+ 'imports:dirs': (dirs: string[]) => HookResult;
474
+ 'components:dirs': (dirs: ComponentsOptions['dirs']) => HookResult;
475
+ 'components:extend': (components: Component[]) => HookResult;
476
+ 'hole:config': (holeConfig: HoleConfig) => HookResult;
477
+ 'hole:init': (hole: Hole) => HookResult;
478
+ 'hole:build:before': (hole: Hole) => HookResult;
479
+ 'prerender:routes': (ctx: {
480
+ routes: Set<string>;
481
+ }) => HookResult;
482
+ 'build:error': (error: Error) => HookResult;
483
+ 'prepare:types': (options: {
484
+ references: TSReference[];
485
+ declarations: string[];
486
+ tsConfig: TSConfig;
487
+ }) => HookResult;
488
+ 'listen': (listenerServer: Server | Server$1, listener: any) => HookResult;
489
+ 'wite:extend': (witeBuildContext: {
490
+ dtwo: Dtwo;
491
+ config: InlineConfig;
492
+ }) => HookResult;
493
+ 'wite:extendConfig': (witeInlineConfig: InlineConfig, env: {
494
+ isClient: boolean;
495
+ isServer: boolean;
496
+ }) => HookResult;
497
+ 'wite:serverCreated': (witeServer: WiteDevServer, env: {
498
+ isClient: boolean;
499
+ isServer: boolean;
500
+ }) => HookResult;
501
+ 'wite:compiled': () => HookResult;
502
+ 'webpack:config': (webpackConfigs: Configuration[]) => HookResult;
503
+ 'webpack:compile': (options: {
504
+ name: string;
505
+ compiler: Compiler;
506
+ }) => HookResult;
507
+ 'webpack:compiled': (options: {
508
+ name: string;
509
+ compiler: Compiler;
510
+ stats: Stats;
511
+ }) => HookResult;
512
+ 'webpack:change': (shortPath: string) => void;
513
+ 'webpack:error': () => void;
514
+ 'webpack:done': () => void;
515
+ 'webpack:progress': (statesArray: any[]) => void;
516
+ }
517
+ type DtwoHookName = keyof DtwoHooks;
518
+
519
+ interface Dtwo {
520
+ _version: string;
521
+ _ignore?: Ignore;
522
+ /** The resolved Dtwo configuration. */
523
+ options: DtwoOptions;
524
+ hooks: Hookable<DtwoHooks>;
525
+ hook: Dtwo['hooks']['hook'];
526
+ callHook: Dtwo['hooks']['callHook'];
527
+ addHooks: Dtwo['hooks']['addHooks'];
528
+ ready: () => Promise<void>;
529
+ close: () => Promise<void>;
530
+ /** The production or development server. */
531
+ server?: any;
532
+ vfs: Record<string, string>;
533
+ }
534
+ interface DtwoTemplate<Options = Record<string, any>> {
535
+ /** resolved output file path (generated) */
536
+ dst?: string;
537
+ /** The target filename once the template is copied into the Dtwo buildDir */
538
+ filename?: string;
539
+ /** An options object that will be accessible within the template via `<% options %>` */
540
+ options?: Options;
541
+ /** The resolved path to the source file to be template */
542
+ src?: string;
543
+ /** Provided compile option instead of src */
544
+ getContents?: (data: Options) => string | Promise<string>;
545
+ /** Write to filesystem */
546
+ write?: boolean;
547
+ }
548
+ interface ResolvedDtwoTemplate<Options = Record<string, any>> extends DtwoTemplate<Options> {
549
+ filename: string;
550
+ dst: string;
551
+ }
552
+ interface DtwoPlugin {
553
+ /** @deprecated use mode */
554
+ ssr?: boolean;
555
+ src: string;
556
+ mode?: 'all' | 'server' | 'client';
557
+ }
558
+ interface DtwoApp {
559
+ mainComponent?: string | null;
560
+ rootComponent?: string | null;
561
+ errorComponent?: string | null;
562
+ dir: string;
563
+ extensions: string[];
564
+ plugins: DtwoPlugin[];
565
+ layouts: Record<string, DtwoLayout>;
566
+ middleware: DtwoMiddleware[];
567
+ templates: DtwoTemplate[];
568
+ configs: string[];
569
+ }
570
+ type _TemplatePlugin<Options> = Omit<DtwoPlugin, 'src'> & DtwoTemplate<Options>;
571
+ interface DtwoPluginTemplate<Options = Record<string, any>> extends _TemplatePlugin<Options> {
572
+ }
573
+
574
+ interface ModuleMeta {
575
+ /** Module name. */
576
+ name?: string;
577
+ /** Module version. */
578
+ version?: string;
579
+ /**
580
+ * The configuration key used within `dtwo.config` for this module's options.
581
+ * For example, `@dtwojs/axios` uses `axios`.
582
+ */
583
+ configKey?: string;
584
+ /**
585
+ * Constraints for the versions of Dtwo or features this module requires.
586
+ */
587
+ compatibility?: DtwoCompatibility;
588
+ [key: string]: any;
589
+ }
590
+ /** The options received. */
591
+ type ModuleOptions = Record<string, any>;
592
+ /** Input module passed to defineDtwoModule. */
593
+ interface ModuleDefinition<T extends ModuleOptions = ModuleOptions> {
594
+ meta?: ModuleMeta;
595
+ defaults?: T | ((dtwo: Dtwo) => T);
596
+ schema?: T;
597
+ hooks?: Partial<DtwoHooks>;
598
+ setup?: (this: void, resolvedOptions: T, dtwo: Dtwo) => void | Promise<void>;
599
+ }
600
+ /** Dtwo modules are always a simple function. */
601
+ interface DtwoModule<T extends ModuleOptions = ModuleOptions> {
602
+ (this: void, inlineOptions: T, dtwo: Dtwo): void | Promise<void>;
603
+ getOptions?: (inlineOptions?: T, dtwo?: Dtwo) => Promise<T>;
604
+ getMeta?: () => Promise<ModuleMeta>;
605
+ }
606
+
607
+ interface ConfigSchema {
608
+ /**
609
+ * Configure Dtwo component auto-registration.
610
+ * Any components in the directories configured here can be used throughout your pages, layouts (and other components) without needing to explicitly import them.
611
+ *
612
+ * @default {{ dirs: [`~/components`] }}
613
+ */
614
+ components: boolean | ComponentsOptions | ComponentsOptions['dirs'],
615
+
616
+ /** Configure how Dtwo auto-imports composables into your application. */
617
+ imports: ImportsOptions,
618
+
619
+ /** Whether to use the kdu-router integration in Dtwo 3. If you do not provide a value it will be enabled if you have a `pages/` directory in your source folder. */
620
+ pages: boolean,
621
+
622
+ /** Manually disable dtwo telemetry. */
623
+ telemetry: boolean,
624
+
625
+ /** Kdu.js config */
626
+ kdu: {
627
+ /**
628
+ * Options for the Kdu compiler that will be passed at build time.
629
+ *
630
+ * @see [documentation](https://kdu-js.web.app/api/application.html#app-config-compileroptions)
631
+ */
632
+ compilerOptions: CompilerOptions,
633
+ },
634
+
635
+ /** Dtwo App configuration. */
636
+ app: {
637
+ /**
638
+ * The base path of your Dtwo application.
639
+ * This can be set at runtime by setting the DTWO_APP_BASE_URL environment variable.
640
+ * @default "/"
641
+ *
642
+ * @example
643
+ * ```bash
644
+ * DTWO_APP_BASE_URL=/prefix/ node .output/server/index.mjs
645
+ * ```
646
+ */
647
+ baseURL: string,
648
+
649
+ /**
650
+ * The folder name for the built site assets, relative to `baseURL` (or `cdnURL` if set). This is set at build time and should not be customized at runtime.
651
+ * @default "/_dtwo/"
652
+ */
653
+ buildAssetsDir: string,
654
+
655
+ /**
656
+ * An absolute URL to serve the public folder from (production-only).
657
+ * This can be set to a different value at runtime by setting the `DTWO_APP_CDN_URL` environment variable.
658
+ * @default ""
659
+ *
660
+ * @example
661
+ * ```bash
662
+ * DTWO_APP_CDN_URL=https://mycdn.org/ node .output/server/index.mjs
663
+ * ```
664
+ */
665
+ cdnURL: string,
666
+
667
+ /**
668
+ * Set default configuration for `<head>` on every page.
669
+ *
670
+ * @example
671
+ * ```js
672
+ * app: {
673
+ * head: {
674
+ * meta: [
675
+ * // <meta name="viewport" content="width=device-width, initial-scale=1">
676
+ * { name: 'viewport', content: 'width=device-width, initial-scale=1' }
677
+ * ],
678
+ * script: [
679
+ * // <script src="https://myawesome-lib.js"></script>
680
+ * { src: 'https://awesome-lib.js' }
681
+ * ],
682
+ * link: [
683
+ * // <link rel="stylesheet" href="https://myawesome-lib.css">
684
+ * { rel: 'stylesheet', href: 'https://awesome-lib.css' }
685
+ * ],
686
+ * // please note that this is an area that is likely to change
687
+ * style: [
688
+ * // <style type="text/css">:root { color: red }</style>
689
+ * { children: ':root { color: red }', type: 'text/css' }
690
+ * ],
691
+ * noscript: [
692
+ * // <noscript>Javascript is required</noscript>
693
+ * { children: 'Javascript is required' }
694
+ * ]
695
+ * }
696
+ * }
697
+ * ```
698
+ */
699
+ head: DtwoAppConfig['head'],
700
+
701
+ /**
702
+ * Default values for layout transitions.
703
+ * This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed.
704
+ * @default false
705
+ *
706
+ * @see https://kdu-js.web.app/api/built-in-components.html#transition
707
+ */
708
+ layoutTransition: DtwoAppConfig['layoutTransition'],
709
+
710
+ /**
711
+ * Default values for page transitions.
712
+ * This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed.
713
+ * @default false
714
+ *
715
+ * @see https://kdu-js.web.app/api/built-in-components.html#transition
716
+ */
717
+ pageTransition: DtwoAppConfig['pageTransition'],
718
+
719
+ /**
720
+ * Default values for KeepAlive configuration between pages.
721
+ * This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed.
722
+ * @default false
723
+ *
724
+ * @see https://kdu-js.web.app/api/built-in-components.html#keepalive
725
+ */
726
+ keepalive: DtwoAppConfig['keepalive'],
727
+
728
+ /**
729
+ * Customize Dtwo root element id.
730
+ * @default "__dtwo"
731
+ */
732
+ rootId: string,
733
+
734
+ /**
735
+ * Customize Dtwo root element tag.
736
+ * @default "div"
737
+ */
738
+ rootTag: string,
739
+ },
740
+
741
+ /**
742
+ * An array of dtwo app plugins.
743
+ * Each plugin can be a string (which can be an absolute or relative path to a file). If it ends with `.client` or `.server` then it will be automatically loaded only in the appropriate context.
744
+ * It can also be an object with `src` and `mode` keys.
745
+ *
746
+ * @example
747
+ * ```js
748
+ * plugins: [
749
+ * '~/plugins/foo.client.js', // only in client side
750
+ * '~/plugins/bar.server.js', // only in server side
751
+ * '~/plugins/baz.js', // both client & server
752
+ * { src: '~/plugins/both-sides.js' },
753
+ * { src: '~/plugins/client-only.js', mode: 'client' }, // only on client side
754
+ * { src: '~/plugins/server-only.js', mode: 'server' } // only on server side
755
+ * ]
756
+ * ```
757
+ */
758
+ plugins: (DtwoPlugin | string)[],
759
+
760
+ /**
761
+ * You can define the CSS files/modules/libraries you want to set globally (included in every page).
762
+ * Dtwo will automatically guess the file type by its extension and use the appropriate pre-processor. You will still need to install the required loader if you need to use them.
763
+ *
764
+ * @example
765
+ * ```js
766
+ * css: [
767
+ * // Load a Node.js module directly (here it's a Sass file).
768
+ * 'bulma',
769
+ * // CSS file in the project
770
+ * '@/assets/css/main.css',
771
+ * // SCSS file in the project
772
+ * '@/assets/css/main.scss'
773
+ * ]
774
+ * ```
775
+ */
776
+ css: string[],
777
+
778
+ /**
779
+ * The builder to use for bundling the Kdu part of your application.
780
+ * @default "@dtwo/wite-builder"
781
+ */
782
+ builder: 'wite' | 'webpack' | { bundle: (dtwo: Dtwo) => Promise<void> },
783
+
784
+ /** Whether to generate sourcemaps. */
785
+ sourcemap: boolean | { server?: boolean, client?: boolean },
786
+
787
+ /** Shared build configuration. */
788
+ build: {
789
+ /**
790
+ * If you want to transpile specific dependencies with Babel, you can add them here. Each item in transpile can be a package name, a function, a string or regex object matching the dependency's file name.
791
+ * You can also use a function to conditionally transpile. The function will receive an object ({ isDev, isServer, isClient, isModern, isLegacy }).
792
+ *
793
+ * @example
794
+ * ```js
795
+ * transpile: [({ isLegacy }) => isLegacy && 'ky']
796
+ * ```
797
+ */
798
+ transpile: Array<string | RegExp | Function>,
799
+
800
+ /**
801
+ * You can provide your own templates which will be rendered based on Dtwo configuration. This feature is specially useful for using with modules.
802
+ * Templates are rendered using [`lodash.template`](https://lodash.com/docs/4.17.15#template).
803
+ *
804
+ * @example
805
+ * ```js
806
+ * templates: [
807
+ * {
808
+ * src: '~/modules/support/plugin.js', // `src` can be absolute or relative
809
+ * dst: 'support.js', // `dst` is relative to project `.dtwo` dir
810
+ * options: {
811
+ * // Options are provided to template as `options` key
812
+ * live_chat: false
813
+ * }
814
+ * }
815
+ * ]
816
+ * ```
817
+ */
818
+ templates: Array<any>,
819
+
820
+ /**
821
+ * Dtwo uses `webpack-bundle-analyzer` to visualize your bundles and how to optimize them.
822
+ * Set to `true` to enable bundle analysis, or pass an object with options: [for webpack](https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin) or [for wite](https://github.com/btd/rollup-plugin-visualizer#options).
823
+ * @default false
824
+ *
825
+ * @example
826
+ * ```js
827
+ * analyze: {
828
+ * analyzerMode: 'static'
829
+ * }
830
+ * ```
831
+ */
832
+ analyze: boolean | BundleAnalyzerPlugin.Options | PluginVisualizerOptions,
833
+ },
834
+
835
+ /**
836
+ * Extend project from multiple local or remote sources.
837
+ * Value should be either a string or array of strings pointing to source directories or config path relative to current config.
838
+ * You can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository.
839
+ */
840
+ extends: string|string[],
841
+
842
+ /**
843
+ * Extend project from a local or remote source.
844
+ * Value should be a string pointing to source directory or config path relative to current config.
845
+ * You can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository.
846
+ * @default null
847
+ */
848
+ theme: string,
849
+
850
+ /**
851
+ * Define the root directory of your application.
852
+ * This property can be overwritten (for example, running `dtwo ./my-app/` will set the `rootDir` to the absolute path of `./my-app/` from the current/working directory.
853
+ * It is normally not needed to configure this option.
854
+ * @default "/<rootDir>"
855
+ */
856
+ rootDir: string,
857
+
858
+ /**
859
+ * Define the workspace directory of your application.
860
+ * Often this is used when in a monorepo setup. Dtwo will attempt to detect your workspace directory automatically, but you can override it here.
861
+ * It is normally not needed to configure this option.
862
+ * @default "/<rootDir>"
863
+ */
864
+ workspaceDir: string,
865
+
866
+ /**
867
+ * Define the source directory of your Dtwo application.
868
+ * If a relative path is specified, it will be relative to the `rootDir`.
869
+ * @default "/<rootDir>"
870
+ *
871
+ * @example
872
+ * ```js
873
+ * export default {
874
+ * srcDir: 'src/'
875
+ * }
876
+ * ```
877
+ * This would work with the following folder structure:
878
+ * ```bash
879
+ * -| app/
880
+ * ---| node_modules/
881
+ * ---| dtwo.config.js
882
+ * ---| package.json
883
+ * ---| src/
884
+ * ------| assets/
885
+ * ------| components/
886
+ * ------| layouts/
887
+ * ------| middleware/
888
+ * ------| pages/
889
+ * ------| plugins/
890
+ * ------| static/
891
+ * ------| store/
892
+ * ------| server/
893
+ * ```
894
+ */
895
+ srcDir: string,
896
+
897
+ /**
898
+ * Define the server directory of your Dtwo application, where Hole routes, middleware and plugins are kept.
899
+ * If a relative path is specified, it will be relative to your `rootDir`.
900
+ * @default "/<rootDir>/server"
901
+ */
902
+ serverDir: string,
903
+
904
+ /**
905
+ * Define the directory where your built Dtwo files will be placed.
906
+ * Many tools assume that `.dtwo` is a hidden directory (because it starts with a `.`). If that is a problem, you can use this option to prevent that.
907
+ * @default "/<rootDir>/.dtwo"
908
+ *
909
+ * @example
910
+ * ```js
911
+ * export default {
912
+ * buildDir: 'dtwo-build'
913
+ * }
914
+ * ```
915
+ */
916
+ buildDir: string,
917
+
918
+ /**
919
+ * Used to set the modules directories for path resolving (for example, webpack's `resolveLoading`, `nodeExternals` and `postcss`).
920
+ * The configuration path is relative to `options.rootDir` (default is current working directory).
921
+ * Setting this field may be necessary if your project is organized as a yarn workspace-styled mono-repository.
922
+ * @default ["/<rootDir>/node_modules","D:/Workspace/ORGs/d2js/dtwo/packages/schema/node_modules"]
923
+ *
924
+ * @example
925
+ * ```js
926
+ * export default {
927
+ * modulesDir: ['../../node_modules']
928
+ * }
929
+ * ```
930
+ */
931
+ modulesDir: Array<string>,
932
+
933
+ /**
934
+ * Whether Dtwo is running in development mode.
935
+ * Normally, you should not need to set this.
936
+ * @default false
937
+ */
938
+ dev: boolean,
939
+
940
+ /**
941
+ * Whether your app is being unit tested.
942
+ * @default false
943
+ */
944
+ test: boolean,
945
+
946
+ /**
947
+ * Set to `true` to enable debug mode.
948
+ * At the moment, it prints out hook names and timings on the server, and logs hook arguments as well in the browser.
949
+ * @default false
950
+ */
951
+ debug: boolean,
952
+
953
+ /**
954
+ * Whether to enable rendering of HTML - either dynamically (in server mode) or at generate time. If set to `false` and combined with `static` target, generated pages will simply display a loading screen with no content.
955
+ * @default true
956
+ */
957
+ ssr: boolean,
958
+
959
+ /**
960
+ * Modules are Dtwo extensions which can extend its core functionality and add endless integrations.
961
+ * Each module is either a string (which can refer to a package, or be a path to a file), a tuple with the module as first string and the options as a second object, or an inline module function.
962
+ * Dtwo tries to resolve each item in the modules array using node require path (in `node_modules`) and then will be resolved from project `srcDir` if `~` alias is used.
963
+ *
964
+ * @note Modules are executed sequentially so the order is important.
965
+ *
966
+ * @example
967
+ * ```js
968
+ * modules: [
969
+ * // Using package name
970
+ * '@dtwojs/axios',
971
+ * // Relative to your project srcDir
972
+ * '~/modules/awesome.js',
973
+ * // Providing options
974
+ * ['@dtwojs/google-analytics', { ua: 'X1234567' }],
975
+ * // Inline definition
976
+ * function () {}
977
+ * ]
978
+ * ```
979
+ */
980
+ modules: (DtwoModule | string | [DtwoModule | string, Record<string, any>])[],
981
+
982
+ /**
983
+ * Customize default directory structure used by Dtwo.
984
+ * It is better to stick with defaults unless needed.
985
+ */
986
+ dir: {
987
+ /**
988
+ * The assets directory (aliased as `~assets` in your build).
989
+ * @default "assets"
990
+ */
991
+ assets: string,
992
+
993
+ /**
994
+ * The layouts directory, each file of which will be auto-registered as a Dtwo layout.
995
+ * @default "layouts"
996
+ */
997
+ layouts: string,
998
+
999
+ /**
1000
+ * The middleware directory, each file of which will be auto-registered as a Dtwo middleware.
1001
+ * @default "middleware"
1002
+ */
1003
+ middleware: string,
1004
+
1005
+ /**
1006
+ * The directory which will be processed to auto-generate your application page routes.
1007
+ * @default "pages"
1008
+ */
1009
+ pages: string,
1010
+
1011
+ /**
1012
+ * The plugins directory, each file of which will be auto-registered as a Dtwo plugin.
1013
+ * @default "plugins"
1014
+ */
1015
+ plugins: string,
1016
+
1017
+ /**
1018
+ * The directory containing your static files, which will be directly accessible via the Dtwo server and copied across into your `dist` folder when your app is generated.
1019
+ * @default "public"
1020
+ */
1021
+ public: string,
1022
+
1023
+ /**
1024
+ * @default "public"
1025
+ *
1026
+ * @deprecated use `dir.public` option instead
1027
+ */
1028
+ static: string,
1029
+ },
1030
+
1031
+ /**
1032
+ * The extensions that should be resolved by the Dtwo resolver.
1033
+ * @default [".js",".jsx",".mjs",".ts",".tsx",".kdu"]
1034
+ */
1035
+ extensions: Array<string>,
1036
+
1037
+ /**
1038
+ * You can improve your DX by defining additional aliases to access custom directories within your JavaScript and CSS.
1039
+ *
1040
+ * @note Within a webpack context (image sources, CSS - but not JavaScript) you _must_ access
1041
+ * your alias by prefixing it with `~`.
1042
+ *
1043
+ * @note These aliases will be automatically added to the generated `.dtwo/tsconfig.json` so you can get full
1044
+ * type support and path auto-complete. In case you need to extend options provided by `./.dtwo/tsconfig.json`
1045
+ * further, make sure to add them here or within the `typescript.tsConfig` property in `dtwo.config`.
1046
+ *
1047
+ * @example
1048
+ * ```js
1049
+ * export default {
1050
+ * alias: {
1051
+ * 'images': fileURLToPath(new URL('./assets/images', import.meta.url)),
1052
+ * 'style': fileURLToPath(new URL('./assets/style', import.meta.url)),
1053
+ * 'data': fileURLToPath(new URL('./assets/other/data', import.meta.url))
1054
+ * }
1055
+ * }
1056
+ * ```
1057
+ *
1058
+ * ```html
1059
+ * <template>
1060
+ * <img src="~images/main-bg.jpg">
1061
+ * </template>
1062
+ *
1063
+ * <script>
1064
+ * import data from 'data/test.json'
1065
+ * </script>
1066
+ *
1067
+ * <style>
1068
+ * // Uncomment the below
1069
+ * //@import '~style/variables.scss';
1070
+ * //@import '~style/utils.scss';
1071
+ * //@import '~style/base.scss';
1072
+ * body {
1073
+ * background-image: url('~images/main-bg.jpg');
1074
+ * }
1075
+ * </style>
1076
+ * ```
1077
+ */
1078
+ alias: Record<string, string>,
1079
+
1080
+ /**
1081
+ * Pass options directly to `node-ignore` (which is used by Dtwo to ignore files).
1082
+ *
1083
+ * @see [node-ignore](https://github.com/kaelzhang/node-ignore)
1084
+ *
1085
+ * @example
1086
+ * ```js
1087
+ * ignoreOptions: {
1088
+ * ignorecase: false
1089
+ * }
1090
+ * ```
1091
+ */
1092
+ ignoreOptions: any,
1093
+
1094
+ /**
1095
+ * Any file in `pages/`, `layouts/`, `middleware/` or `store/` will be ignored during building if its filename starts with the prefix specified by `ignorePrefix`.
1096
+ * @default "-"
1097
+ */
1098
+ ignorePrefix: string,
1099
+
1100
+ /**
1101
+ * More customizable than `ignorePrefix`: all files matching glob patterns specified inside the `ignore` array will be ignored in building.
1102
+ * @default ["**\/*.stories.{js,ts,jsx,tsx}","**\/*.{spec,test}.{js,ts,jsx,tsx}","**\/*.d.ts",".output","**\/-*.*"]
1103
+ */
1104
+ ignore: Array<string>,
1105
+
1106
+ /** The watchers property lets you overwrite watchers configuration in your `dtwo.config`. */
1107
+ watchers: {
1108
+ /** An array of event types, which, when received, will cause the watcher to restart. */
1109
+ rewatchOnRawEvents: any,
1110
+
1111
+ /**
1112
+ * `watchOptions` to pass directly to webpack.
1113
+ *
1114
+ * @see [webpack@4 watch options](https://v4.webpack.js.org/configuration/watch/#watchoptions).
1115
+ */
1116
+ webpack: {
1117
+ /** @default 1000 */
1118
+ aggregateTimeout: number,
1119
+ },
1120
+
1121
+ /**
1122
+ * Options to pass directly to `chokidar`.
1123
+ *
1124
+ * @see [chokidar](https://github.com/paulmillr/chokidar#api)
1125
+ */
1126
+ chokidar: {
1127
+ /** @default true */
1128
+ ignoreInitial: boolean,
1129
+ },
1130
+ },
1131
+
1132
+ /**
1133
+ * Hooks are listeners to Dtwo events that are typically used in modules, but are also available in `dtwo.config`.
1134
+ * Internally, hooks follow a naming pattern using colons (e.g., build:done).
1135
+ * For ease of configuration, you can also structure them as an hierarchical object in `dtwo.config` (as below).
1136
+ *
1137
+ * @example
1138
+ * ```js'node:fs'
1139
+ * import fs from 'node:fs'
1140
+ * import path from 'node:path'
1141
+ * export default {
1142
+ * hooks: {
1143
+ * build: {
1144
+ * done(builder) {
1145
+ * const extraFilePath = path.join(
1146
+ * builder.dtwo.options.buildDir,
1147
+ * 'extra-file'
1148
+ * )
1149
+ * fs.writeFileSync(extraFilePath, 'Something extra')
1150
+ * }
1151
+ * }
1152
+ * }
1153
+ * }
1154
+ * ```
1155
+ */
1156
+ hooks: DtwoHooks,
1157
+
1158
+ /**
1159
+ * Runtime config allows passing dynamic config and environment variables to the Dtwo app context.
1160
+ * The value of this object is accessible from server only using `useRuntimeConfig`.
1161
+ * It mainly should hold _private_ configuration which is not exposed on the frontend. This could include a reference to your API secret tokens.
1162
+ * Anything under `public` and `app` will be exposed to the frontend as well.
1163
+ * Values are automatically replaced by matching env variables at runtime, e.g. setting an environment variable `DTWO_API_KEY=my-api-key DTWO_PUBLIC_BASE_URL=/foo/` would overwrite the two values in the example below.
1164
+ *
1165
+ * @example
1166
+ * ```js
1167
+ * export default {
1168
+ * runtimeConfig: {
1169
+ * apiKey: '' // Default to an empty string, automatically set at runtime using process.env.DTWO_API_KEY
1170
+ * public: {
1171
+ * baseURL: '' // Exposed to the frontend as well.
1172
+ * }
1173
+ * }
1174
+ * }
1175
+ * ```
1176
+ */
1177
+ runtimeConfig: RuntimeConfig,
1178
+
1179
+ /**
1180
+ * Additional app configuration
1181
+ * For programmatic usage and type support, you can directly provide app config with this option. It will be merged with `app.config` file as default value.
1182
+ */
1183
+ appConfig: AppConfig,
1184
+
1185
+ devServer: {
1186
+ /**
1187
+ * Whether to enable HTTPS.
1188
+ * @default false
1189
+ *
1190
+ * @example
1191
+ * ```
1192
+ * import { fileURLToPath } from 'node:url'
1193
+ * export default {
1194
+ * server: {
1195
+ * https: {
1196
+ * key: fs.readFileSync(fileURLToPath(new URL('./server.key', import.meta.url))),
1197
+ * cert: fs.readFileSync(fileURLToPath(new URL('./server.crt', import.meta.url)))
1198
+ * }
1199
+ * }
1200
+ * }
1201
+ * ```
1202
+ */
1203
+ https: false | { key: string; cert: string },
1204
+
1205
+ /**
1206
+ * Dev server listening port
1207
+ * @default 3000
1208
+ */
1209
+ port: number,
1210
+
1211
+ /**
1212
+ * Dev server listening host
1213
+ * @default "localhost"
1214
+ */
1215
+ host: string,
1216
+
1217
+ /**
1218
+ * Listening dev server url
1219
+ * @default "http://localhost:3000"
1220
+ */
1221
+ url: string,
1222
+ },
1223
+
1224
+ experimental: {
1225
+ /**
1226
+ * Set to true to generate an async entry point for the Kdu bundle (for module federation support).
1227
+ * @default false
1228
+ */
1229
+ asyncEntry: boolean,
1230
+
1231
+ /**
1232
+ * Enable Kdu's reactivity transform
1233
+ * @default false
1234
+ *
1235
+ * @see https://kdu-js.web.app/guide/extras/reactivity-transform.html
1236
+ */
1237
+ reactivityTransform: boolean,
1238
+
1239
+ /**
1240
+ * Externalize `kdu`, `@kdujs/*` and `kdu-router` when building.
1241
+ * @default true
1242
+ */
1243
+ externalKdu: boolean,
1244
+
1245
+ /**
1246
+ * Tree shakes contents of client-only components from server bundle.
1247
+ * @default true
1248
+ */
1249
+ treeshakeClientOnly: boolean,
1250
+
1251
+ /**
1252
+ * Use wite-node for on-demand server chunk loading
1253
+ * @default true
1254
+ *
1255
+ * @deprecated use `wite.devBundler: 'wite-node'`
1256
+ */
1257
+ witeNode: boolean,
1258
+
1259
+ /**
1260
+ * Split server bundle into multiple chunks and dynamically import them.
1261
+ * @default true
1262
+ */
1263
+ witeServerDynamicImports: boolean,
1264
+
1265
+ /**
1266
+ * Inline styles when rendering HTML (currently wite only).
1267
+ * You can also pass a function that receives the path of a Kdu component and returns a boolean indicating whether to inline the styles for that component.
1268
+ * @default true
1269
+ */
1270
+ inlineSSRStyles: boolean | ((id?: string) => boolean),
1271
+
1272
+ /**
1273
+ * Turn off rendering of Dtwo scripts and JS resource hints.
1274
+ * @default false
1275
+ */
1276
+ noScripts: boolean,
1277
+
1278
+ /**
1279
+ * When this option is enabled (by default) payload of pages generated with `dtwo generate` are extracted
1280
+ * @default false
1281
+ */
1282
+ payloadExtraction: boolean,
1283
+
1284
+ /**
1285
+ * Enable cross-origin prefetch using the Speculation Rules API.
1286
+ * @default false
1287
+ */
1288
+ crossOriginPrefetch: boolean,
1289
+
1290
+ /**
1291
+ * Write early hints when using node server.
1292
+ * @default false
1293
+ *
1294
+ * @note nginx does not support 103 Early hints in the current version.
1295
+ */
1296
+ writeEarlyHints: boolean,
1297
+ },
1298
+
1299
+ generate: {
1300
+ /**
1301
+ * The routes to generate.
1302
+ * If you are using the crawler, this will be only the starting point for route generation. This is often necessary when using dynamic routes.
1303
+ * It can be an array or a function.
1304
+ *
1305
+ * @example
1306
+ * ```js
1307
+ * routes: ['/users/1', '/users/2', '/users/3']
1308
+ * ```
1309
+ *
1310
+ * You can pass a function that returns a promise or a function that takes a callback. It should
1311
+ * return an array of strings or objects with `route` and (optional) `payload` keys.
1312
+ *
1313
+ * @example
1314
+ * ```js
1315
+ * export default {
1316
+ * generate: {
1317
+ * async routes() {
1318
+ * const res = await axios.get('https://my-api/users')
1319
+ * return res.data.map(user => ({ route: '/users/' + user.id, payload: user }))
1320
+ * }
1321
+ * }
1322
+ * }
1323
+ * ```
1324
+ * Or instead:
1325
+ * ```js
1326
+ * export default {
1327
+ * generate: {
1328
+ * routes(callback) {
1329
+ * axios
1330
+ * .get('https://my-api/users')
1331
+ * .then(res => {
1332
+ * const routes = res.data.map(user => '/users/' + user.id)
1333
+ * callback(null, routes)
1334
+ * })
1335
+ * .catch(callback)
1336
+ * }
1337
+ * }
1338
+ * }
1339
+ * ```
1340
+ *
1341
+ * If `routes()` returns a payload, it can be accessed from the Dtwo context.
1342
+ *
1343
+ * @example
1344
+ * ```js
1345
+ * export default {
1346
+ * async useAsyncData ({ params, error, payload }) {
1347
+ * if (payload) return { user: payload }
1348
+ * else return { user: await backend.fetchUser(params.id) }
1349
+ * }
1350
+ * }
1351
+ * ```
1352
+ */
1353
+ routes: Array<any>,
1354
+
1355
+ /** An array of string or regular expressions that will prevent generation of routes matching them. The routes will still be accessible when `fallback` is set. */
1356
+ exclude: Array<any>,
1357
+ },
1358
+
1359
+ /**
1360
+ * @default 3
1361
+ *
1362
+ * @private
1363
+ */
1364
+ _majorVersion: number,
1365
+
1366
+ /**
1367
+ * @default false
1368
+ *
1369
+ * @private
1370
+ */
1371
+ _legacyGenerate: boolean,
1372
+
1373
+ /**
1374
+ * @default false
1375
+ *
1376
+ * @private
1377
+ */
1378
+ _start: boolean,
1379
+
1380
+ /**
1381
+ * @default false
1382
+ *
1383
+ * @private
1384
+ */
1385
+ _build: boolean,
1386
+
1387
+ /**
1388
+ * @default false
1389
+ *
1390
+ * @private
1391
+ */
1392
+ _generate: boolean,
1393
+
1394
+ /**
1395
+ * @default false
1396
+ *
1397
+ * @private
1398
+ */
1399
+ _prepare: boolean,
1400
+
1401
+ /**
1402
+ * @default false
1403
+ *
1404
+ * @private
1405
+ */
1406
+ _cli: boolean,
1407
+
1408
+ /**
1409
+ *
1410
+ * @private
1411
+ */
1412
+ _requiredModules: any,
1413
+
1414
+ /**
1415
+ *
1416
+ * @private
1417
+ */
1418
+ _dtwoConfigFile: any,
1419
+
1420
+ /**
1421
+ *
1422
+ * @private
1423
+ */
1424
+ _dtwoConfigFiles: Array<any>,
1425
+
1426
+ /**
1427
+ * @default ""
1428
+ *
1429
+ * @private
1430
+ */
1431
+ appDir: string,
1432
+
1433
+ /**
1434
+ *
1435
+ * @private
1436
+ */
1437
+ _installedModules: Array<any>,
1438
+
1439
+ /**
1440
+ *
1441
+ * @private
1442
+ */
1443
+ _modules: Array<any>,
1444
+
1445
+ /**
1446
+ * Configuration for Hole.
1447
+ *
1448
+ * @see https://holepack.web.app/config/
1449
+ */
1450
+ hole: HoleConfig,
1451
+
1452
+ /**
1453
+ * Global route options applied to matching server routes.
1454
+ *
1455
+ * @experimental This is an experimental feature and API may change in the future.
1456
+ *
1457
+ * @see https://holepack.web.app/config/#routes
1458
+ */
1459
+ routeRules: HoleConfig['routeRules'],
1460
+
1461
+ /**
1462
+ * Hole server handlers.
1463
+ * Each handler accepts the following options: - handler: The path to the file defining the handler. - route: The route under which the handler is available. This follows the conventions of https://github.com/unjs/radix3. - method: The HTTP method of requests that should be handled. - middleware: Specifies whether it is a middleware handler. - lazy: Specifies whether to use lazy loading to import the handler.
1464
+ *
1465
+ * @note Files from `server/api`, `server/middleware` and `server/routes` will be automatically registered by Dtwo.
1466
+ *
1467
+ * @example
1468
+ * ```js
1469
+ * serverHandlers: [
1470
+ * { route: '/path/foo/**:name', handler: '~/server/foohandler.ts' }
1471
+ * ]
1472
+ * ```
1473
+ */
1474
+ serverHandlers: HoleEventHandler[],
1475
+
1476
+ /**
1477
+ * Hole development-only server handlers.
1478
+ *
1479
+ * @see https://holepack.web.app/guide/introduction/routing
1480
+ */
1481
+ devServerHandlers: HoleDevEventHandler[],
1482
+
1483
+ postcss: {
1484
+ /**
1485
+ * Path to postcss config file.
1486
+ * @default false
1487
+ */
1488
+ config: boolean,
1489
+
1490
+ /**
1491
+ * Options for configuring PostCSS plugins.
1492
+ * https://postcss.org/
1493
+ */
1494
+ plugins: Record<string, any>,
1495
+ },
1496
+
1497
+ router: {
1498
+ /**
1499
+ * Additional options passed to `kdu-router`.
1500
+ * Note: Only JSON serializable options should be passed by dtwo config.
1501
+ * For more control, you can use `app/router.options.ts` file.
1502
+ *
1503
+ * @see [documentation](https://kdujs-router.web.app/api/interfaces/routeroptions.html).
1504
+ */
1505
+ options: RouterConfigSerializable,
1506
+ },
1507
+
1508
+ /** Configuration for Dtwo's TypeScript integration. */
1509
+ typescript: {
1510
+ /**
1511
+ * TypeScript comes with certain checks to give you more safety and analysis of your program. Once you’ve converted your codebase to TypeScript, you can start enabling these checks for greater safety. [Read More](https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html#getting-stricter-checks)
1512
+ * @default true
1513
+ */
1514
+ strict: boolean,
1515
+
1516
+ /**
1517
+ * Include parent workspace in the Dtwo project. Mostly useful for themes and module authors.
1518
+ * @default false
1519
+ */
1520
+ includeWorkspace: boolean,
1521
+
1522
+ /**
1523
+ * Enable build-time type checking.
1524
+ * If set to true, this will type check in development. You can restrict this to build-time type checking by setting it to `build`. Requires to install `typescript` and `kdu-tsc` as dev dependencies.
1525
+ * @default false
1526
+ */
1527
+ typeCheck: boolean | 'build',
1528
+
1529
+ /** You can extend generated `.dtwo/tsconfig.json` using this option. */
1530
+ tsConfig: readPackageJSON,
1531
+
1532
+ /**
1533
+ * Generate a `*.kdu` shim.
1534
+ * We recommend instead either enabling [**Take Over Mode**](https://kdu-js.web.app/guide/typescript/overview.html#kocan-takeover-mode) or adding TypeScript Kdu Plugin (Kocan)** 👉 [[Download](https://marketplace.visualstudio.com/items?itemName=Kdu-Code.vscode-typescript-kdu-plugin)].
1535
+ * @default true
1536
+ */
1537
+ shim: boolean,
1538
+ },
1539
+
1540
+ /**
1541
+ * Configuration that will be passed directly to Wite.
1542
+ * See https://witejs.web.app/config for more information. Please note that not all wite options are supported in Dtwo.
1543
+ */
1544
+ wite: WiteConfig,
1545
+
1546
+ webpack: {
1547
+ /**
1548
+ * Dtwo uses `webpack-bundle-analyzer` to visualize your bundles and how to optimize them.
1549
+ * Set to `true` to enable bundle analysis, or pass an object with options: [for webpack](https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin) or [for wite](https://github.com/btd/rollup-plugin-visualizer#options).
1550
+ * @default false
1551
+ *
1552
+ * @example
1553
+ * ```js
1554
+ * analyze: {
1555
+ * analyzerMode: 'static'
1556
+ * }
1557
+ * ```
1558
+ */
1559
+ analyze: boolean | BundleAnalyzerPlugin.Options,
1560
+
1561
+ /**
1562
+ * Enable the profiler in webpackbar.
1563
+ * It is normally enabled by CLI argument `--profile`.
1564
+ * @default false
1565
+ *
1566
+ * @see [webpackbar](https://github.com/unjs/webpackbar#profile).
1567
+ */
1568
+ profile: boolean,
1569
+
1570
+ /**
1571
+ * Enables Common CSS Extraction using [Kdu Server Renderer guidelines](https://kdujs-ssr.web.app/guide/css.html).
1572
+ * Using [extract-css-chunks-webpack-plugin](https://github.com/faceyspacey/extract-css-chunks-webpack-plugin/) under the hood, your CSS will be extracted into separate files, usually one per component. This allows caching your CSS and JavaScript separately and is worth trying if you have a lot of global or shared CSS.
1573
+ * @default true
1574
+ *
1575
+ * @example
1576
+ * ```js
1577
+ * export default {
1578
+ * webpack: {
1579
+ * extractCSS: true,
1580
+ * // or
1581
+ * extractCSS: {
1582
+ * ignoreOrder: true
1583
+ * }
1584
+ * }
1585
+ * }
1586
+ * ```
1587
+ *
1588
+ * If you want to extract all your CSS to a single file, there is a workaround for this.
1589
+ * However, note that it is not recommended to extract everything into a single file.
1590
+ * Extracting into multiple CSS files is better for caching and preload isolation. It
1591
+ * can also improve page performance by downloading and resolving only those resources
1592
+ * that are needed.
1593
+ *
1594
+ * @example
1595
+ * ```js
1596
+ * export default {
1597
+ * webpack: {
1598
+ * extractCSS: true,
1599
+ * optimization: {
1600
+ * splitChunks: {
1601
+ * cacheGroups: {
1602
+ * styles: {
1603
+ * name: 'styles',
1604
+ * test: /\.(css|kdu)$/,
1605
+ * chunks: 'all',
1606
+ * enforce: true
1607
+ * }
1608
+ * }
1609
+ * }
1610
+ * }
1611
+ * }
1612
+ * }
1613
+ * ```
1614
+ */
1615
+ extractCSS: boolean | PluginOptions,
1616
+
1617
+ /**
1618
+ * Enables CSS source map support (defaults to `true` in development).
1619
+ * @default false
1620
+ */
1621
+ cssSourceMap: boolean,
1622
+
1623
+ /**
1624
+ * The polyfill library to load to provide URL and URLSearchParams.
1625
+ * Defaults to `'url'` ([see package](https://www.npmjs.com/package/url)).
1626
+ * @default "url"
1627
+ */
1628
+ serverURLPolyfill: string,
1629
+
1630
+ /**
1631
+ * Customize bundle filenames.
1632
+ * To understand a bit more about the use of manifests, take a look at [this webpack documentation](https://webpack.js.org/guides/code-splitting/).
1633
+ *
1634
+ * @note Be careful when using non-hashed based filenames in production
1635
+ * as most browsers will cache the asset and not detect the changes on first load.
1636
+ *
1637
+ * This example changes fancy chunk names to numerical ids:
1638
+ *
1639
+ * @example
1640
+ * ```js
1641
+ * filenames: {
1642
+ * chunk: ({ isDev }) => (isDev ? '[name].js' : '[id].[contenthash].js')
1643
+ * }
1644
+ * ```
1645
+ */
1646
+ filenames: {
1647
+ app: () => any,
1648
+
1649
+ chunk: () => any,
1650
+
1651
+ css: () => any,
1652
+
1653
+ img: () => any,
1654
+
1655
+ font: () => any,
1656
+
1657
+ video: () => any,
1658
+ },
1659
+
1660
+ /** Customize the options of Dtwo's integrated webpack loaders. */
1661
+ loaders: {
1662
+ file: {
1663
+ /** @default false */
1664
+ esModule: boolean,
1665
+ },
1666
+
1667
+ fontUrl: {
1668
+ /** @default false */
1669
+ esModule: boolean,
1670
+
1671
+ /** @default 1000 */
1672
+ limit: number,
1673
+ },
1674
+
1675
+ imgUrl: {
1676
+ /** @default false */
1677
+ esModule: boolean,
1678
+
1679
+ /** @default 1000 */
1680
+ limit: number,
1681
+ },
1682
+
1683
+ pugPlain: any,
1684
+
1685
+ kdu: {
1686
+ /** @default true */
1687
+ productionMode: boolean,
1688
+
1689
+ transformAssetUrls: {
1690
+ /** @default "src" */
1691
+ video: string,
1692
+
1693
+ /** @default "src" */
1694
+ source: string,
1695
+
1696
+ /** @default "src" */
1697
+ object: string,
1698
+
1699
+ /** @default "src" */
1700
+ embed: string,
1701
+ },
1702
+
1703
+ compilerOptions: {
1704
+ [key: string]: any
1705
+ },
1706
+ },
1707
+
1708
+ css: {
1709
+ /** @default 0 */
1710
+ importLoaders: number,
1711
+
1712
+ url: {
1713
+ filter: () => any,
1714
+ },
1715
+
1716
+ /** @default false */
1717
+ esModule: boolean,
1718
+ },
1719
+
1720
+ cssModules: {
1721
+ /** @default 0 */
1722
+ importLoaders: number,
1723
+
1724
+ url: {
1725
+ filter: () => any,
1726
+ },
1727
+
1728
+ /** @default false */
1729
+ esModule: boolean,
1730
+
1731
+ modules: {
1732
+ /** @default "[local]_[hash:base64:5]" */
1733
+ localIdentName: string,
1734
+ },
1735
+ },
1736
+
1737
+ less: any,
1738
+
1739
+ sass: {
1740
+ sassOptions: {
1741
+ /** @default true */
1742
+ indentedSyntax: boolean,
1743
+ },
1744
+ },
1745
+
1746
+ scss: any,
1747
+
1748
+ stylus: any,
1749
+
1750
+ kduStyle: any,
1751
+ },
1752
+
1753
+ /**
1754
+ * Add webpack plugins.
1755
+ *
1756
+ * @example
1757
+ * ```js
1758
+ * import webpack from 'webpack'
1759
+ * import { version } from './package.json'
1760
+ * // ...
1761
+ * plugins: [
1762
+ * new webpack.DefinePlugin({
1763
+ * 'process.VERSION': version
1764
+ * })
1765
+ * ]
1766
+ * ```
1767
+ */
1768
+ plugins: Array<any>,
1769
+
1770
+ /**
1771
+ * Terser plugin options.
1772
+ * Set to false to disable this plugin, or pass an object of options.
1773
+ *
1774
+ * @see [terser-webpack-plugin documentation](https://github.com/webpack-contrib/terser-webpack-plugin).
1775
+ *
1776
+ * @note Enabling sourceMap will leave `//# sourceMappingURL` linking comment at
1777
+ * the end of each output file if webpack `config.devtool` is set to `source-map`.
1778
+ */
1779
+ terser: false | BasePluginOptions & DefinedDefaultMinimizerAndOptions<any>,
1780
+
1781
+ /**
1782
+ * Hard-replaces `typeof process`, `typeof window` and `typeof document` to tree-shake bundle.
1783
+ * @default false
1784
+ */
1785
+ aggressiveCodeRemoval: boolean,
1786
+
1787
+ /**
1788
+ * OptimizeCSSAssets plugin options.
1789
+ * Defaults to true when `extractCSS` is enabled.
1790
+ * @default false
1791
+ *
1792
+ * @see [css-minimizer-webpack-plugin documentation](https://github.com/webpack-contrib/css-minimizer-webpack-plugin).
1793
+ */
1794
+ optimizeCSS: false | BasePluginOptions$1 & DefinedDefaultMinimizerAndOptions$1<any>,
1795
+
1796
+ /** Configure [webpack optimization](https://webpack.js.org/configuration/optimization/). */
1797
+ optimization: false | Configuration['optimization'],
1798
+
1799
+ /** Customize PostCSS Loader. Same options as https://github.com/webpack-contrib/postcss-loader#options */
1800
+ postcss: {
1801
+ execute: any,
1802
+
1803
+ postcssOptions: {
1804
+ /** @default false */
1805
+ config: boolean,
1806
+
1807
+ plugins: {
1808
+ [key: string]: any
1809
+ },
1810
+ },
1811
+
1812
+ sourceMap: any,
1813
+
1814
+ implementation: any,
1815
+
1816
+ /** @default "" */
1817
+ order: string,
1818
+ },
1819
+
1820
+ /** See [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) for available options. */
1821
+ devMiddleware: Options<IncomingMessage, ServerResponse>,
1822
+
1823
+ /** See [webpack-hot-middleware](https://github.com/webpack-contrib/webpack-hot-middleware) for available options. */
1824
+ hotMiddleware: MiddlewareOptions & { client?: ClientOptions },
1825
+
1826
+ /**
1827
+ * Set to `false` to disable the overlay provided by [FriendlyErrorsWebpackPlugin](https://www.npmjs.com/package/@d2js/friendly-errors-webpack-plugin).
1828
+ * @default true
1829
+ */
1830
+ friendlyErrors: boolean,
1831
+
1832
+ /** Filters to hide build warnings. */
1833
+ warningIgnoreFilters: Array<(warn: WebpackError) => boolean>,
1834
+ },
1835
+ }
1836
+
1837
+ interface HeadAugmentations extends MergeHead {
1838
+ base?: {};
1839
+ link?: {};
1840
+ meta?: {};
1841
+ style?: {};
1842
+ script?: {};
1843
+ noscript?: {};
1844
+ htmlAttrs?: {};
1845
+ bodyAttrs?: {};
1846
+ }
1847
+ type MetaObjectRaw = Head<HeadAugmentations>;
1848
+ type MetaObject = MetaObjectRaw;
1849
+ type AppHeadMetaObject = MetaObjectRaw & {
1850
+ /**
1851
+ * The character encoding in which the document is encoded => `<meta charset="<value>" />`
1852
+ *
1853
+ * @default `'utf-8'`
1854
+ */
1855
+ charset?: string;
1856
+ /**
1857
+ * Configuration of the viewport (the area of the window in which web content can be seen),
1858
+ * mapped to => `<meta name="viewport" content="<value>" />`
1859
+ *
1860
+ * @default `'width=device-width, initial-scale=1'`
1861
+ */
1862
+ viewport?: string;
1863
+ };
1864
+
1865
+ type DeepPartial<T> = T extends Function ? T : T extends Record<string, any> ? {
1866
+ [P in keyof T]?: DeepPartial<T[P]>;
1867
+ } : T;
1868
+ /** User configuration in `dtwo.config` file */
1869
+ interface DtwoConfig extends DeepPartial<Omit<ConfigSchema, 'wite'>> {
1870
+ wite?: ConfigSchema['wite'];
1871
+ }
1872
+ interface ConfigLayer<T> {
1873
+ config: T;
1874
+ cwd: string;
1875
+ configFile: string;
1876
+ }
1877
+ type DtwoConfigLayer = ConfigLayer<DtwoConfig & {
1878
+ srcDir: ConfigSchema['srcDir'];
1879
+ rootDir: ConfigSchema['rootDir'];
1880
+ }>;
1881
+ /** Normalized Dtwo options available as `dtwo.options.*` */
1882
+ interface DtwoOptions extends Omit<ConfigSchema, 'builder'> {
1883
+ sourcemap: Required<Exclude<ConfigSchema['sourcemap'], boolean>>;
1884
+ builder: '@dtwo/wite-builder' | '@dtwo/webpack-builder' | {
1885
+ bundle: (dtwo: Dtwo) => Promise<void>;
1886
+ };
1887
+ _layers: DtwoConfigLayer[];
1888
+ }
1889
+ interface WiteConfig extends UserConfig {
1890
+ /**
1891
+ * Options passed to @witejs/plugin-kdu
1892
+ */
1893
+ kdu?: Options$1;
1894
+ /**
1895
+ * Bundler for dev time server-side rendering.
1896
+ * @default 'wite-node'
1897
+ */
1898
+ devBundler?: 'wite-node' | 'legacy';
1899
+ /**
1900
+ * Warmup wite entrypoint caches on dev startup.
1901
+ */
1902
+ warmupEntry?: boolean;
1903
+ /**
1904
+ * Use environment variables or top level `server` options to configure Dtwo server.
1905
+ */
1906
+ server?: Omit<ServerOptions, 'port' | 'host'>;
1907
+ }
1908
+ type RuntimeConfigNamespace = Record<string, any>;
1909
+ interface PublicRuntimeConfig extends RuntimeConfigNamespace {
1910
+ }
1911
+ interface RuntimeConfig extends RuntimeConfigNamespace {
1912
+ public: PublicRuntimeConfig;
1913
+ }
1914
+ interface AppConfigInput extends Record<string, any> {
1915
+ /** @deprecated reserved */
1916
+ private?: never;
1917
+ /** @deprecated reserved */
1918
+ dtwo?: never;
1919
+ /** @deprecated reserved */
1920
+ hole?: never;
1921
+ /** @deprecated reserved */
1922
+ server?: never;
1923
+ }
1924
+ interface DtwoAppConfig {
1925
+ head: AppHeadMetaObject;
1926
+ layoutTransition: boolean | TransitionProps;
1927
+ pageTransition: boolean | TransitionProps;
1928
+ keepalive: boolean | KeepAliveProps;
1929
+ }
1930
+ interface AppConfig {
1931
+ }
1932
+
1933
+ declare const _default: {
1934
+ [x: string]: untyped.SchemaDefinition | untyped.JSValue | untyped.InputObject;
1935
+ };
1936
+
1937
+ export { AppConfig, AppConfigInput, AppHeadMetaObject, Component, ComponentsDir, ComponentsOptions, Dtwo, DtwoApp, DtwoAppConfig, DtwoCompatibility, DtwoCompatibilityIssue, DtwoCompatibilityIssues, DtwoConfig, DtwoConfigLayer, _default as DtwoConfigSchema, DtwoHookName, DtwoHooks, DtwoLayout, DtwoMiddleware, DtwoModule, DtwoOptions, DtwoPage, DtwoPlugin, DtwoPluginTemplate, DtwoTemplate, GenerateAppOptions, HeadAugmentations, HookResult, ImportPresetWithDeprecation, ImportsOptions, MetaObject, MetaObjectRaw, ModuleDefinition, ModuleMeta, ModuleOptions, PublicRuntimeConfig, ResolvedDtwoTemplate, RouterConfig, RouterConfigSerializable, RouterOptions, RuntimeConfig, ScanDir, TSReference, WatchEvent, WiteConfig };