@xyd-js/content 0.1.0-xyd.4 → 0.1.0-xyd.6

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,972 @@
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
+ // eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style -- this is an interface so that it can be extended by plugins
213
+ interface CustomPluginOptions {
214
+ [plugin: string]: any;
215
+ }
216
+
217
+ type LoggingFunctionWithPosition = (
218
+ log: RollupLog | string | (() => RollupLog | string),
219
+ pos?: number | { column: number; line: number }
220
+ ) => void;
221
+
222
+ type ParseAst = (
223
+ input: string,
224
+ options?: { allowReturnOutsideFunction?: boolean; jsx?: boolean }
225
+ ) => ProgramNode;
226
+
227
+ // declare AbortSignal here for environments without DOM lib or @types/node
228
+ declare global {
229
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
230
+ interface AbortSignal {}
231
+ }
232
+
233
+ interface PluginContext extends MinimalPluginContext {
234
+ addWatchFile: (id: string) => void;
235
+ cache: PluginCache;
236
+ debug: LoggingFunction;
237
+ emitFile: EmitFile;
238
+ error: (error: RollupError | string) => never;
239
+ getFileName: (fileReferenceId: string) => string;
240
+ getModuleIds: () => IterableIterator<string>;
241
+ getModuleInfo: GetModuleInfo;
242
+ getWatchFiles: () => string[];
243
+ info: LoggingFunction;
244
+ load: (
245
+ options: { id: string; resolveDependencies?: boolean } & Partial<PartialNull<ModuleOptions>>
246
+ ) => Promise<ModuleInfo>;
247
+ parse: ParseAst;
248
+ resolve: (
249
+ source: string,
250
+ importer?: string,
251
+ options?: {
252
+ attributes?: Record<string, string>;
253
+ custom?: CustomPluginOptions;
254
+ isEntry?: boolean;
255
+ skipSelf?: boolean;
256
+ }
257
+ ) => Promise<ResolvedId | null>;
258
+ setAssetSource: (assetReferenceId: string, source: string | Uint8Array) => void;
259
+ warn: LoggingFunction;
260
+ }
261
+
262
+ interface PluginContextMeta {
263
+ rollupVersion: string;
264
+ watchMode: boolean;
265
+ }
266
+
267
+ interface ResolvedId extends ModuleOptions {
268
+ external: boolean | 'absolute';
269
+ id: string;
270
+ resolvedBy: string;
271
+ }
272
+
273
+ type ResolvedIdMap = Record<string, ResolvedId>;
274
+
275
+ interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> {
276
+ external?: boolean | 'absolute' | 'relative';
277
+ id: string;
278
+ resolvedBy?: string;
279
+ }
280
+
281
+ type ResolveIdResult = string | NullValue | false | PartialResolvedId;
282
+
283
+ type ResolveIdHook = (
284
+ this: PluginContext,
285
+ source: string,
286
+ importer: string | undefined,
287
+ options: { attributes: Record<string, string>; custom?: CustomPluginOptions; isEntry: boolean }
288
+ ) => ResolveIdResult;
289
+
290
+ type ShouldTransformCachedModuleHook = (
291
+ this: PluginContext,
292
+ options: {
293
+ ast: ProgramNode;
294
+ code: string;
295
+ id: string;
296
+ meta: CustomPluginOptions;
297
+ moduleSideEffects: boolean | 'no-treeshake';
298
+ resolvedSources: ResolvedIdMap;
299
+ syntheticNamedExports: boolean | string;
300
+ }
301
+ ) => boolean | NullValue;
302
+
303
+ type IsExternal = (
304
+ source: string,
305
+ importer: string | undefined,
306
+ isResolved: boolean
307
+ ) => boolean;
308
+
309
+ type HasModuleSideEffects = (id: string, external: boolean) => boolean;
310
+
311
+ type LoadResult = SourceDescription | string | NullValue;
312
+
313
+ type LoadHook = (this: PluginContext, id: string) => LoadResult;
314
+
315
+ interface TransformPluginContext extends PluginContext {
316
+ debug: LoggingFunctionWithPosition;
317
+ error: (error: RollupError | string, pos?: number | { column: number; line: number }) => never;
318
+ getCombinedSourcemap: () => SourceMap;
319
+ info: LoggingFunctionWithPosition;
320
+ warn: LoggingFunctionWithPosition;
321
+ }
322
+
323
+ type TransformResult = string | NullValue | Partial<SourceDescription>;
324
+
325
+ type TransformHook = (
326
+ this: TransformPluginContext,
327
+ code: string,
328
+ id: string
329
+ ) => TransformResult;
330
+
331
+ type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => void;
332
+
333
+ type RenderChunkHook = (
334
+ this: PluginContext,
335
+ code: string,
336
+ chunk: RenderedChunk,
337
+ options: NormalizedOutputOptions,
338
+ meta: { chunks: Record<string, RenderedChunk> }
339
+ ) => { code: string; map?: SourceMapInput } | string | NullValue;
340
+
341
+ type ResolveDynamicImportHook = (
342
+ this: PluginContext,
343
+ specifier: string | AstNode,
344
+ importer: string,
345
+ options: { attributes: Record<string, string> }
346
+ ) => ResolveIdResult;
347
+
348
+ type ResolveImportMetaHook = (
349
+ this: PluginContext,
350
+ property: string | null,
351
+ options: { chunkId: string; format: InternalModuleFormat; moduleId: string }
352
+ ) => string | NullValue;
353
+
354
+ type ResolveFileUrlHook = (
355
+ this: PluginContext,
356
+ options: {
357
+ chunkId: string;
358
+ fileName: string;
359
+ format: InternalModuleFormat;
360
+ moduleId: string;
361
+ referenceId: string;
362
+ relativePath: string;
363
+ }
364
+ ) => string | NullValue;
365
+
366
+ type AddonHookFunction = (
367
+ this: PluginContext,
368
+ chunk: RenderedChunk
369
+ ) => string | Promise<string>;
370
+ type AddonHook = string | AddonHookFunction;
371
+
372
+ type ChangeEvent = 'create' | 'update' | 'delete';
373
+ type WatchChangeHook = (
374
+ this: PluginContext,
375
+ id: string,
376
+ change: { event: ChangeEvent }
377
+ ) => void;
378
+
379
+ type OutputBundle = Record<string, OutputAsset | OutputChunk>;
380
+
381
+ type PreRenderedChunkWithFileName = PreRenderedChunk & { fileName: string };
382
+
383
+ interface ImportedInternalChunk {
384
+ type: 'internal';
385
+ fileName: string;
386
+ resolvedImportPath: string;
387
+ chunk: PreRenderedChunk;
388
+ }
389
+
390
+ interface ImportedExternalChunk {
391
+ type: 'external';
392
+ fileName: string;
393
+ resolvedImportPath: string;
394
+ }
395
+
396
+ type DynamicImportTargetChunk = ImportedInternalChunk | ImportedExternalChunk;
397
+
398
+ interface FunctionPluginHooks {
399
+ augmentChunkHash: (this: PluginContext, chunk: RenderedChunk) => string | void;
400
+ buildEnd: (this: PluginContext, error?: Error) => void;
401
+ buildStart: (this: PluginContext, options: NormalizedInputOptions) => void;
402
+ closeBundle: (this: PluginContext, error?: Error) => void;
403
+ closeWatcher: (this: PluginContext) => void;
404
+ generateBundle: (
405
+ this: PluginContext,
406
+ options: NormalizedOutputOptions,
407
+ bundle: OutputBundle,
408
+ isWrite: boolean
409
+ ) => void;
410
+ load: LoadHook;
411
+ moduleParsed: ModuleParsedHook;
412
+ onLog: (this: MinimalPluginContext, level: LogLevel, log: RollupLog) => boolean | NullValue;
413
+ options: (this: MinimalPluginContext, options: InputOptions) => InputOptions | NullValue;
414
+ outputOptions: (this: PluginContext, options: OutputOptions) => OutputOptions | NullValue;
415
+ renderChunk: RenderChunkHook;
416
+ renderDynamicImport: (
417
+ this: PluginContext,
418
+ options: {
419
+ customResolution: string | null;
420
+ format: InternalModuleFormat;
421
+ moduleId: string;
422
+ targetModuleId: string | null;
423
+ chunk: PreRenderedChunkWithFileName;
424
+ targetChunk: PreRenderedChunkWithFileName | null;
425
+ getTargetChunkImports: () => DynamicImportTargetChunk[] | null;
426
+ }
427
+ ) => { left: string; right: string } | NullValue;
428
+ renderError: (this: PluginContext, error?: Error) => void;
429
+ renderStart: (
430
+ this: PluginContext,
431
+ outputOptions: NormalizedOutputOptions,
432
+ inputOptions: NormalizedInputOptions
433
+ ) => void;
434
+ resolveDynamicImport: ResolveDynamicImportHook;
435
+ resolveFileUrl: ResolveFileUrlHook;
436
+ resolveId: ResolveIdHook;
437
+ resolveImportMeta: ResolveImportMetaHook;
438
+ shouldTransformCachedModule: ShouldTransformCachedModuleHook;
439
+ transform: TransformHook;
440
+ watchChange: WatchChangeHook;
441
+ writeBundle: (
442
+ this: PluginContext,
443
+ options: NormalizedOutputOptions,
444
+ bundle: OutputBundle
445
+ ) => void;
446
+ }
447
+
448
+ type OutputPluginHooks =
449
+ | 'augmentChunkHash'
450
+ | 'generateBundle'
451
+ | 'outputOptions'
452
+ | 'renderChunk'
453
+ | 'renderDynamicImport'
454
+ | 'renderError'
455
+ | 'renderStart'
456
+ | 'resolveFileUrl'
457
+ | 'resolveImportMeta'
458
+ | 'writeBundle';
459
+
460
+ type SyncPluginHooks =
461
+ | 'augmentChunkHash'
462
+ | 'onLog'
463
+ | 'outputOptions'
464
+ | 'renderDynamicImport'
465
+ | 'resolveFileUrl'
466
+ | 'resolveImportMeta';
467
+
468
+ type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
469
+
470
+ type FirstPluginHooks =
471
+ | 'load'
472
+ | 'renderDynamicImport'
473
+ | 'resolveDynamicImport'
474
+ | 'resolveFileUrl'
475
+ | 'resolveId'
476
+ | 'resolveImportMeta'
477
+ | 'shouldTransformCachedModule';
478
+
479
+ type SequentialPluginHooks =
480
+ | 'augmentChunkHash'
481
+ | 'generateBundle'
482
+ | 'onLog'
483
+ | 'options'
484
+ | 'outputOptions'
485
+ | 'renderChunk'
486
+ | 'transform';
487
+
488
+ type ParallelPluginHooks = Exclude<
489
+ keyof FunctionPluginHooks | AddonHooks,
490
+ FirstPluginHooks | SequentialPluginHooks
491
+ >;
492
+
493
+ type AddonHooks = 'banner' | 'footer' | 'intro' | 'outro';
494
+
495
+ type MakeAsync<Function_> = Function_ extends (
496
+ this: infer This,
497
+ ...parameters: infer Arguments
498
+ ) => infer Return
499
+ ? (this: This, ...parameters: Arguments) => Return | Promise<Return>
500
+ : never;
501
+
502
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
503
+ type ObjectHook<T, O = {}> = T | ({ handler: T; order?: 'pre' | 'post' | null } & O);
504
+
505
+ type PluginHooks = {
506
+ [K in keyof FunctionPluginHooks]: ObjectHook<
507
+ K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K],
508
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
509
+ K extends ParallelPluginHooks ? { sequential?: boolean } : {}
510
+ >;
511
+ };
512
+
513
+ interface OutputPlugin
514
+ extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>,
515
+ Partial<Record<AddonHooks, ObjectHook<AddonHook>>> {
516
+ cacheKey?: string;
517
+ name: string;
518
+ version?: string;
519
+ }
520
+
521
+ interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
522
+ // for inter-plugin communication
523
+ api?: A;
524
+ }
525
+
526
+ type JsxPreset = 'react' | 'react-jsx' | 'preserve' | 'preserve-react';
527
+
528
+ type NormalizedJsxOptions =
529
+ | NormalizedJsxPreserveOptions
530
+ | NormalizedJsxClassicOptions
531
+ | NormalizedJsxAutomaticOptions;
532
+
533
+ interface NormalizedJsxPreserveOptions {
534
+ factory: string | null;
535
+ fragment: string | null;
536
+ importSource: string | null;
537
+ mode: 'preserve';
538
+ }
539
+
540
+ interface NormalizedJsxClassicOptions {
541
+ factory: string;
542
+ fragment: string;
543
+ importSource: string | null;
544
+ mode: 'classic';
545
+ }
546
+
547
+ interface NormalizedJsxAutomaticOptions {
548
+ factory: string;
549
+ importSource: string | null;
550
+ jsxImportSource: string;
551
+ mode: 'automatic';
552
+ }
553
+
554
+ type JsxOptions = Partial<NormalizedJsxOptions> & {
555
+ preset?: JsxPreset;
556
+ };
557
+
558
+ type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
559
+
560
+ interface NormalizedTreeshakingOptions {
561
+ annotations: boolean;
562
+ correctVarValueBeforeDeclaration: boolean;
563
+ manualPureFunctions: readonly string[];
564
+ moduleSideEffects: HasModuleSideEffects;
565
+ propertyReadSideEffects: boolean | 'always';
566
+ tryCatchDeoptimization: boolean;
567
+ unknownGlobalSideEffects: boolean;
568
+ }
569
+
570
+ interface TreeshakingOptions
571
+ extends Partial<Omit<NormalizedTreeshakingOptions, 'moduleSideEffects'>> {
572
+ moduleSideEffects?: ModuleSideEffectsOption;
573
+ preset?: TreeshakingPreset;
574
+ }
575
+
576
+ interface ManualChunkMeta {
577
+ getModuleIds: () => IterableIterator<string>;
578
+ getModuleInfo: GetModuleInfo;
579
+ }
580
+
581
+ type GetManualChunk = (id: string, meta: ManualChunkMeta) => string | NullValue;
582
+
583
+ type ExternalOption =
584
+ | (string | RegExp)[]
585
+ | string
586
+ | RegExp
587
+ | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | NullValue);
588
+
589
+ type GlobalsOption = Record<string, string> | ((name: string) => string);
590
+
591
+ type InputOption = string | string[] | Record<string, string>;
592
+
593
+ type ManualChunksOption = Record<string, string[]> | GetManualChunk;
594
+
595
+ type LogHandlerWithDefault = (
596
+ level: LogLevel,
597
+ log: RollupLog,
598
+ defaultHandler: LogOrStringHandler
599
+ ) => void;
600
+
601
+ type LogOrStringHandler = (level: LogLevel | 'error', log: RollupLog | string) => void;
602
+
603
+ type LogHandler = (level: LogLevel, log: RollupLog) => void;
604
+
605
+ type ModuleSideEffectsOption = boolean | 'no-external' | string[] | HasModuleSideEffects;
606
+
607
+ type PreserveEntrySignaturesOption = false | 'strict' | 'allow-extension' | 'exports-only';
608
+
609
+ type SourcemapPathTransformOption = (
610
+ relativeSourcePath: string,
611
+ sourcemapPath: string
612
+ ) => string;
613
+
614
+ type SourcemapIgnoreListOption = (
615
+ relativeSourcePath: string,
616
+ sourcemapPath: string
617
+ ) => boolean;
618
+
619
+ type InputPluginOption = MaybePromise<Plugin | NullValue | false | InputPluginOption[]>;
620
+
621
+ interface InputOptions {
622
+ cache?: boolean | RollupCache;
623
+ context?: string;
624
+ experimentalCacheExpiry?: number;
625
+ experimentalLogSideEffects?: boolean;
626
+ external?: ExternalOption;
627
+ input?: InputOption;
628
+ jsx?: false | JsxPreset | JsxOptions;
629
+ logLevel?: LogLevelOption;
630
+ makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource';
631
+ maxParallelFileOps?: number;
632
+ moduleContext?: ((id: string) => string | NullValue) | Record<string, string>;
633
+ onLog?: LogHandlerWithDefault;
634
+ onwarn?: WarningHandlerWithDefault;
635
+ perf?: boolean;
636
+ plugins?: InputPluginOption;
637
+ preserveEntrySignatures?: PreserveEntrySignaturesOption;
638
+ preserveSymlinks?: boolean;
639
+ shimMissingExports?: boolean;
640
+ strictDeprecations?: boolean;
641
+ treeshake?: boolean | TreeshakingPreset | TreeshakingOptions;
642
+ watch?: WatcherOptions | false;
643
+ }
644
+
645
+ interface NormalizedInputOptions {
646
+ cache: false | undefined | RollupCache;
647
+ context: string;
648
+ experimentalCacheExpiry: number;
649
+ experimentalLogSideEffects: boolean;
650
+ external: IsExternal;
651
+ input: string[] | Record<string, string>;
652
+ jsx: false | NormalizedJsxOptions;
653
+ logLevel: LogLevelOption;
654
+ makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource';
655
+ maxParallelFileOps: number;
656
+ moduleContext: (id: string) => string;
657
+ onLog: LogHandler;
658
+ perf: boolean;
659
+ plugins: Plugin[];
660
+ preserveEntrySignatures: PreserveEntrySignaturesOption;
661
+ preserveSymlinks: boolean;
662
+ shimMissingExports: boolean;
663
+ strictDeprecations: boolean;
664
+ treeshake: false | NormalizedTreeshakingOptions;
665
+ }
666
+
667
+ type InternalModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd';
668
+ type ImportAttributesKey = 'with' | 'assert';
669
+
670
+ type ModuleFormat = InternalModuleFormat | 'commonjs' | 'esm' | 'module' | 'systemjs';
671
+
672
+ type GeneratedCodePreset = 'es5' | 'es2015';
673
+
674
+ interface NormalizedGeneratedCodeOptions {
675
+ arrowFunctions: boolean;
676
+ constBindings: boolean;
677
+ objectShorthand: boolean;
678
+ reservedNamesAsProps: boolean;
679
+ symbols: boolean;
680
+ }
681
+
682
+ interface GeneratedCodeOptions extends Partial<NormalizedGeneratedCodeOptions> {
683
+ preset?: GeneratedCodePreset;
684
+ }
685
+
686
+ type OptionsPaths = Record<string, string> | ((id: string) => string);
687
+
688
+ type InteropType = 'compat' | 'auto' | 'esModule' | 'default' | 'defaultOnly';
689
+
690
+ type GetInterop = (id: string | null) => InteropType;
691
+
692
+ type AmdOptions = (
693
+ | {
694
+ autoId?: false;
695
+ id: string;
696
+ }
697
+ | {
698
+ autoId: true;
699
+ basePath?: string;
700
+ id?: undefined;
701
+ }
702
+ | {
703
+ autoId?: false;
704
+ id?: undefined;
705
+ }
706
+ ) & {
707
+ define?: string;
708
+ forceJsExtensionForImports?: boolean;
709
+ };
710
+
711
+ type NormalizedAmdOptions = (
712
+ | {
713
+ autoId: false;
714
+ id?: string;
715
+ }
716
+ | {
717
+ autoId: true;
718
+ basePath: string;
719
+ }
720
+ ) & {
721
+ define: string;
722
+ forceJsExtensionForImports: boolean;
723
+ };
724
+
725
+ type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
726
+
727
+ type OutputPluginOption = MaybePromise<OutputPlugin | NullValue | false | OutputPluginOption[]>;
728
+
729
+ type HashCharacters = 'base64' | 'base36' | 'hex';
730
+
731
+ interface OutputOptions {
732
+ amd?: AmdOptions;
733
+ assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string);
734
+ banner?: string | AddonFunction;
735
+ chunkFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
736
+ compact?: boolean;
737
+ // only required for bundle.write
738
+ dir?: string;
739
+ dynamicImportInCjs?: boolean;
740
+ entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
741
+ esModule?: boolean | 'if-default-prop';
742
+ experimentalMinChunkSize?: number;
743
+ exports?: 'default' | 'named' | 'none' | 'auto';
744
+ extend?: boolean;
745
+ /** @deprecated Use "externalImportAttributes" instead. */
746
+ externalImportAssertions?: boolean;
747
+ externalImportAttributes?: boolean;
748
+ externalLiveBindings?: boolean;
749
+ // only required for bundle.write
750
+ file?: string;
751
+ footer?: string | AddonFunction;
752
+ format?: ModuleFormat;
753
+ freeze?: boolean;
754
+ generatedCode?: GeneratedCodePreset | GeneratedCodeOptions;
755
+ globals?: GlobalsOption;
756
+ hashCharacters?: HashCharacters;
757
+ hoistTransitiveImports?: boolean;
758
+ importAttributesKey?: ImportAttributesKey;
759
+ indent?: string | boolean;
760
+ inlineDynamicImports?: boolean;
761
+ interop?: InteropType | GetInterop;
762
+ intro?: string | AddonFunction;
763
+ manualChunks?: ManualChunksOption;
764
+ minifyInternalExports?: boolean;
765
+ name?: string;
766
+ noConflict?: boolean;
767
+ outro?: string | AddonFunction;
768
+ paths?: OptionsPaths;
769
+ plugins?: OutputPluginOption;
770
+ preserveModules?: boolean;
771
+ preserveModulesRoot?: string;
772
+ reexportProtoFromExternal?: boolean;
773
+ sanitizeFileName?: boolean | ((fileName: string) => string);
774
+ sourcemap?: boolean | 'inline' | 'hidden';
775
+ sourcemapBaseUrl?: string;
776
+ sourcemapExcludeSources?: boolean;
777
+ sourcemapFile?: string;
778
+ sourcemapFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
779
+ sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption;
780
+ sourcemapPathTransform?: SourcemapPathTransformOption;
781
+ sourcemapDebugIds?: boolean;
782
+ strict?: boolean;
783
+ systemNullSetters?: boolean;
784
+ validate?: boolean;
785
+ virtualDirname?: string;
786
+ }
787
+
788
+ interface NormalizedOutputOptions {
789
+ amd: NormalizedAmdOptions;
790
+ assetFileNames: string | ((chunkInfo: PreRenderedAsset) => string);
791
+ banner: AddonFunction;
792
+ chunkFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
793
+ compact: boolean;
794
+ dir: string | undefined;
795
+ dynamicImportInCjs: boolean;
796
+ entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
797
+ esModule: boolean | 'if-default-prop';
798
+ experimentalMinChunkSize: number;
799
+ exports: 'default' | 'named' | 'none' | 'auto';
800
+ extend: boolean;
801
+ /** @deprecated Use "externalImportAttributes" instead. */
802
+ externalImportAssertions: boolean;
803
+ externalImportAttributes: boolean;
804
+ externalLiveBindings: boolean;
805
+ file: string | undefined;
806
+ footer: AddonFunction;
807
+ format: InternalModuleFormat;
808
+ freeze: boolean;
809
+ generatedCode: NormalizedGeneratedCodeOptions;
810
+ globals: GlobalsOption;
811
+ hashCharacters: HashCharacters;
812
+ hoistTransitiveImports: boolean;
813
+ importAttributesKey: ImportAttributesKey;
814
+ indent: true | string;
815
+ inlineDynamicImports: boolean;
816
+ interop: GetInterop;
817
+ intro: AddonFunction;
818
+ manualChunks: ManualChunksOption;
819
+ minifyInternalExports: boolean;
820
+ name: string | undefined;
821
+ noConflict: boolean;
822
+ outro: AddonFunction;
823
+ paths: OptionsPaths;
824
+ plugins: OutputPlugin[];
825
+ preserveModules: boolean;
826
+ preserveModulesRoot: string | undefined;
827
+ reexportProtoFromExternal: boolean;
828
+ sanitizeFileName: (fileName: string) => string;
829
+ sourcemap: boolean | 'inline' | 'hidden';
830
+ sourcemapBaseUrl: string | undefined;
831
+ sourcemapExcludeSources: boolean;
832
+ sourcemapFile: string | undefined;
833
+ sourcemapFileNames: string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
834
+ sourcemapIgnoreList: SourcemapIgnoreListOption;
835
+ sourcemapPathTransform: SourcemapPathTransformOption | undefined;
836
+ sourcemapDebugIds: boolean;
837
+ strict: boolean;
838
+ systemNullSetters: boolean;
839
+ validate: boolean;
840
+ virtualDirname: string;
841
+ }
842
+
843
+ type WarningHandlerWithDefault = (
844
+ warning: RollupLog,
845
+ defaultHandler: LoggingFunction
846
+ ) => void;
847
+
848
+ interface PreRenderedAsset {
849
+ /** @deprecated Use "names" instead. */
850
+ name: string | undefined;
851
+ names: string[];
852
+ /** @deprecated Use "originalFileNames" instead. */
853
+ originalFileName: string | null;
854
+ originalFileNames: string[];
855
+ source: string | Uint8Array;
856
+ type: 'asset';
857
+ }
858
+
859
+ interface OutputAsset extends PreRenderedAsset {
860
+ fileName: string;
861
+ needsCodeReference: boolean;
862
+ }
863
+
864
+ interface RenderedModule {
865
+ readonly code: string | null;
866
+ originalLength: number;
867
+ removedExports: string[];
868
+ renderedExports: string[];
869
+ renderedLength: number;
870
+ }
871
+
872
+ interface PreRenderedChunk {
873
+ exports: string[];
874
+ facadeModuleId: string | null;
875
+ isDynamicEntry: boolean;
876
+ isEntry: boolean;
877
+ isImplicitEntry: boolean;
878
+ moduleIds: string[];
879
+ name: string;
880
+ type: 'chunk';
881
+ }
882
+
883
+ interface RenderedChunk extends PreRenderedChunk {
884
+ dynamicImports: string[];
885
+ fileName: string;
886
+ implicitlyLoadedBefore: string[];
887
+ importedBindings: Record<string, string[]>;
888
+ imports: string[];
889
+ modules: Record<string, RenderedModule>;
890
+ referencedFiles: string[];
891
+ }
892
+
893
+ interface OutputChunk extends RenderedChunk {
894
+ code: string;
895
+ map: SourceMap | null;
896
+ sourcemapFileName: string | null;
897
+ preliminaryFileName: string;
898
+ }
899
+
900
+ type SerializablePluginCache = Record<string, [number, any]>;
901
+
902
+ interface RollupCache {
903
+ modules: ModuleJSON[];
904
+ plugins?: Record<string, SerializablePluginCache>;
905
+ }
906
+
907
+ interface ChokidarOptions {
908
+ alwaysStat?: boolean;
909
+ atomic?: boolean | number;
910
+ awaitWriteFinish?:
911
+ | {
912
+ pollInterval?: number;
913
+ stabilityThreshold?: number;
914
+ }
915
+ | boolean;
916
+ binaryInterval?: number;
917
+ cwd?: string;
918
+ depth?: number;
919
+ disableGlobbing?: boolean;
920
+ followSymlinks?: boolean;
921
+ ignoreInitial?: boolean;
922
+ ignorePermissionErrors?: boolean;
923
+ ignored?: any;
924
+ interval?: number;
925
+ persistent?: boolean;
926
+ useFsEvents?: boolean;
927
+ usePolling?: boolean;
928
+ }
929
+
930
+ interface WatcherOptions {
931
+ buildDelay?: number;
932
+ chokidar?: ChokidarOptions;
933
+ clearScreen?: boolean;
934
+ exclude?: string | RegExp | (string | RegExp)[];
935
+ include?: string | RegExp | (string | RegExp)[];
936
+ skipWrite?: boolean;
937
+ onInvalidate?: (id: string) => void;
938
+ }
939
+
940
+ interface AstNodeLocation {
941
+ end: number;
942
+ start: number;
943
+ }
944
+
945
+ type OmittedEstreeKeys =
946
+ | 'loc'
947
+ | 'range'
948
+ | 'leadingComments'
949
+ | 'trailingComments'
950
+ | 'innerComments'
951
+ | 'comments';
952
+ type RollupAstNode<T> = Omit<T, OmittedEstreeKeys> & AstNodeLocation;
953
+
954
+ type ProgramNode = RollupAstNode<estree.Program>;
955
+ type AstNode = RollupAstNode<estree.Node>;
956
+
957
+ type CustomTag = {
958
+ name: RegExp;
959
+ depth: (name: string) => number;
960
+ };
961
+ interface RemarkMdxTocOptions {
962
+ name?: string;
963
+ customTags?: CustomTag[];
964
+ minDepth?: number;
965
+ }
966
+
967
+ interface VitePluginInterface {
968
+ toc: RemarkMdxTocOptions;
969
+ }
970
+ declare function vitePlugins(options: VitePluginInterface): Plugin[];
971
+
972
+ export { type VitePluginInterface, vitePlugins };