@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,601 @@
1
+ //#region ../../node_modules/esbuild/lib/main.d.ts
2
+ type Platform = 'browser' | 'node' | 'neutral';
3
+ type Format = 'iife' | 'cjs' | 'esm';
4
+ type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx';
5
+ type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent';
6
+ type Charset = 'ascii' | 'utf8';
7
+ type Drop = 'console' | 'debugger';
8
+ interface CommonOptions {
9
+ /** Documentation: https://esbuild.github.io/api/#sourcemap */
10
+ sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both';
11
+ /** Documentation: https://esbuild.github.io/api/#legal-comments */
12
+ legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external';
13
+ /** Documentation: https://esbuild.github.io/api/#source-root */
14
+ sourceRoot?: string;
15
+ /** Documentation: https://esbuild.github.io/api/#sources-content */
16
+ sourcesContent?: boolean;
17
+ /** Documentation: https://esbuild.github.io/api/#format */
18
+ format?: Format;
19
+ /** Documentation: https://esbuild.github.io/api/#global-name */
20
+ globalName?: string;
21
+ /** Documentation: https://esbuild.github.io/api/#target */
22
+ target?: string | string[];
23
+ /** Documentation: https://esbuild.github.io/api/#supported */
24
+ supported?: Record<string, boolean>;
25
+ /** Documentation: https://esbuild.github.io/api/#platform */
26
+ platform?: Platform;
27
+ /** Documentation: https://esbuild.github.io/api/#mangle-props */
28
+ mangleProps?: RegExp;
29
+ /** Documentation: https://esbuild.github.io/api/#mangle-props */
30
+ reserveProps?: RegExp;
31
+ /** Documentation: https://esbuild.github.io/api/#mangle-props */
32
+ mangleQuoted?: boolean;
33
+ /** Documentation: https://esbuild.github.io/api/#mangle-props */
34
+ mangleCache?: Record<string, string | false>;
35
+ /** Documentation: https://esbuild.github.io/api/#drop */
36
+ drop?: Drop[];
37
+ /** Documentation: https://esbuild.github.io/api/#drop-labels */
38
+ dropLabels?: string[];
39
+ /** Documentation: https://esbuild.github.io/api/#minify */
40
+ minify?: boolean;
41
+ /** Documentation: https://esbuild.github.io/api/#minify */
42
+ minifyWhitespace?: boolean;
43
+ /** Documentation: https://esbuild.github.io/api/#minify */
44
+ minifyIdentifiers?: boolean;
45
+ /** Documentation: https://esbuild.github.io/api/#minify */
46
+ minifySyntax?: boolean;
47
+ /** Documentation: https://esbuild.github.io/api/#line-limit */
48
+ lineLimit?: number;
49
+ /** Documentation: https://esbuild.github.io/api/#charset */
50
+ charset?: Charset;
51
+ /** Documentation: https://esbuild.github.io/api/#tree-shaking */
52
+ treeShaking?: boolean;
53
+ /** Documentation: https://esbuild.github.io/api/#ignore-annotations */
54
+ ignoreAnnotations?: boolean;
55
+ /** Documentation: https://esbuild.github.io/api/#jsx */
56
+ jsx?: 'transform' | 'preserve' | 'automatic';
57
+ /** Documentation: https://esbuild.github.io/api/#jsx-factory */
58
+ jsxFactory?: string;
59
+ /** Documentation: https://esbuild.github.io/api/#jsx-fragment */
60
+ jsxFragment?: string;
61
+ /** Documentation: https://esbuild.github.io/api/#jsx-import-source */
62
+ jsxImportSource?: string;
63
+ /** Documentation: https://esbuild.github.io/api/#jsx-development */
64
+ jsxDev?: boolean;
65
+ /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */
66
+ jsxSideEffects?: boolean;
67
+ /** Documentation: https://esbuild.github.io/api/#define */
68
+ define?: {
69
+ [key: string]: string;
70
+ };
71
+ /** Documentation: https://esbuild.github.io/api/#pure */
72
+ pure?: string[];
73
+ /** Documentation: https://esbuild.github.io/api/#keep-names */
74
+ keepNames?: boolean;
75
+ /** Documentation: https://esbuild.github.io/api/#color */
76
+ color?: boolean;
77
+ /** Documentation: https://esbuild.github.io/api/#log-level */
78
+ logLevel?: LogLevel;
79
+ /** Documentation: https://esbuild.github.io/api/#log-limit */
80
+ logLimit?: number;
81
+ /** Documentation: https://esbuild.github.io/api/#log-override */
82
+ logOverride?: Record<string, LogLevel>;
83
+ /** Documentation: https://esbuild.github.io/api/#tsconfig-raw */
84
+ tsconfigRaw?: string | TsconfigRaw;
85
+ }
86
+ interface TsconfigRaw {
87
+ compilerOptions?: {
88
+ alwaysStrict?: boolean;
89
+ baseUrl?: string;
90
+ experimentalDecorators?: boolean;
91
+ importsNotUsedAsValues?: 'remove' | 'preserve' | 'error';
92
+ jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev';
93
+ jsxFactory?: string;
94
+ jsxFragmentFactory?: string;
95
+ jsxImportSource?: string;
96
+ paths?: Record<string, string[]>;
97
+ preserveValueImports?: boolean;
98
+ strict?: boolean;
99
+ target?: string;
100
+ useDefineForClassFields?: boolean;
101
+ verbatimModuleSyntax?: boolean;
102
+ };
103
+ }
104
+ interface BuildOptions extends CommonOptions {
105
+ /** Documentation: https://esbuild.github.io/api/#bundle */
106
+ bundle?: boolean;
107
+ /** Documentation: https://esbuild.github.io/api/#splitting */
108
+ splitting?: boolean;
109
+ /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */
110
+ preserveSymlinks?: boolean;
111
+ /** Documentation: https://esbuild.github.io/api/#outfile */
112
+ outfile?: string;
113
+ /** Documentation: https://esbuild.github.io/api/#metafile */
114
+ metafile?: boolean;
115
+ /** Documentation: https://esbuild.github.io/api/#outdir */
116
+ outdir?: string;
117
+ /** Documentation: https://esbuild.github.io/api/#outbase */
118
+ outbase?: string;
119
+ /** Documentation: https://esbuild.github.io/api/#external */
120
+ external?: string[];
121
+ /** Documentation: https://esbuild.github.io/api/#packages */
122
+ packages?: 'external';
123
+ /** Documentation: https://esbuild.github.io/api/#alias */
124
+ alias?: Record<string, string>;
125
+ /** Documentation: https://esbuild.github.io/api/#loader */
126
+ loader?: {
127
+ [ext: string]: Loader;
128
+ };
129
+ /** Documentation: https://esbuild.github.io/api/#resolve-extensions */
130
+ resolveExtensions?: string[];
131
+ /** Documentation: https://esbuild.github.io/api/#main-fields */
132
+ mainFields?: string[];
133
+ /** Documentation: https://esbuild.github.io/api/#conditions */
134
+ conditions?: string[];
135
+ /** Documentation: https://esbuild.github.io/api/#write */
136
+ write?: boolean;
137
+ /** Documentation: https://esbuild.github.io/api/#allow-overwrite */
138
+ allowOverwrite?: boolean;
139
+ /** Documentation: https://esbuild.github.io/api/#tsconfig */
140
+ tsconfig?: string;
141
+ /** Documentation: https://esbuild.github.io/api/#out-extension */
142
+ outExtension?: {
143
+ [ext: string]: string;
144
+ };
145
+ /** Documentation: https://esbuild.github.io/api/#public-path */
146
+ publicPath?: string;
147
+ /** Documentation: https://esbuild.github.io/api/#entry-names */
148
+ entryNames?: string;
149
+ /** Documentation: https://esbuild.github.io/api/#chunk-names */
150
+ chunkNames?: string;
151
+ /** Documentation: https://esbuild.github.io/api/#asset-names */
152
+ assetNames?: string;
153
+ /** Documentation: https://esbuild.github.io/api/#inject */
154
+ inject?: string[];
155
+ /** Documentation: https://esbuild.github.io/api/#banner */
156
+ banner?: {
157
+ [type: string]: string;
158
+ };
159
+ /** Documentation: https://esbuild.github.io/api/#footer */
160
+ footer?: {
161
+ [type: string]: string;
162
+ };
163
+ /** Documentation: https://esbuild.github.io/api/#entry-points */
164
+ entryPoints?: string[] | Record<string, string> | {
165
+ in: string;
166
+ out: string;
167
+ }[];
168
+ /** Documentation: https://esbuild.github.io/api/#stdin */
169
+ stdin?: StdinOptions;
170
+ /** Documentation: https://esbuild.github.io/plugins/ */
171
+ plugins?: Plugin[];
172
+ /** Documentation: https://esbuild.github.io/api/#working-directory */
173
+ absWorkingDir?: string;
174
+ /** Documentation: https://esbuild.github.io/api/#node-paths */
175
+ nodePaths?: string[]; // The "NODE_PATH" variable from Node.js
176
+ }
177
+ interface StdinOptions {
178
+ contents: string | Uint8Array;
179
+ resolveDir?: string;
180
+ sourcefile?: string;
181
+ loader?: Loader;
182
+ }
183
+ interface Message {
184
+ id: string;
185
+ pluginName: string;
186
+ text: string;
187
+ location: Location | null;
188
+ notes: Note[];
189
+ /**
190
+ * Optional user-specified data that is passed through unmodified. You can
191
+ * use this to stash the original error, for example.
192
+ */
193
+ detail: any;
194
+ }
195
+ interface Note {
196
+ text: string;
197
+ location: Location | null;
198
+ }
199
+ interface Location {
200
+ file: string;
201
+ namespace: string;
202
+ /** 1-based */
203
+ line: number;
204
+ /** 0-based, in bytes */
205
+ column: number;
206
+ /** in bytes */
207
+ length: number;
208
+ lineText: string;
209
+ suggestion: string;
210
+ }
211
+ interface OutputFile {
212
+ path: string;
213
+ contents: Uint8Array;
214
+ hash: string;
215
+ /** "contents" as text (changes automatically with "contents") */
216
+ readonly text: string;
217
+ }
218
+ interface BuildResult<ProvidedOptions extends BuildOptions = BuildOptions> {
219
+ errors: Message[];
220
+ warnings: Message[];
221
+ /** Only when "write: false" */
222
+ outputFiles: OutputFile[] | (ProvidedOptions['write'] extends false ? never : undefined);
223
+ /** Only when "metafile: true" */
224
+ metafile: Metafile | (ProvidedOptions['metafile'] extends true ? never : undefined);
225
+ /** Only when "mangleCache" is present */
226
+ mangleCache: Record<string, string | false> | (ProvidedOptions['mangleCache'] extends Object ? never : undefined);
227
+ }
228
+ /** Documentation: https://esbuild.github.io/api/#serve-arguments */
229
+ interface ServeOptions {
230
+ port?: number;
231
+ host?: string;
232
+ servedir?: string;
233
+ keyfile?: string;
234
+ certfile?: string;
235
+ fallback?: string;
236
+ onRequest?: (args: ServeOnRequestArgs) => void;
237
+ }
238
+ interface ServeOnRequestArgs {
239
+ remoteAddress: string;
240
+ method: string;
241
+ path: string;
242
+ status: number;
243
+ /** The time to generate the response, not to send it */
244
+ timeInMS: number;
245
+ }
246
+ /** Documentation: https://esbuild.github.io/api/#serve-return-values */
247
+ interface ServeResult {
248
+ port: number;
249
+ host: string;
250
+ }
251
+ interface TransformOptions extends CommonOptions {
252
+ /** Documentation: https://esbuild.github.io/api/#sourcefile */
253
+ sourcefile?: string;
254
+ /** Documentation: https://esbuild.github.io/api/#loader */
255
+ loader?: Loader;
256
+ /** Documentation: https://esbuild.github.io/api/#banner */
257
+ banner?: string;
258
+ /** Documentation: https://esbuild.github.io/api/#footer */
259
+ footer?: string;
260
+ }
261
+ interface TransformResult<ProvidedOptions extends TransformOptions = TransformOptions> {
262
+ code: string;
263
+ map: string;
264
+ warnings: Message[];
265
+ /** Only when "mangleCache" is present */
266
+ mangleCache: Record<string, string | false> | (ProvidedOptions['mangleCache'] extends Object ? never : undefined);
267
+ /** Only when "legalComments" is "external" */
268
+ legalComments: string | (ProvidedOptions['legalComments'] extends 'external' ? never : undefined);
269
+ }
270
+ interface Plugin {
271
+ name: string;
272
+ setup: (build: PluginBuild) => (void | Promise<void>);
273
+ }
274
+ interface PluginBuild {
275
+ /** Documentation: https://esbuild.github.io/plugins/#build-options */
276
+ initialOptions: BuildOptions;
277
+ /** Documentation: https://esbuild.github.io/plugins/#resolve */
278
+ resolve(path: string, options?: ResolveOptions): Promise<ResolveResult>;
279
+ /** Documentation: https://esbuild.github.io/plugins/#on-start */
280
+ onStart(callback: () => (OnStartResult | null | void | Promise<OnStartResult | null | void>)): void;
281
+ /** Documentation: https://esbuild.github.io/plugins/#on-end */
282
+ onEnd(callback: (result: BuildResult) => (OnEndResult | null | void | Promise<OnEndResult | null | void>)): void;
283
+ /** Documentation: https://esbuild.github.io/plugins/#on-resolve */
284
+ onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) => (OnResolveResult | null | undefined | Promise<OnResolveResult | null | undefined>)): void;
285
+ /** Documentation: https://esbuild.github.io/plugins/#on-load */
286
+ onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) => (OnLoadResult | null | undefined | Promise<OnLoadResult | null | undefined>)): void;
287
+ /** Documentation: https://esbuild.github.io/plugins/#on-dispose */
288
+ onDispose(callback: () => void): void; // This is a full copy of the esbuild library in case you need it
289
+ esbuild: {
290
+ context: typeof context;
291
+ build: typeof build;
292
+ buildSync: typeof buildSync;
293
+ transform: typeof transform;
294
+ transformSync: typeof transformSync;
295
+ formatMessages: typeof formatMessages;
296
+ formatMessagesSync: typeof formatMessagesSync;
297
+ analyzeMetafile: typeof analyzeMetafile;
298
+ analyzeMetafileSync: typeof analyzeMetafileSync;
299
+ initialize: typeof initialize;
300
+ version: typeof version;
301
+ };
302
+ }
303
+ /** Documentation: https://esbuild.github.io/plugins/#resolve-options */
304
+ interface ResolveOptions {
305
+ pluginName?: string;
306
+ importer?: string;
307
+ namespace?: string;
308
+ resolveDir?: string;
309
+ kind?: ImportKind;
310
+ pluginData?: any;
311
+ with?: Record<string, string>;
312
+ }
313
+ /** Documentation: https://esbuild.github.io/plugins/#resolve-results */
314
+ interface ResolveResult {
315
+ errors: Message[];
316
+ warnings: Message[];
317
+ path: string;
318
+ external: boolean;
319
+ sideEffects: boolean;
320
+ namespace: string;
321
+ suffix: string;
322
+ pluginData: any;
323
+ }
324
+ interface OnStartResult {
325
+ errors?: PartialMessage[];
326
+ warnings?: PartialMessage[];
327
+ }
328
+ interface OnEndResult {
329
+ errors?: PartialMessage[];
330
+ warnings?: PartialMessage[];
331
+ }
332
+ /** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */
333
+ interface OnResolveOptions {
334
+ filter: RegExp;
335
+ namespace?: string;
336
+ }
337
+ /** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */
338
+ interface OnResolveArgs {
339
+ path: string;
340
+ importer: string;
341
+ namespace: string;
342
+ resolveDir: string;
343
+ kind: ImportKind;
344
+ pluginData: any;
345
+ with: Record<string, string>;
346
+ }
347
+ type ImportKind = 'entry-point' // JS
348
+ | 'import-statement' | 'require-call' | 'dynamic-import' | 'require-resolve' // CSS
349
+ | 'import-rule' | 'composes-from' | 'url-token';
350
+ /** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */
351
+ interface OnResolveResult {
352
+ pluginName?: string;
353
+ errors?: PartialMessage[];
354
+ warnings?: PartialMessage[];
355
+ path?: string;
356
+ external?: boolean;
357
+ sideEffects?: boolean;
358
+ namespace?: string;
359
+ suffix?: string;
360
+ pluginData?: any;
361
+ watchFiles?: string[];
362
+ watchDirs?: string[];
363
+ }
364
+ /** Documentation: https://esbuild.github.io/plugins/#on-load-options */
365
+ interface OnLoadOptions {
366
+ filter: RegExp;
367
+ namespace?: string;
368
+ }
369
+ /** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */
370
+ interface OnLoadArgs {
371
+ path: string;
372
+ namespace: string;
373
+ suffix: string;
374
+ pluginData: any;
375
+ with: Record<string, string>;
376
+ }
377
+ /** Documentation: https://esbuild.github.io/plugins/#on-load-results */
378
+ interface OnLoadResult {
379
+ pluginName?: string;
380
+ errors?: PartialMessage[];
381
+ warnings?: PartialMessage[];
382
+ contents?: string | Uint8Array;
383
+ resolveDir?: string;
384
+ loader?: Loader;
385
+ pluginData?: any;
386
+ watchFiles?: string[];
387
+ watchDirs?: string[];
388
+ }
389
+ interface PartialMessage {
390
+ id?: string;
391
+ pluginName?: string;
392
+ text?: string;
393
+ location?: Partial<Location> | null;
394
+ notes?: PartialNote[];
395
+ detail?: any;
396
+ }
397
+ interface PartialNote {
398
+ text?: string;
399
+ location?: Partial<Location> | null;
400
+ }
401
+ /** Documentation: https://esbuild.github.io/api/#metafile */
402
+ interface Metafile {
403
+ inputs: {
404
+ [path: string]: {
405
+ bytes: number;
406
+ imports: {
407
+ path: string;
408
+ kind: ImportKind;
409
+ external?: boolean;
410
+ original?: string;
411
+ with?: Record<string, string>;
412
+ }[];
413
+ format?: 'cjs' | 'esm';
414
+ with?: Record<string, string>;
415
+ };
416
+ };
417
+ outputs: {
418
+ [path: string]: {
419
+ bytes: number;
420
+ inputs: {
421
+ [path: string]: {
422
+ bytesInOutput: number;
423
+ };
424
+ };
425
+ imports: {
426
+ path: string;
427
+ kind: ImportKind | 'file-loader';
428
+ external?: boolean;
429
+ }[];
430
+ exports: string[];
431
+ entryPoint?: string;
432
+ cssBundle?: string;
433
+ };
434
+ };
435
+ }
436
+ interface FormatMessagesOptions {
437
+ kind: 'error' | 'warning';
438
+ color?: boolean;
439
+ terminalWidth?: number;
440
+ }
441
+ interface AnalyzeMetafileOptions {
442
+ color?: boolean;
443
+ verbose?: boolean;
444
+ }
445
+ interface WatchOptions {}
446
+ interface BuildContext<ProvidedOptions extends BuildOptions = BuildOptions> {
447
+ /** Documentation: https://esbuild.github.io/api/#rebuild */
448
+ rebuild(): Promise<BuildResult<ProvidedOptions>>;
449
+ /** Documentation: https://esbuild.github.io/api/#watch */
450
+ watch(options?: WatchOptions): Promise<void>;
451
+ /** Documentation: https://esbuild.github.io/api/#serve */
452
+ serve(options?: ServeOptions): Promise<ServeResult>;
453
+ cancel(): Promise<void>;
454
+ dispose(): Promise<void>;
455
+ }
456
+ // This is a TypeScript type-level function which replaces any keys in "In"
457
+ // that aren't in "Out" with "never". We use this to reject properties with
458
+ // typos in object literals. See: https://stackoverflow.com/questions/49580725
459
+ type SameShape<Out, In extends Out> = In & { [Key in Exclude<keyof In, keyof Out>]: never };
460
+ /**
461
+ * This function invokes the "esbuild" command-line tool for you. It returns a
462
+ * promise that either resolves with a "BuildResult" object or rejects with a
463
+ * "BuildFailure" object.
464
+ *
465
+ * - Works in node: yes
466
+ * - Works in browser: yes
467
+ *
468
+ * Documentation: https://esbuild.github.io/api/#build
469
+ */
470
+ declare function build<T extends BuildOptions>(options: SameShape<BuildOptions, T>): Promise<BuildResult<T>>;
471
+ /**
472
+ * This is the advanced long-running form of "build" that supports additional
473
+ * features such as watch mode and a local development server.
474
+ *
475
+ * - Works in node: yes
476
+ * - Works in browser: no
477
+ *
478
+ * Documentation: https://esbuild.github.io/api/#build
479
+ */
480
+ declare function context<T extends BuildOptions>(options: SameShape<BuildOptions, T>): Promise<BuildContext<T>>;
481
+ /**
482
+ * This function transforms a single JavaScript file. It can be used to minify
483
+ * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript
484
+ * to older JavaScript. It returns a promise that is either resolved with a
485
+ * "TransformResult" object or rejected with a "TransformFailure" object.
486
+ *
487
+ * - Works in node: yes
488
+ * - Works in browser: yes
489
+ *
490
+ * Documentation: https://esbuild.github.io/api/#transform
491
+ */
492
+ declare function transform<T extends TransformOptions>(input: string | Uint8Array, options?: SameShape<TransformOptions, T>): Promise<TransformResult<T>>;
493
+ /**
494
+ * Converts log messages to formatted message strings suitable for printing in
495
+ * the terminal. This allows you to reuse the built-in behavior of esbuild's
496
+ * log message formatter. This is a batch-oriented API for efficiency.
497
+ *
498
+ * - Works in node: yes
499
+ * - Works in browser: yes
500
+ */
501
+ declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise<string[]>;
502
+ /**
503
+ * Pretty-prints an analysis of the metafile JSON to a string. This is just for
504
+ * convenience to be able to match esbuild's pretty-printing exactly. If you want
505
+ * to customize it, you can just inspect the data in the metafile yourself.
506
+ *
507
+ * - Works in node: yes
508
+ * - Works in browser: yes
509
+ *
510
+ * Documentation: https://esbuild.github.io/api/#analyze
511
+ */
512
+ declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise<string>;
513
+ /**
514
+ * A synchronous version of "build".
515
+ *
516
+ * - Works in node: yes
517
+ * - Works in browser: no
518
+ *
519
+ * Documentation: https://esbuild.github.io/api/#build
520
+ */
521
+ declare function buildSync<T extends BuildOptions>(options: SameShape<BuildOptions, T>): BuildResult<T>;
522
+ /**
523
+ * A synchronous version of "transform".
524
+ *
525
+ * - Works in node: yes
526
+ * - Works in browser: no
527
+ *
528
+ * Documentation: https://esbuild.github.io/api/#transform
529
+ */
530
+ declare function transformSync<T extends TransformOptions>(input: string | Uint8Array, options?: SameShape<TransformOptions, T>): TransformResult<T>;
531
+ /**
532
+ * A synchronous version of "formatMessages".
533
+ *
534
+ * - Works in node: yes
535
+ * - Works in browser: no
536
+ */
537
+ declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[];
538
+ /**
539
+ * A synchronous version of "analyzeMetafile".
540
+ *
541
+ * - Works in node: yes
542
+ * - Works in browser: no
543
+ *
544
+ * Documentation: https://esbuild.github.io/api/#analyze
545
+ */
546
+ declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string;
547
+ /**
548
+ * This configures the browser-based version of esbuild. It is necessary to
549
+ * call this first and wait for the returned promise to be resolved before
550
+ * making other API calls when using esbuild in the browser.
551
+ *
552
+ * - Works in node: yes
553
+ * - Works in browser: yes ("options" is required)
554
+ *
555
+ * Documentation: https://esbuild.github.io/api/#browser
556
+ */
557
+ declare function initialize(options: InitializeOptions): Promise<void>;
558
+ interface InitializeOptions {
559
+ /**
560
+ * The URL of the "esbuild.wasm" file. This must be provided when running
561
+ * esbuild in the browser.
562
+ */
563
+ wasmURL?: string | URL;
564
+ /**
565
+ * The result of calling "new WebAssembly.Module(buffer)" where "buffer"
566
+ * is a typed array or ArrayBuffer containing the binary code of the
567
+ * "esbuild.wasm" file.
568
+ *
569
+ * You can use this as an alternative to "wasmURL" for environments where it's
570
+ * not possible to download the WebAssembly module.
571
+ */
572
+ wasmModule?: WebAssembly.Module;
573
+ /**
574
+ * By default esbuild runs the WebAssembly-based browser API in a web worker
575
+ * to avoid blocking the UI thread. This can be disabled by setting "worker"
576
+ * to false.
577
+ */
578
+ worker?: boolean;
579
+ }
580
+ declare let version: string;
581
+ // Note: These declarations exist to avoid type errors when you omit "dom" from
582
+ // "lib" in your "tsconfig.json" file. TypeScript confusingly declares the
583
+ // global "WebAssembly" type in "lib.dom.d.ts" even though it has nothing to do
584
+ // with the browser DOM and is present in many non-browser JavaScript runtimes
585
+ // (e.g. node and deno). Declaring it here allows esbuild's API to be used in
586
+ // these scenarios.
587
+ //
588
+ // There's an open issue about getting this problem corrected (although these
589
+ // declarations will need to remain even if this is fixed for backward
590
+ // compatibility with older TypeScript versions):
591
+ //
592
+ // https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826
593
+ //
594
+ declare global {
595
+ namespace WebAssembly {
596
+ interface Module {}
597
+ }
598
+ interface URL {}
599
+ }
600
+ //#endregion
601
+ export { Plugin as n, TransformOptions as r, BuildOptions as t };
package/dist/rolldown.cjs CHANGED
@@ -1,7 +1,7 @@
1
- const require_src = require('./src-AjuA4p5U.cjs');
1
+ const require_index = require('./index.cjs');
2
2
 
3
3
  //#region src/rolldown.ts
4
- var rolldown_default = require_src.src_default.rolldown;
4
+ var rolldown_default = require_index.rolldown;
5
5
 
6
6
  //#endregion
7
7
  module.exports = rolldown_default;