@xyd-js/content 0.1.0-xyd.10

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