@monstermann/unplugin-map 0.2.0 → 0.4.0

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.
@@ -0,0 +1,1263 @@
1
+ //#region ../../node_modules/rollup/node_modules/@types/estree/index.d.ts
2
+ // This definition file follows a somewhat unusual format. ESTree allows
3
+ // runtime type checks based on the `type` parameter. In order to explain this
4
+ // to typescript we want to use discriminated union types:
5
+ // https://github.com/Microsoft/TypeScript/pull/9163
6
+ //
7
+ // For ESTree this is a bit tricky because the high level interfaces like
8
+ // Node or Function are pulling double duty. We want to pass common fields down
9
+ // to the interfaces that extend them (like Identifier or
10
+ // ArrowFunctionExpression), but you can't extend a type union or enforce
11
+ // common fields on them. So we've split the high level interfaces into two
12
+ // types, a base type which passes down inherited fields, and a type union of
13
+ // all types which extend the base type. Only the type union is exported, and
14
+ // the union is how other types refer to the collection of inheriting types.
15
+ //
16
+ // This makes the definitions file here somewhat more difficult to maintain,
17
+ // but it has the notable advantage of making ESTree much easier to use as
18
+ // an end user.
19
+ interface BaseNodeWithoutComments {
20
+ // Every leaf interface that extends BaseNode must specify a type property.
21
+ // The type property should be a string literal. For example, Identifier
22
+ // has: `type: "Identifier"`
23
+ type: string;
24
+ loc?: SourceLocation | null | undefined;
25
+ range?: [number, number] | undefined;
26
+ }
27
+ interface BaseNode extends BaseNodeWithoutComments {
28
+ leadingComments?: Comment[] | undefined;
29
+ trailingComments?: Comment[] | undefined;
30
+ }
31
+ interface NodeMap {
32
+ AssignmentProperty: AssignmentProperty;
33
+ CatchClause: CatchClause;
34
+ Class: Class;
35
+ ClassBody: ClassBody;
36
+ Expression: Expression;
37
+ Function: Function;
38
+ Identifier: Identifier;
39
+ Literal: Literal;
40
+ MethodDefinition: MethodDefinition;
41
+ ModuleDeclaration: ModuleDeclaration;
42
+ ModuleSpecifier: ModuleSpecifier;
43
+ Pattern: Pattern;
44
+ PrivateIdentifier: PrivateIdentifier;
45
+ Program: Program;
46
+ Property: Property;
47
+ PropertyDefinition: PropertyDefinition;
48
+ SpreadElement: SpreadElement;
49
+ Statement: Statement;
50
+ Super: Super;
51
+ SwitchCase: SwitchCase;
52
+ TemplateElement: TemplateElement;
53
+ VariableDeclarator: VariableDeclarator;
54
+ }
55
+ type Node = NodeMap[keyof NodeMap];
56
+ interface Comment extends BaseNodeWithoutComments {
57
+ type: "Line" | "Block";
58
+ value: string;
59
+ }
60
+ interface SourceLocation {
61
+ source?: string | null | undefined;
62
+ start: Position;
63
+ end: Position;
64
+ }
65
+ interface Position {
66
+ /** >= 1 */
67
+ line: number;
68
+ /** >= 0 */
69
+ column: number;
70
+ }
71
+ interface Program extends BaseNode {
72
+ type: "Program";
73
+ sourceType: "script" | "module";
74
+ body: Array<Directive | Statement | ModuleDeclaration>;
75
+ comments?: Comment[] | undefined;
76
+ }
77
+ interface Directive extends BaseNode {
78
+ type: "ExpressionStatement";
79
+ expression: Literal;
80
+ directive: string;
81
+ }
82
+ interface BaseFunction extends BaseNode {
83
+ params: Pattern[];
84
+ generator?: boolean | undefined;
85
+ async?: boolean | undefined; // The body is either BlockStatement or Expression because arrow functions
86
+ // can have a body that's either. FunctionDeclarations and
87
+ // FunctionExpressions have only BlockStatement bodies.
88
+ body: BlockStatement | Expression;
89
+ }
90
+ type Function = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
91
+ type Statement = ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration;
92
+ interface BaseStatement extends BaseNode {}
93
+ interface EmptyStatement extends BaseStatement {
94
+ type: "EmptyStatement";
95
+ }
96
+ interface BlockStatement extends BaseStatement {
97
+ type: "BlockStatement";
98
+ body: Statement[];
99
+ innerComments?: Comment[] | undefined;
100
+ }
101
+ interface StaticBlock extends Omit<BlockStatement, "type"> {
102
+ type: "StaticBlock";
103
+ }
104
+ interface ExpressionStatement extends BaseStatement {
105
+ type: "ExpressionStatement";
106
+ expression: Expression;
107
+ }
108
+ interface IfStatement extends BaseStatement {
109
+ type: "IfStatement";
110
+ test: Expression;
111
+ consequent: Statement;
112
+ alternate?: Statement | null | undefined;
113
+ }
114
+ interface LabeledStatement extends BaseStatement {
115
+ type: "LabeledStatement";
116
+ label: Identifier;
117
+ body: Statement;
118
+ }
119
+ interface BreakStatement extends BaseStatement {
120
+ type: "BreakStatement";
121
+ label?: Identifier | null | undefined;
122
+ }
123
+ interface ContinueStatement extends BaseStatement {
124
+ type: "ContinueStatement";
125
+ label?: Identifier | null | undefined;
126
+ }
127
+ interface WithStatement extends BaseStatement {
128
+ type: "WithStatement";
129
+ object: Expression;
130
+ body: Statement;
131
+ }
132
+ interface SwitchStatement extends BaseStatement {
133
+ type: "SwitchStatement";
134
+ discriminant: Expression;
135
+ cases: SwitchCase[];
136
+ }
137
+ interface ReturnStatement extends BaseStatement {
138
+ type: "ReturnStatement";
139
+ argument?: Expression | null | undefined;
140
+ }
141
+ interface ThrowStatement extends BaseStatement {
142
+ type: "ThrowStatement";
143
+ argument: Expression;
144
+ }
145
+ interface TryStatement extends BaseStatement {
146
+ type: "TryStatement";
147
+ block: BlockStatement;
148
+ handler?: CatchClause | null | undefined;
149
+ finalizer?: BlockStatement | null | undefined;
150
+ }
151
+ interface WhileStatement extends BaseStatement {
152
+ type: "WhileStatement";
153
+ test: Expression;
154
+ body: Statement;
155
+ }
156
+ interface DoWhileStatement extends BaseStatement {
157
+ type: "DoWhileStatement";
158
+ body: Statement;
159
+ test: Expression;
160
+ }
161
+ interface ForStatement extends BaseStatement {
162
+ type: "ForStatement";
163
+ init?: VariableDeclaration | Expression | null | undefined;
164
+ test?: Expression | null | undefined;
165
+ update?: Expression | null | undefined;
166
+ body: Statement;
167
+ }
168
+ interface BaseForXStatement extends BaseStatement {
169
+ left: VariableDeclaration | Pattern;
170
+ right: Expression;
171
+ body: Statement;
172
+ }
173
+ interface ForInStatement extends BaseForXStatement {
174
+ type: "ForInStatement";
175
+ }
176
+ interface DebuggerStatement extends BaseStatement {
177
+ type: "DebuggerStatement";
178
+ }
179
+ type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
180
+ interface BaseDeclaration extends BaseStatement {}
181
+ interface MaybeNamedFunctionDeclaration extends BaseFunction, BaseDeclaration {
182
+ type: "FunctionDeclaration";
183
+ /** It is null when a function declaration is a part of the `export default function` statement */
184
+ id: Identifier | null;
185
+ body: BlockStatement;
186
+ }
187
+ interface FunctionDeclaration extends MaybeNamedFunctionDeclaration {
188
+ id: Identifier;
189
+ }
190
+ interface VariableDeclaration extends BaseDeclaration {
191
+ type: "VariableDeclaration";
192
+ declarations: VariableDeclarator[];
193
+ kind: "var" | "let" | "const";
194
+ }
195
+ interface VariableDeclarator extends BaseNode {
196
+ type: "VariableDeclarator";
197
+ id: Pattern;
198
+ init?: Expression | null | undefined;
199
+ }
200
+ interface ExpressionMap {
201
+ ArrayExpression: ArrayExpression;
202
+ ArrowFunctionExpression: ArrowFunctionExpression;
203
+ AssignmentExpression: AssignmentExpression;
204
+ AwaitExpression: AwaitExpression;
205
+ BinaryExpression: BinaryExpression;
206
+ CallExpression: CallExpression;
207
+ ChainExpression: ChainExpression;
208
+ ClassExpression: ClassExpression;
209
+ ConditionalExpression: ConditionalExpression;
210
+ FunctionExpression: FunctionExpression;
211
+ Identifier: Identifier;
212
+ ImportExpression: ImportExpression;
213
+ Literal: Literal;
214
+ LogicalExpression: LogicalExpression;
215
+ MemberExpression: MemberExpression;
216
+ MetaProperty: MetaProperty;
217
+ NewExpression: NewExpression;
218
+ ObjectExpression: ObjectExpression;
219
+ SequenceExpression: SequenceExpression;
220
+ TaggedTemplateExpression: TaggedTemplateExpression;
221
+ TemplateLiteral: TemplateLiteral;
222
+ ThisExpression: ThisExpression;
223
+ UnaryExpression: UnaryExpression;
224
+ UpdateExpression: UpdateExpression;
225
+ YieldExpression: YieldExpression;
226
+ }
227
+ type Expression = ExpressionMap[keyof ExpressionMap];
228
+ interface BaseExpression extends BaseNode {}
229
+ type ChainElement = SimpleCallExpression | MemberExpression;
230
+ interface ChainExpression extends BaseExpression {
231
+ type: "ChainExpression";
232
+ expression: ChainElement;
233
+ }
234
+ interface ThisExpression extends BaseExpression {
235
+ type: "ThisExpression";
236
+ }
237
+ interface ArrayExpression extends BaseExpression {
238
+ type: "ArrayExpression";
239
+ elements: Array<Expression | SpreadElement | null>;
240
+ }
241
+ interface ObjectExpression extends BaseExpression {
242
+ type: "ObjectExpression";
243
+ properties: Array<Property | SpreadElement>;
244
+ }
245
+ interface PrivateIdentifier extends BaseNode {
246
+ type: "PrivateIdentifier";
247
+ name: string;
248
+ }
249
+ interface Property extends BaseNode {
250
+ type: "Property";
251
+ key: Expression | PrivateIdentifier;
252
+ value: Expression | Pattern; // Could be an AssignmentProperty
253
+ kind: "init" | "get" | "set";
254
+ method: boolean;
255
+ shorthand: boolean;
256
+ computed: boolean;
257
+ }
258
+ interface PropertyDefinition extends BaseNode {
259
+ type: "PropertyDefinition";
260
+ key: Expression | PrivateIdentifier;
261
+ value?: Expression | null | undefined;
262
+ computed: boolean;
263
+ static: boolean;
264
+ }
265
+ interface FunctionExpression extends BaseFunction, BaseExpression {
266
+ id?: Identifier | null | undefined;
267
+ type: "FunctionExpression";
268
+ body: BlockStatement;
269
+ }
270
+ interface SequenceExpression extends BaseExpression {
271
+ type: "SequenceExpression";
272
+ expressions: Expression[];
273
+ }
274
+ interface UnaryExpression extends BaseExpression {
275
+ type: "UnaryExpression";
276
+ operator: UnaryOperator;
277
+ prefix: true;
278
+ argument: Expression;
279
+ }
280
+ interface BinaryExpression extends BaseExpression {
281
+ type: "BinaryExpression";
282
+ operator: BinaryOperator;
283
+ left: Expression | PrivateIdentifier;
284
+ right: Expression;
285
+ }
286
+ interface AssignmentExpression extends BaseExpression {
287
+ type: "AssignmentExpression";
288
+ operator: AssignmentOperator;
289
+ left: Pattern | MemberExpression;
290
+ right: Expression;
291
+ }
292
+ interface UpdateExpression extends BaseExpression {
293
+ type: "UpdateExpression";
294
+ operator: UpdateOperator;
295
+ argument: Expression;
296
+ prefix: boolean;
297
+ }
298
+ interface LogicalExpression extends BaseExpression {
299
+ type: "LogicalExpression";
300
+ operator: LogicalOperator;
301
+ left: Expression;
302
+ right: Expression;
303
+ }
304
+ interface ConditionalExpression extends BaseExpression {
305
+ type: "ConditionalExpression";
306
+ test: Expression;
307
+ alternate: Expression;
308
+ consequent: Expression;
309
+ }
310
+ interface BaseCallExpression extends BaseExpression {
311
+ callee: Expression | Super;
312
+ arguments: Array<Expression | SpreadElement>;
313
+ }
314
+ type CallExpression = SimpleCallExpression | NewExpression;
315
+ interface SimpleCallExpression extends BaseCallExpression {
316
+ type: "CallExpression";
317
+ optional: boolean;
318
+ }
319
+ interface NewExpression extends BaseCallExpression {
320
+ type: "NewExpression";
321
+ }
322
+ interface MemberExpression extends BaseExpression, BasePattern {
323
+ type: "MemberExpression";
324
+ object: Expression | Super;
325
+ property: Expression | PrivateIdentifier;
326
+ computed: boolean;
327
+ optional: boolean;
328
+ }
329
+ type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression;
330
+ interface BasePattern extends BaseNode {}
331
+ interface SwitchCase extends BaseNode {
332
+ type: "SwitchCase";
333
+ test?: Expression | null | undefined;
334
+ consequent: Statement[];
335
+ }
336
+ interface CatchClause extends BaseNode {
337
+ type: "CatchClause";
338
+ param: Pattern | null;
339
+ body: BlockStatement;
340
+ }
341
+ interface Identifier extends BaseNode, BaseExpression, BasePattern {
342
+ type: "Identifier";
343
+ name: string;
344
+ }
345
+ type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
346
+ interface SimpleLiteral extends BaseNode, BaseExpression {
347
+ type: "Literal";
348
+ value: string | boolean | number | null;
349
+ raw?: string | undefined;
350
+ }
351
+ interface RegExpLiteral extends BaseNode, BaseExpression {
352
+ type: "Literal";
353
+ value?: RegExp | null | undefined;
354
+ regex: {
355
+ pattern: string;
356
+ flags: string;
357
+ };
358
+ raw?: string | undefined;
359
+ }
360
+ interface BigIntLiteral extends BaseNode, BaseExpression {
361
+ type: "Literal";
362
+ value?: bigint | null | undefined;
363
+ bigint: string;
364
+ raw?: string | undefined;
365
+ }
366
+ type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
367
+ type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof";
368
+ type LogicalOperator = "||" | "&&" | "??";
369
+ type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
370
+ type UpdateOperator = "++" | "--";
371
+ interface ForOfStatement extends BaseForXStatement {
372
+ type: "ForOfStatement";
373
+ await: boolean;
374
+ }
375
+ interface Super extends BaseNode {
376
+ type: "Super";
377
+ }
378
+ interface SpreadElement extends BaseNode {
379
+ type: "SpreadElement";
380
+ argument: Expression;
381
+ }
382
+ interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
383
+ type: "ArrowFunctionExpression";
384
+ expression: boolean;
385
+ body: BlockStatement | Expression;
386
+ }
387
+ interface YieldExpression extends BaseExpression {
388
+ type: "YieldExpression";
389
+ argument?: Expression | null | undefined;
390
+ delegate: boolean;
391
+ }
392
+ interface TemplateLiteral extends BaseExpression {
393
+ type: "TemplateLiteral";
394
+ quasis: TemplateElement[];
395
+ expressions: Expression[];
396
+ }
397
+ interface TaggedTemplateExpression extends BaseExpression {
398
+ type: "TaggedTemplateExpression";
399
+ tag: Expression;
400
+ quasi: TemplateLiteral;
401
+ }
402
+ interface TemplateElement extends BaseNode {
403
+ type: "TemplateElement";
404
+ tail: boolean;
405
+ value: {
406
+ /** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */cooked?: string | null | undefined;
407
+ raw: string;
408
+ };
409
+ }
410
+ interface AssignmentProperty extends Property {
411
+ value: Pattern;
412
+ kind: "init";
413
+ method: boolean; // false
414
+ }
415
+ interface ObjectPattern extends BasePattern {
416
+ type: "ObjectPattern";
417
+ properties: Array<AssignmentProperty | RestElement>;
418
+ }
419
+ interface ArrayPattern extends BasePattern {
420
+ type: "ArrayPattern";
421
+ elements: Array<Pattern | null>;
422
+ }
423
+ interface RestElement extends BasePattern {
424
+ type: "RestElement";
425
+ argument: Pattern;
426
+ }
427
+ interface AssignmentPattern extends BasePattern {
428
+ type: "AssignmentPattern";
429
+ left: Pattern;
430
+ right: Expression;
431
+ }
432
+ type Class = ClassDeclaration | ClassExpression;
433
+ interface BaseClass extends BaseNode {
434
+ superClass?: Expression | null | undefined;
435
+ body: ClassBody;
436
+ }
437
+ interface ClassBody extends BaseNode {
438
+ type: "ClassBody";
439
+ body: Array<MethodDefinition | PropertyDefinition | StaticBlock>;
440
+ }
441
+ interface MethodDefinition extends BaseNode {
442
+ type: "MethodDefinition";
443
+ key: Expression | PrivateIdentifier;
444
+ value: FunctionExpression;
445
+ kind: "constructor" | "method" | "get" | "set";
446
+ computed: boolean;
447
+ static: boolean;
448
+ }
449
+ interface MaybeNamedClassDeclaration extends BaseClass, BaseDeclaration {
450
+ type: "ClassDeclaration";
451
+ /** It is null when a class declaration is a part of the `export default class` statement */
452
+ id: Identifier | null;
453
+ }
454
+ interface ClassDeclaration extends MaybeNamedClassDeclaration {
455
+ id: Identifier;
456
+ }
457
+ interface ClassExpression extends BaseClass, BaseExpression {
458
+ type: "ClassExpression";
459
+ id?: Identifier | null | undefined;
460
+ }
461
+ interface MetaProperty extends BaseExpression {
462
+ type: "MetaProperty";
463
+ meta: Identifier;
464
+ property: Identifier;
465
+ }
466
+ type ModuleDeclaration = ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration;
467
+ interface BaseModuleDeclaration extends BaseNode {}
468
+ type ModuleSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier;
469
+ interface BaseModuleSpecifier extends BaseNode {
470
+ local: Identifier;
471
+ }
472
+ interface ImportDeclaration extends BaseModuleDeclaration {
473
+ type: "ImportDeclaration";
474
+ specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
475
+ attributes: ImportAttribute[];
476
+ source: Literal;
477
+ }
478
+ interface ImportSpecifier extends BaseModuleSpecifier {
479
+ type: "ImportSpecifier";
480
+ imported: Identifier | Literal;
481
+ }
482
+ interface ImportAttribute extends BaseNode {
483
+ type: "ImportAttribute";
484
+ key: Identifier | Literal;
485
+ value: Literal;
486
+ }
487
+ interface ImportExpression extends BaseExpression {
488
+ type: "ImportExpression";
489
+ source: Expression;
490
+ options?: Expression | null | undefined;
491
+ }
492
+ interface ImportDefaultSpecifier extends BaseModuleSpecifier {
493
+ type: "ImportDefaultSpecifier";
494
+ }
495
+ interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
496
+ type: "ImportNamespaceSpecifier";
497
+ }
498
+ interface ExportNamedDeclaration extends BaseModuleDeclaration {
499
+ type: "ExportNamedDeclaration";
500
+ declaration?: Declaration | null | undefined;
501
+ specifiers: ExportSpecifier[];
502
+ attributes: ImportAttribute[];
503
+ source?: Literal | null | undefined;
504
+ }
505
+ interface ExportSpecifier extends Omit<BaseModuleSpecifier, "local"> {
506
+ type: "ExportSpecifier";
507
+ local: Identifier | Literal;
508
+ exported: Identifier | Literal;
509
+ }
510
+ interface ExportDefaultDeclaration extends BaseModuleDeclaration {
511
+ type: "ExportDefaultDeclaration";
512
+ declaration: MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration | Expression;
513
+ }
514
+ interface ExportAllDeclaration extends BaseModuleDeclaration {
515
+ type: "ExportAllDeclaration";
516
+ exported: Identifier | Literal | null;
517
+ attributes: ImportAttribute[];
518
+ source: Literal;
519
+ }
520
+ interface AwaitExpression extends BaseExpression {
521
+ type: "AwaitExpression";
522
+ argument: Expression;
523
+ }
524
+ //#endregion
525
+ //#region ../../node_modules/rollup/dist/rollup.d.ts
526
+ declare module 'estree' {
527
+ export interface Decorator extends BaseNode {
528
+ type: 'Decorator';
529
+ expression: Expression;
530
+ }
531
+ interface PropertyDefinition {
532
+ decorators: undefined[];
533
+ }
534
+ interface MethodDefinition {
535
+ decorators: undefined[];
536
+ }
537
+ interface BaseClass {
538
+ decorators: undefined[];
539
+ }
540
+ }
541
+ // utils
542
+ type NullValue = null | undefined | void;
543
+ type MaybeArray<T> = T | T[];
544
+ type MaybePromise<T> = T | Promise<T>;
545
+ type PartialNull<T> = { [P in keyof T]: T[P] | null };
546
+ interface RollupError extends RollupLog {
547
+ name?: string;
548
+ stack?: string;
549
+ watchFiles?: string[];
550
+ }
551
+ interface RollupLog {
552
+ binding?: string;
553
+ cause?: unknown;
554
+ code?: string;
555
+ exporter?: string;
556
+ frame?: string;
557
+ hook?: string;
558
+ id?: string;
559
+ ids?: string[];
560
+ loc?: {
561
+ column: number;
562
+ file?: string;
563
+ line: number;
564
+ };
565
+ message: string;
566
+ meta?: any;
567
+ names?: string[];
568
+ plugin?: string;
569
+ pluginCode?: unknown;
570
+ pos?: number;
571
+ reexporter?: string;
572
+ stack?: string;
573
+ url?: string;
574
+ }
575
+ type LogLevel = 'warn' | 'info' | 'debug';
576
+ type LogLevelOption = LogLevel | 'silent';
577
+ type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number];
578
+ interface ExistingDecodedSourceMap {
579
+ file?: string;
580
+ readonly mappings: SourceMapSegment[][];
581
+ names: string[];
582
+ sourceRoot?: string;
583
+ sources: string[];
584
+ sourcesContent?: string[];
585
+ version: number;
586
+ x_google_ignoreList?: number[];
587
+ }
588
+ interface ExistingRawSourceMap {
589
+ file?: string;
590
+ mappings: string;
591
+ names: string[];
592
+ sourceRoot?: string;
593
+ sources: string[];
594
+ sourcesContent?: string[];
595
+ version: number;
596
+ x_google_ignoreList?: number[];
597
+ }
598
+ type DecodedSourceMapOrMissing = {
599
+ missing: true;
600
+ plugin: string;
601
+ } | (ExistingDecodedSourceMap & {
602
+ missing?: false;
603
+ });
604
+ interface SourceMap {
605
+ file: string;
606
+ mappings: string;
607
+ names: string[];
608
+ sources: string[];
609
+ sourcesContent?: string[];
610
+ version: number;
611
+ debugId?: string;
612
+ toString(): string;
613
+ toUrl(): string;
614
+ }
615
+ type SourceMapInput = ExistingRawSourceMap | string | null | {
616
+ mappings: '';
617
+ };
618
+ interface ModuleOptions {
619
+ attributes: Record<string, string>;
620
+ meta: CustomPluginOptions;
621
+ moduleSideEffects: boolean | 'no-treeshake';
622
+ syntheticNamedExports: boolean | string;
623
+ }
624
+ interface SourceDescription extends Partial<PartialNull<ModuleOptions>> {
625
+ ast?: ProgramNode;
626
+ code: string;
627
+ map?: SourceMapInput;
628
+ }
629
+ interface TransformModuleJSON {
630
+ ast?: ProgramNode;
631
+ code: string; // note if plugins use new this.cache to opt-out auto transform cache
632
+ customTransformCache: boolean;
633
+ originalCode: string;
634
+ originalSourcemap: ExistingDecodedSourceMap | null;
635
+ sourcemapChain: DecodedSourceMapOrMissing[];
636
+ transformDependencies: string[];
637
+ }
638
+ interface ModuleJSON extends TransformModuleJSON, ModuleOptions {
639
+ ast: ProgramNode;
640
+ dependencies: string[];
641
+ id: string;
642
+ resolvedIds: ResolvedIdMap;
643
+ transformFiles: EmittedFile[] | undefined;
644
+ }
645
+ interface PluginCache {
646
+ delete(id: string): boolean;
647
+ get<T = any>(id: string): T;
648
+ has(id: string): boolean;
649
+ set<T = any>(id: string, value: T): void;
650
+ }
651
+ type LoggingFunction = (log: RollupLog | string | (() => RollupLog | string)) => void;
652
+ interface MinimalPluginContext {
653
+ debug: LoggingFunction;
654
+ error: (error: RollupError | string) => never;
655
+ info: LoggingFunction;
656
+ meta: PluginContextMeta;
657
+ warn: LoggingFunction;
658
+ }
659
+ interface EmittedAsset {
660
+ fileName?: string;
661
+ name?: string;
662
+ needsCodeReference?: boolean;
663
+ originalFileName?: string | null;
664
+ source?: string | Uint8Array;
665
+ type: 'asset';
666
+ }
667
+ interface EmittedChunk {
668
+ fileName?: string;
669
+ id: string;
670
+ implicitlyLoadedAfterOneOf?: string[];
671
+ importer?: string;
672
+ name?: string;
673
+ preserveSignature?: PreserveEntrySignaturesOption;
674
+ type: 'chunk';
675
+ }
676
+ interface EmittedPrebuiltChunk {
677
+ code: string;
678
+ exports?: string[];
679
+ fileName: string;
680
+ map?: SourceMap;
681
+ sourcemapFileName?: string;
682
+ type: 'prebuilt-chunk';
683
+ }
684
+ type EmittedFile = EmittedAsset | EmittedChunk | EmittedPrebuiltChunk;
685
+ type EmitFile = (emittedFile: EmittedFile) => string;
686
+ interface ModuleInfo extends ModuleOptions {
687
+ ast: ProgramNode | null;
688
+ code: string | null;
689
+ dynamicImporters: readonly string[];
690
+ dynamicallyImportedIdResolutions: readonly ResolvedId[];
691
+ dynamicallyImportedIds: readonly string[];
692
+ exportedBindings: Record<string, string[]> | null;
693
+ exports: string[] | null;
694
+ hasDefaultExport: boolean | null;
695
+ id: string;
696
+ implicitlyLoadedAfterOneOf: readonly string[];
697
+ implicitlyLoadedBefore: readonly string[];
698
+ importedIdResolutions: readonly ResolvedId[];
699
+ importedIds: readonly string[];
700
+ importers: readonly string[];
701
+ isEntry: boolean;
702
+ isExternal: boolean;
703
+ isIncluded: boolean | null;
704
+ }
705
+ type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
706
+ // eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style -- this is an interface so that it can be extended by plugins
707
+ interface CustomPluginOptions {
708
+ [plugin: string]: any;
709
+ }
710
+ type LoggingFunctionWithPosition = (log: RollupLog | string | (() => RollupLog | string), pos?: number | {
711
+ column: number;
712
+ line: number;
713
+ }) => void;
714
+ type ParseAst = (input: string, options?: {
715
+ allowReturnOutsideFunction?: boolean;
716
+ jsx?: boolean;
717
+ }) => ProgramNode;
718
+ // declare AbortSignal here for environments without DOM lib or @types/node
719
+ declare global {
720
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
721
+ interface AbortSignal {}
722
+ }
723
+ interface PluginContext extends MinimalPluginContext {
724
+ addWatchFile: (id: string) => void;
725
+ cache: PluginCache;
726
+ debug: LoggingFunction;
727
+ emitFile: EmitFile;
728
+ error: (error: RollupError | string) => never;
729
+ getFileName: (fileReferenceId: string) => string;
730
+ getModuleIds: () => IterableIterator<string>;
731
+ getModuleInfo: GetModuleInfo;
732
+ getWatchFiles: () => string[];
733
+ info: LoggingFunction;
734
+ load: (options: {
735
+ id: string;
736
+ resolveDependencies?: boolean;
737
+ } & Partial<PartialNull<ModuleOptions>>) => Promise<ModuleInfo>;
738
+ parse: ParseAst;
739
+ resolve: (source: string, importer?: string, options?: {
740
+ attributes?: Record<string, string>;
741
+ custom?: CustomPluginOptions;
742
+ isEntry?: boolean;
743
+ skipSelf?: boolean;
744
+ }) => Promise<ResolvedId | null>;
745
+ setAssetSource: (assetReferenceId: string, source: string | Uint8Array) => void;
746
+ warn: LoggingFunction;
747
+ }
748
+ interface PluginContextMeta {
749
+ rollupVersion: string;
750
+ watchMode: boolean;
751
+ }
752
+ type StringOrRegExp = string | RegExp;
753
+ type StringFilter<Value = StringOrRegExp> = MaybeArray<Value> | {
754
+ include?: MaybeArray<Value>;
755
+ exclude?: MaybeArray<Value>;
756
+ };
757
+ interface HookFilter {
758
+ id?: StringFilter;
759
+ code?: StringFilter;
760
+ }
761
+ interface ResolvedId extends ModuleOptions {
762
+ external: boolean | 'absolute';
763
+ id: string;
764
+ resolvedBy: string;
765
+ }
766
+ type ResolvedIdMap = Record<string, ResolvedId>;
767
+ interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> {
768
+ external?: boolean | 'absolute' | 'relative';
769
+ id: string;
770
+ resolvedBy?: string;
771
+ }
772
+ type ResolveIdResult = string | NullValue | false | PartialResolvedId;
773
+ type ResolveIdHook = (this: PluginContext, source: string, importer: string | undefined, options: {
774
+ attributes: Record<string, string>;
775
+ custom?: CustomPluginOptions;
776
+ isEntry: boolean;
777
+ }) => ResolveIdResult;
778
+ type ShouldTransformCachedModuleHook = (this: PluginContext, options: {
779
+ ast: ProgramNode;
780
+ code: string;
781
+ id: string;
782
+ meta: CustomPluginOptions;
783
+ moduleSideEffects: boolean | 'no-treeshake';
784
+ resolvedSources: ResolvedIdMap;
785
+ syntheticNamedExports: boolean | string;
786
+ }) => boolean | NullValue;
787
+ type IsExternal = (source: string, importer: string | undefined, isResolved: boolean) => boolean;
788
+ type HasModuleSideEffects = (id: string, external: boolean) => boolean;
789
+ type LoadResult = SourceDescription | string | NullValue;
790
+ type LoadHook = (this: PluginContext, id: string) => LoadResult;
791
+ interface TransformPluginContext extends PluginContext {
792
+ debug: LoggingFunctionWithPosition;
793
+ error: (error: RollupError | string, pos?: number | {
794
+ column: number;
795
+ line: number;
796
+ }) => never;
797
+ getCombinedSourcemap: () => SourceMap;
798
+ info: LoggingFunctionWithPosition;
799
+ warn: LoggingFunctionWithPosition;
800
+ }
801
+ type TransformResult = string | NullValue | Partial<SourceDescription>;
802
+ type TransformHook = (this: TransformPluginContext, code: string, id: string) => TransformResult;
803
+ type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => void;
804
+ type RenderChunkHook = (this: PluginContext, code: string, chunk: RenderedChunk, options: NormalizedOutputOptions, meta: {
805
+ chunks: Record<string, RenderedChunk>;
806
+ }) => {
807
+ code: string;
808
+ map?: SourceMapInput;
809
+ } | string | NullValue;
810
+ type ResolveDynamicImportHook = (this: PluginContext, specifier: string | AstNode, importer: string, options: {
811
+ attributes: Record<string, string>;
812
+ }) => ResolveIdResult;
813
+ type ResolveImportMetaHook = (this: PluginContext, property: string | null, options: {
814
+ chunkId: string;
815
+ format: InternalModuleFormat;
816
+ moduleId: string;
817
+ }) => string | NullValue;
818
+ type ResolveFileUrlHook = (this: PluginContext, options: {
819
+ chunkId: string;
820
+ fileName: string;
821
+ format: InternalModuleFormat;
822
+ moduleId: string;
823
+ referenceId: string;
824
+ relativePath: string;
825
+ }) => string | NullValue;
826
+ type AddonHookFunction = (this: PluginContext, chunk: RenderedChunk) => string | Promise<string>;
827
+ type AddonHook = string | AddonHookFunction;
828
+ type ChangeEvent = 'create' | 'update' | 'delete';
829
+ type WatchChangeHook = (this: PluginContext, id: string, change: {
830
+ event: ChangeEvent;
831
+ }) => void;
832
+ type OutputBundle = Record<string, OutputAsset | OutputChunk>;
833
+ type PreRenderedChunkWithFileName = PreRenderedChunk & {
834
+ fileName: string;
835
+ };
836
+ interface ImportedInternalChunk {
837
+ type: 'internal';
838
+ fileName: string;
839
+ resolvedImportPath: string;
840
+ chunk: PreRenderedChunk;
841
+ }
842
+ interface ImportedExternalChunk {
843
+ type: 'external';
844
+ fileName: string;
845
+ resolvedImportPath: string;
846
+ }
847
+ type DynamicImportTargetChunk = ImportedInternalChunk | ImportedExternalChunk;
848
+ interface FunctionPluginHooks {
849
+ augmentChunkHash: (this: PluginContext, chunk: RenderedChunk) => string | void;
850
+ buildEnd: (this: PluginContext, error?: Error) => void;
851
+ buildStart: (this: PluginContext, options: NormalizedInputOptions) => void;
852
+ closeBundle: (this: PluginContext, error?: Error) => void;
853
+ closeWatcher: (this: PluginContext) => void;
854
+ generateBundle: (this: PluginContext, options: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void;
855
+ load: LoadHook;
856
+ moduleParsed: ModuleParsedHook;
857
+ onLog: (this: MinimalPluginContext, level: LogLevel, log: RollupLog) => boolean | NullValue;
858
+ options: (this: MinimalPluginContext, options: InputOptions) => InputOptions | NullValue;
859
+ outputOptions: (this: PluginContext, options: OutputOptions) => OutputOptions | NullValue;
860
+ renderChunk: RenderChunkHook;
861
+ renderDynamicImport: (this: PluginContext, options: {
862
+ customResolution: string | null;
863
+ format: InternalModuleFormat;
864
+ moduleId: string;
865
+ targetModuleId: string | null;
866
+ chunk: PreRenderedChunkWithFileName;
867
+ targetChunk: PreRenderedChunkWithFileName | null;
868
+ getTargetChunkImports: () => DynamicImportTargetChunk[] | null;
869
+ }) => {
870
+ left: string;
871
+ right: string;
872
+ } | NullValue;
873
+ renderError: (this: PluginContext, error?: Error) => void;
874
+ renderStart: (this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void;
875
+ resolveDynamicImport: ResolveDynamicImportHook;
876
+ resolveFileUrl: ResolveFileUrlHook;
877
+ resolveId: ResolveIdHook;
878
+ resolveImportMeta: ResolveImportMetaHook;
879
+ shouldTransformCachedModule: ShouldTransformCachedModuleHook;
880
+ transform: TransformHook;
881
+ watchChange: WatchChangeHook;
882
+ writeBundle: (this: PluginContext, options: NormalizedOutputOptions, bundle: OutputBundle) => void;
883
+ }
884
+ type OutputPluginHooks = 'augmentChunkHash' | 'generateBundle' | 'outputOptions' | 'renderChunk' | 'renderDynamicImport' | 'renderError' | 'renderStart' | 'resolveFileUrl' | 'resolveImportMeta' | 'writeBundle';
885
+ type SyncPluginHooks = 'augmentChunkHash' | 'onLog' | 'outputOptions' | 'renderDynamicImport' | 'resolveFileUrl' | 'resolveImportMeta';
886
+ type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
887
+ type FirstPluginHooks = 'load' | 'renderDynamicImport' | 'resolveDynamicImport' | 'resolveFileUrl' | 'resolveId' | 'resolveImportMeta' | 'shouldTransformCachedModule';
888
+ type SequentialPluginHooks = 'augmentChunkHash' | 'generateBundle' | 'onLog' | 'options' | 'outputOptions' | 'renderChunk' | 'transform';
889
+ type ParallelPluginHooks = Exclude<keyof FunctionPluginHooks | AddonHooks, FirstPluginHooks | SequentialPluginHooks>;
890
+ type AddonHooks = 'banner' | 'footer' | 'intro' | 'outro';
891
+ type MakeAsync<Function_> = Function_ extends ((this: infer This, ...parameters: infer Arguments) => infer Return) ? (this: This, ...parameters: Arguments) => Return | Promise<Return> : never; // eslint-disable-next-line @typescript-eslint/no-empty-object-type
892
+ type ObjectHook<T, O = {}> = T | ({
893
+ handler: T;
894
+ order?: 'pre' | 'post' | null;
895
+ } & O);
896
+ type HookFilterExtension<K extends keyof FunctionPluginHooks> = K extends 'transform' ? {
897
+ filter?: HookFilter;
898
+ } : K extends 'load' ? {
899
+ filter?: Pick<HookFilter, 'id'>;
900
+ } : K extends 'resolveId' ? {
901
+ filter?: {
902
+ id?: StringFilter<RegExp>;
903
+ };
904
+ } : // eslint-disable-next-line @typescript-eslint/no-empty-object-type
905
+ {};
906
+ type PluginHooks = { [K in keyof FunctionPluginHooks]: ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], // eslint-disable-next-line @typescript-eslint/no-empty-object-type
907
+ HookFilterExtension<K> & (K extends ParallelPluginHooks ? {
908
+ sequential?: boolean;
909
+ } : {})> };
910
+ interface OutputPlugin extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>, Partial<Record<AddonHooks, ObjectHook<AddonHook>>> {
911
+ cacheKey?: string;
912
+ name: string;
913
+ version?: string;
914
+ }
915
+ interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
916
+ // for inter-plugin communication
917
+ api?: A;
918
+ }
919
+ type JsxPreset = 'react' | 'react-jsx' | 'preserve' | 'preserve-react';
920
+ type NormalizedJsxOptions = NormalizedJsxPreserveOptions | NormalizedJsxClassicOptions | NormalizedJsxAutomaticOptions;
921
+ interface NormalizedJsxPreserveOptions {
922
+ factory: string | null;
923
+ fragment: string | null;
924
+ importSource: string | null;
925
+ mode: 'preserve';
926
+ }
927
+ interface NormalizedJsxClassicOptions {
928
+ factory: string;
929
+ fragment: string;
930
+ importSource: string | null;
931
+ mode: 'classic';
932
+ }
933
+ interface NormalizedJsxAutomaticOptions {
934
+ factory: string;
935
+ importSource: string | null;
936
+ jsxImportSource: string;
937
+ mode: 'automatic';
938
+ }
939
+ type JsxOptions = Partial<NormalizedJsxOptions> & {
940
+ preset?: JsxPreset;
941
+ };
942
+ type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
943
+ interface NormalizedTreeshakingOptions {
944
+ annotations: boolean;
945
+ correctVarValueBeforeDeclaration: boolean;
946
+ manualPureFunctions: readonly string[];
947
+ moduleSideEffects: HasModuleSideEffects;
948
+ propertyReadSideEffects: boolean | 'always';
949
+ tryCatchDeoptimization: boolean;
950
+ unknownGlobalSideEffects: boolean;
951
+ }
952
+ interface TreeshakingOptions extends Partial<Omit<NormalizedTreeshakingOptions, 'moduleSideEffects'>> {
953
+ moduleSideEffects?: ModuleSideEffectsOption;
954
+ preset?: TreeshakingPreset;
955
+ }
956
+ interface ManualChunkMeta {
957
+ getModuleIds: () => IterableIterator<string>;
958
+ getModuleInfo: GetModuleInfo;
959
+ }
960
+ type GetManualChunk = (id: string, meta: ManualChunkMeta) => string | NullValue;
961
+ type ExternalOption = (string | RegExp)[] | string | RegExp | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | NullValue);
962
+ type GlobalsOption = Record<string, string> | ((name: string) => string);
963
+ type InputOption = string | string[] | Record<string, string>;
964
+ type ManualChunksOption = Record<string, string[]> | GetManualChunk;
965
+ type LogHandlerWithDefault = (level: LogLevel, log: RollupLog, defaultHandler: LogOrStringHandler) => void;
966
+ type LogOrStringHandler = (level: LogLevel | 'error', log: RollupLog | string) => void;
967
+ type LogHandler = (level: LogLevel, log: RollupLog) => void;
968
+ type ModuleSideEffectsOption = boolean | 'no-external' | string[] | HasModuleSideEffects;
969
+ type PreserveEntrySignaturesOption = false | 'strict' | 'allow-extension' | 'exports-only';
970
+ type SourcemapPathTransformOption = (relativeSourcePath: string, sourcemapPath: string) => string;
971
+ type SourcemapIgnoreListOption = (relativeSourcePath: string, sourcemapPath: string) => boolean;
972
+ type InputPluginOption = MaybePromise<Plugin | NullValue | false | InputPluginOption[]>;
973
+ interface InputOptions {
974
+ cache?: boolean | RollupCache;
975
+ context?: string;
976
+ experimentalCacheExpiry?: number;
977
+ experimentalLogSideEffects?: boolean;
978
+ external?: ExternalOption;
979
+ input?: InputOption;
980
+ jsx?: false | JsxPreset | JsxOptions;
981
+ logLevel?: LogLevelOption;
982
+ makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource';
983
+ maxParallelFileOps?: number;
984
+ moduleContext?: ((id: string) => string | NullValue) | Record<string, string>;
985
+ onLog?: LogHandlerWithDefault;
986
+ onwarn?: WarningHandlerWithDefault;
987
+ perf?: boolean;
988
+ plugins?: InputPluginOption;
989
+ preserveEntrySignatures?: PreserveEntrySignaturesOption;
990
+ preserveSymlinks?: boolean;
991
+ shimMissingExports?: boolean;
992
+ strictDeprecations?: boolean;
993
+ treeshake?: boolean | TreeshakingPreset | TreeshakingOptions;
994
+ watch?: WatcherOptions | false;
995
+ }
996
+ interface NormalizedInputOptions {
997
+ cache: false | undefined | RollupCache;
998
+ context: string;
999
+ experimentalCacheExpiry: number;
1000
+ experimentalLogSideEffects: boolean;
1001
+ external: IsExternal;
1002
+ input: string[] | Record<string, string>;
1003
+ jsx: false | NormalizedJsxOptions;
1004
+ logLevel: LogLevelOption;
1005
+ makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource';
1006
+ maxParallelFileOps: number;
1007
+ moduleContext: (id: string) => string;
1008
+ onLog: LogHandler;
1009
+ perf: boolean;
1010
+ plugins: Plugin[];
1011
+ preserveEntrySignatures: PreserveEntrySignaturesOption;
1012
+ preserveSymlinks: boolean;
1013
+ shimMissingExports: boolean;
1014
+ strictDeprecations: boolean;
1015
+ treeshake: false | NormalizedTreeshakingOptions;
1016
+ }
1017
+ type InternalModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd';
1018
+ type ImportAttributesKey = 'with' | 'assert';
1019
+ type ModuleFormat = InternalModuleFormat | 'commonjs' | 'esm' | 'module' | 'systemjs';
1020
+ type GeneratedCodePreset = 'es5' | 'es2015';
1021
+ interface NormalizedGeneratedCodeOptions {
1022
+ arrowFunctions: boolean;
1023
+ constBindings: boolean;
1024
+ objectShorthand: boolean;
1025
+ reservedNamesAsProps: boolean;
1026
+ symbols: boolean;
1027
+ }
1028
+ interface GeneratedCodeOptions extends Partial<NormalizedGeneratedCodeOptions> {
1029
+ preset?: GeneratedCodePreset;
1030
+ }
1031
+ type OptionsPaths = Record<string, string> | ((id: string) => string);
1032
+ type InteropType = 'compat' | 'auto' | 'esModule' | 'default' | 'defaultOnly';
1033
+ type GetInterop = (id: string | null) => InteropType;
1034
+ type AmdOptions = ({
1035
+ autoId?: false;
1036
+ id: string;
1037
+ } | {
1038
+ autoId: true;
1039
+ basePath?: string;
1040
+ id?: undefined;
1041
+ } | {
1042
+ autoId?: false;
1043
+ id?: undefined;
1044
+ }) & {
1045
+ define?: string;
1046
+ forceJsExtensionForImports?: boolean;
1047
+ };
1048
+ type NormalizedAmdOptions = ({
1049
+ autoId: false;
1050
+ id?: string;
1051
+ } | {
1052
+ autoId: true;
1053
+ basePath: string;
1054
+ }) & {
1055
+ define: string;
1056
+ forceJsExtensionForImports: boolean;
1057
+ };
1058
+ type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
1059
+ type OutputPluginOption = MaybePromise<OutputPlugin | NullValue | false | OutputPluginOption[]>;
1060
+ type HashCharacters = 'base64' | 'base36' | 'hex';
1061
+ interface OutputOptions {
1062
+ amd?: AmdOptions;
1063
+ assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string);
1064
+ banner?: string | AddonFunction;
1065
+ chunkFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
1066
+ compact?: boolean; // only required for bundle.write
1067
+ dir?: string;
1068
+ dynamicImportInCjs?: boolean;
1069
+ entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
1070
+ esModule?: boolean | 'if-default-prop';
1071
+ experimentalMinChunkSize?: number;
1072
+ exports?: 'default' | 'named' | 'none' | 'auto';
1073
+ extend?: boolean;
1074
+ /** @deprecated Use "externalImportAttributes" instead. */
1075
+ externalImportAssertions?: boolean;
1076
+ externalImportAttributes?: boolean;
1077
+ externalLiveBindings?: boolean; // only required for bundle.write
1078
+ file?: string;
1079
+ footer?: string | AddonFunction;
1080
+ format?: ModuleFormat;
1081
+ freeze?: boolean;
1082
+ generatedCode?: GeneratedCodePreset | GeneratedCodeOptions;
1083
+ globals?: GlobalsOption;
1084
+ hashCharacters?: HashCharacters;
1085
+ hoistTransitiveImports?: boolean;
1086
+ importAttributesKey?: ImportAttributesKey;
1087
+ indent?: string | boolean;
1088
+ inlineDynamicImports?: boolean;
1089
+ interop?: InteropType | GetInterop;
1090
+ intro?: string | AddonFunction;
1091
+ manualChunks?: ManualChunksOption;
1092
+ minifyInternalExports?: boolean;
1093
+ name?: string;
1094
+ noConflict?: boolean;
1095
+ outro?: string | AddonFunction;
1096
+ paths?: OptionsPaths;
1097
+ plugins?: OutputPluginOption;
1098
+ preserveModules?: boolean;
1099
+ preserveModulesRoot?: string;
1100
+ reexportProtoFromExternal?: boolean;
1101
+ sanitizeFileName?: boolean | ((fileName: string) => string);
1102
+ sourcemap?: boolean | 'inline' | 'hidden';
1103
+ sourcemapBaseUrl?: string;
1104
+ sourcemapExcludeSources?: boolean;
1105
+ sourcemapFile?: string;
1106
+ sourcemapFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
1107
+ sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption;
1108
+ sourcemapPathTransform?: SourcemapPathTransformOption;
1109
+ sourcemapDebugIds?: boolean;
1110
+ strict?: boolean;
1111
+ systemNullSetters?: boolean;
1112
+ validate?: boolean;
1113
+ virtualDirname?: string;
1114
+ }
1115
+ interface NormalizedOutputOptions {
1116
+ amd: NormalizedAmdOptions;
1117
+ assetFileNames: string | ((chunkInfo: PreRenderedAsset) => string);
1118
+ banner: AddonFunction;
1119
+ chunkFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
1120
+ compact: boolean;
1121
+ dir: string | undefined;
1122
+ dynamicImportInCjs: boolean;
1123
+ entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
1124
+ esModule: boolean | 'if-default-prop';
1125
+ experimentalMinChunkSize: number;
1126
+ exports: 'default' | 'named' | 'none' | 'auto';
1127
+ extend: boolean;
1128
+ /** @deprecated Use "externalImportAttributes" instead. */
1129
+ externalImportAssertions: boolean;
1130
+ externalImportAttributes: boolean;
1131
+ externalLiveBindings: boolean;
1132
+ file: string | undefined;
1133
+ footer: AddonFunction;
1134
+ format: InternalModuleFormat;
1135
+ freeze: boolean;
1136
+ generatedCode: NormalizedGeneratedCodeOptions;
1137
+ globals: GlobalsOption;
1138
+ hashCharacters: HashCharacters;
1139
+ hoistTransitiveImports: boolean;
1140
+ importAttributesKey: ImportAttributesKey;
1141
+ indent: true | string;
1142
+ inlineDynamicImports: boolean;
1143
+ interop: GetInterop;
1144
+ intro: AddonFunction;
1145
+ manualChunks: ManualChunksOption;
1146
+ minifyInternalExports: boolean;
1147
+ name: string | undefined;
1148
+ noConflict: boolean;
1149
+ outro: AddonFunction;
1150
+ paths: OptionsPaths;
1151
+ plugins: OutputPlugin[];
1152
+ preserveModules: boolean;
1153
+ preserveModulesRoot: string | undefined;
1154
+ reexportProtoFromExternal: boolean;
1155
+ sanitizeFileName: (fileName: string) => string;
1156
+ sourcemap: boolean | 'inline' | 'hidden';
1157
+ sourcemapBaseUrl: string | undefined;
1158
+ sourcemapExcludeSources: boolean;
1159
+ sourcemapFile: string | undefined;
1160
+ sourcemapFileNames: string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
1161
+ sourcemapIgnoreList: SourcemapIgnoreListOption;
1162
+ sourcemapPathTransform: SourcemapPathTransformOption | undefined;
1163
+ sourcemapDebugIds: boolean;
1164
+ strict: boolean;
1165
+ systemNullSetters: boolean;
1166
+ validate: boolean;
1167
+ virtualDirname: string;
1168
+ }
1169
+ type WarningHandlerWithDefault = (warning: RollupLog, defaultHandler: LoggingFunction) => void;
1170
+ interface PreRenderedAsset {
1171
+ /** @deprecated Use "names" instead. */
1172
+ name: string | undefined;
1173
+ names: string[];
1174
+ /** @deprecated Use "originalFileNames" instead. */
1175
+ originalFileName: string | null;
1176
+ originalFileNames: string[];
1177
+ source: string | Uint8Array;
1178
+ type: 'asset';
1179
+ }
1180
+ interface OutputAsset extends PreRenderedAsset {
1181
+ fileName: string;
1182
+ needsCodeReference: boolean;
1183
+ }
1184
+ interface RenderedModule {
1185
+ readonly code: string | null;
1186
+ originalLength: number;
1187
+ removedExports: string[];
1188
+ renderedExports: string[];
1189
+ renderedLength: number;
1190
+ }
1191
+ interface PreRenderedChunk {
1192
+ exports: string[];
1193
+ facadeModuleId: string | null;
1194
+ isDynamicEntry: boolean;
1195
+ isEntry: boolean;
1196
+ isImplicitEntry: boolean;
1197
+ moduleIds: string[];
1198
+ name: string;
1199
+ type: 'chunk';
1200
+ }
1201
+ interface RenderedChunk extends PreRenderedChunk {
1202
+ dynamicImports: string[];
1203
+ fileName: string;
1204
+ implicitlyLoadedBefore: string[];
1205
+ importedBindings: Record<string, string[]>;
1206
+ imports: string[];
1207
+ modules: Record<string, RenderedModule>;
1208
+ referencedFiles: string[];
1209
+ }
1210
+ interface OutputChunk extends RenderedChunk {
1211
+ code: string;
1212
+ map: SourceMap | null;
1213
+ sourcemapFileName: string | null;
1214
+ preliminaryFileName: string;
1215
+ }
1216
+ type SerializablePluginCache = Record<string, [number, any]>;
1217
+ interface RollupCache {
1218
+ modules: ModuleJSON[];
1219
+ plugins?: Record<string, SerializablePluginCache>;
1220
+ }
1221
+ interface RollupOptions extends InputOptions {
1222
+ // This is included for compatibility with config files but ignored by rollup.rollup
1223
+ output?: OutputOptions | OutputOptions[];
1224
+ }
1225
+ interface ChokidarOptions {
1226
+ alwaysStat?: boolean;
1227
+ atomic?: boolean | number;
1228
+ awaitWriteFinish?: {
1229
+ pollInterval?: number;
1230
+ stabilityThreshold?: number;
1231
+ } | boolean;
1232
+ binaryInterval?: number;
1233
+ cwd?: string;
1234
+ depth?: number;
1235
+ disableGlobbing?: boolean;
1236
+ followSymlinks?: boolean;
1237
+ ignoreInitial?: boolean;
1238
+ ignorePermissionErrors?: boolean;
1239
+ ignored?: any;
1240
+ interval?: number;
1241
+ persistent?: boolean;
1242
+ useFsEvents?: boolean;
1243
+ usePolling?: boolean;
1244
+ }
1245
+ interface WatcherOptions {
1246
+ buildDelay?: number;
1247
+ chokidar?: ChokidarOptions;
1248
+ clearScreen?: boolean;
1249
+ exclude?: string | RegExp | (string | RegExp)[];
1250
+ include?: string | RegExp | (string | RegExp)[];
1251
+ skipWrite?: boolean;
1252
+ onInvalidate?: (id: string) => void;
1253
+ }
1254
+ interface AstNodeLocation {
1255
+ end: number;
1256
+ start: number;
1257
+ }
1258
+ type OmittedEstreeKeys = 'loc' | 'range' | 'leadingComments' | 'trailingComments' | 'innerComments' | 'comments';
1259
+ type RollupAstNode<T> = Omit<T, OmittedEstreeKeys> & AstNodeLocation;
1260
+ type ProgramNode = RollupAstNode<Program>;
1261
+ type AstNode = RollupAstNode<Node>;
1262
+ //#endregion
1263
+ export { WatcherOptions as S, RollupOptions as _, MinimalPluginContext as a, TransformPluginContext as b, ObjectHook as c, PartialResolvedId as d, Plugin as f, RollupError as g, ResolveIdResult as h, LoadResult as i, OutputBundle as l, PluginHooks as m, InputOption as n, ModuleFormat as o, PluginContext as p, InputOptions as r, ModuleInfo as s, CustomPluginOptions as t, OutputChunk as u, SourceDescription as v, TransformResult as x, SourceMap as y };