@xyd-js/content 0.1.0-xyd.3 → 0.1.0-xyd.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.
package/dist/vite.d.ts ADDED
@@ -0,0 +1,948 @@
1
+ import * as estree from 'estree';
2
+
3
+ declare module 'estree' {
4
+ export interface Decorator extends estree.BaseNode {
5
+ type: 'Decorator';
6
+ expression: estree.Expression;
7
+ }
8
+ interface PropertyDefinition {
9
+ decorators: estree.Decorator[];
10
+ }
11
+ interface MethodDefinition {
12
+ decorators: estree.Decorator[];
13
+ }
14
+ interface BaseClass {
15
+ decorators: estree.Decorator[];
16
+ }
17
+ }
18
+
19
+ // utils
20
+ type NullValue = null | undefined | void;
21
+ type MaybePromise<T> = T | Promise<T>;
22
+
23
+ type PartialNull<T> = {
24
+ [P in keyof T]: T[P] | null;
25
+ };
26
+
27
+ interface RollupError extends RollupLog {
28
+ name?: string;
29
+ stack?: string;
30
+ watchFiles?: string[];
31
+ }
32
+
33
+ interface RollupLog {
34
+ binding?: string;
35
+ cause?: unknown;
36
+ code?: string;
37
+ exporter?: string;
38
+ frame?: string;
39
+ hook?: string;
40
+ id?: string;
41
+ ids?: string[];
42
+ loc?: {
43
+ column: number;
44
+ file?: string;
45
+ line: number;
46
+ };
47
+ message: string;
48
+ meta?: any;
49
+ names?: string[];
50
+ plugin?: string;
51
+ pluginCode?: unknown;
52
+ pos?: number;
53
+ reexporter?: string;
54
+ stack?: string;
55
+ url?: string;
56
+ }
57
+
58
+ type LogLevel = 'warn' | 'info' | 'debug';
59
+ type LogLevelOption = LogLevel | 'silent';
60
+
61
+ type SourceMapSegment =
62
+ | [number]
63
+ | [number, number, number, number]
64
+ | [number, number, number, number, number];
65
+
66
+ interface ExistingDecodedSourceMap {
67
+ file?: string;
68
+ readonly mappings: SourceMapSegment[][];
69
+ names: string[];
70
+ sourceRoot?: string;
71
+ sources: string[];
72
+ sourcesContent?: string[];
73
+ version: number;
74
+ x_google_ignoreList?: number[];
75
+ }
76
+
77
+ interface ExistingRawSourceMap {
78
+ file?: string;
79
+ mappings: string;
80
+ names: string[];
81
+ sourceRoot?: string;
82
+ sources: string[];
83
+ sourcesContent?: string[];
84
+ version: number;
85
+ x_google_ignoreList?: number[];
86
+ }
87
+
88
+ type DecodedSourceMapOrMissing =
89
+ | {
90
+ missing: true;
91
+ plugin: string;
92
+ }
93
+ | (ExistingDecodedSourceMap & { missing?: false });
94
+
95
+ interface SourceMap {
96
+ file: string;
97
+ mappings: string;
98
+ names: string[];
99
+ sources: string[];
100
+ sourcesContent?: string[];
101
+ version: number;
102
+ debugId?: string;
103
+ toString(): string;
104
+ toUrl(): string;
105
+ }
106
+
107
+ type SourceMapInput = ExistingRawSourceMap | string | null | { mappings: '' };
108
+
109
+ interface ModuleOptions {
110
+ attributes: Record<string, string>;
111
+ meta: CustomPluginOptions;
112
+ moduleSideEffects: boolean | 'no-treeshake';
113
+ syntheticNamedExports: boolean | string;
114
+ }
115
+
116
+ interface SourceDescription extends Partial<PartialNull<ModuleOptions>> {
117
+ ast?: ProgramNode;
118
+ code: string;
119
+ map?: SourceMapInput;
120
+ }
121
+
122
+ interface TransformModuleJSON {
123
+ ast?: ProgramNode;
124
+ code: string;
125
+ // note if plugins use new this.cache to opt-out auto transform cache
126
+ customTransformCache: boolean;
127
+ originalCode: string;
128
+ originalSourcemap: ExistingDecodedSourceMap | null;
129
+ sourcemapChain: DecodedSourceMapOrMissing[];
130
+ transformDependencies: string[];
131
+ }
132
+
133
+ interface ModuleJSON extends TransformModuleJSON, ModuleOptions {
134
+ ast: ProgramNode;
135
+ dependencies: string[];
136
+ id: string;
137
+ resolvedIds: ResolvedIdMap;
138
+ transformFiles: EmittedFile[] | undefined;
139
+ }
140
+
141
+ interface PluginCache {
142
+ delete(id: string): boolean;
143
+ get<T = any>(id: string): T;
144
+ has(id: string): boolean;
145
+ set<T = any>(id: string, value: T): void;
146
+ }
147
+
148
+ type LoggingFunction = (log: RollupLog | string | (() => RollupLog | string)) => void;
149
+
150
+ interface MinimalPluginContext {
151
+ debug: LoggingFunction;
152
+ error: (error: RollupError | string) => never;
153
+ info: LoggingFunction;
154
+ meta: PluginContextMeta;
155
+ warn: LoggingFunction;
156
+ }
157
+
158
+ interface EmittedAsset {
159
+ fileName?: string;
160
+ name?: string;
161
+ needsCodeReference?: boolean;
162
+ originalFileName?: string | null;
163
+ source?: string | Uint8Array;
164
+ type: 'asset';
165
+ }
166
+
167
+ interface EmittedChunk {
168
+ fileName?: string;
169
+ id: string;
170
+ implicitlyLoadedAfterOneOf?: string[];
171
+ importer?: string;
172
+ name?: string;
173
+ preserveSignature?: PreserveEntrySignaturesOption;
174
+ type: 'chunk';
175
+ }
176
+
177
+ interface EmittedPrebuiltChunk {
178
+ code: string;
179
+ exports?: string[];
180
+ fileName: string;
181
+ map?: SourceMap;
182
+ sourcemapFileName?: string;
183
+ type: 'prebuilt-chunk';
184
+ }
185
+
186
+ type EmittedFile = EmittedAsset | EmittedChunk | EmittedPrebuiltChunk;
187
+
188
+ type EmitFile = (emittedFile: EmittedFile) => string;
189
+
190
+ interface ModuleInfo extends ModuleOptions {
191
+ ast: ProgramNode | null;
192
+ code: string | null;
193
+ dynamicImporters: readonly string[];
194
+ dynamicallyImportedIdResolutions: readonly ResolvedId[];
195
+ dynamicallyImportedIds: readonly string[];
196
+ exportedBindings: Record<string, string[]> | null;
197
+ exports: string[] | null;
198
+ hasDefaultExport: boolean | null;
199
+ id: string;
200
+ implicitlyLoadedAfterOneOf: readonly string[];
201
+ implicitlyLoadedBefore: readonly string[];
202
+ importedIdResolutions: readonly ResolvedId[];
203
+ importedIds: readonly string[];
204
+ importers: readonly string[];
205
+ isEntry: boolean;
206
+ isExternal: boolean;
207
+ isIncluded: boolean | null;
208
+ }
209
+
210
+ type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
211
+
212
+ type CustomPluginOptions = Record<string, any>;
213
+
214
+ type LoggingFunctionWithPosition = (
215
+ log: RollupLog | string | (() => RollupLog | string),
216
+ pos?: number | { column: number; line: number }
217
+ ) => void;
218
+
219
+ type ParseAst = (
220
+ input: string,
221
+ options?: { allowReturnOutsideFunction?: boolean; jsx?: boolean }
222
+ ) => ProgramNode;
223
+
224
+ // declare AbortSignal here for environments without DOM lib or @types/node
225
+ declare global {
226
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
227
+ interface AbortSignal {}
228
+ }
229
+
230
+ interface PluginContext extends MinimalPluginContext {
231
+ addWatchFile: (id: string) => void;
232
+ cache: PluginCache;
233
+ debug: LoggingFunction;
234
+ emitFile: EmitFile;
235
+ error: (error: RollupError | string) => never;
236
+ getFileName: (fileReferenceId: string) => string;
237
+ getModuleIds: () => IterableIterator<string>;
238
+ getModuleInfo: GetModuleInfo;
239
+ getWatchFiles: () => string[];
240
+ info: LoggingFunction;
241
+ load: (
242
+ options: { id: string; resolveDependencies?: boolean } & Partial<PartialNull<ModuleOptions>>
243
+ ) => Promise<ModuleInfo>;
244
+ parse: ParseAst;
245
+ resolve: (
246
+ source: string,
247
+ importer?: string,
248
+ options?: {
249
+ attributes?: Record<string, string>;
250
+ custom?: CustomPluginOptions;
251
+ isEntry?: boolean;
252
+ skipSelf?: boolean;
253
+ }
254
+ ) => Promise<ResolvedId | null>;
255
+ setAssetSource: (assetReferenceId: string, source: string | Uint8Array) => void;
256
+ warn: LoggingFunction;
257
+ }
258
+
259
+ interface PluginContextMeta {
260
+ rollupVersion: string;
261
+ watchMode: boolean;
262
+ }
263
+
264
+ interface ResolvedId extends ModuleOptions {
265
+ external: boolean | 'absolute';
266
+ id: string;
267
+ resolvedBy: string;
268
+ }
269
+
270
+ type ResolvedIdMap = Record<string, ResolvedId>;
271
+
272
+ interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> {
273
+ external?: boolean | 'absolute' | 'relative';
274
+ id: string;
275
+ resolvedBy?: string;
276
+ }
277
+
278
+ type ResolveIdResult = string | NullValue | false | PartialResolvedId;
279
+
280
+ type ResolveIdHook = (
281
+ this: PluginContext,
282
+ source: string,
283
+ importer: string | undefined,
284
+ options: { attributes: Record<string, string>; custom?: CustomPluginOptions; isEntry: boolean }
285
+ ) => ResolveIdResult;
286
+
287
+ type ShouldTransformCachedModuleHook = (
288
+ this: PluginContext,
289
+ options: {
290
+ ast: ProgramNode;
291
+ code: string;
292
+ id: string;
293
+ meta: CustomPluginOptions;
294
+ moduleSideEffects: boolean | 'no-treeshake';
295
+ resolvedSources: ResolvedIdMap;
296
+ syntheticNamedExports: boolean | string;
297
+ }
298
+ ) => boolean | NullValue;
299
+
300
+ type IsExternal = (
301
+ source: string,
302
+ importer: string | undefined,
303
+ isResolved: boolean
304
+ ) => boolean;
305
+
306
+ type HasModuleSideEffects = (id: string, external: boolean) => boolean;
307
+
308
+ type LoadResult = SourceDescription | string | NullValue;
309
+
310
+ type LoadHook = (this: PluginContext, id: string) => LoadResult;
311
+
312
+ interface TransformPluginContext extends PluginContext {
313
+ debug: LoggingFunctionWithPosition;
314
+ error: (error: RollupError | string, pos?: number | { column: number; line: number }) => never;
315
+ getCombinedSourcemap: () => SourceMap;
316
+ info: LoggingFunctionWithPosition;
317
+ warn: LoggingFunctionWithPosition;
318
+ }
319
+
320
+ type TransformResult = string | NullValue | Partial<SourceDescription>;
321
+
322
+ type TransformHook = (
323
+ this: TransformPluginContext,
324
+ code: string,
325
+ id: string
326
+ ) => TransformResult;
327
+
328
+ type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => void;
329
+
330
+ type RenderChunkHook = (
331
+ this: PluginContext,
332
+ code: string,
333
+ chunk: RenderedChunk,
334
+ options: NormalizedOutputOptions,
335
+ meta: { chunks: Record<string, RenderedChunk> }
336
+ ) => { code: string; map?: SourceMapInput } | string | NullValue;
337
+
338
+ type ResolveDynamicImportHook = (
339
+ this: PluginContext,
340
+ specifier: string | AstNode,
341
+ importer: string,
342
+ options: { attributes: Record<string, string> }
343
+ ) => ResolveIdResult;
344
+
345
+ type ResolveImportMetaHook = (
346
+ this: PluginContext,
347
+ property: string | null,
348
+ options: { chunkId: string; format: InternalModuleFormat; moduleId: string }
349
+ ) => string | NullValue;
350
+
351
+ type ResolveFileUrlHook = (
352
+ this: PluginContext,
353
+ options: {
354
+ chunkId: string;
355
+ fileName: string;
356
+ format: InternalModuleFormat;
357
+ moduleId: string;
358
+ referenceId: string;
359
+ relativePath: string;
360
+ }
361
+ ) => string | NullValue;
362
+
363
+ type AddonHookFunction = (
364
+ this: PluginContext,
365
+ chunk: RenderedChunk
366
+ ) => string | Promise<string>;
367
+ type AddonHook = string | AddonHookFunction;
368
+
369
+ type ChangeEvent = 'create' | 'update' | 'delete';
370
+ type WatchChangeHook = (
371
+ this: PluginContext,
372
+ id: string,
373
+ change: { event: ChangeEvent }
374
+ ) => void;
375
+
376
+ type OutputBundle = Record<string, OutputAsset | OutputChunk>;
377
+
378
+ interface FunctionPluginHooks {
379
+ augmentChunkHash: (this: PluginContext, chunk: RenderedChunk) => string | void;
380
+ buildEnd: (this: PluginContext, error?: Error) => void;
381
+ buildStart: (this: PluginContext, options: NormalizedInputOptions) => void;
382
+ closeBundle: (this: PluginContext) => void;
383
+ closeWatcher: (this: PluginContext) => void;
384
+ generateBundle: (
385
+ this: PluginContext,
386
+ options: NormalizedOutputOptions,
387
+ bundle: OutputBundle,
388
+ isWrite: boolean
389
+ ) => void;
390
+ load: LoadHook;
391
+ moduleParsed: ModuleParsedHook;
392
+ onLog: (this: MinimalPluginContext, level: LogLevel, log: RollupLog) => boolean | NullValue;
393
+ options: (this: MinimalPluginContext, options: InputOptions) => InputOptions | NullValue;
394
+ outputOptions: (this: PluginContext, options: OutputOptions) => OutputOptions | NullValue;
395
+ renderChunk: RenderChunkHook;
396
+ renderDynamicImport: (
397
+ this: PluginContext,
398
+ options: {
399
+ customResolution: string | null;
400
+ format: InternalModuleFormat;
401
+ moduleId: string;
402
+ targetModuleId: string | null;
403
+ }
404
+ ) => { left: string; right: string } | NullValue;
405
+ renderError: (this: PluginContext, error?: Error) => void;
406
+ renderStart: (
407
+ this: PluginContext,
408
+ outputOptions: NormalizedOutputOptions,
409
+ inputOptions: NormalizedInputOptions
410
+ ) => void;
411
+ resolveDynamicImport: ResolveDynamicImportHook;
412
+ resolveFileUrl: ResolveFileUrlHook;
413
+ resolveId: ResolveIdHook;
414
+ resolveImportMeta: ResolveImportMetaHook;
415
+ shouldTransformCachedModule: ShouldTransformCachedModuleHook;
416
+ transform: TransformHook;
417
+ watchChange: WatchChangeHook;
418
+ writeBundle: (
419
+ this: PluginContext,
420
+ options: NormalizedOutputOptions,
421
+ bundle: OutputBundle
422
+ ) => void;
423
+ }
424
+
425
+ type OutputPluginHooks =
426
+ | 'augmentChunkHash'
427
+ | 'generateBundle'
428
+ | 'outputOptions'
429
+ | 'renderChunk'
430
+ | 'renderDynamicImport'
431
+ | 'renderError'
432
+ | 'renderStart'
433
+ | 'resolveFileUrl'
434
+ | 'resolveImportMeta'
435
+ | 'writeBundle';
436
+
437
+ type SyncPluginHooks =
438
+ | 'augmentChunkHash'
439
+ | 'onLog'
440
+ | 'outputOptions'
441
+ | 'renderDynamicImport'
442
+ | 'resolveFileUrl'
443
+ | 'resolveImportMeta';
444
+
445
+ type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
446
+
447
+ type FirstPluginHooks =
448
+ | 'load'
449
+ | 'renderDynamicImport'
450
+ | 'resolveDynamicImport'
451
+ | 'resolveFileUrl'
452
+ | 'resolveId'
453
+ | 'resolveImportMeta'
454
+ | 'shouldTransformCachedModule';
455
+
456
+ type SequentialPluginHooks =
457
+ | 'augmentChunkHash'
458
+ | 'generateBundle'
459
+ | 'onLog'
460
+ | 'options'
461
+ | 'outputOptions'
462
+ | 'renderChunk'
463
+ | 'transform';
464
+
465
+ type ParallelPluginHooks = Exclude<
466
+ keyof FunctionPluginHooks | AddonHooks,
467
+ FirstPluginHooks | SequentialPluginHooks
468
+ >;
469
+
470
+ type AddonHooks = 'banner' | 'footer' | 'intro' | 'outro';
471
+
472
+ type MakeAsync<Function_> = Function_ extends (
473
+ this: infer This,
474
+ ...parameters: infer Arguments
475
+ ) => infer Return
476
+ ? (this: This, ...parameters: Arguments) => Return | Promise<Return>
477
+ : never;
478
+
479
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
480
+ type ObjectHook<T, O = {}> = T | ({ handler: T; order?: 'pre' | 'post' | null } & O);
481
+
482
+ type PluginHooks = {
483
+ [K in keyof FunctionPluginHooks]: ObjectHook<
484
+ K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K],
485
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
486
+ K extends ParallelPluginHooks ? { sequential?: boolean } : {}
487
+ >;
488
+ };
489
+
490
+ interface OutputPlugin
491
+ extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>,
492
+ Partial<Record<AddonHooks, ObjectHook<AddonHook>>> {
493
+ cacheKey?: string;
494
+ name: string;
495
+ version?: string;
496
+ }
497
+
498
+ interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
499
+ // for inter-plugin communication
500
+ api?: A;
501
+ }
502
+
503
+ type JsxPreset = 'react' | 'react-jsx' | 'preserve' | 'preserve-react';
504
+
505
+ type NormalizedJsxOptions =
506
+ | NormalizedJsxPreserveOptions
507
+ | NormalizedJsxClassicOptions
508
+ | NormalizedJsxAutomaticOptions;
509
+
510
+ interface NormalizedJsxPreserveOptions {
511
+ factory: string | null;
512
+ fragment: string | null;
513
+ importSource: string | null;
514
+ mode: 'preserve';
515
+ }
516
+
517
+ interface NormalizedJsxClassicOptions {
518
+ factory: string;
519
+ fragment: string;
520
+ importSource: string | null;
521
+ mode: 'classic';
522
+ }
523
+
524
+ interface NormalizedJsxAutomaticOptions {
525
+ factory: string;
526
+ importSource: string | null;
527
+ jsxImportSource: string;
528
+ mode: 'automatic';
529
+ }
530
+
531
+ type JsxOptions = Partial<NormalizedJsxOptions> & {
532
+ preset?: JsxPreset;
533
+ };
534
+
535
+ type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
536
+
537
+ interface NormalizedTreeshakingOptions {
538
+ annotations: boolean;
539
+ correctVarValueBeforeDeclaration: boolean;
540
+ manualPureFunctions: readonly string[];
541
+ moduleSideEffects: HasModuleSideEffects;
542
+ propertyReadSideEffects: boolean | 'always';
543
+ tryCatchDeoptimization: boolean;
544
+ unknownGlobalSideEffects: boolean;
545
+ }
546
+
547
+ interface TreeshakingOptions
548
+ extends Partial<Omit<NormalizedTreeshakingOptions, 'moduleSideEffects'>> {
549
+ moduleSideEffects?: ModuleSideEffectsOption;
550
+ preset?: TreeshakingPreset;
551
+ }
552
+
553
+ interface ManualChunkMeta {
554
+ getModuleIds: () => IterableIterator<string>;
555
+ getModuleInfo: GetModuleInfo;
556
+ }
557
+
558
+ type GetManualChunk = (id: string, meta: ManualChunkMeta) => string | NullValue;
559
+
560
+ type ExternalOption =
561
+ | (string | RegExp)[]
562
+ | string
563
+ | RegExp
564
+ | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | NullValue);
565
+
566
+ type GlobalsOption = Record<string, string> | ((name: string) => string);
567
+
568
+ type InputOption = string | string[] | Record<string, string>;
569
+
570
+ type ManualChunksOption = Record<string, string[]> | GetManualChunk;
571
+
572
+ type LogHandlerWithDefault = (
573
+ level: LogLevel,
574
+ log: RollupLog,
575
+ defaultHandler: LogOrStringHandler
576
+ ) => void;
577
+
578
+ type LogOrStringHandler = (level: LogLevel | 'error', log: RollupLog | string) => void;
579
+
580
+ type LogHandler = (level: LogLevel, log: RollupLog) => void;
581
+
582
+ type ModuleSideEffectsOption = boolean | 'no-external' | string[] | HasModuleSideEffects;
583
+
584
+ type PreserveEntrySignaturesOption = false | 'strict' | 'allow-extension' | 'exports-only';
585
+
586
+ type SourcemapPathTransformOption = (
587
+ relativeSourcePath: string,
588
+ sourcemapPath: string
589
+ ) => string;
590
+
591
+ type SourcemapIgnoreListOption = (
592
+ relativeSourcePath: string,
593
+ sourcemapPath: string
594
+ ) => boolean;
595
+
596
+ type InputPluginOption = MaybePromise<Plugin | NullValue | false | InputPluginOption[]>;
597
+
598
+ interface InputOptions {
599
+ cache?: boolean | RollupCache;
600
+ context?: string;
601
+ experimentalCacheExpiry?: number;
602
+ experimentalLogSideEffects?: boolean;
603
+ external?: ExternalOption;
604
+ input?: InputOption;
605
+ jsx?: false | JsxPreset | JsxOptions;
606
+ logLevel?: LogLevelOption;
607
+ makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource';
608
+ maxParallelFileOps?: number;
609
+ moduleContext?: ((id: string) => string | NullValue) | Record<string, string>;
610
+ onLog?: LogHandlerWithDefault;
611
+ onwarn?: WarningHandlerWithDefault;
612
+ perf?: boolean;
613
+ plugins?: InputPluginOption;
614
+ preserveEntrySignatures?: PreserveEntrySignaturesOption;
615
+ preserveSymlinks?: boolean;
616
+ shimMissingExports?: boolean;
617
+ strictDeprecations?: boolean;
618
+ treeshake?: boolean | TreeshakingPreset | TreeshakingOptions;
619
+ watch?: WatcherOptions | false;
620
+ }
621
+
622
+ interface NormalizedInputOptions {
623
+ cache: false | undefined | RollupCache;
624
+ context: string;
625
+ experimentalCacheExpiry: number;
626
+ experimentalLogSideEffects: boolean;
627
+ external: IsExternal;
628
+ input: string[] | Record<string, string>;
629
+ jsx: false | NormalizedJsxOptions;
630
+ logLevel: LogLevelOption;
631
+ makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource';
632
+ maxParallelFileOps: number;
633
+ moduleContext: (id: string) => string;
634
+ onLog: LogHandler;
635
+ perf: boolean;
636
+ plugins: Plugin[];
637
+ preserveEntrySignatures: PreserveEntrySignaturesOption;
638
+ preserveSymlinks: boolean;
639
+ shimMissingExports: boolean;
640
+ strictDeprecations: boolean;
641
+ treeshake: false | NormalizedTreeshakingOptions;
642
+ }
643
+
644
+ type InternalModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd';
645
+ type ImportAttributesKey = 'with' | 'assert';
646
+
647
+ type ModuleFormat = InternalModuleFormat | 'commonjs' | 'esm' | 'module' | 'systemjs';
648
+
649
+ type GeneratedCodePreset = 'es5' | 'es2015';
650
+
651
+ interface NormalizedGeneratedCodeOptions {
652
+ arrowFunctions: boolean;
653
+ constBindings: boolean;
654
+ objectShorthand: boolean;
655
+ reservedNamesAsProps: boolean;
656
+ symbols: boolean;
657
+ }
658
+
659
+ interface GeneratedCodeOptions extends Partial<NormalizedGeneratedCodeOptions> {
660
+ preset?: GeneratedCodePreset;
661
+ }
662
+
663
+ type OptionsPaths = Record<string, string> | ((id: string) => string);
664
+
665
+ type InteropType = 'compat' | 'auto' | 'esModule' | 'default' | 'defaultOnly';
666
+
667
+ type GetInterop = (id: string | null) => InteropType;
668
+
669
+ type AmdOptions = (
670
+ | {
671
+ autoId?: false;
672
+ id: string;
673
+ }
674
+ | {
675
+ autoId: true;
676
+ basePath?: string;
677
+ id?: undefined;
678
+ }
679
+ | {
680
+ autoId?: false;
681
+ id?: undefined;
682
+ }
683
+ ) & {
684
+ define?: string;
685
+ forceJsExtensionForImports?: boolean;
686
+ };
687
+
688
+ type NormalizedAmdOptions = (
689
+ | {
690
+ autoId: false;
691
+ id?: string;
692
+ }
693
+ | {
694
+ autoId: true;
695
+ basePath: string;
696
+ }
697
+ ) & {
698
+ define: string;
699
+ forceJsExtensionForImports: boolean;
700
+ };
701
+
702
+ type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
703
+
704
+ type OutputPluginOption = MaybePromise<OutputPlugin | NullValue | false | OutputPluginOption[]>;
705
+
706
+ type HashCharacters = 'base64' | 'base36' | 'hex';
707
+
708
+ interface OutputOptions {
709
+ amd?: AmdOptions;
710
+ assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string);
711
+ banner?: string | AddonFunction;
712
+ chunkFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
713
+ compact?: boolean;
714
+ // only required for bundle.write
715
+ dir?: string;
716
+ dynamicImportInCjs?: boolean;
717
+ entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
718
+ esModule?: boolean | 'if-default-prop';
719
+ experimentalMinChunkSize?: number;
720
+ exports?: 'default' | 'named' | 'none' | 'auto';
721
+ extend?: boolean;
722
+ /** @deprecated Use "externalImportAttributes" instead. */
723
+ externalImportAssertions?: boolean;
724
+ externalImportAttributes?: boolean;
725
+ externalLiveBindings?: boolean;
726
+ // only required for bundle.write
727
+ file?: string;
728
+ footer?: string | AddonFunction;
729
+ format?: ModuleFormat;
730
+ freeze?: boolean;
731
+ generatedCode?: GeneratedCodePreset | GeneratedCodeOptions;
732
+ globals?: GlobalsOption;
733
+ hashCharacters?: HashCharacters;
734
+ hoistTransitiveImports?: boolean;
735
+ importAttributesKey?: ImportAttributesKey;
736
+ indent?: string | boolean;
737
+ inlineDynamicImports?: boolean;
738
+ interop?: InteropType | GetInterop;
739
+ intro?: string | AddonFunction;
740
+ manualChunks?: ManualChunksOption;
741
+ minifyInternalExports?: boolean;
742
+ name?: string;
743
+ noConflict?: boolean;
744
+ outro?: string | AddonFunction;
745
+ paths?: OptionsPaths;
746
+ plugins?: OutputPluginOption;
747
+ preserveModules?: boolean;
748
+ preserveModulesRoot?: string;
749
+ reexportProtoFromExternal?: boolean;
750
+ sanitizeFileName?: boolean | ((fileName: string) => string);
751
+ sourcemap?: boolean | 'inline' | 'hidden';
752
+ sourcemapBaseUrl?: string;
753
+ sourcemapExcludeSources?: boolean;
754
+ sourcemapFile?: string;
755
+ sourcemapFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
756
+ sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption;
757
+ sourcemapPathTransform?: SourcemapPathTransformOption;
758
+ sourcemapDebugIds?: boolean;
759
+ strict?: boolean;
760
+ systemNullSetters?: boolean;
761
+ validate?: boolean;
762
+ virtualDirname?: string;
763
+ }
764
+
765
+ interface NormalizedOutputOptions {
766
+ amd: NormalizedAmdOptions;
767
+ assetFileNames: string | ((chunkInfo: PreRenderedAsset) => string);
768
+ banner: AddonFunction;
769
+ chunkFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
770
+ compact: boolean;
771
+ dir: string | undefined;
772
+ dynamicImportInCjs: boolean;
773
+ entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
774
+ esModule: boolean | 'if-default-prop';
775
+ experimentalMinChunkSize: number;
776
+ exports: 'default' | 'named' | 'none' | 'auto';
777
+ extend: boolean;
778
+ /** @deprecated Use "externalImportAttributes" instead. */
779
+ externalImportAssertions: boolean;
780
+ externalImportAttributes: boolean;
781
+ externalLiveBindings: boolean;
782
+ file: string | undefined;
783
+ footer: AddonFunction;
784
+ format: InternalModuleFormat;
785
+ freeze: boolean;
786
+ generatedCode: NormalizedGeneratedCodeOptions;
787
+ globals: GlobalsOption;
788
+ hashCharacters: HashCharacters;
789
+ hoistTransitiveImports: boolean;
790
+ importAttributesKey: ImportAttributesKey;
791
+ indent: true | string;
792
+ inlineDynamicImports: boolean;
793
+ interop: GetInterop;
794
+ intro: AddonFunction;
795
+ manualChunks: ManualChunksOption;
796
+ minifyInternalExports: boolean;
797
+ name: string | undefined;
798
+ noConflict: boolean;
799
+ outro: AddonFunction;
800
+ paths: OptionsPaths;
801
+ plugins: OutputPlugin[];
802
+ preserveModules: boolean;
803
+ preserveModulesRoot: string | undefined;
804
+ reexportProtoFromExternal: boolean;
805
+ sanitizeFileName: (fileName: string) => string;
806
+ sourcemap: boolean | 'inline' | 'hidden';
807
+ sourcemapBaseUrl: string | undefined;
808
+ sourcemapExcludeSources: boolean;
809
+ sourcemapFile: string | undefined;
810
+ sourcemapFileNames: string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
811
+ sourcemapIgnoreList: SourcemapIgnoreListOption;
812
+ sourcemapPathTransform: SourcemapPathTransformOption | undefined;
813
+ sourcemapDebugIds: boolean;
814
+ strict: boolean;
815
+ systemNullSetters: boolean;
816
+ validate: boolean;
817
+ virtualDirname: string;
818
+ }
819
+
820
+ type WarningHandlerWithDefault = (
821
+ warning: RollupLog,
822
+ defaultHandler: LoggingFunction
823
+ ) => void;
824
+
825
+ interface PreRenderedAsset {
826
+ /** @deprecated Use "names" instead. */
827
+ name: string | undefined;
828
+ names: string[];
829
+ /** @deprecated Use "originalFileNames" instead. */
830
+ originalFileName: string | null;
831
+ originalFileNames: string[];
832
+ source: string | Uint8Array;
833
+ type: 'asset';
834
+ }
835
+
836
+ interface OutputAsset extends PreRenderedAsset {
837
+ fileName: string;
838
+ needsCodeReference: boolean;
839
+ }
840
+
841
+ interface RenderedModule {
842
+ readonly code: string | null;
843
+ originalLength: number;
844
+ removedExports: string[];
845
+ renderedExports: string[];
846
+ renderedLength: number;
847
+ }
848
+
849
+ interface PreRenderedChunk {
850
+ exports: string[];
851
+ facadeModuleId: string | null;
852
+ isDynamicEntry: boolean;
853
+ isEntry: boolean;
854
+ isImplicitEntry: boolean;
855
+ moduleIds: string[];
856
+ name: string;
857
+ type: 'chunk';
858
+ }
859
+
860
+ interface RenderedChunk extends PreRenderedChunk {
861
+ dynamicImports: string[];
862
+ fileName: string;
863
+ implicitlyLoadedBefore: string[];
864
+ importedBindings: Record<string, string[]>;
865
+ imports: string[];
866
+ modules: Record<string, RenderedModule>;
867
+ referencedFiles: string[];
868
+ }
869
+
870
+ interface OutputChunk extends RenderedChunk {
871
+ code: string;
872
+ map: SourceMap | null;
873
+ sourcemapFileName: string | null;
874
+ preliminaryFileName: string;
875
+ }
876
+
877
+ type SerializablePluginCache = Record<string, [number, any]>;
878
+
879
+ interface RollupCache {
880
+ modules: ModuleJSON[];
881
+ plugins?: Record<string, SerializablePluginCache>;
882
+ }
883
+
884
+ interface ChokidarOptions {
885
+ alwaysStat?: boolean;
886
+ atomic?: boolean | number;
887
+ awaitWriteFinish?:
888
+ | {
889
+ pollInterval?: number;
890
+ stabilityThreshold?: number;
891
+ }
892
+ | boolean;
893
+ binaryInterval?: number;
894
+ cwd?: string;
895
+ depth?: number;
896
+ disableGlobbing?: boolean;
897
+ followSymlinks?: boolean;
898
+ ignoreInitial?: boolean;
899
+ ignorePermissionErrors?: boolean;
900
+ ignored?: any;
901
+ interval?: number;
902
+ persistent?: boolean;
903
+ useFsEvents?: boolean;
904
+ usePolling?: boolean;
905
+ }
906
+
907
+ interface WatcherOptions {
908
+ buildDelay?: number;
909
+ chokidar?: ChokidarOptions;
910
+ clearScreen?: boolean;
911
+ exclude?: string | RegExp | (string | RegExp)[];
912
+ include?: string | RegExp | (string | RegExp)[];
913
+ skipWrite?: boolean;
914
+ }
915
+
916
+ interface AstNodeLocation {
917
+ end: number;
918
+ start: number;
919
+ }
920
+
921
+ type OmittedEstreeKeys =
922
+ | 'loc'
923
+ | 'range'
924
+ | 'leadingComments'
925
+ | 'trailingComments'
926
+ | 'innerComments'
927
+ | 'comments';
928
+ type RollupAstNode<T> = Omit<T, OmittedEstreeKeys> & AstNodeLocation;
929
+
930
+ type ProgramNode = RollupAstNode<estree.Program>;
931
+ type AstNode = RollupAstNode<estree.Node>;
932
+
933
+ type CustomTag = {
934
+ name: RegExp;
935
+ depth: (name: string) => number;
936
+ };
937
+ interface RemarkMdxTocOptions {
938
+ name?: string;
939
+ customTags?: CustomTag[];
940
+ minDepth?: number;
941
+ }
942
+
943
+ interface VitePluginInterface {
944
+ toc: RemarkMdxTocOptions;
945
+ }
946
+ declare function vitePlugins(options: VitePluginInterface): Plugin[];
947
+
948
+ export { type VitePluginInterface, vitePlugins };