@donotdev/core 0.0.3 → 0.0.5

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,1476 @@
1
+ import * as React from 'react';
2
+ import { ReactNode } from 'react';
3
+
4
+ // packages/core/types/src/auth/constants.ts
5
+
6
+
7
+
8
+ // =============================================================================
9
+ // User Role Constants
10
+ // =============================================================================
11
+
12
+ /**
13
+ * Standard user role names
14
+ * Apps can override these by providing their own role constants
15
+ *
16
+ * @version 0.0.1
17
+ * @since 0.0.1
18
+ * @author AMBROISE PARK Consulting
19
+ */
20
+ declare const USER_ROLES = {
21
+ GUEST: 'guest',
22
+ USER: 'user',
23
+ ADMIN: 'admin',
24
+ } as const;
25
+
26
+ /**
27
+ * Type for user role names
28
+ * Apps can extend this with their own custom roles
29
+ *
30
+ * @version 0.0.1
31
+ * @since 0.0.1
32
+ * @author AMBROISE PARK Consulting
33
+ */
34
+ type UserRole = (typeof USER_ROLES)[keyof typeof USER_ROLES] | string;
35
+
36
+ // =============================================================================
37
+ // Subscription Tier Constants
38
+ // =============================================================================
39
+
40
+ /**
41
+ * Standard subscription tier names
42
+ * Apps can override these by providing their own tier constants
43
+ *
44
+ * @version 0.0.1
45
+ * @since 0.0.1
46
+ * @author AMBROISE PARK Consulting
47
+ */
48
+ declare const SUBSCRIPTION_TIERS = {
49
+ FREE: 'free',
50
+ PRO: 'pro',
51
+ PREMIUM: 'premium',
52
+ } as const;
53
+
54
+ /**
55
+ * Type for subscription tier names
56
+ * Apps can extend this with their own custom tiers
57
+ *
58
+ * @version 0.0.1
59
+ * @since 0.0.1
60
+ * @author AMBROISE PARK Consulting
61
+ */
62
+ type SubscriptionTier =
63
+ | (typeof SUBSCRIPTION_TIERS)[keyof typeof SUBSCRIPTION_TIERS]
64
+ | string;
65
+
66
+ // packages/core/types/src/common/index.ts
67
+
68
+
69
+
70
+ // =============================================================================
71
+ // PLATFORM CONSTANTS
72
+ // =============================================================================
73
+
74
+ /**
75
+ * Supported platform identifiers
76
+ * @constant
77
+ */
78
+ declare const PLATFORMS = {
79
+ VITE: 'vite',
80
+ NEXTJS: 'nextjs',
81
+ UNKNOWN: 'unknown',
82
+ } as const;
83
+
84
+ /**
85
+ * Platform type derived from PLATFORMS constant
86
+ */
87
+ type Platform = (typeof PLATFORMS)[keyof typeof PLATFORMS];
88
+
89
+ // =============================================================================
90
+ // ENVIRONMENT CONSTANTS
91
+ // =============================================================================
92
+
93
+ /**
94
+ * Supported environment modes
95
+ * @constant
96
+ */
97
+ declare const ENVIRONMENTS = {
98
+ DEVELOPMENT: 'development',
99
+ PRODUCTION: 'production',
100
+ TEST: 'test',
101
+ } as const;
102
+
103
+ /**
104
+ * Environment mode type derived from ENVIRONMENTS constant
105
+ */
106
+ type EnvironmentMode = (typeof ENVIRONMENTS)[keyof typeof ENVIRONMENTS];
107
+
108
+ // =============================================================================
109
+ // CONTEXT CONSTANTS
110
+ // =============================================================================
111
+
112
+ /**
113
+ * Supported execution contexts
114
+ * @constant
115
+ */
116
+ declare const CONTEXTS = {
117
+ CLIENT: 'client',
118
+ SERVER: 'server',
119
+ BUILD: 'build',
120
+ } as const;
121
+
122
+ /**
123
+ * Context type derived from CONTEXTS constant
124
+ */
125
+ type Context = (typeof CONTEXTS)[keyof typeof CONTEXTS];
126
+
127
+ // =============================================================================
128
+ // STORAGE CONSTANTS
129
+ // =============================================================================
130
+
131
+ /**
132
+ * Supported storage backend types
133
+ * @constant
134
+ */
135
+ declare const STORAGE_TYPES = {
136
+ LOCAL: 'localStorage',
137
+ SESSION: 'sessionStorage',
138
+ INDEXED_DB: 'indexedDB',
139
+ MEMORY: 'memory',
140
+ } as const;
141
+
142
+ /**
143
+ * Storage type derived from STORAGE_TYPES constant
144
+ */
145
+ type StorageType = (typeof STORAGE_TYPES)[keyof typeof STORAGE_TYPES];
146
+
147
+ // =============================================================================
148
+ // PWA CONSTANTS
149
+ // =============================================================================
150
+
151
+ /**
152
+ * PWA display modes
153
+ * @constant
154
+ */
155
+ declare const PWA_DISPLAY_MODES = {
156
+ STANDALONE: 'standalone',
157
+ FULLSCREEN: 'fullscreen',
158
+ MINIMAL_UI: 'minimal-ui',
159
+ BROWSER: 'browser',
160
+ } as const;
161
+
162
+ /**
163
+ * PWA display mode type derived from PWA_DISPLAY_MODES constant
164
+ */
165
+ type PWADisplayMode =
166
+ (typeof PWA_DISPLAY_MODES)[keyof typeof PWA_DISPLAY_MODES];
167
+
168
+ /**
169
+ * PWA asset types
170
+ * @constant
171
+ */
172
+ declare const PWA_ASSET_TYPES = {
173
+ MANIFEST: 'manifest',
174
+ SERVICE_WORKER: 'service-worker',
175
+ ICON: 'icon',
176
+ } as const;
177
+
178
+ /**
179
+ * PWA asset type derived from PWA_ASSET_TYPES constant
180
+ */
181
+ type PWAAssetType =
182
+ (typeof PWA_ASSET_TYPES)[keyof typeof PWA_ASSET_TYPES];
183
+
184
+ // =============================================================================
185
+ // ROUTE DISCOVERY CONSTANTS
186
+ // =============================================================================
187
+
188
+ /**
189
+ * Route discovery sources
190
+ * @constant
191
+ */
192
+ declare const ROUTE_SOURCES = {
193
+ AUTO: 'auto-discovery',
194
+ MANUAL: 'manual',
195
+ HYBRID: 'hybrid',
196
+ } as const;
197
+
198
+ /**
199
+ * Route source type derived from ROUTE_SOURCES constant
200
+ */
201
+ type RouteSource = (typeof ROUTE_SOURCES)[keyof typeof ROUTE_SOURCES];
202
+
203
+ // =============================================================================
204
+ // AUTHENTICATION TYPES
205
+ // =============================================================================
206
+
207
+ /**
208
+ * Page-level authentication requirements
209
+ * @description Used in PageMeta and NavigationRoute for route-level auth
210
+ */
211
+ type PageAuth =
212
+ | boolean
213
+ | {
214
+ /** Whether authentication is required */
215
+ required?: boolean;
216
+ /** Required user role */
217
+ role?: UserRole;
218
+ /** Required subscription tier */
219
+ tier?: SubscriptionTier;
220
+ /** Custom validation function */
221
+ validate?: (role: string, tier: string) => boolean;
222
+ };
223
+
224
+ // =============================================================================
225
+ // PAGE METADATA TYPES
226
+ // =============================================================================
227
+
228
+ /**
229
+ * Page metadata interface for route discovery and configuration
230
+ *
231
+ * @remarks
232
+ * **ALL PROPERTIES ARE OPTIONAL** - Framework provides smart defaults:
233
+ *
234
+ * - `auth`: false (public) by default - YOU must specify auth requirements explicitly
235
+ * - `title`: Auto-extracted from filename (ShowcasePage → "Showcase")
236
+ * - `entity`: Auto-extracted from path (pages/showcase/ → "showcase")
237
+ * - `action`: Auto-extracted from filename patterns (ListPage → "list", FormPage → "form")
238
+ * - `route`: Only needed for custom paths or dynamic routes like :id, :slug
239
+ *
240
+ * @example Simple page (no meta needed):
241
+ * ```tsx
242
+ * export function HomePage() {
243
+ * return <PageContainer>...</PageContainer>;
244
+ * }
245
+ * // Framework provides: auth=false, title from home.title, entity=home
246
+ * ```
247
+ *
248
+ * @example Dynamic route (just define the path you want):
249
+ * ```tsx
250
+ * export const meta: PageMeta = {
251
+ * route: '/blog/:slug' // Creates /blog/:slug
252
+ * };
253
+ * // Framework provides: auth=false, title from blog.title, entity=blog
254
+ * ```
255
+ *
256
+ * @example Auth-required (developer must be explicit):
257
+ * ```tsx
258
+ * export const meta: PageMeta = {
259
+ * auth: { required: true } // YOU decide what needs auth
260
+ * };
261
+ * ```
262
+ */
263
+ interface PageMeta {
264
+ /** Authentication requirements for this route */
265
+ auth?: PageAuth;
266
+
267
+ /** Route configuration - just define the exact path you want */
268
+ route?: string | { params?: string[] };
269
+
270
+ /** Page title (optional - framework auto-extracts from filename if not provided) */
271
+ title?: string;
272
+
273
+ /**
274
+ * Translation/SEO namespace for this page
275
+ * @description Used for meta tags and translations
276
+ */
277
+ namespace?: string;
278
+
279
+ /**
280
+ * Icon for navigation (optional - framework provides smart defaults)
281
+ * @description **ONLY lucide-react JSX components** - extracted as component name string at build time for tree-shaking.
282
+ *
283
+ * **RESTRICTIONS:**
284
+ * - ✅ Only: `<Rocket />`, `<ShoppingCart />`, `<Home />` (lucide-react JSX components)
285
+ * - ❌ NOT: Emojis (`"🚀"`), strings (`"Rocket"`), or custom ReactNode
286
+ *
287
+ * **Why?** This is for build-time extraction and tree-shaking. The component name is extracted and stored as a string.
288
+ *
289
+ * **For flexible icons** (emojis, strings, custom components), use the `Icon` component directly in your JSX, not in PageMeta.
290
+ *
291
+ * @example
292
+ * ```tsx
293
+ * import { Rocket } from 'lucide-react';
294
+ * export const meta: PageMeta = {
295
+ * icon: <Rocket /> // ✅ Correct - lucide-react component
296
+ * };
297
+ * ```
298
+ *
299
+ * @example
300
+ * ```tsx
301
+ * // ❌ WRONG - Don't use emojis or strings in PageMeta
302
+ * export const meta: PageMeta = {
303
+ * icon: "🚀" // ❌ Not supported in PageMeta
304
+ * };
305
+ * ```
306
+ */
307
+ icon?: ReactNode;
308
+
309
+ /**
310
+ * Hide from navigation menu (default: false - shows in navigation)
311
+ * @description Set to true to exclude this route from navigation menus
312
+ * @default false
313
+ * @example
314
+ * ```tsx
315
+ * export const meta: PageMeta = {
316
+ * hideFromMenu: true // Won't appear in HeaderNavigation, Sidebar, etc.
317
+ * };
318
+ * ```
319
+ */
320
+ hideFromMenu?: boolean;
321
+ }
322
+
323
+ /**
324
+ * Route metadata (discovery-generated)
325
+ * @description Complete route metadata including auto-discovered fields from RouteDiscovery
326
+ *
327
+ * This extends PageMeta with fields that are automatically discovered from file paths:
328
+ * - `entity`: Auto-extracted from path (pages/showcase/ → "showcase")
329
+ * - `action`: Auto-extracted from filename patterns (ListPage → "list", FormPage → "form")
330
+ *
331
+ * These fields are always present in discovered routes but cannot be set in PageMeta.
332
+ *
333
+ * @version 0.0.1
334
+ * @since 0.0.1
335
+ * @author AMBROISE PARK Consulting
336
+ */
337
+ interface RouteMeta extends PageMeta {
338
+ /** Entity/domain grouping - auto-discovered from file path (not user-configurable) */
339
+ entity?: string;
340
+ /** Action type for route categorization - auto-discovered from filename patterns (not user-configurable) */
341
+ action?: string | null;
342
+ /** File path where route was discovered */
343
+ file?: string;
344
+ }
345
+
346
+ // =============================================================================
347
+ // PLUGIN CONFIGURATION TYPES
348
+ // =============================================================================
349
+
350
+ /**
351
+ * i18n Plugin Configuration
352
+ * @description Configuration for internationalization system
353
+ */
354
+ interface I18nPluginConfig {
355
+ /** Mapping of language → namespace → loader function */
356
+ mapping: Record<string, Record<string, () => Promise<any>>>;
357
+ /** List of available language codes */
358
+ languages: string[];
359
+ /** List of eagerly loaded namespace identifiers */
360
+ eager: string[];
361
+ /** Fallback language code */
362
+ fallback: string;
363
+ /** Preloaded translation content (optional) */
364
+ content?: Record<string, Record<string, any>>;
365
+ /** Storage configuration */
366
+ storage: {
367
+ /** Storage backend type */
368
+ type: StorageType;
369
+ /** Storage key prefix */
370
+ prefix: string;
371
+ /** Time-to-live in seconds */
372
+ ttl: number;
373
+ /** Whether to encrypt stored data */
374
+ encryption: boolean;
375
+ /** Maximum storage size in bytes */
376
+ maxSize: number;
377
+ };
378
+ /** Performance configuration */
379
+ performance: {
380
+ /** Maximum cache size */
381
+ cacheSize: number;
382
+ /** Error cache TTL in seconds */
383
+ errorCacheTTL: number;
384
+ };
385
+ /** Discovery manifest metadata */
386
+ manifest: {
387
+ /** Total number of translation files */
388
+ totalFiles: number;
389
+ /** Total number of namespaces */
390
+ totalNamespaces: number;
391
+ /** Total number of languages */
392
+ totalLanguages: number;
393
+ /** Number of eagerly loaded namespaces */
394
+ eagerNamespaces: number;
395
+ /** ISO timestamp of generation */
396
+ generatedAt: string;
397
+ };
398
+ /** Whether debug mode is enabled */
399
+ debug: boolean;
400
+ }
401
+
402
+ /**
403
+ * Routes Plugin Configuration
404
+ * @description Complete route configuration populated by discovery system
405
+ */
406
+ interface RoutesPluginConfig {
407
+ /**
408
+ * Array of discovered routes
409
+ * @description All routes discovered by the route discovery system
410
+ */
411
+ mapping: Array<{
412
+ /**
413
+ * URL path for the route (platform-agnostic)
414
+ * @description The URL path that users see in their browser
415
+ * @example '/showcase/layouts', '/users/:id', '/dashboard'
416
+ */
417
+ path: string;
418
+
419
+ /**
420
+ * Lazy component reference (Vite-specific)
421
+ * @description React.lazy() component for code splitting
422
+ * @example lazy(() => import("/src/pages/showcase/LayoutsPage"))
423
+ */
424
+ component: any;
425
+
426
+ /**
427
+ * Absolute file system path (Next.js-specific)
428
+ * @description The absolute path to the component file
429
+ * @example '/src/pages/showcase/LayoutsPage.tsx'
430
+ */
431
+ importPath: string;
432
+
433
+ /**
434
+ * Export name for named exports
435
+ * @example 'HomePage', 'AboutPage'
436
+ */
437
+ exportName?: string;
438
+
439
+ /**
440
+ * Authentication configuration (platform-agnostic)
441
+ * @description Defines whether the route requires authentication
442
+ */
443
+ auth: PageAuth;
444
+
445
+ /**
446
+ * Route metadata (platform-agnostic)
447
+ * @description Additional information about the route, including auto-discovered fields
448
+ */
449
+ meta: RouteMeta;
450
+ }>;
451
+
452
+ /**
453
+ * Discovery metadata and statistics
454
+ * @description Information about the route discovery process
455
+ */
456
+ manifest: {
457
+ /** Total number of discovered routes */
458
+ totalRoutes: number;
459
+ /** Number of routes requiring authentication */
460
+ authRequired: number;
461
+ /** Number of public routes */
462
+ publicRoutes: number;
463
+ /** Source of routes (auto-discovery vs manual) */
464
+ source: RouteSource;
465
+ /** ISO timestamp when routes were generated */
466
+ generatedAt: string;
467
+ };
468
+ }
469
+
470
+ /**
471
+ * Themes Plugin Configuration
472
+ * @description Configuration for theme discovery and management
473
+ */
474
+ interface ThemesPluginConfig {
475
+ /** Mapping of theme names to theme configurations */
476
+ mapping: Record<string, any>;
477
+ /** Array of discovered themes */
478
+ discovered: Array<{
479
+ /** Theme identifier */
480
+ name: string;
481
+ /** Human-readable theme name */
482
+ displayName: string;
483
+ /** Whether this is a dark theme */
484
+ isDark: boolean;
485
+ /** Theme metadata */
486
+ meta: {
487
+ /** Icon identifier */
488
+ icon: string;
489
+ /** Theme description */
490
+ description?: string;
491
+ /** Theme category */
492
+ category?: string;
493
+ /** Theme author */
494
+ author?: string;
495
+ /** Additional metadata */
496
+ [key: string]: any;
497
+ };
498
+ /** Source file path */
499
+ source: string;
500
+ /** Whether theme is essential (cannot be disabled) */
501
+ essential: boolean;
502
+ }>;
503
+ /** CSS custom property variables */
504
+ variables: Record<string, string>;
505
+ /** Utility class mappings */
506
+ utilities: Record<string, Record<string, string>>;
507
+ /** Discovery manifest metadata */
508
+ manifest: {
509
+ /** Total number of discovered themes */
510
+ totalThemes: number;
511
+ /** Total number of CSS variables */
512
+ totalVariables: number;
513
+ /** Total number of utility classes */
514
+ totalUtilities: number;
515
+ /** ISO timestamp of generation */
516
+ generatedAt: string;
517
+ };
518
+ }
519
+
520
+ /**
521
+ * Assets Plugin Configuration
522
+ * @description Configuration for static asset management
523
+ */
524
+ interface AssetsPluginConfig {
525
+ /** Mapping of asset paths to asset metadata */
526
+ mapping: Record<string, any>;
527
+ /** SVG content of logo.svg for inline rendering with CSS variable theming */
528
+ logoSvgContent?: string | null;
529
+ /** Discovery manifest metadata */
530
+ manifest: {
531
+ /** Total number of discovered assets */
532
+ totalAssets: number;
533
+ /** ISO timestamp of generation */
534
+ generatedAt: string;
535
+ };
536
+ }
537
+
538
+ /**
539
+ * PWA Plugin Configuration
540
+ * @description Configuration for Progressive Web App features
541
+ */
542
+ interface PWAPluginConfig {
543
+ /** Array of PWA assets */
544
+ assets: Array<{
545
+ /** Type of PWA asset */
546
+ type: PWAAssetType;
547
+ /** Asset file path */
548
+ path: string;
549
+ /** Asset file size in bytes */
550
+ size?: number;
551
+ /** Asset content (for inline assets) */
552
+ content?: any;
553
+ /** Asset format (for images) */
554
+ format?: string;
555
+ /** Asset purpose (for icons) */
556
+ purpose?: string;
557
+ }>;
558
+ /** PWA manifest configuration */
559
+ manifest: {
560
+ /** Application name */
561
+ name: string;
562
+ /** Short application name */
563
+ short_name: string;
564
+ /** Application description */
565
+ description: string;
566
+ /** Start URL */
567
+ start_url: string;
568
+ /** Display mode */
569
+ display: PWADisplayMode;
570
+ /** Background color */
571
+ background_color: string;
572
+ /** Theme color */
573
+ theme_color: string;
574
+ /** Array of app icons */
575
+ icons: Array<{
576
+ /** Icon source path */
577
+ src: string;
578
+ /** Icon sizes (e.g., '192x192') */
579
+ sizes: string;
580
+ /** Icon MIME type */
581
+ type: string;
582
+ /** Icon purpose (e.g., 'any', 'maskable') */
583
+ purpose: string;
584
+ }>;
585
+ };
586
+ /** Discovery manifest metadata */
587
+ manifestInfo: {
588
+ /** Total number of PWA assets */
589
+ totalAssets: number;
590
+ /** Total number of icons */
591
+ totalIcons: number;
592
+ /** Whether service worker is present */
593
+ hasServiceWorker: boolean;
594
+ /** ISO timestamp of generation */
595
+ generatedAt: string;
596
+ };
597
+ }
598
+
599
+ /**
600
+ * Features Plugin Configuration
601
+ * @description Configuration for feature discovery and enablement
602
+ *
603
+ * @remarks
604
+ * This interface defines the structure for feature discovery data that is populated
605
+ * at build time and made available at runtime for feature availability checking.
606
+ *
607
+ * @example
608
+ * ```typescript
609
+ * // Generated by feature discovery system
610
+ * const featuresConfig: FeaturesPluginConfig = {
611
+ * available: ['auth', 'billing', 'i18n', 'oauth'],
612
+ * enabled: ['auth', 'i18n'],
613
+ * overridden: false
614
+ * };
615
+ * ```
616
+ */
617
+ interface FeaturesPluginConfig {
618
+ /**
619
+ * List of all available features discovered in packages/features/
620
+ * @example ['auth', 'billing', 'i18n', 'oauth']
621
+ */
622
+ available: string[];
623
+ }
624
+
625
+ // =============================================================================
626
+ // FRAMEWORK CONFIGURATION
627
+ // =============================================================================
628
+
629
+ /**
630
+ * Complete DoNotDev framework configuration structure
631
+ * @description Single source of truth for all framework configuration
632
+ *
633
+ * @remarks
634
+ * All discovery plugins add their data to this unified config.
635
+ * Available at runtime via globalThis._DNDEV_CONFIG_ or window._DNDEV_CONFIG_
636
+ */
637
+ interface DndevFrameworkConfig {
638
+ /** Framework platform (Vite or Next.js) */
639
+ platform: Platform;
640
+ /** Current environment mode */
641
+ mode: EnvironmentMode;
642
+ /** Framework version */
643
+ version: string;
644
+ /** Execution context */
645
+ context: Context;
646
+ /** Unix timestamp of config generation */
647
+ timestamp: number;
648
+ /** i18n plugin configuration (optional) */
649
+ i18n?: I18nPluginConfig;
650
+ /** Routes plugin configuration (optional) */
651
+ routes?: RoutesPluginConfig;
652
+ /** Themes plugin configuration (optional) */
653
+ themes?: ThemesPluginConfig;
654
+ /** Assets plugin configuration (optional) */
655
+ assets?: AssetsPluginConfig;
656
+ /** PWA plugin configuration (optional) */
657
+ pwa?: PWAPluginConfig;
658
+ /** Features plugin configuration (optional) */
659
+ features?: FeaturesPluginConfig;
660
+ /** Environment variables (VITE_* variables from .env files) */
661
+ env?: Record<string, string>;
662
+ }
663
+
664
+ // =============================================================================
665
+ // GLOBAL AUGMENTATIONS
666
+ // =============================================================================
667
+
668
+ declare global {
669
+ interface Window {
670
+ /**
671
+ * Single source of truth for all DoNotDev framework configuration
672
+ * @description Set by platform detection and populated by discovery plugins
673
+ */
674
+ _DNDEV_CONFIG_?: DndevFrameworkConfig;
675
+
676
+ /**
677
+ * Global store registry for singleton Zustand stores
678
+ * @description Ensures single instance across code-split chunks
679
+ */
680
+ _DNDEV_STORES_?: Record<string, any>;
681
+
682
+ /** PapaParse CSV parser library (external) */
683
+ Papa?: {
684
+ parse: (input: string | File, config?: any) => any;
685
+ unparse: (data: any[], config?: any) => string;
686
+ };
687
+
688
+ /** Sentry error tracking library (external) */
689
+ Sentry?: {
690
+ captureException: (error: unknown) => void;
691
+ withScope: (callback: (scope: any) => void) => void;
692
+ getClient: () => { close: () => Promise<boolean> } | undefined;
693
+ };
694
+
695
+ /**
696
+ * Google APIs (Maps, One Tap, etc.)
697
+ * @description Unified type for all Google services
698
+ */
699
+ google?: {
700
+ /** Google Maps API */
701
+ maps?: {
702
+ places?: {
703
+ AutocompleteService: new () => any;
704
+ PlacesService: new (element: HTMLElement) => any;
705
+ PlacesServiceStatus: {
706
+ OK: string;
707
+ };
708
+ };
709
+ [key: string]: any;
710
+ };
711
+ /** Google Identity Services (One Tap) */
712
+ accounts?: {
713
+ id?: {
714
+ initialize: (config: any) => void;
715
+ prompt: (callback?: (notification: any) => void) => void;
716
+ cancel?: () => void;
717
+ disableAutoSelect?: () => void;
718
+ };
719
+ };
720
+ [key: string]: any;
721
+ };
722
+
723
+ /** FedCM Identity Credential API */
724
+ IdentityCredential?: any;
725
+ }
726
+
727
+ namespace NodeJS {
728
+ interface ProcessEnv {
729
+ /** Serialized framework config for Node.js environment */
730
+ _DNDEV_CONFIG_?: string;
731
+ }
732
+ }
733
+
734
+ namespace globalThis {
735
+ /** Framework configuration (same as window._DNDEV_CONFIG_) */
736
+ var _DNDEV_CONFIG_: DndevFrameworkConfig | undefined;
737
+ /** Store registry (same as window._DNDEV_STORES_) */
738
+ var _DNDEV_STORES_: Record<string, any> | undefined;
739
+
740
+ // Third-party framework globals (not owned by DoNotDev)
741
+ var __vite_plugin_react_preamble_installed__: boolean | undefined;
742
+ var __vite_hmr_port: number | undefined;
743
+ var __NEXT_DATA__: any | undefined;
744
+ var __REACT_QUERY_CLIENT__: any | undefined;
745
+ var __REACT_QUERY_PROVIDER__: any | undefined;
746
+ var __DNDEV_DEBUG: boolean | undefined;
747
+ var __FIREBASE_DEMO_MODE__: boolean | undefined;
748
+ // gc is already defined by Node.js globals - removed to avoid TS 5.9+ conflict
749
+ var getAvailableThemes: (() => string[]) | undefined;
750
+ }
751
+ }
752
+
753
+ type $MergeBy<T, K> = Omit<T, keyof K> & K;
754
+
755
+ type $PreservedValue<Value, Fallback> = [Value] extends [never] ? Fallback : Value;
756
+
757
+ /**
758
+ * This interface can be augmented by users to add types to `i18next` default TypeOptions.
759
+ *
760
+ * Usage:
761
+ * ```ts
762
+ * // i18next.d.ts
763
+ * import 'i18next';
764
+ * declare module 'i18next' {
765
+ * interface CustomTypeOptions {
766
+ * defaultNS: 'custom';
767
+ * returnNull: false;
768
+ * returnObjects: false;
769
+ * nsSeparator: ':';
770
+ * keySeparator: '.';
771
+ * compatibilityJSON: 'v4';
772
+ * allowObjectInHTMLChildren: false;
773
+ * resources: {
774
+ * custom: {
775
+ * foo: 'foo';
776
+ * };
777
+ * };
778
+ * }
779
+ * }
780
+ * ```
781
+ */
782
+ interface CustomTypeOptions {}
783
+
784
+ type TypeOptions = $MergeBy<
785
+ {
786
+ /** @see {InitOptions.returnNull} */
787
+ returnNull: false;
788
+
789
+ /** @see {InitOptions.returnEmptyString} */
790
+ returnEmptyString: true;
791
+
792
+ /** @see {InitOptions.returnObjects} */
793
+ returnObjects: false;
794
+
795
+ /** @see {InitOptions.keySeparator} */
796
+ keySeparator: '.';
797
+
798
+ /** @see {InitOptions.nsSeparator} */
799
+ nsSeparator: ':';
800
+
801
+ /** @see {InitOptions.pluralSeparator} */
802
+ pluralSeparator: '_';
803
+
804
+ /** @see {InitOptions.contextSeparator} */
805
+ contextSeparator: '_';
806
+
807
+ /** @see {InitOptions.defaultNS} */
808
+ defaultNS: 'translation';
809
+
810
+ /** @see {InitOptions.fallbackNS} */
811
+ fallbackNS: false;
812
+
813
+ /** @see {InitOptions.compatibilityJSON} */
814
+ compatibilityJSON: 'v4';
815
+
816
+ /** @see {InitOptions.resources} */
817
+ resources: object;
818
+
819
+ /**
820
+ * Flag that allows HTML elements to receive objects. This is only useful for React applications
821
+ * where you pass objects to HTML elements so they can be replaced to their respective interpolation
822
+ * values (mostly with Trans component)
823
+ */
824
+ allowObjectInHTMLChildren: false;
825
+
826
+ /**
827
+ * Flag that enables strict key checking even if a `defaultValue` has been provided.
828
+ * This ensures all calls of `t` function don't accidentally use implicitly missing keys.
829
+ */
830
+ strictKeyChecks: false;
831
+
832
+ /**
833
+ * Prefix for interpolation
834
+ */
835
+ interpolationPrefix: '{{';
836
+
837
+ /**
838
+ * Suffix for interpolation
839
+ */
840
+ interpolationSuffix: '}}';
841
+
842
+ /** @see {InterpolationOptions.unescapePrefix} */
843
+ unescapePrefix: '-';
844
+
845
+ /** @see {InterpolationOptions.unescapeSuffix} */
846
+ unescapeSuffix: '';
847
+
848
+ /**
849
+ * Use a proxy-based selector to select a translation.
850
+ *
851
+ * Enables features like go-to definition, and better DX/faster autocompletion
852
+ * for TypeScript developers.
853
+ *
854
+ * If you're working with an especially large set of translations and aren't
855
+ * using context, you set `enableSelector` to `"optimize"` and i18next won't do
856
+ * any type-level processing of your translations at all.
857
+ *
858
+ * With `enableSelector` set to `"optimize"`, i18next is capable of supporting
859
+ * arbitrarily large/deep translation sets without causing any IDE slowdown
860
+ * whatsoever.
861
+ *
862
+ * @default false
863
+ */
864
+ enableSelector: false;
865
+ },
866
+ CustomTypeOptions
867
+ >;
868
+
869
+ type FlatNamespace = $PreservedValue<keyof TypeOptions['resources'], string>;
870
+ type Namespace<T = FlatNamespace> = T | readonly T[];
871
+
872
+ interface ReportNamespaces {
873
+ addUsedNamespaces(namespaces: Namespace): void;
874
+ getUsedNamespaces(): string[];
875
+ }
876
+
877
+ declare module 'i18next' {
878
+ // interface i18n {
879
+ // reportNamespaces?: ReportNamespaces;
880
+ // }
881
+ interface CustomInstanceExtensions {
882
+ reportNamespaces?: ReportNamespaces;
883
+ }
884
+ }
885
+
886
+ type ObjectOrNever = TypeOptions['allowObjectInHTMLChildren'] extends true
887
+ ? Record<string, unknown>
888
+ : never;
889
+
890
+ type ReactI18NextChildren = React.ReactNode | ObjectOrNever;
891
+
892
+ declare module 'react' {
893
+ namespace JSX {
894
+ interface IntrinsicAttributes {
895
+ i18nIsDynamicList?: boolean;
896
+ }
897
+ }
898
+
899
+ interface HTMLAttributes<T> {
900
+ // This union is inspired by the typings for React.ReactNode. We do this to fix "This JSX tag's 'children' prop
901
+ // expects a single child of type 'ReactI18NextChildren', but multiple children were provided":
902
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/5a1e9f91ed0143adede394adb3f540e650455f71/types/react/index.d.ts#L268
903
+ children?: ReactI18NextChildren | Iterable<ReactI18NextChildren>;
904
+ }
905
+ }
906
+
907
+ // packages/core/types/src/layout/layoutTypes.ts
908
+
909
+
910
+
911
+ /**
912
+ * App metadata and branding configuration
913
+ *
914
+ * @version 0.0.2
915
+ * @since 0.0.1
916
+ * @author AMBROISE PARK Consulting
917
+ */
918
+ interface AppMetadata {
919
+ /** Application name */
920
+ name?: string;
921
+
922
+ /** Short application name for mobile/compact displays (defaults to name if not set) */
923
+ shortName?: string;
924
+
925
+ /** Application URL (base URL for production, defaults to localhost in development) */
926
+ url?: string;
927
+
928
+ /** Application description */
929
+ description?: string;
930
+
931
+ /** Social and external links */
932
+ links?: {
933
+ /** GitHub repository URL */
934
+ github?: string;
935
+ /** Twitter/X profile URL */
936
+ twitter?: string;
937
+ /** LinkedIn profile URL */
938
+ linkedin?: string;
939
+ /** Support/contact URL */
940
+ support?: string;
941
+ /** Documentation URL */
942
+ docs?: string;
943
+ /** Blog URL */
944
+ blog?: string;
945
+ };
946
+
947
+ /** Footer configuration
948
+ * - `null`: Explicitly hide footer
949
+ * - `undefined`: Use framework default footer
950
+ * - `{ copyright?: ..., legalLinks?: ... }`: Custom footer configuration
951
+ */
952
+ footer?: {
953
+ /** Copyright configuration
954
+ * - `null`: Hide copyright
955
+ * - `undefined`: Use default (© YEAR appName. All rights reserved)
956
+ * - `string`: Custom copyright text
957
+ */
958
+ copyright?: null | string;
959
+ /** Legal links configuration
960
+ * - `null`: Hide legal links
961
+ * - `Array<{ path, label }>`: Custom legal links (labels can be i18n keys via maybeTranslate)
962
+ * - `undefined`: Use framework defaults (Privacy Policy, Terms of Service with i18n labels)
963
+ */
964
+ legalLinks?: null | Array<{
965
+ path: string;
966
+ label: string;
967
+ }>;
968
+ } | null;
969
+
970
+ /** Additional application metadata */
971
+ metadata?: Record<string, any>;
972
+ }
973
+
974
+ /**
975
+ * Authentication route configuration
976
+ *
977
+ * Configure redirect routes for authentication and authorization failures.
978
+ * Also configures AuthHeader UI behavior (login page, user menu, etc.).
979
+ * All routes are optional with security-first defaults.
980
+ *
981
+ * @example
982
+ * ```typescript
983
+ * const authConfig: AuthConfig = {
984
+ * authRoute: '/signin',
985
+ * roleRoute: '/403',
986
+ * tierRoute: '/pricing',
987
+ * loginPath: '/login', // Optional: links to login page (undefined = show providers in header)
988
+ * profilePath: '/account',
989
+ * authMenuPaths: ['/dashboard', '/settings']
990
+ * };
991
+ * ```
992
+ *
993
+ * @version 0.0.2
994
+ * @since 0.0.1
995
+ * @author AMBROISE PARK Consulting
996
+ */
997
+ interface AuthConfig {
998
+ /** Route to redirect when authentication required (default: '/login') */
999
+ authRoute: string;
1000
+ /** Route to redirect when role insufficient (default: '/404') */
1001
+ roleRoute: string;
1002
+ /** Route to redirect when tier insufficient (default: '/404') */
1003
+ tierRoute: string;
1004
+ /** Optional: Path to login page. If provided, AuthHeader links to login page. If undefined (default), shows providers in header */
1005
+ loginPath?: string;
1006
+ /** Optional: Path to profile page (default: '/profile') */
1007
+ profilePath?: string;
1008
+ /**
1009
+ * Optional: Custom menu items for authenticated user menu dropdown.
1010
+ * Supports route-based items with paths (auto-creates Link).
1011
+ * Icons are auto-resolved from route discovery (PageMeta.icon) if not provided.
1012
+ * For items with onClick handlers, use AuthMenu customItems prop instead.
1013
+ *
1014
+ * @example
1015
+ * ```typescript
1016
+ * authMenuItems: [
1017
+ * { path: '/dashboard' }, // icon auto-resolved from route
1018
+ * { path: '/settings', label: 'Settings' }, // override label, icon from route
1019
+ * { path: '/billing', icon: 'CreditCard' } // override icon
1020
+ * ]
1021
+ * ```
1022
+ */
1023
+ authMenuItems?: Array<{
1024
+ /** Route path (creates Link automatically) */
1025
+ path: string;
1026
+ /** Optional label (falls back to navigation item label or path segment) */
1027
+ label?: string;
1028
+ /** Optional Lucide icon name (string) - overrides route discovery icon */
1029
+ icon?: string;
1030
+ }>;
1031
+ /**
1032
+ * Optional function to handle custom data deletion before account removal
1033
+ * Framework will try/catch this - failures won't block account deletion
1034
+ *
1035
+ * @example
1036
+ * ```typescript
1037
+ * deleteUserFunction: async (userId: string) => {
1038
+ * // Cancel Stripe subscriptions
1039
+ * await fetch('/api/billing/cancel', { method: 'POST' });
1040
+ *
1041
+ * // Delete Firestore user data
1042
+ * await deleteDoc(doc(db, 'users', userId));
1043
+ *
1044
+ * // Custom cleanup
1045
+ * await myCustomCleanup(userId);
1046
+ * }
1047
+ * ```
1048
+ */
1049
+ deleteUserFunction?: (userId: string) => Promise<void>;
1050
+ }
1051
+
1052
+ /**
1053
+ * SEO configuration
1054
+ *
1055
+ * Configure automatic SEO meta tags and social sharing.
1056
+ *
1057
+ * @example
1058
+ * ```typescript
1059
+ * const seoConfig: SEOConfig = {
1060
+ * baseUrl: 'https://example.com',
1061
+ * defaultImage: '/og-image.png',
1062
+ * twitterHandle: 'mycompany'
1063
+ * };
1064
+ * ```
1065
+ *
1066
+ * @version 0.0.2
1067
+ * @since 0.0.1
1068
+ * @author AMBROISE PARK Consulting
1069
+ */
1070
+ interface SEOConfig {
1071
+ /** Enable automatic SEO (default: true) */
1072
+ enabled?: boolean;
1073
+ /** Base URL for SEO files (robots.txt, sitemap.xml) - defaults to appConfig.app.url (set at build time) */
1074
+ baseUrl?: string;
1075
+ /** Site name for SEO - defaults to APP_NAME from app.ts */
1076
+ siteName?: string;
1077
+ /** Crawl delay for robots.txt (default: 1) */
1078
+ crawlDelay?: number;
1079
+ /** Generate robots.txt (default: true) */
1080
+ generateRobotsTxt?: boolean;
1081
+ /** Generate sitemap.xml (default: true) */
1082
+ generateSitemap?: boolean;
1083
+ /** Default namespace for i18n translations (default: 'home') */
1084
+ defaultNamespace?: string;
1085
+ /** Default image for social sharing */
1086
+ defaultImage?: string;
1087
+ /** Twitter handle (without @) */
1088
+ twitterHandle?: string;
1089
+ /** Additional static meta tags */
1090
+ staticTags?: Record<string, string>;
1091
+ }
1092
+
1093
+ /**
1094
+ * Favicon and PWA configuration
1095
+ *
1096
+ * Configure automatic favicon generation and PWA manifest icons.
1097
+ *
1098
+ * @example
1099
+ * ```typescript
1100
+ * const faviconConfig: FaviconConfig = {
1101
+ * appName: 'My App',
1102
+ * themeColor: '#000000',
1103
+ * backgroundColor: '#ffffff'
1104
+ * };
1105
+ * ```
1106
+ *
1107
+ * @version 0.0.2
1108
+ * @since 0.0.1
1109
+ * @author AMBROISE PARK Consulting
1110
+ */
1111
+ interface FaviconConfig {
1112
+ /** Enable automatic favicon system (default: true) */
1113
+ enabled?: boolean;
1114
+ /** App name for PWA manifest */
1115
+ appName?: string;
1116
+ /** Theme color for mobile browsers */
1117
+ themeColor?: string;
1118
+ /** Background color for splash screens */
1119
+ backgroundColor?: string;
1120
+ /** Include PWA manifest icons */
1121
+ includeManifestIcons?: boolean;
1122
+ /** Include Microsoft tile icons */
1123
+ includeMSIcons?: boolean;
1124
+ }
1125
+
1126
+ /**
1127
+ * Feature flags and debug configuration
1128
+ *
1129
+ * Controls app behavior and GDPR compliance.
1130
+ * Feature availability is auto-detected via env vars/packages.
1131
+ *
1132
+ * @example
1133
+ * ```typescript
1134
+ * const featuresConfig: FeaturesConfig = {
1135
+ * debug: true,
1136
+ * offlineTrustEnabled: true,
1137
+ * requiredCookies: ['necessary', 'analytics']
1138
+ * };
1139
+ * ```
1140
+ *
1141
+ * @version 0.0.2
1142
+ * @since 0.0.1
1143
+ * @author AMBROISE PARK Consulting
1144
+ */
1145
+ interface FeaturesConfig {
1146
+ /** Enable debug tools (default: false in production, true in development) */
1147
+ debug?: boolean;
1148
+
1149
+ /**
1150
+ * Enable offline trust for cached claims (default: false)
1151
+ *
1152
+ * When true:
1153
+ * - Online: Always verify with server (don't trust cache)
1154
+ * - Offline: Use cached claims (graceful degradation)
1155
+ *
1156
+ * When false:
1157
+ * - Online: Always verify with server
1158
+ * - Offline: Reject (throw error, require network)
1159
+ *
1160
+ * @default false
1161
+ */
1162
+ offlineTrustEnabled?: boolean;
1163
+
1164
+ /**
1165
+ * Cookie consent categories to display in GDPR banner
1166
+ *
1167
+ * Controls which cookie categories users can consent to.
1168
+ * Framework always includes 'necessary' (cannot be disabled).
1169
+ *
1170
+ * @example
1171
+ * ```typescript
1172
+ * features: {
1173
+ * requiredCookies: ['necessary', 'functional', 'analytics']
1174
+ * }
1175
+ * ```
1176
+ *
1177
+ * @default ['necessary']
1178
+ */
1179
+ requiredCookies?: string[];
1180
+ }
1181
+
1182
+ /**
1183
+ * Complete application configuration
1184
+ *
1185
+ * Consolidates all app-level configuration with smart defaults.
1186
+ * Pass only what you need to override - everything has sensible defaults.
1187
+ *
1188
+ * @example
1189
+ * ```typescript
1190
+ * // Minimal configuration
1191
+ * const config: AppConfig = {
1192
+ * app: { name: 'My App' }
1193
+ * };
1194
+ *
1195
+ * // Full configuration
1196
+ * const config: AppConfig = {
1197
+ * app: {
1198
+ * name: 'My App',
1199
+ * description: 'Professional app'
1200
+ * },
1201
+ * auth: {
1202
+ * authRoute: '/signin',
1203
+ * roleRoute: '/403',
1204
+ * tierRoute: '/pricing'
1205
+ * },
1206
+ * seo: {
1207
+ * defaultImage: '/og.png'
1208
+ * },
1209
+ * preset: 'landing',
1210
+ * features: {
1211
+ * debug: true
1212
+ * }
1213
+ * };
1214
+ * ```
1215
+ *
1216
+ * @version 0.0.2
1217
+ * @since 0.0.1
1218
+ * @author AMBROISE PARK Consulting
1219
+ */
1220
+ interface AppConfig {
1221
+ /** App metadata and branding */
1222
+ app?: AppMetadata;
1223
+ /** Authentication routes - partial override of defaults */
1224
+ auth?: Partial<AuthConfig> | false;
1225
+ /** SEO configuration (set to false to disable) */
1226
+ seo?: SEOConfig | false;
1227
+ /** Favicon configuration (set to false to disable) */
1228
+ favicon?: FaviconConfig | false;
1229
+ /** Layout preset for store initialization (defaults to 'landing' if invalid/empty) */
1230
+ preset?: string;
1231
+ /** Feature flags */
1232
+ features?: FeaturesConfig;
1233
+ }
1234
+
1235
+ /**
1236
+ * I18n virtual mapping options
1237
+ *
1238
+ * @version 0.0.1
1239
+ * @since 0.0.1
1240
+ * @author AMBROISE PARK Consulting
1241
+ */
1242
+ interface I18nVirtualMappingOptions {
1243
+ virtualModuleId?: string;
1244
+ eagerNamespaces?: string[];
1245
+ }
1246
+
1247
+ /**
1248
+ * Base discovery options - DRY type for code, not a config level
1249
+ * HMR options are internal framework concerns (in DEFAULT_OPTIONS only, not user-configurable)
1250
+ * Plugins are always enabled (part of framework) - no enabled option
1251
+ *
1252
+ * @version 0.0.1
1253
+ * @since 0.0.1
1254
+ * @author AMBROISE PARK Consulting
1255
+ */
1256
+ interface BaseDiscoveryOptions {
1257
+ /** Debug logging (default: false) - cascades from global debug */
1258
+ debug?: boolean;
1259
+ /** Verbose logging (default: true) - cascades from global verbose */
1260
+ verbose?: boolean;
1261
+ }
1262
+
1263
+ /**
1264
+ * Theme detection options
1265
+ *
1266
+ * @version 0.0.1
1267
+ * @since 0.0.1
1268
+ * @author AMBROISE PARK Consulting
1269
+ */
1270
+ interface ThemeDetectionOptions extends BaseDiscoveryOptions {
1271
+ /** Theme manifest file name (default: 'theme-manifest.json') */
1272
+ manifestFileName?: string;
1273
+ /** Auto-generate safelist (default: true) */
1274
+ autoSafelist?: boolean;
1275
+ }
1276
+
1277
+ /**
1278
+ * Route discovery options with virtual module support
1279
+ *
1280
+ * @version 0.0.1
1281
+ * @since 0.0.1
1282
+ * @author AMBROISE PARK Consulting
1283
+ */
1284
+ interface RouteDiscoveryOptions extends BaseDiscoveryOptions {
1285
+ /** Disable route discovery (default: false) - set to true if using custom router */
1286
+ disabled?: boolean;
1287
+ /** Path to manual routes file relative to vite.config.ts (default: './src/routes.ts') */
1288
+ manualPath?: string;
1289
+ /** Additional patterns to scan beyond centralized patterns */
1290
+ additionalPatterns?: string[];
1291
+ }
1292
+
1293
+ /**
1294
+ * I18n options
1295
+ *
1296
+ * @version 0.0.1
1297
+ * @since 0.0.1
1298
+ * @author AMBROISE PARK Consulting
1299
+ */
1300
+ interface I18nOptions extends BaseDiscoveryOptions {
1301
+ useVirtualMapping?: boolean;
1302
+ fallbackLanguage?: string;
1303
+ namespaces?: string[];
1304
+ virtualMapping?: I18nVirtualMappingOptions;
1305
+ }
1306
+
1307
+ /**
1308
+ * Asset options
1309
+ *
1310
+ * @version 0.0.1
1311
+ * @since 0.0.1
1312
+ * @author AMBROISE PARK Consulting
1313
+ */
1314
+ interface AssetOptions extends BaseDiscoveryOptions {
1315
+ /** Asset fallback configuration */
1316
+ fallback?: AssetFallbackOptions | false;
1317
+ }
1318
+
1319
+ /**
1320
+ * Progressive Web App options
1321
+ *
1322
+ * @version 0.0.1
1323
+ * @since 0.0.1
1324
+ * @author AMBROISE PARK Consulting
1325
+ */
1326
+ interface PWAOptions {
1327
+ /** Enable PWA in production builds (default: false) */
1328
+ enabled?: boolean;
1329
+ /** Enable PWA in development (default: false) */
1330
+ devEnabled?: boolean;
1331
+ /** Debug logging (default: false) */
1332
+ debug?: boolean;
1333
+ /** Override manifest values (auto-discovered from app.ts by default) */
1334
+ manifest?: Record<string, any>;
1335
+ /** Discover build assets for precache (Next.js only, default: true) */
1336
+ discoverBuildAssets?: boolean;
1337
+ /** Override workbox configuration (smart defaults provided) */
1338
+ workbox?: {
1339
+ /** Maximum file size to cache in bytes (default: 5MB) */
1340
+ maximumFileSizeToCacheInBytes?: number;
1341
+ /** Glob patterns for precaching (default: all js, css, html, icons, and fonts) */
1342
+ globPatterns?: string[];
1343
+ /** Glob patterns to ignore */
1344
+ globIgnores?: string[];
1345
+ /** Clean up outdated caches (default: true) */
1346
+ cleanupOutdatedCaches?: boolean;
1347
+ /** Skip waiting for service worker activation (default: true) */
1348
+ skipWaiting?: boolean;
1349
+ /** Claim clients immediately (default: true) */
1350
+ clientsClaim?: boolean;
1351
+ /** Runtime caching strategies (smart defaults provided) */
1352
+ runtimeCaching?: Array<{
1353
+ urlPattern: RegExp | ((options: { request: Request }) => boolean);
1354
+ handler:
1355
+ | 'CacheFirst'
1356
+ | 'NetworkFirst'
1357
+ | 'StaleWhileRevalidate'
1358
+ | 'NetworkOnly'
1359
+ | 'CacheOnly';
1360
+ options?: Record<string, any>;
1361
+ }>;
1362
+ /** Navigation fallback URL (default: '/') */
1363
+ navigateFallback?: string;
1364
+ /** URLs to exclude from navigation fallback */
1365
+ navigateFallbackDenylist?: RegExp[];
1366
+ /** Transform precache manifest (allows custom filtering/modification) */
1367
+ manifestTransforms?: Array<
1368
+ (manifest: Array<{ url: string; revision: string | null }>) => {
1369
+ manifest: Array<{ url: string; revision: string | null }>;
1370
+ warnings?: string[];
1371
+ }
1372
+ >;
1373
+ /** Background sync configuration for offline actions */
1374
+ backgroundSync?:
1375
+ | {
1376
+ /** Queue name for background sync (default: 'background-sync-queue') */
1377
+ queueName?: string;
1378
+ /** Maximum retention time in minutes (default: 24 * 60) */
1379
+ maxRetentionTime?: number;
1380
+ /** URL pattern for background sync routes (default: matches /api/ routes) */
1381
+ urlPattern?: RegExp | ((options: { request: Request }) => boolean);
1382
+ }
1383
+ | false;
1384
+ [key: string]: any; // Allow other workbox options
1385
+ };
1386
+ }
1387
+
1388
+ /**
1389
+ * Asset fallback options
1390
+ *
1391
+ * @version 0.0.1
1392
+ * @since 0.0.1
1393
+ * @author AMBROISE PARK Consulting
1394
+ */
1395
+ interface AssetFallbackOptions {
1396
+ /** Enable asset fallback (default: true) */
1397
+ enabled?: boolean;
1398
+ /** Assets to copy (default: from centralized patterns) */
1399
+ assets?: string[];
1400
+ /** Asset patterns to scan (default: from centralized patterns) */
1401
+ assetPatterns?: string[];
1402
+ /** Framework package name (default: '@donotdev/ui') */
1403
+ frameworkPackage?: string;
1404
+ /** Assets path within framework package (default: 'assets') */
1405
+ assetsPath?: string;
1406
+ /** Debug logging (default: false) */
1407
+ debug?: boolean;
1408
+ }
1409
+
1410
+ /**
1411
+ * Server shim options for blocking server-only imports
1412
+ * Note: serverShim cannot be disabled - framework would crash without it
1413
+ *
1414
+ * @version 0.0.1
1415
+ * @since 0.0.1
1416
+ * @author AMBROISE PARK Consulting
1417
+ */
1418
+ interface ServerShimOptions {
1419
+ /** Additional imports to block beyond defaults */
1420
+ blockedImports?: string[];
1421
+ /** Debug logging (default: false) */
1422
+ debug?: boolean;
1423
+ }
1424
+
1425
+ // Next.js Configuration
1426
+
1427
+ /**
1428
+ * Next.js configuration options for DNDev applications
1429
+ *
1430
+ * @version 0.0.1
1431
+ * @since 0.0.1
1432
+ * @author AMBROISE PARK Consulting
1433
+ */
1434
+ interface NextConfigOptions {
1435
+ /** App config from app.ts - features and SEO will be extracted automatically (required) */
1436
+ appConfig: AppConfig;
1437
+ /** Debug mode - enables detailed debug logging */
1438
+ debug?: boolean;
1439
+ /** Verbose logging - shows config/search paths (opt-out, auto-disabled in CI) */
1440
+ verbose?: boolean;
1441
+ /** Route discovery configuration (uses DRY RouteDiscoveryOptions) */
1442
+ routes?: RouteDiscoveryOptions & {
1443
+ /** Generate app/** page files (Site template) (default: true) */
1444
+ generateAppPages?: boolean;
1445
+ /** Routing mode for Next.js */
1446
+ routingMode?: 'pages' | 'app';
1447
+ /** Generate authentication middleware */
1448
+ generateMiddleware?: boolean;
1449
+ };
1450
+ /** Internationalization configuration (uses DRY I18nOptions) */
1451
+ i18n?: I18nOptions;
1452
+ /** Theme configuration (uses DRY ThemeDetectionOptions) */
1453
+ themes?: ThemeDetectionOptions;
1454
+ /** Asset configuration (uses DRY AssetOptions) */
1455
+ assets?: AssetOptions;
1456
+ /** Generate route manifest */
1457
+ generateManifest?: boolean;
1458
+ /** PWA configuration */
1459
+ pwa?: PWAOptions;
1460
+ /** Server shim options */
1461
+ serverShim?: ServerShimOptions;
1462
+ /** Standard Next.js config options (webpack, rewrites, headers, etc.) - passed through as-is */
1463
+ [key: string]: any;
1464
+ }
1465
+
1466
+ /**
1467
+ * Creates a Next.js configuration optimized for DNDev applications
1468
+ *
1469
+ * @version 0.0.1
1470
+ * @since 0.0.1
1471
+ * @author AMBROISE PARK Consulting
1472
+ */
1473
+ declare function defineNextConfig(options?: NextConfigOptions): any;
1474
+
1475
+ export { defineNextConfig };
1476
+ export type { NextConfigOptions };