@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.
@@ -1,1452 +1,5 @@
1
+ import { BuildOptions } from 'esbuild';
1
2
  import * as React from 'react';
2
- import { ReactNode } from 'react';
3
-
4
- type Platform$1 = 'browser' | 'node' | 'neutral'
5
- type Format = 'iife' | 'cjs' | 'esm'
6
- type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx'
7
- type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent'
8
- type Charset = 'ascii' | 'utf8'
9
- type Drop = 'console' | 'debugger'
10
- type AbsPaths = 'code' | 'log' | 'metafile'
11
-
12
- interface CommonOptions {
13
- /** Documentation: https://esbuild.github.io/api/#sourcemap */
14
- sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both'
15
- /** Documentation: https://esbuild.github.io/api/#legal-comments */
16
- legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external'
17
- /** Documentation: https://esbuild.github.io/api/#source-root */
18
- sourceRoot?: string
19
- /** Documentation: https://esbuild.github.io/api/#sources-content */
20
- sourcesContent?: boolean
21
-
22
- /** Documentation: https://esbuild.github.io/api/#format */
23
- format?: Format
24
- /** Documentation: https://esbuild.github.io/api/#global-name */
25
- globalName?: string
26
- /** Documentation: https://esbuild.github.io/api/#target */
27
- target?: string | string[]
28
- /** Documentation: https://esbuild.github.io/api/#supported */
29
- supported?: Record<string, boolean>
30
- /** Documentation: https://esbuild.github.io/api/#platform */
31
- platform?: Platform$1
32
-
33
- /** Documentation: https://esbuild.github.io/api/#mangle-props */
34
- mangleProps?: RegExp
35
- /** Documentation: https://esbuild.github.io/api/#mangle-props */
36
- reserveProps?: RegExp
37
- /** Documentation: https://esbuild.github.io/api/#mangle-props */
38
- mangleQuoted?: boolean
39
- /** Documentation: https://esbuild.github.io/api/#mangle-props */
40
- mangleCache?: Record<string, string | false>
41
- /** Documentation: https://esbuild.github.io/api/#drop */
42
- drop?: Drop[]
43
- /** Documentation: https://esbuild.github.io/api/#drop-labels */
44
- dropLabels?: string[]
45
- /** Documentation: https://esbuild.github.io/api/#minify */
46
- minify?: boolean
47
- /** Documentation: https://esbuild.github.io/api/#minify */
48
- minifyWhitespace?: boolean
49
- /** Documentation: https://esbuild.github.io/api/#minify */
50
- minifyIdentifiers?: boolean
51
- /** Documentation: https://esbuild.github.io/api/#minify */
52
- minifySyntax?: boolean
53
- /** Documentation: https://esbuild.github.io/api/#line-limit */
54
- lineLimit?: number
55
- /** Documentation: https://esbuild.github.io/api/#charset */
56
- charset?: Charset
57
- /** Documentation: https://esbuild.github.io/api/#tree-shaking */
58
- treeShaking?: boolean
59
- /** Documentation: https://esbuild.github.io/api/#ignore-annotations */
60
- ignoreAnnotations?: boolean
61
-
62
- /** Documentation: https://esbuild.github.io/api/#jsx */
63
- jsx?: 'transform' | 'preserve' | 'automatic'
64
- /** Documentation: https://esbuild.github.io/api/#jsx-factory */
65
- jsxFactory?: string
66
- /** Documentation: https://esbuild.github.io/api/#jsx-fragment */
67
- jsxFragment?: string
68
- /** Documentation: https://esbuild.github.io/api/#jsx-import-source */
69
- jsxImportSource?: string
70
- /** Documentation: https://esbuild.github.io/api/#jsx-development */
71
- jsxDev?: boolean
72
- /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */
73
- jsxSideEffects?: boolean
74
-
75
- /** Documentation: https://esbuild.github.io/api/#define */
76
- define?: { [key: string]: string }
77
- /** Documentation: https://esbuild.github.io/api/#pure */
78
- pure?: string[]
79
- /** Documentation: https://esbuild.github.io/api/#keep-names */
80
- keepNames?: boolean
81
-
82
- /** Documentation: https://esbuild.github.io/api/#abs-paths */
83
- absPaths?: AbsPaths[]
84
- /** Documentation: https://esbuild.github.io/api/#color */
85
- color?: boolean
86
- /** Documentation: https://esbuild.github.io/api/#log-level */
87
- logLevel?: LogLevel
88
- /** Documentation: https://esbuild.github.io/api/#log-limit */
89
- logLimit?: number
90
- /** Documentation: https://esbuild.github.io/api/#log-override */
91
- logOverride?: Record<string, LogLevel>
92
-
93
- /** Documentation: https://esbuild.github.io/api/#tsconfig-raw */
94
- tsconfigRaw?: string | TsconfigRaw
95
- }
96
-
97
- interface TsconfigRaw {
98
- compilerOptions?: {
99
- alwaysStrict?: boolean
100
- baseUrl?: string
101
- experimentalDecorators?: boolean
102
- importsNotUsedAsValues?: 'remove' | 'preserve' | 'error'
103
- jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev'
104
- jsxFactory?: string
105
- jsxFragmentFactory?: string
106
- jsxImportSource?: string
107
- paths?: Record<string, string[]>
108
- preserveValueImports?: boolean
109
- strict?: boolean
110
- target?: string
111
- useDefineForClassFields?: boolean
112
- verbatimModuleSyntax?: boolean
113
- }
114
- }
115
-
116
- interface BuildOptions extends CommonOptions {
117
- /** Documentation: https://esbuild.github.io/api/#bundle */
118
- bundle?: boolean
119
- /** Documentation: https://esbuild.github.io/api/#splitting */
120
- splitting?: boolean
121
- /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */
122
- preserveSymlinks?: boolean
123
- /** Documentation: https://esbuild.github.io/api/#outfile */
124
- outfile?: string
125
- /** Documentation: https://esbuild.github.io/api/#metafile */
126
- metafile?: boolean
127
- /** Documentation: https://esbuild.github.io/api/#outdir */
128
- outdir?: string
129
- /** Documentation: https://esbuild.github.io/api/#outbase */
130
- outbase?: string
131
- /** Documentation: https://esbuild.github.io/api/#external */
132
- external?: string[]
133
- /** Documentation: https://esbuild.github.io/api/#packages */
134
- packages?: 'bundle' | 'external'
135
- /** Documentation: https://esbuild.github.io/api/#alias */
136
- alias?: Record<string, string>
137
- /** Documentation: https://esbuild.github.io/api/#loader */
138
- loader?: { [ext: string]: Loader }
139
- /** Documentation: https://esbuild.github.io/api/#resolve-extensions */
140
- resolveExtensions?: string[]
141
- /** Documentation: https://esbuild.github.io/api/#main-fields */
142
- mainFields?: string[]
143
- /** Documentation: https://esbuild.github.io/api/#conditions */
144
- conditions?: string[]
145
- /** Documentation: https://esbuild.github.io/api/#write */
146
- write?: boolean
147
- /** Documentation: https://esbuild.github.io/api/#allow-overwrite */
148
- allowOverwrite?: boolean
149
- /** Documentation: https://esbuild.github.io/api/#tsconfig */
150
- tsconfig?: string
151
- /** Documentation: https://esbuild.github.io/api/#out-extension */
152
- outExtension?: { [ext: string]: string }
153
- /** Documentation: https://esbuild.github.io/api/#public-path */
154
- publicPath?: string
155
- /** Documentation: https://esbuild.github.io/api/#entry-names */
156
- entryNames?: string
157
- /** Documentation: https://esbuild.github.io/api/#chunk-names */
158
- chunkNames?: string
159
- /** Documentation: https://esbuild.github.io/api/#asset-names */
160
- assetNames?: string
161
- /** Documentation: https://esbuild.github.io/api/#inject */
162
- inject?: string[]
163
- /** Documentation: https://esbuild.github.io/api/#banner */
164
- banner?: { [type: string]: string }
165
- /** Documentation: https://esbuild.github.io/api/#footer */
166
- footer?: { [type: string]: string }
167
- /** Documentation: https://esbuild.github.io/api/#entry-points */
168
- entryPoints?: (string | { in: string, out: string })[] | Record<string, string>
169
- /** Documentation: https://esbuild.github.io/api/#stdin */
170
- stdin?: StdinOptions
171
- /** Documentation: https://esbuild.github.io/plugins/ */
172
- plugins?: Plugin[]
173
- /** Documentation: https://esbuild.github.io/api/#working-directory */
174
- absWorkingDir?: string
175
- /** Documentation: https://esbuild.github.io/api/#node-paths */
176
- nodePaths?: string[]; // The "NODE_PATH" variable from Node.js
177
- }
178
-
179
- interface StdinOptions {
180
- contents: string | Uint8Array
181
- resolveDir?: string
182
- sourcefile?: string
183
- loader?: Loader
184
- }
185
-
186
- interface Message {
187
- id: string
188
- pluginName: string
189
- text: string
190
- location: Location | null
191
- notes: Note[]
192
-
193
- /**
194
- * Optional user-specified data that is passed through unmodified. You can
195
- * use this to stash the original error, for example.
196
- */
197
- detail: any
198
- }
199
-
200
- interface Note {
201
- text: string
202
- location: Location | null
203
- }
204
-
205
- interface Location {
206
- file: string
207
- namespace: string
208
- /** 1-based */
209
- line: number
210
- /** 0-based, in bytes */
211
- column: number
212
- /** in bytes */
213
- length: number
214
- lineText: string
215
- suggestion: string
216
- }
217
-
218
- interface OutputFile {
219
- path: string
220
- contents: Uint8Array
221
- hash: string
222
- /** "contents" as text (changes automatically with "contents") */
223
- readonly text: string
224
- }
225
-
226
- interface BuildResult<ProvidedOptions extends BuildOptions = BuildOptions> {
227
- errors: Message[]
228
- warnings: Message[]
229
- /** Only when "write: false" */
230
- outputFiles: OutputFile[] | (ProvidedOptions['write'] extends false ? never : undefined)
231
- /** Only when "metafile: true" */
232
- metafile: Metafile | (ProvidedOptions['metafile'] extends true ? never : undefined)
233
- /** Only when "mangleCache" is present */
234
- mangleCache: Record<string, string | false> | (ProvidedOptions['mangleCache'] extends Object ? never : undefined)
235
- }
236
-
237
- /** Documentation: https://esbuild.github.io/api/#serve-arguments */
238
- interface ServeOptions {
239
- port?: number
240
- host?: string
241
- servedir?: string
242
- keyfile?: string
243
- certfile?: string
244
- fallback?: string
245
- cors?: CORSOptions
246
- onRequest?: (args: ServeOnRequestArgs) => void
247
- }
248
-
249
- /** Documentation: https://esbuild.github.io/api/#cors */
250
- interface CORSOptions {
251
- origin?: string | string[]
252
- }
253
-
254
- interface ServeOnRequestArgs {
255
- remoteAddress: string
256
- method: string
257
- path: string
258
- status: number
259
- /** The time to generate the response, not to send it */
260
- timeInMS: number
261
- }
262
-
263
- /** Documentation: https://esbuild.github.io/api/#serve-return-values */
264
- interface ServeResult {
265
- port: number
266
- hosts: string[]
267
- }
268
-
269
- interface TransformOptions extends CommonOptions {
270
- /** Documentation: https://esbuild.github.io/api/#sourcefile */
271
- sourcefile?: string
272
- /** Documentation: https://esbuild.github.io/api/#loader */
273
- loader?: Loader
274
- /** Documentation: https://esbuild.github.io/api/#banner */
275
- banner?: string
276
- /** Documentation: https://esbuild.github.io/api/#footer */
277
- footer?: string
278
- }
279
-
280
- interface TransformResult<ProvidedOptions extends TransformOptions = TransformOptions> {
281
- code: string
282
- map: string
283
- warnings: Message[]
284
- /** Only when "mangleCache" is present */
285
- mangleCache: Record<string, string | false> | (ProvidedOptions['mangleCache'] extends Object ? never : undefined)
286
- /** Only when "legalComments" is "external" */
287
- legalComments: string | (ProvidedOptions['legalComments'] extends 'external' ? never : undefined)
288
- }
289
-
290
- interface Plugin {
291
- name: string
292
- setup: (build: PluginBuild) => (void | Promise<void>)
293
- }
294
-
295
- interface PluginBuild {
296
- /** Documentation: https://esbuild.github.io/plugins/#build-options */
297
- initialOptions: BuildOptions
298
-
299
- /** Documentation: https://esbuild.github.io/plugins/#resolve */
300
- resolve(path: string, options?: ResolveOptions): Promise<ResolveResult>
301
-
302
- /** Documentation: https://esbuild.github.io/plugins/#on-start */
303
- onStart(callback: () =>
304
- (OnStartResult | null | void | Promise<OnStartResult | null | void>)): void
305
-
306
- /** Documentation: https://esbuild.github.io/plugins/#on-end */
307
- onEnd(callback: (result: BuildResult) =>
308
- (OnEndResult | null | void | Promise<OnEndResult | null | void>)): void
309
-
310
- /** Documentation: https://esbuild.github.io/plugins/#on-resolve */
311
- onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) =>
312
- (OnResolveResult | null | undefined | Promise<OnResolveResult | null | undefined>)): void
313
-
314
- /** Documentation: https://esbuild.github.io/plugins/#on-load */
315
- onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) =>
316
- (OnLoadResult | null | undefined | Promise<OnLoadResult | null | undefined>)): void
317
-
318
- /** Documentation: https://esbuild.github.io/plugins/#on-dispose */
319
- onDispose(callback: () => void): void
320
-
321
- // This is a full copy of the esbuild library in case you need it
322
- esbuild: {
323
- context: typeof context,
324
- build: typeof build,
325
- buildSync: typeof buildSync,
326
- transform: typeof transform,
327
- transformSync: typeof transformSync,
328
- formatMessages: typeof formatMessages,
329
- formatMessagesSync: typeof formatMessagesSync,
330
- analyzeMetafile: typeof analyzeMetafile,
331
- analyzeMetafileSync: typeof analyzeMetafileSync,
332
- initialize: typeof initialize,
333
- version: typeof version,
334
- }
335
- }
336
-
337
- /** Documentation: https://esbuild.github.io/plugins/#resolve-options */
338
- interface ResolveOptions {
339
- pluginName?: string
340
- importer?: string
341
- namespace?: string
342
- resolveDir?: string
343
- kind?: ImportKind
344
- pluginData?: any
345
- with?: Record<string, string>
346
- }
347
-
348
- /** Documentation: https://esbuild.github.io/plugins/#resolve-results */
349
- interface ResolveResult {
350
- errors: Message[]
351
- warnings: Message[]
352
-
353
- path: string
354
- external: boolean
355
- sideEffects: boolean
356
- namespace: string
357
- suffix: string
358
- pluginData: any
359
- }
360
-
361
- interface OnStartResult {
362
- errors?: PartialMessage[]
363
- warnings?: PartialMessage[]
364
- }
365
-
366
- interface OnEndResult {
367
- errors?: PartialMessage[]
368
- warnings?: PartialMessage[]
369
- }
370
-
371
- /** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */
372
- interface OnResolveOptions {
373
- filter: RegExp
374
- namespace?: string
375
- }
376
-
377
- /** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */
378
- interface OnResolveArgs {
379
- path: string
380
- importer: string
381
- namespace: string
382
- resolveDir: string
383
- kind: ImportKind
384
- pluginData: any
385
- with: Record<string, string>
386
- }
387
-
388
- type ImportKind =
389
- | 'entry-point'
390
-
391
- // JS
392
- | 'import-statement'
393
- | 'require-call'
394
- | 'dynamic-import'
395
- | 'require-resolve'
396
-
397
- // CSS
398
- | 'import-rule'
399
- | 'composes-from'
400
- | 'url-token'
401
-
402
- /** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */
403
- interface OnResolveResult {
404
- pluginName?: string
405
-
406
- errors?: PartialMessage[]
407
- warnings?: PartialMessage[]
408
-
409
- path?: string
410
- external?: boolean
411
- sideEffects?: boolean
412
- namespace?: string
413
- suffix?: string
414
- pluginData?: any
415
-
416
- watchFiles?: string[]
417
- watchDirs?: string[]
418
- }
419
-
420
- /** Documentation: https://esbuild.github.io/plugins/#on-load-options */
421
- interface OnLoadOptions {
422
- filter: RegExp
423
- namespace?: string
424
- }
425
-
426
- /** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */
427
- interface OnLoadArgs {
428
- path: string
429
- namespace: string
430
- suffix: string
431
- pluginData: any
432
- with: Record<string, string>
433
- }
434
-
435
- /** Documentation: https://esbuild.github.io/plugins/#on-load-results */
436
- interface OnLoadResult {
437
- pluginName?: string
438
-
439
- errors?: PartialMessage[]
440
- warnings?: PartialMessage[]
441
-
442
- contents?: string | Uint8Array
443
- resolveDir?: string
444
- loader?: Loader
445
- pluginData?: any
446
-
447
- watchFiles?: string[]
448
- watchDirs?: string[]
449
- }
450
-
451
- interface PartialMessage {
452
- id?: string
453
- pluginName?: string
454
- text?: string
455
- location?: Partial<Location> | null
456
- notes?: PartialNote[]
457
- detail?: any
458
- }
459
-
460
- interface PartialNote {
461
- text?: string
462
- location?: Partial<Location> | null
463
- }
464
-
465
- /** Documentation: https://esbuild.github.io/api/#metafile */
466
- interface Metafile {
467
- inputs: {
468
- [path: string]: {
469
- bytes: number
470
- imports: {
471
- path: string
472
- kind: ImportKind
473
- external?: boolean
474
- original?: string
475
- with?: Record<string, string>
476
- }[]
477
- format?: 'cjs' | 'esm'
478
- with?: Record<string, string>
479
- }
480
- }
481
- outputs: {
482
- [path: string]: {
483
- bytes: number
484
- inputs: {
485
- [path: string]: {
486
- bytesInOutput: number
487
- }
488
- }
489
- imports: {
490
- path: string
491
- kind: ImportKind | 'file-loader'
492
- external?: boolean
493
- }[]
494
- exports: string[]
495
- entryPoint?: string
496
- cssBundle?: string
497
- }
498
- }
499
- }
500
-
501
- interface FormatMessagesOptions {
502
- kind: 'error' | 'warning'
503
- color?: boolean
504
- terminalWidth?: number
505
- }
506
-
507
- interface AnalyzeMetafileOptions {
508
- color?: boolean
509
- verbose?: boolean
510
- }
511
-
512
- /** Documentation: https://esbuild.github.io/api/#watch-arguments */
513
- interface WatchOptions {
514
- delay?: number // In milliseconds
515
- }
516
-
517
- interface BuildContext<ProvidedOptions extends BuildOptions = BuildOptions> {
518
- /** Documentation: https://esbuild.github.io/api/#rebuild */
519
- rebuild(): Promise<BuildResult<ProvidedOptions>>
520
-
521
- /** Documentation: https://esbuild.github.io/api/#watch */
522
- watch(options?: WatchOptions): Promise<void>
523
-
524
- /** Documentation: https://esbuild.github.io/api/#serve */
525
- serve(options?: ServeOptions): Promise<ServeResult>
526
-
527
- cancel(): Promise<void>
528
- dispose(): Promise<void>
529
- }
530
-
531
- // This is a TypeScript type-level function which replaces any keys in "In"
532
- // that aren't in "Out" with "never". We use this to reject properties with
533
- // typos in object literals. See: https://stackoverflow.com/questions/49580725
534
- type SameShape<Out, In extends Out> = In & { [Key in Exclude<keyof In, keyof Out>]: never }
535
-
536
- /**
537
- * This function invokes the "esbuild" command-line tool for you. It returns a
538
- * promise that either resolves with a "BuildResult" object or rejects with a
539
- * "BuildFailure" object.
540
- *
541
- * - Works in node: yes
542
- * - Works in browser: yes
543
- *
544
- * Documentation: https://esbuild.github.io/api/#build
545
- */
546
- declare function build<T extends BuildOptions>(options: SameShape<BuildOptions, T>): Promise<BuildResult<T>>
547
-
548
- /**
549
- * This is the advanced long-running form of "build" that supports additional
550
- * features such as watch mode and a local development server.
551
- *
552
- * - Works in node: yes
553
- * - Works in browser: no
554
- *
555
- * Documentation: https://esbuild.github.io/api/#build
556
- */
557
- declare function context<T extends BuildOptions>(options: SameShape<BuildOptions, T>): Promise<BuildContext<T>>
558
-
559
- /**
560
- * This function transforms a single JavaScript file. It can be used to minify
561
- * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript
562
- * to older JavaScript. It returns a promise that is either resolved with a
563
- * "TransformResult" object or rejected with a "TransformFailure" object.
564
- *
565
- * - Works in node: yes
566
- * - Works in browser: yes
567
- *
568
- * Documentation: https://esbuild.github.io/api/#transform
569
- */
570
- declare function transform<T extends TransformOptions>(input: string | Uint8Array, options?: SameShape<TransformOptions, T>): Promise<TransformResult<T>>
571
-
572
- /**
573
- * Converts log messages to formatted message strings suitable for printing in
574
- * the terminal. This allows you to reuse the built-in behavior of esbuild's
575
- * log message formatter. This is a batch-oriented API for efficiency.
576
- *
577
- * - Works in node: yes
578
- * - Works in browser: yes
579
- */
580
- declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise<string[]>
581
-
582
- /**
583
- * Pretty-prints an analysis of the metafile JSON to a string. This is just for
584
- * convenience to be able to match esbuild's pretty-printing exactly. If you want
585
- * to customize it, you can just inspect the data in the metafile yourself.
586
- *
587
- * - Works in node: yes
588
- * - Works in browser: yes
589
- *
590
- * Documentation: https://esbuild.github.io/api/#analyze
591
- */
592
- declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise<string>
593
-
594
- /**
595
- * A synchronous version of "build".
596
- *
597
- * - Works in node: yes
598
- * - Works in browser: no
599
- *
600
- * Documentation: https://esbuild.github.io/api/#build
601
- */
602
- declare function buildSync<T extends BuildOptions>(options: SameShape<BuildOptions, T>): BuildResult<T>
603
-
604
- /**
605
- * A synchronous version of "transform".
606
- *
607
- * - Works in node: yes
608
- * - Works in browser: no
609
- *
610
- * Documentation: https://esbuild.github.io/api/#transform
611
- */
612
- declare function transformSync<T extends TransformOptions>(input: string | Uint8Array, options?: SameShape<TransformOptions, T>): TransformResult<T>
613
-
614
- /**
615
- * A synchronous version of "formatMessages".
616
- *
617
- * - Works in node: yes
618
- * - Works in browser: no
619
- */
620
- declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[]
621
-
622
- /**
623
- * A synchronous version of "analyzeMetafile".
624
- *
625
- * - Works in node: yes
626
- * - Works in browser: no
627
- *
628
- * Documentation: https://esbuild.github.io/api/#analyze
629
- */
630
- declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string
631
-
632
- /**
633
- * This configures the browser-based version of esbuild. It is necessary to
634
- * call this first and wait for the returned promise to be resolved before
635
- * making other API calls when using esbuild in the browser.
636
- *
637
- * - Works in node: yes
638
- * - Works in browser: yes ("options" is required)
639
- *
640
- * Documentation: https://esbuild.github.io/api/#browser
641
- */
642
- declare function initialize(options: InitializeOptions): Promise<void>
643
-
644
- interface InitializeOptions {
645
- /**
646
- * The URL of the "esbuild.wasm" file. This must be provided when running
647
- * esbuild in the browser.
648
- */
649
- wasmURL?: string | URL
650
-
651
- /**
652
- * The result of calling "new WebAssembly.Module(buffer)" where "buffer"
653
- * is a typed array or ArrayBuffer containing the binary code of the
654
- * "esbuild.wasm" file.
655
- *
656
- * You can use this as an alternative to "wasmURL" for environments where it's
657
- * not possible to download the WebAssembly module.
658
- */
659
- wasmModule?: WebAssembly.Module
660
-
661
- /**
662
- * By default esbuild runs the WebAssembly-based browser API in a web worker
663
- * to avoid blocking the UI thread. This can be disabled by setting "worker"
664
- * to false.
665
- */
666
- worker?: boolean
667
- }
668
-
669
- declare let version: string
670
-
671
- // Note: These declarations exist to avoid type errors when you omit "dom" from
672
- // "lib" in your "tsconfig.json" file. TypeScript confusingly declares the
673
- // global "WebAssembly" type in "lib.dom.d.ts" even though it has nothing to do
674
- // with the browser DOM and is present in many non-browser JavaScript runtimes
675
- // (e.g. node and deno). Declaring it here allows esbuild's API to be used in
676
- // these scenarios.
677
- //
678
- // There's an open issue about getting this problem corrected (although these
679
- // declarations will need to remain even if this is fixed for backward
680
- // compatibility with older TypeScript versions):
681
- //
682
- // https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826
683
- //
684
- declare global {
685
- namespace WebAssembly {
686
- interface Module {
687
- }
688
- }
689
- interface URL {
690
- }
691
- }
692
-
693
- // packages/core/types/src/auth/constants.ts
694
-
695
-
696
-
697
- // =============================================================================
698
- // User Role Constants
699
- // =============================================================================
700
-
701
- /**
702
- * Standard user role names
703
- * Apps can override these by providing their own role constants
704
- *
705
- * @version 0.0.1
706
- * @since 0.0.1
707
- * @author AMBROISE PARK Consulting
708
- */
709
- declare const USER_ROLES = {
710
- GUEST: 'guest',
711
- USER: 'user',
712
- ADMIN: 'admin',
713
- SUPER: 'super',
714
- } as const;
715
-
716
- /**
717
- * Type for user role names
718
- * Apps can extend this with their own custom roles
719
- *
720
- * @version 0.0.1
721
- * @since 0.0.1
722
- * @author AMBROISE PARK Consulting
723
- */
724
- type UserRole = (typeof USER_ROLES)[keyof typeof USER_ROLES] | string;
725
-
726
- // =============================================================================
727
- // Subscription Tier Constants
728
- // =============================================================================
729
-
730
- /**
731
- * Standard subscription tier names
732
- * Apps can override these by providing their own tier constants
733
- *
734
- * @version 0.0.1
735
- * @since 0.0.1
736
- * @author AMBROISE PARK Consulting
737
- */
738
- declare const SUBSCRIPTION_TIERS = {
739
- FREE: 'free',
740
- PRO: 'pro',
741
- PREMIUM: 'premium',
742
- } as const;
743
-
744
- /**
745
- * Type for subscription tier names
746
- * Apps can extend this with their own custom tiers
747
- *
748
- * @version 0.0.1
749
- * @since 0.0.1
750
- * @author AMBROISE PARK Consulting
751
- */
752
- type SubscriptionTier =
753
- | (typeof SUBSCRIPTION_TIERS)[keyof typeof SUBSCRIPTION_TIERS]
754
- | string;
755
-
756
- // packages/core/types/src/common/index.ts
757
-
758
-
759
-
760
- // =============================================================================
761
- // PLATFORM CONSTANTS
762
- // =============================================================================
763
-
764
- /**
765
- * Supported platform identifiers
766
- * @constant
767
- */
768
- declare const PLATFORMS = {
769
- VITE: 'vite',
770
- NEXTJS: 'nextjs',
771
- UNKNOWN: 'unknown',
772
- } as const;
773
-
774
- /**
775
- * Platform type derived from PLATFORMS constant
776
- */
777
- type Platform = (typeof PLATFORMS)[keyof typeof PLATFORMS];
778
-
779
- // =============================================================================
780
- // ENVIRONMENT CONSTANTS
781
- // =============================================================================
782
-
783
- /**
784
- * Supported environment modes
785
- * @constant
786
- */
787
- declare const ENVIRONMENTS = {
788
- DEVELOPMENT: 'development',
789
- PRODUCTION: 'production',
790
- TEST: 'test',
791
- } as const;
792
-
793
- /**
794
- * Environment mode type derived from ENVIRONMENTS constant
795
- */
796
- type EnvironmentMode = (typeof ENVIRONMENTS)[keyof typeof ENVIRONMENTS];
797
-
798
- // =============================================================================
799
- // CONTEXT CONSTANTS
800
- // =============================================================================
801
-
802
- /**
803
- * Supported execution contexts
804
- * @constant
805
- */
806
- declare const CONTEXTS = {
807
- CLIENT: 'client',
808
- SERVER: 'server',
809
- BUILD: 'build',
810
- } as const;
811
-
812
- /**
813
- * Context type derived from CONTEXTS constant
814
- */
815
- type Context = (typeof CONTEXTS)[keyof typeof CONTEXTS];
816
-
817
- // =============================================================================
818
- // STORAGE CONSTANTS
819
- // =============================================================================
820
-
821
- /**
822
- * Supported storage backend types
823
- * @constant
824
- */
825
- declare const STORAGE_TYPES = {
826
- LOCAL: 'localStorage',
827
- SESSION: 'sessionStorage',
828
- INDEXED_DB: 'indexedDB',
829
- MEMORY: 'memory',
830
- } as const;
831
-
832
- /**
833
- * Storage type derived from STORAGE_TYPES constant
834
- */
835
- type StorageType = (typeof STORAGE_TYPES)[keyof typeof STORAGE_TYPES];
836
-
837
- // =============================================================================
838
- // PWA CONSTANTS
839
- // =============================================================================
840
-
841
- /**
842
- * PWA display modes
843
- * @constant
844
- */
845
- declare const PWA_DISPLAY_MODES = {
846
- STANDALONE: 'standalone',
847
- FULLSCREEN: 'fullscreen',
848
- MINIMAL_UI: 'minimal-ui',
849
- BROWSER: 'browser',
850
- } as const;
851
-
852
- /**
853
- * PWA display mode type derived from PWA_DISPLAY_MODES constant
854
- */
855
- type PWADisplayMode =
856
- (typeof PWA_DISPLAY_MODES)[keyof typeof PWA_DISPLAY_MODES];
857
-
858
- /**
859
- * PWA asset types
860
- * @constant
861
- */
862
- declare const PWA_ASSET_TYPES = {
863
- MANIFEST: 'manifest',
864
- SERVICE_WORKER: 'service-worker',
865
- ICON: 'icon',
866
- } as const;
867
-
868
- /**
869
- * PWA asset type derived from PWA_ASSET_TYPES constant
870
- */
871
- type PWAAssetType =
872
- (typeof PWA_ASSET_TYPES)[keyof typeof PWA_ASSET_TYPES];
873
-
874
- // =============================================================================
875
- // ROUTE DISCOVERY CONSTANTS
876
- // =============================================================================
877
-
878
- /**
879
- * Route discovery sources
880
- * @constant
881
- */
882
- declare const ROUTE_SOURCES = {
883
- AUTO: 'auto-discovery',
884
- MANUAL: 'manual',
885
- HYBRID: 'hybrid',
886
- } as const;
887
-
888
- /**
889
- * Route source type derived from ROUTE_SOURCES constant
890
- */
891
- type RouteSource = (typeof ROUTE_SOURCES)[keyof typeof ROUTE_SOURCES];
892
-
893
- // =============================================================================
894
- // AUTHENTICATION TYPES
895
- // =============================================================================
896
-
897
- /**
898
- * Page-level authentication requirements
899
- * @description Used in PageMeta and NavigationRoute for route-level auth
900
- */
901
- type PageAuth =
902
- | boolean
903
- | {
904
- /** Whether authentication is required */
905
- required?: boolean;
906
- /** Required user role */
907
- role?: UserRole;
908
- /** Required subscription tier */
909
- tier?: SubscriptionTier;
910
- /** Custom validation function */
911
- validate?: (role: string, tier: string) => boolean;
912
- };
913
-
914
- // =============================================================================
915
- // PAGE METADATA TYPES
916
- // =============================================================================
917
-
918
- /**
919
- * Page metadata interface for route discovery and configuration
920
- *
921
- * @remarks
922
- * **ALL PROPERTIES ARE OPTIONAL** - Framework provides smart defaults:
923
- *
924
- * - `auth`: false (public) by default - YOU must specify auth requirements explicitly
925
- * - `title`: Auto-extracted from filename (ShowcasePage → "Showcase")
926
- * - `entity`: Auto-extracted from path (pages/showcase/ → "showcase")
927
- * - `action`: Auto-extracted from filename patterns (ListPage → "list", FormPage → "form")
928
- * - `route`: Only needed for custom paths or dynamic routes like :id, :slug
929
- *
930
- * @example Simple page (no meta needed):
931
- * ```tsx
932
- * export function HomePage() {
933
- * return <PageContainer>...</PageContainer>;
934
- * }
935
- * // Framework provides: auth=false, title from home.title, entity=home
936
- * ```
937
- *
938
- * @example Dynamic route (string format - explicit path):
939
- * ```tsx
940
- * export const meta: PageMeta = {
941
- * route: '/blog/:slug' // Creates /blog/:slug
942
- * };
943
- * // Framework provides: auth=false, title from blog.title, entity=blog
944
- * ```
945
- *
946
- * @example Dynamic route (object format - auto-generates base path):
947
- * ```tsx
948
- * export const meta: PageMeta = {
949
- * route: { params: ['id'] } // Creates /myRoute/:id (base path from file location)
950
- * };
951
- * // For file at pages/myRoute/DetailPage.tsx → route becomes /myRoute/:id
952
- * ```
953
- *
954
- * @example Auth-required (developer must be explicit):
955
- * ```tsx
956
- * export const meta: PageMeta = {
957
- * auth: { required: true } // YOU decide what needs auth
958
- * };
959
- * ```
960
- */
961
- interface PageMeta {
962
- /** Authentication requirements for this route */
963
- auth?: PageAuth;
964
-
965
- /** Route configuration - just define the exact path you want */
966
- route?: string | { params?: string[] };
967
-
968
- /** Page title (optional - framework auto-extracts from filename if not provided) */
969
- title?: string;
970
-
971
- /**
972
- * Translation/SEO namespace for this page
973
- * @description Used for meta tags and translations
974
- */
975
- namespace?: string;
976
-
977
- /**
978
- * Icon for navigation (optional - framework provides smart defaults)
979
- * @description **ONLY lucide-react JSX components** - extracted as component name string at build time for tree-shaking.
980
- *
981
- * **RESTRICTIONS:**
982
- * - ✅ Only: `<Rocket />`, `<ShoppingCart />`, `<Home />` (lucide-react JSX components)
983
- * - ❌ NOT: Emojis (`"🚀"`), strings (`"Rocket"`), or custom ReactNode
984
- *
985
- * **Why?** This is for build-time extraction and tree-shaking. The component name is extracted and stored as a string.
986
- *
987
- * **For flexible icons** (emojis, strings, custom components), use the `Icon` component directly in your JSX, not in PageMeta.
988
- *
989
- * @example
990
- * ```tsx
991
- * import { Rocket } from 'lucide-react';
992
- * export const meta: PageMeta = {
993
- * icon: <Rocket /> // ✅ Correct - lucide-react component
994
- * };
995
- * ```
996
- *
997
- * @example
998
- * ```tsx
999
- * // ❌ WRONG - Don't use emojis or strings in PageMeta
1000
- * export const meta: PageMeta = {
1001
- * icon: "🚀" // ❌ Not supported in PageMeta
1002
- * };
1003
- * ```
1004
- */
1005
- icon?: ReactNode;
1006
-
1007
- /**
1008
- * Hide from navigation menu (default: false - shows in navigation)
1009
- * @description Set to true to exclude this route from navigation menus
1010
- * @default false
1011
- * @example
1012
- * ```tsx
1013
- * export const meta: PageMeta = {
1014
- * hideFromMenu: true // Won't appear in HeaderNavigation, Sidebar, etc.
1015
- * };
1016
- * ```
1017
- */
1018
- hideFromMenu?: boolean;
1019
- }
1020
-
1021
- /**
1022
- * Route metadata (discovery-generated)
1023
- * @description Complete route metadata including auto-discovered fields from RouteDiscovery
1024
- *
1025
- * This extends PageMeta with fields that are automatically discovered from file paths:
1026
- * - `entity`: Auto-extracted from path (pages/showcase/ → "showcase")
1027
- * - `action`: Auto-extracted from filename patterns (ListPage → "list", FormPage → "form")
1028
- *
1029
- * These fields are always present in discovered routes but cannot be set in PageMeta.
1030
- *
1031
- * @version 0.0.1
1032
- * @since 0.0.1
1033
- * @author AMBROISE PARK Consulting
1034
- */
1035
- interface RouteMeta extends PageMeta {
1036
- /** Entity/domain grouping - auto-discovered from file path (not user-configurable) */
1037
- entity?: string;
1038
- /** Action type for route categorization - auto-discovered from filename patterns (not user-configurable) */
1039
- action?: string | null;
1040
- /** File path where route was discovered */
1041
- file?: string;
1042
- }
1043
-
1044
- // =============================================================================
1045
- // PLUGIN CONFIGURATION TYPES
1046
- // =============================================================================
1047
-
1048
- /**
1049
- * i18n Plugin Configuration
1050
- * @description Configuration for internationalization system
1051
- */
1052
- interface I18nPluginConfig {
1053
- /** Mapping of language → namespace → loader function */
1054
- mapping: Record<string, Record<string, () => Promise<any>>>;
1055
- /** List of available language codes */
1056
- languages: string[];
1057
- /** List of eagerly loaded namespace identifiers */
1058
- eager: string[];
1059
- /** Fallback language code */
1060
- fallback: string;
1061
- /** Preloaded translation content (optional) */
1062
- content?: Record<string, Record<string, any>>;
1063
- /** Storage configuration */
1064
- storage: {
1065
- /** Storage backend type */
1066
- type: StorageType;
1067
- /** Storage key prefix */
1068
- prefix: string;
1069
- /** Time-to-live in seconds */
1070
- ttl: number;
1071
- /** Whether to encrypt stored data */
1072
- encryption: boolean;
1073
- /** Maximum storage size in bytes */
1074
- maxSize: number;
1075
- };
1076
- /** Performance configuration */
1077
- performance: {
1078
- /** Maximum cache size */
1079
- cacheSize: number;
1080
- /** Error cache TTL in seconds */
1081
- errorCacheTTL: number;
1082
- };
1083
- /** Discovery manifest metadata */
1084
- manifest: {
1085
- /** Total number of translation files */
1086
- totalFiles: number;
1087
- /** Total number of namespaces */
1088
- totalNamespaces: number;
1089
- /** Total number of languages */
1090
- totalLanguages: number;
1091
- /** Number of eagerly loaded namespaces */
1092
- eagerNamespaces: number;
1093
- /** ISO timestamp of generation */
1094
- generatedAt: string;
1095
- };
1096
- /** Whether debug mode is enabled */
1097
- debug: boolean;
1098
- }
1099
-
1100
- /**
1101
- * Routes Plugin Configuration
1102
- * @description Complete route configuration populated by discovery system
1103
- */
1104
- interface RoutesPluginConfig {
1105
- /**
1106
- * Array of discovered routes
1107
- * @description All routes discovered by the route discovery system
1108
- */
1109
- mapping: Array<{
1110
- /**
1111
- * URL path for the route (platform-agnostic)
1112
- * @description The URL path that users see in their browser
1113
- * @example '/showcase/layouts', '/users/:id', '/dashboard'
1114
- */
1115
- path: string;
1116
-
1117
- /**
1118
- * Lazy component reference (Vite-specific)
1119
- * @description React.lazy() component for code splitting
1120
- * @example lazy(() => import("/src/pages/showcase/LayoutsPage"))
1121
- */
1122
- component: any;
1123
-
1124
- /**
1125
- * Absolute file system path (Next.js-specific)
1126
- * @description The absolute path to the component file
1127
- * @example '/src/pages/showcase/LayoutsPage.tsx'
1128
- */
1129
- importPath: string;
1130
-
1131
- /**
1132
- * Export name for named exports
1133
- * @example 'HomePage', 'AboutPage'
1134
- */
1135
- exportName?: string;
1136
-
1137
- /**
1138
- * Authentication configuration (platform-agnostic)
1139
- * @description Defines whether the route requires authentication
1140
- */
1141
- auth: PageAuth;
1142
-
1143
- /**
1144
- * Route metadata (platform-agnostic)
1145
- * @description Additional information about the route, including auto-discovered fields
1146
- */
1147
- meta: RouteMeta;
1148
- }>;
1149
-
1150
- /**
1151
- * Discovery metadata and statistics
1152
- * @description Information about the route discovery process
1153
- */
1154
- manifest: {
1155
- /** Total number of discovered routes */
1156
- totalRoutes: number;
1157
- /** Number of routes requiring authentication */
1158
- authRequired: number;
1159
- /** Number of public routes */
1160
- publicRoutes: number;
1161
- /** Source of routes (auto-discovery vs manual) */
1162
- source: RouteSource;
1163
- /** ISO timestamp when routes were generated */
1164
- generatedAt: string;
1165
- };
1166
- }
1167
-
1168
- /**
1169
- * Themes Plugin Configuration
1170
- * @description Configuration for theme discovery and management
1171
- */
1172
- interface ThemesPluginConfig {
1173
- /** Mapping of theme names to theme configurations */
1174
- mapping: Record<string, any>;
1175
- /** Array of discovered themes */
1176
- discovered: Array<{
1177
- /** Theme identifier */
1178
- name: string;
1179
- /** Human-readable theme name */
1180
- displayName: string;
1181
- /** Whether this is a dark theme */
1182
- isDark: boolean;
1183
- /** Theme metadata */
1184
- meta: {
1185
- /** Icon identifier */
1186
- icon: string;
1187
- /** Theme description */
1188
- description?: string;
1189
- /** Theme category */
1190
- category?: string;
1191
- /** Theme author */
1192
- author?: string;
1193
- /** Additional metadata */
1194
- [key: string]: any;
1195
- };
1196
- /** Source file path */
1197
- source: string;
1198
- /** Whether theme is essential (cannot be disabled) */
1199
- essential: boolean;
1200
- }>;
1201
- /** CSS custom property variables */
1202
- variables: Record<string, string>;
1203
- /** Utility class mappings */
1204
- utilities: Record<string, Record<string, string>>;
1205
- /** Discovery manifest metadata */
1206
- manifest: {
1207
- /** Total number of discovered themes */
1208
- totalThemes: number;
1209
- /** Total number of CSS variables */
1210
- totalVariables: number;
1211
- /** Total number of utility classes */
1212
- totalUtilities: number;
1213
- /** ISO timestamp of generation */
1214
- generatedAt: string;
1215
- };
1216
- }
1217
-
1218
- /**
1219
- * Assets Plugin Configuration
1220
- * @description Configuration for static asset management
1221
- */
1222
- interface AssetsPluginConfig {
1223
- /** Mapping of asset paths to asset metadata */
1224
- mapping: Record<string, any>;
1225
- /** SVG content of logo.svg for inline rendering with CSS variable theming */
1226
- logoSvgContent?: string | null;
1227
- /** Discovery manifest metadata */
1228
- manifest: {
1229
- /** Total number of discovered assets */
1230
- totalAssets: number;
1231
- /** ISO timestamp of generation */
1232
- generatedAt: string;
1233
- };
1234
- }
1235
-
1236
- /**
1237
- * PWA Plugin Configuration
1238
- * @description Configuration for Progressive Web App features
1239
- */
1240
- interface PWAPluginConfig {
1241
- /** Array of PWA assets */
1242
- assets: Array<{
1243
- /** Type of PWA asset */
1244
- type: PWAAssetType;
1245
- /** Asset file path */
1246
- path: string;
1247
- /** Asset file size in bytes */
1248
- size?: number;
1249
- /** Asset content (for inline assets) */
1250
- content?: any;
1251
- /** Asset format (for images) */
1252
- format?: string;
1253
- /** Asset purpose (for icons) */
1254
- purpose?: string;
1255
- }>;
1256
- /** PWA manifest configuration */
1257
- manifest: {
1258
- /** Application name */
1259
- name: string;
1260
- /** Short application name */
1261
- short_name: string;
1262
- /** Application description */
1263
- description: string;
1264
- /** Start URL */
1265
- start_url: string;
1266
- /** Display mode */
1267
- display: PWADisplayMode;
1268
- /** Background color */
1269
- background_color: string;
1270
- /** Theme color */
1271
- theme_color: string;
1272
- /** Array of app icons */
1273
- icons: Array<{
1274
- /** Icon source path */
1275
- src: string;
1276
- /** Icon sizes (e.g., '192x192') */
1277
- sizes: string;
1278
- /** Icon MIME type */
1279
- type: string;
1280
- /** Icon purpose (e.g., 'any', 'maskable') */
1281
- purpose: string;
1282
- }>;
1283
- };
1284
- /** Discovery manifest metadata */
1285
- manifestInfo: {
1286
- /** Total number of PWA assets */
1287
- totalAssets: number;
1288
- /** Total number of icons */
1289
- totalIcons: number;
1290
- /** Whether service worker is present */
1291
- hasServiceWorker: boolean;
1292
- /** ISO timestamp of generation */
1293
- generatedAt: string;
1294
- };
1295
- }
1296
-
1297
- /**
1298
- * Features Plugin Configuration
1299
- * @description Configuration for feature discovery and enablement
1300
- *
1301
- * @remarks
1302
- * This interface defines the structure for feature discovery data that is populated
1303
- * at build time and made available at runtime for feature availability checking.
1304
- *
1305
- * @example
1306
- * ```typescript
1307
- * // Generated by feature discovery system
1308
- * const featuresConfig: FeaturesPluginConfig = {
1309
- * available: ['auth', 'billing', 'i18n', 'oauth'],
1310
- * enabled: ['auth', 'i18n'],
1311
- * overridden: false
1312
- * };
1313
- * ```
1314
- */
1315
- interface FeaturesPluginConfig {
1316
- /**
1317
- * List of all available features discovered in packages/features/
1318
- * @example ['auth', 'billing', 'i18n', 'oauth']
1319
- */
1320
- available: string[];
1321
- }
1322
-
1323
- // =============================================================================
1324
- // FRAMEWORK CONFIGURATION
1325
- // =============================================================================
1326
-
1327
- /**
1328
- * Complete DoNotDev framework configuration structure
1329
- * @description Single source of truth for all framework configuration
1330
- *
1331
- * @remarks
1332
- * All discovery plugins add their data to this unified config.
1333
- * Available at runtime via globalThis._DNDEV_CONFIG_ or window._DNDEV_CONFIG_
1334
- */
1335
- interface DndevFrameworkConfig {
1336
- /** Framework platform (Vite or Next.js) */
1337
- platform: Platform;
1338
- /** Current environment mode */
1339
- mode: EnvironmentMode;
1340
- /** Framework version */
1341
- version: string;
1342
- /** Execution context */
1343
- context: Context;
1344
- /** Unix timestamp of config generation */
1345
- timestamp: number;
1346
- /** i18n plugin configuration (optional) */
1347
- i18n?: I18nPluginConfig;
1348
- /** Routes plugin configuration (optional) */
1349
- routes?: RoutesPluginConfig;
1350
- /** Themes plugin configuration (optional) */
1351
- themes?: ThemesPluginConfig;
1352
- /** Assets plugin configuration (optional) */
1353
- assets?: AssetsPluginConfig;
1354
- /** PWA plugin configuration (optional) */
1355
- pwa?: PWAPluginConfig;
1356
- /** Features plugin configuration (optional) */
1357
- features?: FeaturesPluginConfig;
1358
- /** Environment variables (VITE_* variables from .env files) */
1359
- env?: Record<string, string>;
1360
- }
1361
-
1362
- // =============================================================================
1363
- // GLOBAL AUGMENTATIONS
1364
- // =============================================================================
1365
-
1366
- declare global {
1367
- interface Window {
1368
- /**
1369
- * Single source of truth for all DoNotDev framework configuration
1370
- * @description Set by platform detection and populated by discovery plugins
1371
- */
1372
- _DNDEV_CONFIG_?: DndevFrameworkConfig;
1373
-
1374
- /**
1375
- * Global store registry for singleton Zustand stores
1376
- * @description Ensures single instance across code-split chunks
1377
- */
1378
- _DNDEV_STORES_?: Record<string, any>;
1379
-
1380
- /** PapaParse CSV parser library (external) */
1381
- Papa?: {
1382
- parse: (input: string | File, config?: any) => any;
1383
- unparse: (data: any[], config?: any) => string;
1384
- };
1385
-
1386
- /** Sentry error tracking library (external) */
1387
- Sentry?: {
1388
- captureException: (error: unknown) => void;
1389
- withScope: (callback: (scope: any) => void) => void;
1390
- getClient: () => { close: () => Promise<boolean> } | undefined;
1391
- };
1392
-
1393
- /**
1394
- * Google APIs (Maps, One Tap, etc.)
1395
- * @description Unified type for all Google services
1396
- */
1397
- google?: {
1398
- /** Google Maps API */
1399
- maps?: {
1400
- places?: {
1401
- AutocompleteService: new () => any;
1402
- PlacesService: new (element: HTMLElement) => any;
1403
- PlacesServiceStatus: {
1404
- OK: string;
1405
- };
1406
- };
1407
- [key: string]: any;
1408
- };
1409
- /** Google Identity Services (One Tap) */
1410
- accounts?: {
1411
- id?: {
1412
- initialize: (config: any) => void;
1413
- prompt: (callback?: (notification: any) => void) => void;
1414
- cancel?: () => void;
1415
- disableAutoSelect?: () => void;
1416
- };
1417
- };
1418
- [key: string]: any;
1419
- };
1420
-
1421
- /** FedCM Identity Credential API */
1422
- IdentityCredential?: any;
1423
- }
1424
-
1425
- namespace NodeJS {
1426
- interface ProcessEnv {
1427
- /** Serialized framework config for Node.js environment */
1428
- _DNDEV_CONFIG_?: string;
1429
- }
1430
- }
1431
-
1432
- namespace globalThis {
1433
- /** Framework configuration (same as window._DNDEV_CONFIG_) */
1434
- var _DNDEV_CONFIG_: DndevFrameworkConfig | undefined;
1435
- /** Store registry (same as window._DNDEV_STORES_) */
1436
- var _DNDEV_STORES_: Record<string, any> | undefined;
1437
-
1438
- // Third-party framework globals (not owned by DoNotDev)
1439
- var __vite_plugin_react_preamble_installed__: boolean | undefined;
1440
- var __vite_hmr_port: number | undefined;
1441
- var __NEXT_DATA__: any | undefined;
1442
- var __REACT_QUERY_CLIENT__: any | undefined;
1443
- var __REACT_QUERY_PROVIDER__: any | undefined;
1444
- var __DNDEV_DEBUG: boolean | undefined;
1445
- var __FIREBASE_DEMO_MODE__: boolean | undefined;
1446
- // gc is already defined by Node.js globals - removed to avoid TS 5.9+ conflict
1447
- var getAvailableThemes: (() => string[]) | undefined;
1448
- }
1449
- }
1450
3
 
1451
4
  // packages/core/types/src/functions/functionTypes.ts
1452
5