@donotdev/core 0.0.17 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/next/index.d.ts CHANGED
@@ -1,761 +1,156 @@
1
1
  import * as React from 'react';
2
- import { ReactNode } from 'react';
3
2
 
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
- SUPER: 'super',
25
- } as const;
26
-
27
- /**
28
- * Type for user role names
29
- * Apps can extend this with their own custom roles
30
- *
31
- * @version 0.0.1
32
- * @since 0.0.1
33
- * @author AMBROISE PARK Consulting
34
- */
35
- type UserRole = (typeof USER_ROLES)[keyof typeof USER_ROLES] | string;
36
-
37
- // =============================================================================
38
- // Subscription Tier Constants
39
- // =============================================================================
40
-
41
- /**
42
- * Standard subscription tier names
43
- * Apps can override these by providing their own tier constants
44
- *
45
- * @version 0.0.1
46
- * @since 0.0.1
47
- * @author AMBROISE PARK Consulting
48
- */
49
- declare const SUBSCRIPTION_TIERS = {
50
- FREE: 'free',
51
- PRO: 'pro',
52
- PREMIUM: 'premium',
53
- } as const;
54
-
55
- /**
56
- * Type for subscription tier names
57
- * Apps can extend this with their own custom tiers
58
- *
59
- * @version 0.0.1
60
- * @since 0.0.1
61
- * @author AMBROISE PARK Consulting
62
- */
63
- type SubscriptionTier =
64
- | (typeof SUBSCRIPTION_TIERS)[keyof typeof SUBSCRIPTION_TIERS]
65
- | string;
66
-
67
- // packages/core/types/src/common/index.ts
68
-
69
-
70
-
71
- // =============================================================================
72
- // PLATFORM CONSTANTS
73
- // =============================================================================
74
-
75
- /**
76
- * Supported platform identifiers
77
- * @constant
78
- */
79
- declare const PLATFORMS = {
80
- VITE: 'vite',
81
- NEXTJS: 'nextjs',
82
- UNKNOWN: 'unknown',
83
- } as const;
84
-
85
- /**
86
- * Platform type derived from PLATFORMS constant
87
- */
88
- type Platform = (typeof PLATFORMS)[keyof typeof PLATFORMS];
89
-
90
- // =============================================================================
91
- // ENVIRONMENT CONSTANTS
92
- // =============================================================================
93
-
94
- /**
95
- * Supported environment modes
96
- * @constant
97
- */
98
- declare const ENVIRONMENTS = {
99
- DEVELOPMENT: 'development',
100
- PRODUCTION: 'production',
101
- TEST: 'test',
102
- } as const;
103
-
104
- /**
105
- * Environment mode type derived from ENVIRONMENTS constant
106
- */
107
- type EnvironmentMode = (typeof ENVIRONMENTS)[keyof typeof ENVIRONMENTS];
108
-
109
- // =============================================================================
110
- // CONTEXT CONSTANTS
111
- // =============================================================================
112
-
113
- /**
114
- * Supported execution contexts
115
- * @constant
116
- */
117
- declare const CONTEXTS = {
118
- CLIENT: 'client',
119
- SERVER: 'server',
120
- BUILD: 'build',
121
- } as const;
122
-
123
- /**
124
- * Context type derived from CONTEXTS constant
125
- */
126
- type Context = (typeof CONTEXTS)[keyof typeof CONTEXTS];
127
-
128
- // =============================================================================
129
- // STORAGE CONSTANTS
130
- // =============================================================================
131
-
132
- /**
133
- * Supported storage backend types
134
- * @constant
135
- */
136
- declare const STORAGE_TYPES = {
137
- LOCAL: 'localStorage',
138
- SESSION: 'sessionStorage',
139
- INDEXED_DB: 'indexedDB',
140
- MEMORY: 'memory',
141
- } as const;
142
-
143
- /**
144
- * Storage type derived from STORAGE_TYPES constant
145
- */
146
- type StorageType = (typeof STORAGE_TYPES)[keyof typeof STORAGE_TYPES];
147
-
148
- // =============================================================================
149
- // PWA CONSTANTS
150
- // =============================================================================
151
-
152
- /**
153
- * PWA display modes
154
- * @constant
155
- */
156
- declare const PWA_DISPLAY_MODES = {
157
- STANDALONE: 'standalone',
158
- FULLSCREEN: 'fullscreen',
159
- MINIMAL_UI: 'minimal-ui',
160
- BROWSER: 'browser',
161
- } as const;
162
-
163
- /**
164
- * PWA display mode type derived from PWA_DISPLAY_MODES constant
165
- */
166
- type PWADisplayMode =
167
- (typeof PWA_DISPLAY_MODES)[keyof typeof PWA_DISPLAY_MODES];
168
-
169
- /**
170
- * PWA asset types
171
- * @constant
172
- */
173
- declare const PWA_ASSET_TYPES = {
174
- MANIFEST: 'manifest',
175
- SERVICE_WORKER: 'service-worker',
176
- ICON: 'icon',
177
- } as const;
178
-
179
- /**
180
- * PWA asset type derived from PWA_ASSET_TYPES constant
181
- */
182
- type PWAAssetType =
183
- (typeof PWA_ASSET_TYPES)[keyof typeof PWA_ASSET_TYPES];
184
-
185
- // =============================================================================
186
- // ROUTE DISCOVERY CONSTANTS
187
- // =============================================================================
188
-
189
- /**
190
- * Route discovery sources
191
- * @constant
192
- */
193
- declare const ROUTE_SOURCES = {
194
- AUTO: 'auto-discovery',
195
- MANUAL: 'manual',
196
- HYBRID: 'hybrid',
197
- } as const;
198
-
199
- /**
200
- * Route source type derived from ROUTE_SOURCES constant
201
- */
202
- type RouteSource = (typeof ROUTE_SOURCES)[keyof typeof ROUTE_SOURCES];
203
-
204
- // =============================================================================
205
- // AUTHENTICATION TYPES
206
- // =============================================================================
207
-
208
- /**
209
- * Page-level authentication requirements
210
- * @description Used in PageMeta and NavigationRoute for route-level auth
211
- */
212
- type PageAuth =
213
- | boolean
214
- | {
215
- /** Whether authentication is required */
216
- required?: boolean;
217
- /** Required user role */
218
- role?: UserRole;
219
- /** Required subscription tier */
220
- tier?: SubscriptionTier;
221
- /** Custom validation function */
222
- validate?: (role: string, tier: string) => boolean;
223
- };
3
+ type $MergeBy<T, K> = Omit<T, keyof K> & K;
224
4
 
225
- // =============================================================================
226
- // PAGE METADATA TYPES
227
- // =============================================================================
5
+ type $PreservedValue<Value, Fallback> = [Value] extends [never] ? Fallback : Value;
228
6
 
229
7
  /**
230
- * Page metadata interface for route discovery and configuration
231
- *
232
- * @remarks
233
- * **ALL PROPERTIES ARE OPTIONAL** - Framework provides smart defaults:
234
- *
235
- * - `auth`: false (public) by default - YOU must specify auth requirements explicitly
236
- * - `title`: Auto-extracted from filename (ShowcasePage → "Showcase")
237
- * - `entity`: Auto-extracted from path (pages/showcase/ → "showcase")
238
- * - `action`: Auto-extracted from filename patterns (ListPage → "list", FormPage → "form")
239
- * - `route`: Only needed for custom paths or dynamic routes like :id, :slug
8
+ * This interface can be augmented by users to add types to `i18next` default TypeOptions.
240
9
  *
241
- * @example Simple page (no meta needed):
242
- * ```tsx
243
- * export function HomePage() {
244
- * return <PageContainer>...</PageContainer>;
10
+ * Usage:
11
+ * ```ts
12
+ * // i18next.d.ts
13
+ * import 'i18next';
14
+ * declare module 'i18next' {
15
+ * interface CustomTypeOptions {
16
+ * defaultNS: 'custom';
17
+ * returnNull: false;
18
+ * returnObjects: false;
19
+ * nsSeparator: ':';
20
+ * keySeparator: '.';
21
+ * compatibilityJSON: 'v4';
22
+ * allowObjectInHTMLChildren: false;
23
+ * resources: {
24
+ * custom: {
25
+ * foo: 'foo';
26
+ * };
27
+ * };
28
+ * }
245
29
  * }
246
- * // Framework provides: auth=false, title from home.title, entity=home
247
- * ```
248
- *
249
- * @example Dynamic route (string format - explicit path):
250
- * ```tsx
251
- * export const meta: PageMeta = {
252
- * route: '/blog/:slug' // Creates /blog/:slug
253
- * };
254
- * // Framework provides: auth=false, title from blog.title, entity=blog
255
- * ```
256
- *
257
- * @example Dynamic route (object format - auto-generates base path):
258
- * ```tsx
259
- * export const meta: PageMeta = {
260
- * route: { params: ['id'] } // Creates /myRoute/:id (base path from file location)
261
- * };
262
- * // For file at pages/myRoute/DetailPage.tsx → route becomes /myRoute/:id
263
- * ```
264
- *
265
- * @example Auth-required (developer must be explicit):
266
- * ```tsx
267
- * export const meta: PageMeta = {
268
- * auth: { required: true } // YOU decide what needs auth
269
- * };
270
30
  * ```
271
31
  */
272
- interface PageMeta {
273
- /** Authentication requirements for this route */
274
- auth?: PageAuth;
32
+ interface CustomTypeOptions {}
275
33
 
276
- /** Route configuration - just define the exact path you want */
277
- route?: string | { params?: string[] };
34
+ type TypeOptions = $MergeBy<
35
+ {
36
+ /** @see {InitOptions.returnNull} */
37
+ returnNull: false;
278
38
 
279
- /** Page title (optional - framework auto-extracts from filename if not provided) */
280
- title?: string;
39
+ /** @see {InitOptions.returnEmptyString} */
40
+ returnEmptyString: true;
281
41
 
282
- /**
283
- * Translation/SEO namespace for this page
284
- * @description Used for meta tags and translations
285
- */
286
- namespace?: string;
42
+ /** @see {InitOptions.returnObjects} */
43
+ returnObjects: false;
287
44
 
288
- /**
289
- * Icon for navigation (optional - framework provides smart defaults)
290
- * @description **ONLY lucide-react JSX components** - extracted as component name string at build time for tree-shaking.
291
- *
292
- * **RESTRICTIONS:**
293
- * - ✅ Only: `<Rocket />`, `<ShoppingCart />`, `<Home />` (lucide-react JSX components)
294
- * - ❌ NOT: Emojis (`"🚀"`), strings (`"Rocket"`), or custom ReactNode
295
- *
296
- * **Why?** This is for build-time extraction and tree-shaking. The component name is extracted and stored as a string.
297
- *
298
- * **For flexible icons** (emojis, strings, custom components), use the `Icon` component directly in your JSX, not in PageMeta.
299
- *
300
- * @example
301
- * ```tsx
302
- * import { Rocket } from 'lucide-react';
303
- * export const meta: PageMeta = {
304
- * icon: <Rocket /> // ✅ Correct - lucide-react component
305
- * };
306
- * ```
307
- *
308
- * @example
309
- * ```tsx
310
- * // ❌ WRONG - Don't use emojis or strings in PageMeta
311
- * export const meta: PageMeta = {
312
- * icon: "🚀" // ❌ Not supported in PageMeta
313
- * };
314
- * ```
315
- */
316
- icon?: ReactNode;
45
+ /** @see {InitOptions.keySeparator} */
46
+ keySeparator: '.';
317
47
 
318
- /**
319
- * Hide from navigation menu (default: false - shows in navigation)
320
- * @description Set to true to exclude this route from navigation menus
321
- * @default false
322
- * @example
323
- * ```tsx
324
- * export const meta: PageMeta = {
325
- * hideFromMenu: true // Won't appear in HeaderNavigation, Sidebar, etc.
326
- * };
327
- * ```
328
- */
329
- hideFromMenu?: boolean;
330
- }
48
+ /** @see {InitOptions.nsSeparator} */
49
+ nsSeparator: ':';
331
50
 
332
- /**
333
- * Route metadata (discovery-generated)
334
- * @description Complete route metadata including auto-discovered fields from RouteDiscovery
335
- *
336
- * This extends PageMeta with fields that are automatically discovered from file paths:
337
- * - `entity`: Auto-extracted from path (pages/showcase/ → "showcase")
338
- * - `action`: Auto-extracted from filename patterns (ListPage → "list", FormPage → "form")
339
- *
340
- * These fields are always present in discovered routes but cannot be set in PageMeta.
341
- *
342
- * @version 0.0.1
343
- * @since 0.0.1
344
- * @author AMBROISE PARK Consulting
345
- */
346
- interface RouteMeta extends PageMeta {
347
- /** Entity/domain grouping - auto-discovered from file path (not user-configurable) */
348
- entity?: string;
349
- /** Action type for route categorization - auto-discovered from filename patterns (not user-configurable) */
350
- action?: string | null;
351
- /** File path where route was discovered */
352
- file?: string;
353
- }
51
+ /** @see {InitOptions.pluralSeparator} */
52
+ pluralSeparator: '_';
354
53
 
355
- // =============================================================================
356
- // PLUGIN CONFIGURATION TYPES
357
- // =============================================================================
54
+ /** @see {InitOptions.contextSeparator} */
55
+ contextSeparator: '_';
358
56
 
359
- /**
360
- * i18n Plugin Configuration
361
- * @description Configuration for internationalization system
362
- */
363
- interface I18nPluginConfig {
364
- /** Mapping of language → namespace → loader function */
365
- mapping: Record<string, Record<string, () => Promise<any>>>;
366
- /** List of available language codes */
367
- languages: string[];
368
- /** List of eagerly loaded namespace identifiers */
369
- eager: string[];
370
- /** Fallback language code */
371
- fallback: string;
372
- /** Preloaded translation content (optional) */
373
- content?: Record<string, Record<string, any>>;
374
- /** Storage configuration */
375
- storage: {
376
- /** Storage backend type */
377
- type: StorageType;
378
- /** Storage key prefix */
379
- prefix: string;
380
- /** Time-to-live in seconds */
381
- ttl: number;
382
- /** Whether to encrypt stored data */
383
- encryption: boolean;
384
- /** Maximum storage size in bytes */
385
- maxSize: number;
386
- };
387
- /** Performance configuration */
388
- performance: {
389
- /** Maximum cache size */
390
- cacheSize: number;
391
- /** Error cache TTL in seconds */
392
- errorCacheTTL: number;
393
- };
394
- /** Discovery manifest metadata */
395
- manifest: {
396
- /** Total number of translation files */
397
- totalFiles: number;
398
- /** Total number of namespaces */
399
- totalNamespaces: number;
400
- /** Total number of languages */
401
- totalLanguages: number;
402
- /** Number of eagerly loaded namespaces */
403
- eagerNamespaces: number;
404
- /** ISO timestamp of generation */
405
- generatedAt: string;
406
- };
407
- /** Whether debug mode is enabled */
408
- debug: boolean;
409
- }
57
+ /** @see {InitOptions.defaultNS} */
58
+ defaultNS: 'translation';
410
59
 
411
- /**
412
- * Routes Plugin Configuration
413
- * @description Complete route configuration populated by discovery system
414
- */
415
- interface RoutesPluginConfig {
416
- /**
417
- * Array of discovered routes
418
- * @description All routes discovered by the route discovery system
419
- */
420
- mapping: Array<{
421
- /**
422
- * URL path for the route (platform-agnostic)
423
- * @description The URL path that users see in their browser
424
- * @example '/showcase/layouts', '/users/:id', '/dashboard'
425
- */
426
- path: string;
60
+ /** @see {InitOptions.fallbackNS} */
61
+ fallbackNS: false;
427
62
 
428
- /**
429
- * Lazy component reference (Vite-specific)
430
- * @description React.lazy() component for code splitting
431
- * @example lazy(() => import("/src/pages/showcase/LayoutsPage"))
432
- */
433
- component: any;
63
+ /** @see {InitOptions.compatibilityJSON} */
64
+ compatibilityJSON: 'v4';
65
+
66
+ /** @see {InitOptions.resources} */
67
+ resources: object;
434
68
 
435
69
  /**
436
- * Absolute file system path (Next.js-specific)
437
- * @description The absolute path to the component file
438
- * @example '/src/pages/showcase/LayoutsPage.tsx'
70
+ * Flag that allows HTML elements to receive objects. This is only useful for React applications
71
+ * where you pass objects to HTML elements so they can be replaced to their respective interpolation
72
+ * values (mostly with Trans component)
439
73
  */
440
- importPath: string;
74
+ allowObjectInHTMLChildren: false;
441
75
 
442
76
  /**
443
- * Export name for named exports
444
- * @example 'HomePage', 'AboutPage'
77
+ * Flag that enables strict key checking even if a `defaultValue` has been provided.
78
+ * This ensures all calls of `t` function don't accidentally use implicitly missing keys.
445
79
  */
446
- exportName?: string;
80
+ strictKeyChecks: false;
447
81
 
448
82
  /**
449
- * Authentication configuration (platform-agnostic)
450
- * @description Defines whether the route requires authentication
83
+ * Prefix for interpolation
451
84
  */
452
- auth: PageAuth;
85
+ interpolationPrefix: '{{';
453
86
 
454
87
  /**
455
- * Route metadata (platform-agnostic)
456
- * @description Additional information about the route, including auto-discovered fields
88
+ * Suffix for interpolation
457
89
  */
458
- meta: RouteMeta;
459
- }>;
460
-
461
- /**
462
- * Discovery metadata and statistics
463
- * @description Information about the route discovery process
464
- */
465
- manifest: {
466
- /** Total number of discovered routes */
467
- totalRoutes: number;
468
- /** Number of routes requiring authentication */
469
- authRequired: number;
470
- /** Number of public routes */
471
- publicRoutes: number;
472
- /** Source of routes (auto-discovery vs manual) */
473
- source: RouteSource;
474
- /** ISO timestamp when routes were generated */
475
- generatedAt: string;
476
- };
477
- }
478
-
479
- /**
480
- * Themes Plugin Configuration
481
- * @description Configuration for theme discovery and management
482
- */
483
- interface ThemesPluginConfig {
484
- /** Mapping of theme names to theme configurations */
485
- mapping: Record<string, any>;
486
- /** Array of discovered themes */
487
- discovered: Array<{
488
- /** Theme identifier */
489
- name: string;
490
- /** Human-readable theme name */
491
- displayName: string;
492
- /** Whether this is a dark theme */
493
- isDark: boolean;
494
- /** Theme metadata */
495
- meta: {
496
- /** Icon identifier */
497
- icon: string;
498
- /** Theme description */
499
- description?: string;
500
- /** Theme category */
501
- category?: string;
502
- /** Theme author */
503
- author?: string;
504
- /** Additional metadata */
505
- [key: string]: any;
506
- };
507
- /** Source file path */
508
- source: string;
509
- /** Whether theme is essential (cannot be disabled) */
510
- essential: boolean;
511
- }>;
512
- /** CSS custom property variables */
513
- variables: Record<string, string>;
514
- /** Utility class mappings */
515
- utilities: Record<string, Record<string, string>>;
516
- /** Discovery manifest metadata */
517
- manifest: {
518
- /** Total number of discovered themes */
519
- totalThemes: number;
520
- /** Total number of CSS variables */
521
- totalVariables: number;
522
- /** Total number of utility classes */
523
- totalUtilities: number;
524
- /** ISO timestamp of generation */
525
- generatedAt: string;
526
- };
527
- }
528
-
529
- /**
530
- * Assets Plugin Configuration
531
- * @description Configuration for static asset management
532
- */
533
- interface AssetsPluginConfig {
534
- /** Mapping of asset paths to asset metadata */
535
- mapping: Record<string, any>;
536
- /** SVG content of logo.svg for inline rendering with CSS variable theming */
537
- logoSvgContent?: string | null;
538
- /** Discovery manifest metadata */
539
- manifest: {
540
- /** Total number of discovered assets */
541
- totalAssets: number;
542
- /** ISO timestamp of generation */
543
- generatedAt: string;
544
- };
545
- }
546
-
547
- /**
548
- * PWA Plugin Configuration
549
- * @description Configuration for Progressive Web App features
550
- */
551
- interface PWAPluginConfig {
552
- /** Array of PWA assets */
553
- assets: Array<{
554
- /** Type of PWA asset */
555
- type: PWAAssetType;
556
- /** Asset file path */
557
- path: string;
558
- /** Asset file size in bytes */
559
- size?: number;
560
- /** Asset content (for inline assets) */
561
- content?: any;
562
- /** Asset format (for images) */
563
- format?: string;
564
- /** Asset purpose (for icons) */
565
- purpose?: string;
566
- }>;
567
- /** PWA manifest configuration */
568
- manifest: {
569
- /** Application name */
570
- name: string;
571
- /** Short application name */
572
- short_name: string;
573
- /** Application description */
574
- description: string;
575
- /** Start URL */
576
- start_url: string;
577
- /** Display mode */
578
- display: PWADisplayMode;
579
- /** Background color */
580
- background_color: string;
581
- /** Theme color */
582
- theme_color: string;
583
- /** Array of app icons */
584
- icons: Array<{
585
- /** Icon source path */
586
- src: string;
587
- /** Icon sizes (e.g., '192x192') */
588
- sizes: string;
589
- /** Icon MIME type */
590
- type: string;
591
- /** Icon purpose (e.g., 'any', 'maskable') */
592
- purpose: string;
593
- }>;
594
- };
595
- /** Discovery manifest metadata */
596
- manifestInfo: {
597
- /** Total number of PWA assets */
598
- totalAssets: number;
599
- /** Total number of icons */
600
- totalIcons: number;
601
- /** Whether service worker is present */
602
- hasServiceWorker: boolean;
603
- /** ISO timestamp of generation */
604
- generatedAt: string;
605
- };
606
- }
607
-
608
- /**
609
- * Features Plugin Configuration
610
- * @description Configuration for feature discovery and enablement
611
- *
612
- * @remarks
613
- * This interface defines the structure for feature discovery data that is populated
614
- * at build time and made available at runtime for feature availability checking.
615
- *
616
- * @example
617
- * ```typescript
618
- * // Generated by feature discovery system
619
- * const featuresConfig: FeaturesPluginConfig = {
620
- * available: ['auth', 'billing', 'i18n', 'oauth'],
621
- * enabled: ['auth', 'i18n'],
622
- * overridden: false
623
- * };
624
- * ```
625
- */
626
- interface FeaturesPluginConfig {
627
- /**
628
- * List of all available features discovered in packages/features/
629
- * @example ['auth', 'billing', 'i18n', 'oauth']
630
- */
631
- available: string[];
632
- }
633
-
634
- // =============================================================================
635
- // FRAMEWORK CONFIGURATION
636
- // =============================================================================
90
+ interpolationSuffix: '}}';
637
91
 
638
- /**
639
- * Complete DoNotDev framework configuration structure
640
- * @description Single source of truth for all framework configuration
641
- *
642
- * @remarks
643
- * All discovery plugins add their data to this unified config.
644
- * Available at runtime via globalThis._DNDEV_CONFIG_ or window._DNDEV_CONFIG_
645
- */
646
- interface DndevFrameworkConfig {
647
- /** Framework platform (Vite or Next.js) */
648
- platform: Platform;
649
- /** Current environment mode */
650
- mode: EnvironmentMode;
651
- /** Framework version */
652
- version: string;
653
- /** Execution context */
654
- context: Context;
655
- /** Unix timestamp of config generation */
656
- timestamp: number;
657
- /** i18n plugin configuration (optional) */
658
- i18n?: I18nPluginConfig;
659
- /** Routes plugin configuration (optional) */
660
- routes?: RoutesPluginConfig;
661
- /** Themes plugin configuration (optional) */
662
- themes?: ThemesPluginConfig;
663
- /** Assets plugin configuration (optional) */
664
- assets?: AssetsPluginConfig;
665
- /** PWA plugin configuration (optional) */
666
- pwa?: PWAPluginConfig;
667
- /** Features plugin configuration (optional) */
668
- features?: FeaturesPluginConfig;
669
- /** Environment variables (VITE_* variables from .env files) */
670
- env?: Record<string, string>;
671
- }
92
+ /** @see {InterpolationOptions.unescapePrefix} */
93
+ unescapePrefix: '-';
672
94
 
673
- // =============================================================================
674
- // GLOBAL AUGMENTATIONS
675
- // =============================================================================
95
+ /** @see {InterpolationOptions.unescapeSuffix} */
96
+ unescapeSuffix: '';
676
97
 
677
- declare global {
678
- interface Window {
679
98
  /**
680
- * Single source of truth for all DoNotDev framework configuration
681
- * @description Set by platform detection and populated by discovery plugins
99
+ * Use a proxy-based selector to select a translation.
100
+ *
101
+ * Enables features like go-to definition, and better DX/faster autocompletion
102
+ * for TypeScript developers.
103
+ *
104
+ * If you're working with an especially large set of translations and aren't
105
+ * using context, you set `enableSelector` to `"optimize"` and i18next won't do
106
+ * any type-level processing of your translations at all.
107
+ *
108
+ * With `enableSelector` set to `"optimize"`, i18next is capable of supporting
109
+ * arbitrarily large/deep translation sets without causing any IDE slowdown
110
+ * whatsoever.
111
+ *
112
+ * @default false
682
113
  */
683
- _DNDEV_CONFIG_?: DndevFrameworkConfig;
114
+ enableSelector: false;
115
+ },
116
+ CustomTypeOptions
117
+ >;
684
118
 
685
- /**
686
- * Global store registry for singleton Zustand stores
687
- * @description Ensures single instance across code-split chunks
688
- */
689
- _DNDEV_STORES_?: Record<string, any>;
119
+ type FlatNamespace = $PreservedValue<keyof TypeOptions['resources'], string>;
120
+ type Namespace<T = FlatNamespace> = T | readonly T[];
690
121
 
691
- /** PapaParse CSV parser library (external) */
692
- Papa?: {
693
- parse: (input: string | File, config?: any) => any;
694
- unparse: (data: any[], config?: any) => string;
695
- };
122
+ interface ReportNamespaces {
123
+ addUsedNamespaces(namespaces: Namespace): void;
124
+ getUsedNamespaces(): string[];
125
+ }
696
126
 
697
- /** Sentry error tracking library (external) */
698
- Sentry?: {
699
- captureException: (error: unknown) => void;
700
- withScope: (callback: (scope: any) => void) => void;
701
- getClient: () => { close: () => Promise<boolean> } | undefined;
702
- };
127
+ declare module 'i18next' {
128
+ // interface i18n {
129
+ // reportNamespaces?: ReportNamespaces;
130
+ // }
131
+ interface CustomInstanceExtensions {
132
+ reportNamespaces?: ReportNamespaces;
133
+ }
134
+ }
703
135
 
704
- /**
705
- * Google APIs (Maps, One Tap, etc.)
706
- * @description Unified type for all Google services
707
- */
708
- google?: {
709
- /** Google Maps API */
710
- maps?: {
711
- places?: {
712
- AutocompleteService: new () => any;
713
- PlacesService: new (element: HTMLElement) => any;
714
- PlacesServiceStatus: {
715
- OK: string;
716
- };
717
- };
718
- [key: string]: any;
719
- };
720
- /** Google Identity Services (One Tap) */
721
- accounts?: {
722
- id?: {
723
- initialize: (config: any) => void;
724
- prompt: (callback?: (notification: any) => void) => void;
725
- cancel?: () => void;
726
- disableAutoSelect?: () => void;
727
- };
728
- };
729
- [key: string]: any;
730
- };
136
+ type ObjectOrNever = TypeOptions['allowObjectInHTMLChildren'] extends true
137
+ ? Record<string, unknown>
138
+ : never;
731
139
 
732
- /** FedCM Identity Credential API */
733
- IdentityCredential?: any;
734
- }
140
+ type ReactI18NextChildren = React.ReactNode | ObjectOrNever;
735
141
 
736
- namespace NodeJS {
737
- interface ProcessEnv {
738
- /** Serialized framework config for Node.js environment */
739
- _DNDEV_CONFIG_?: string;
142
+ declare module 'react' {
143
+ namespace JSX {
144
+ interface IntrinsicAttributes {
145
+ i18nIsDynamicList?: boolean;
740
146
  }
741
147
  }
742
148
 
743
- namespace globalThis {
744
- /** Framework configuration (same as window._DNDEV_CONFIG_) */
745
- var _DNDEV_CONFIG_: DndevFrameworkConfig | undefined;
746
- /** Store registry (same as window._DNDEV_STORES_) */
747
- var _DNDEV_STORES_: Record<string, any> | undefined;
748
-
749
- // Third-party framework globals (not owned by DoNotDev)
750
- var __vite_plugin_react_preamble_installed__: boolean | undefined;
751
- var __vite_hmr_port: number | undefined;
752
- var __NEXT_DATA__: any | undefined;
753
- var __REACT_QUERY_CLIENT__: any | undefined;
754
- var __REACT_QUERY_PROVIDER__: any | undefined;
755
- var __DNDEV_DEBUG: boolean | undefined;
756
- var __FIREBASE_DEMO_MODE__: boolean | undefined;
757
- // gc is already defined by Node.js globals - removed to avoid TS 5.9+ conflict
758
- var getAvailableThemes: (() => string[]) | undefined;
149
+ interface HTMLAttributes<T> {
150
+ // This union is inspired by the typings for React.ReactNode. We do this to fix "This JSX tag's 'children' prop
151
+ // expects a single child of type 'ReactI18NextChildren', but multiple children were provided":
152
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/5a1e9f91ed0143adede394adb3f540e650455f71/types/react/index.d.ts#L268
153
+ children?: ReactI18NextChildren | Iterable<ReactI18NextChildren>;
759
154
  }
760
155
  }
761
156
 
@@ -777,9 +172,6 @@ interface AppMetadata {
777
172
  /** Short application name for mobile/compact displays (defaults to name if not set) */
778
173
  shortName?: string;
779
174
 
780
- /** Application URL (base URL for production, defaults to localhost in development) */
781
- url?: string;
782
-
783
175
  /** Application description */
784
176
  description?: string;
785
177
 
@@ -925,7 +317,7 @@ interface AuthConfig {
925
317
  interface SEOConfig {
926
318
  /** Enable automatic SEO (default: true) */
927
319
  enabled?: boolean;
928
- /** Base URL for SEO files (robots.txt, sitemap.xml) - defaults to appConfig.app.url (set at build time) */
320
+ /** Base URL for SEO files (robots.txt, sitemap.xml) - reads from VITE_APP_URL/NEXT_PUBLIC_APP_URL env var */
929
321
  baseUrl?: string;
930
322
  /** Site name for SEO - defaults to APP_NAME from app.ts */
931
323
  siteName?: string;
@@ -1142,160 +534,6 @@ interface AppConfig {
1142
534
  query?: QueryConfig;
1143
535
  }
1144
536
 
1145
- type $MergeBy<T, K> = Omit<T, keyof K> & K;
1146
-
1147
- type $PreservedValue<Value, Fallback> = [Value] extends [never] ? Fallback : Value;
1148
-
1149
- /**
1150
- * This interface can be augmented by users to add types to `i18next` default TypeOptions.
1151
- *
1152
- * Usage:
1153
- * ```ts
1154
- * // i18next.d.ts
1155
- * import 'i18next';
1156
- * declare module 'i18next' {
1157
- * interface CustomTypeOptions {
1158
- * defaultNS: 'custom';
1159
- * returnNull: false;
1160
- * returnObjects: false;
1161
- * nsSeparator: ':';
1162
- * keySeparator: '.';
1163
- * compatibilityJSON: 'v4';
1164
- * allowObjectInHTMLChildren: false;
1165
- * resources: {
1166
- * custom: {
1167
- * foo: 'foo';
1168
- * };
1169
- * };
1170
- * }
1171
- * }
1172
- * ```
1173
- */
1174
- interface CustomTypeOptions {}
1175
-
1176
- type TypeOptions = $MergeBy<
1177
- {
1178
- /** @see {InitOptions.returnNull} */
1179
- returnNull: false;
1180
-
1181
- /** @see {InitOptions.returnEmptyString} */
1182
- returnEmptyString: true;
1183
-
1184
- /** @see {InitOptions.returnObjects} */
1185
- returnObjects: false;
1186
-
1187
- /** @see {InitOptions.keySeparator} */
1188
- keySeparator: '.';
1189
-
1190
- /** @see {InitOptions.nsSeparator} */
1191
- nsSeparator: ':';
1192
-
1193
- /** @see {InitOptions.pluralSeparator} */
1194
- pluralSeparator: '_';
1195
-
1196
- /** @see {InitOptions.contextSeparator} */
1197
- contextSeparator: '_';
1198
-
1199
- /** @see {InitOptions.defaultNS} */
1200
- defaultNS: 'translation';
1201
-
1202
- /** @see {InitOptions.fallbackNS} */
1203
- fallbackNS: false;
1204
-
1205
- /** @see {InitOptions.compatibilityJSON} */
1206
- compatibilityJSON: 'v4';
1207
-
1208
- /** @see {InitOptions.resources} */
1209
- resources: object;
1210
-
1211
- /**
1212
- * Flag that allows HTML elements to receive objects. This is only useful for React applications
1213
- * where you pass objects to HTML elements so they can be replaced to their respective interpolation
1214
- * values (mostly with Trans component)
1215
- */
1216
- allowObjectInHTMLChildren: false;
1217
-
1218
- /**
1219
- * Flag that enables strict key checking even if a `defaultValue` has been provided.
1220
- * This ensures all calls of `t` function don't accidentally use implicitly missing keys.
1221
- */
1222
- strictKeyChecks: false;
1223
-
1224
- /**
1225
- * Prefix for interpolation
1226
- */
1227
- interpolationPrefix: '{{';
1228
-
1229
- /**
1230
- * Suffix for interpolation
1231
- */
1232
- interpolationSuffix: '}}';
1233
-
1234
- /** @see {InterpolationOptions.unescapePrefix} */
1235
- unescapePrefix: '-';
1236
-
1237
- /** @see {InterpolationOptions.unescapeSuffix} */
1238
- unescapeSuffix: '';
1239
-
1240
- /**
1241
- * Use a proxy-based selector to select a translation.
1242
- *
1243
- * Enables features like go-to definition, and better DX/faster autocompletion
1244
- * for TypeScript developers.
1245
- *
1246
- * If you're working with an especially large set of translations and aren't
1247
- * using context, you set `enableSelector` to `"optimize"` and i18next won't do
1248
- * any type-level processing of your translations at all.
1249
- *
1250
- * With `enableSelector` set to `"optimize"`, i18next is capable of supporting
1251
- * arbitrarily large/deep translation sets without causing any IDE slowdown
1252
- * whatsoever.
1253
- *
1254
- * @default false
1255
- */
1256
- enableSelector: false;
1257
- },
1258
- CustomTypeOptions
1259
- >;
1260
-
1261
- type FlatNamespace = $PreservedValue<keyof TypeOptions['resources'], string>;
1262
- type Namespace<T = FlatNamespace> = T | readonly T[];
1263
-
1264
- interface ReportNamespaces {
1265
- addUsedNamespaces(namespaces: Namespace): void;
1266
- getUsedNamespaces(): string[];
1267
- }
1268
-
1269
- declare module 'i18next' {
1270
- // interface i18n {
1271
- // reportNamespaces?: ReportNamespaces;
1272
- // }
1273
- interface CustomInstanceExtensions {
1274
- reportNamespaces?: ReportNamespaces;
1275
- }
1276
- }
1277
-
1278
- type ObjectOrNever = TypeOptions['allowObjectInHTMLChildren'] extends true
1279
- ? Record<string, unknown>
1280
- : never;
1281
-
1282
- type ReactI18NextChildren = React.ReactNode | ObjectOrNever;
1283
-
1284
- declare module 'react' {
1285
- namespace JSX {
1286
- interface IntrinsicAttributes {
1287
- i18nIsDynamicList?: boolean;
1288
- }
1289
- }
1290
-
1291
- interface HTMLAttributes<T> {
1292
- // This union is inspired by the typings for React.ReactNode. We do this to fix "This JSX tag's 'children' prop
1293
- // expects a single child of type 'ReactI18NextChildren', but multiple children were provided":
1294
- // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/5a1e9f91ed0143adede394adb3f540e650455f71/types/react/index.d.ts#L268
1295
- children?: ReactI18NextChildren | Iterable<ReactI18NextChildren>;
1296
- }
1297
- }
1298
-
1299
537
  /**
1300
538
  * I18n virtual mapping options
1301
539
  *
@@ -1366,6 +604,11 @@ interface I18nOptions extends BaseDiscoveryOptions {
1366
604
  fallbackLanguage?: string;
1367
605
  namespaces?: string[];
1368
606
  virtualMapping?: I18nVirtualMappingOptions;
607
+ /** Additional locale paths from workspace packages (e.g., shared entities) */
608
+ /** Paths are relative to app root. Useful for custom shared translation locations. */
609
+ /** Example: ['../../packages/shared/locales'] */
610
+ /** Note: '../../entities/locales' is auto-detected by default, no config needed */
611
+ additionalPaths?: string[];
1369
612
  }
1370
613
 
1371
614
  /**
@@ -1416,11 +659,11 @@ interface PWAOptions {
1416
659
  runtimeCaching?: Array<{
1417
660
  urlPattern: RegExp | ((options: { request: Request }) => boolean);
1418
661
  handler:
1419
- | 'CacheFirst'
1420
- | 'NetworkFirst'
1421
- | 'StaleWhileRevalidate'
1422
- | 'NetworkOnly'
1423
- | 'CacheOnly';
662
+ | 'CacheFirst'
663
+ | 'NetworkFirst'
664
+ | 'StaleWhileRevalidate'
665
+ | 'NetworkOnly'
666
+ | 'CacheOnly';
1424
667
  options?: Record<string, any>;
1425
668
  }>;
1426
669
  /** Navigation fallback URL (default: '/') */
@@ -1436,15 +679,15 @@ interface PWAOptions {
1436
679
  >;
1437
680
  /** Background sync configuration for offline actions */
1438
681
  backgroundSync?:
1439
- | {
1440
- /** Queue name for background sync (default: 'background-sync-queue') */
1441
- queueName?: string;
1442
- /** Maximum retention time in minutes (default: 24 * 60) */
1443
- maxRetentionTime?: number;
1444
- /** URL pattern for background sync routes (default: matches /api/ routes) */
1445
- urlPattern?: RegExp | ((options: { request: Request }) => boolean);
1446
- }
1447
- | false;
682
+ | {
683
+ /** Queue name for background sync (default: 'background-sync-queue') */
684
+ queueName?: string;
685
+ /** Maximum retention time in minutes (default: 24 * 60) */
686
+ maxRetentionTime?: number;
687
+ /** URL pattern for background sync routes (default: matches /api/ routes) */
688
+ urlPattern?: RegExp | ((options: { request: Request }) => boolean);
689
+ }
690
+ | false;
1448
691
  [key: string]: any; // Allow other workbox options
1449
692
  };
1450
693
  }