adnbn 0.0.21 → 0.0.23

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/index.d.ts CHANGED
@@ -1,39 +1,941 @@
1
+ import { z } from 'zod';
2
+ import { Optional } from 'utility-types';
1
3
  import { Configuration } from 'webpack';
2
4
 
3
- interface EntrypointOptions {
5
+ declare enum Browser {
6
+ Chrome = "chrome",
7
+ Chromium = "chromium",
8
+ Edge = "edge",
9
+ Firefox = "firefox",
10
+ Opera = "opera",
11
+ Safari = "safari"
12
+ }
13
+ declare enum Mode {
14
+ None = "none",
15
+ Development = "development",
16
+ Production = "production"
17
+ }
18
+ declare enum Command {
19
+ Build = "build",
20
+ Watch = "watch"
21
+ }
22
+ declare const ConfigSchema: z.ZodObject<{
23
+ debug: z.ZodBoolean;
24
+ command: z.ZodNativeEnum<typeof Command>;
25
+ mode: z.ZodNativeEnum<typeof Mode>;
26
+ app: z.ZodString;
27
+ browser: z.ZodNativeEnum<typeof Browser>;
28
+ manifestVersion: z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>;
29
+ inputDir: z.ZodString;
30
+ outputDir: z.ZodString;
31
+ srcDir: z.ZodString;
32
+ sharedDir: z.ZodString;
33
+ appsDir: z.ZodString;
34
+ jsDir: z.ZodString;
35
+ cssDir: z.ZodString;
36
+ assetsDir: z.ZodString;
37
+ htmlDir: z.ZodString;
38
+ plugins: z.ZodArray<z.ZodAny, "many">;
39
+ analyze: z.ZodBoolean;
40
+ configFile: z.ZodString;
41
+ mergeBackground: z.ZodBoolean;
42
+ mergeCommands: z.ZodBoolean;
43
+ mergeContentScripts: z.ZodBoolean;
44
+ concatContentScripts: z.ZodBoolean;
45
+ }, "strip", z.ZodTypeAny, {
46
+ command: Command;
47
+ plugins: any[];
48
+ debug: boolean;
49
+ mode: Mode;
50
+ app: string;
51
+ browser: Browser;
52
+ manifestVersion: 2 | 3;
53
+ inputDir: string;
54
+ outputDir: string;
55
+ srcDir: string;
56
+ sharedDir: string;
57
+ appsDir: string;
58
+ jsDir: string;
59
+ cssDir: string;
60
+ assetsDir: string;
61
+ htmlDir: string;
62
+ analyze: boolean;
63
+ configFile: string;
64
+ mergeBackground: boolean;
65
+ mergeCommands: boolean;
66
+ mergeContentScripts: boolean;
67
+ concatContentScripts: boolean;
68
+ }, {
69
+ command: Command;
70
+ plugins: any[];
71
+ debug: boolean;
72
+ mode: Mode;
73
+ app: string;
74
+ browser: Browser;
75
+ manifestVersion: 2 | 3;
76
+ inputDir: string;
77
+ outputDir: string;
78
+ srcDir: string;
79
+ sharedDir: string;
80
+ appsDir: string;
81
+ jsDir: string;
82
+ cssDir: string;
83
+ assetsDir: string;
84
+ htmlDir: string;
85
+ analyze: boolean;
86
+ configFile: string;
87
+ mergeBackground: boolean;
88
+ mergeCommands: boolean;
89
+ mergeContentScripts: boolean;
90
+ concatContentScripts: boolean;
91
+ }>;
92
+ declare const ReadonlyConfigSchema: z.ZodReadonly<z.ZodObject<{
93
+ debug: z.ZodBoolean;
94
+ command: z.ZodNativeEnum<typeof Command>;
95
+ mode: z.ZodNativeEnum<typeof Mode>;
96
+ app: z.ZodString;
97
+ browser: z.ZodNativeEnum<typeof Browser>;
98
+ manifestVersion: z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>;
99
+ inputDir: z.ZodString;
100
+ outputDir: z.ZodString;
101
+ srcDir: z.ZodString;
102
+ sharedDir: z.ZodString;
103
+ appsDir: z.ZodString;
104
+ jsDir: z.ZodString;
105
+ cssDir: z.ZodString;
106
+ assetsDir: z.ZodString;
107
+ htmlDir: z.ZodString;
108
+ plugins: z.ZodArray<z.ZodAny, "many">;
109
+ analyze: z.ZodBoolean;
110
+ configFile: z.ZodString;
111
+ mergeBackground: z.ZodBoolean;
112
+ mergeCommands: z.ZodBoolean;
113
+ mergeContentScripts: z.ZodBoolean;
114
+ concatContentScripts: z.ZodBoolean;
115
+ }, "strip", z.ZodTypeAny, {
116
+ command: Command;
117
+ plugins: any[];
118
+ debug: boolean;
119
+ mode: Mode;
120
+ app: string;
121
+ browser: Browser;
122
+ manifestVersion: 2 | 3;
123
+ inputDir: string;
124
+ outputDir: string;
125
+ srcDir: string;
126
+ sharedDir: string;
127
+ appsDir: string;
128
+ jsDir: string;
129
+ cssDir: string;
130
+ assetsDir: string;
131
+ htmlDir: string;
132
+ analyze: boolean;
133
+ configFile: string;
134
+ mergeBackground: boolean;
135
+ mergeCommands: boolean;
136
+ mergeContentScripts: boolean;
137
+ concatContentScripts: boolean;
138
+ }, {
139
+ command: Command;
140
+ plugins: any[];
141
+ debug: boolean;
142
+ mode: Mode;
143
+ app: string;
144
+ browser: Browser;
145
+ manifestVersion: 2 | 3;
146
+ inputDir: string;
147
+ outputDir: string;
148
+ srcDir: string;
149
+ sharedDir: string;
150
+ appsDir: string;
151
+ jsDir: string;
152
+ cssDir: string;
153
+ assetsDir: string;
154
+ htmlDir: string;
155
+ analyze: boolean;
156
+ configFile: string;
157
+ mergeBackground: boolean;
158
+ mergeCommands: boolean;
159
+ mergeContentScripts: boolean;
160
+ concatContentScripts: boolean;
161
+ }>>;
162
+ declare const OptionalConfigSchema: z.ZodObject<{
163
+ debug: z.ZodOptional<z.ZodBoolean>;
164
+ command: z.ZodOptional<z.ZodNativeEnum<typeof Command>>;
165
+ mode: z.ZodOptional<z.ZodNativeEnum<typeof Mode>>;
166
+ app: z.ZodOptional<z.ZodString>;
167
+ browser: z.ZodOptional<z.ZodNativeEnum<typeof Browser>>;
168
+ manifestVersion: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
169
+ inputDir: z.ZodOptional<z.ZodString>;
170
+ outputDir: z.ZodOptional<z.ZodString>;
171
+ srcDir: z.ZodOptional<z.ZodString>;
172
+ sharedDir: z.ZodOptional<z.ZodString>;
173
+ appsDir: z.ZodOptional<z.ZodString>;
174
+ jsDir: z.ZodOptional<z.ZodString>;
175
+ cssDir: z.ZodOptional<z.ZodString>;
176
+ assetsDir: z.ZodOptional<z.ZodString>;
177
+ htmlDir: z.ZodOptional<z.ZodString>;
178
+ plugins: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
179
+ analyze: z.ZodOptional<z.ZodBoolean>;
180
+ configFile: z.ZodOptional<z.ZodString>;
181
+ mergeBackground: z.ZodOptional<z.ZodBoolean>;
182
+ mergeCommands: z.ZodOptional<z.ZodBoolean>;
183
+ mergeContentScripts: z.ZodOptional<z.ZodBoolean>;
184
+ concatContentScripts: z.ZodOptional<z.ZodBoolean>;
185
+ }, "strip", z.ZodTypeAny, {
186
+ command?: Command | undefined;
187
+ plugins?: any[] | undefined;
188
+ debug?: boolean | undefined;
189
+ mode?: Mode | undefined;
190
+ app?: string | undefined;
191
+ browser?: Browser | undefined;
192
+ manifestVersion?: 2 | 3 | undefined;
193
+ inputDir?: string | undefined;
194
+ outputDir?: string | undefined;
195
+ srcDir?: string | undefined;
196
+ sharedDir?: string | undefined;
197
+ appsDir?: string | undefined;
198
+ jsDir?: string | undefined;
199
+ cssDir?: string | undefined;
200
+ assetsDir?: string | undefined;
201
+ htmlDir?: string | undefined;
202
+ analyze?: boolean | undefined;
203
+ configFile?: string | undefined;
204
+ mergeBackground?: boolean | undefined;
205
+ mergeCommands?: boolean | undefined;
206
+ mergeContentScripts?: boolean | undefined;
207
+ concatContentScripts?: boolean | undefined;
208
+ }, {
209
+ command?: Command | undefined;
210
+ plugins?: any[] | undefined;
211
+ debug?: boolean | undefined;
212
+ mode?: Mode | undefined;
213
+ app?: string | undefined;
214
+ browser?: Browser | undefined;
215
+ manifestVersion?: 2 | 3 | undefined;
216
+ inputDir?: string | undefined;
217
+ outputDir?: string | undefined;
218
+ srcDir?: string | undefined;
219
+ sharedDir?: string | undefined;
220
+ appsDir?: string | undefined;
221
+ jsDir?: string | undefined;
222
+ cssDir?: string | undefined;
223
+ assetsDir?: string | undefined;
224
+ htmlDir?: string | undefined;
225
+ analyze?: boolean | undefined;
226
+ configFile?: string | undefined;
227
+ mergeBackground?: boolean | undefined;
228
+ mergeCommands?: boolean | undefined;
229
+ mergeContentScripts?: boolean | undefined;
230
+ concatContentScripts?: boolean | undefined;
231
+ }>;
232
+ declare const UserConfigSchema: z.ZodObject<Omit<{
233
+ debug: z.ZodOptional<z.ZodBoolean>;
234
+ command: z.ZodOptional<z.ZodNativeEnum<typeof Command>>;
235
+ mode: z.ZodOptional<z.ZodNativeEnum<typeof Mode>>;
236
+ app: z.ZodOptional<z.ZodString>;
237
+ browser: z.ZodOptional<z.ZodNativeEnum<typeof Browser>>;
238
+ manifestVersion: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
239
+ inputDir: z.ZodOptional<z.ZodString>;
240
+ outputDir: z.ZodOptional<z.ZodString>;
241
+ srcDir: z.ZodOptional<z.ZodString>;
242
+ sharedDir: z.ZodOptional<z.ZodString>;
243
+ appsDir: z.ZodOptional<z.ZodString>;
244
+ jsDir: z.ZodOptional<z.ZodString>;
245
+ cssDir: z.ZodOptional<z.ZodString>;
246
+ assetsDir: z.ZodOptional<z.ZodString>;
247
+ htmlDir: z.ZodOptional<z.ZodString>;
248
+ plugins: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
249
+ analyze: z.ZodOptional<z.ZodBoolean>;
250
+ configFile: z.ZodOptional<z.ZodString>;
251
+ mergeBackground: z.ZodOptional<z.ZodBoolean>;
252
+ mergeCommands: z.ZodOptional<z.ZodBoolean>;
253
+ mergeContentScripts: z.ZodOptional<z.ZodBoolean>;
254
+ concatContentScripts: z.ZodOptional<z.ZodBoolean>;
255
+ }, "command" | "configFile">, "strip", z.ZodTypeAny, {
256
+ plugins?: any[] | undefined;
257
+ debug?: boolean | undefined;
258
+ mode?: Mode | undefined;
259
+ app?: string | undefined;
260
+ browser?: Browser | undefined;
261
+ manifestVersion?: 2 | 3 | undefined;
262
+ inputDir?: string | undefined;
263
+ outputDir?: string | undefined;
264
+ srcDir?: string | undefined;
265
+ sharedDir?: string | undefined;
266
+ appsDir?: string | undefined;
267
+ jsDir?: string | undefined;
268
+ cssDir?: string | undefined;
269
+ assetsDir?: string | undefined;
270
+ htmlDir?: string | undefined;
271
+ analyze?: boolean | undefined;
272
+ mergeBackground?: boolean | undefined;
273
+ mergeCommands?: boolean | undefined;
274
+ mergeContentScripts?: boolean | undefined;
275
+ concatContentScripts?: boolean | undefined;
276
+ }, {
277
+ plugins?: any[] | undefined;
278
+ debug?: boolean | undefined;
279
+ mode?: Mode | undefined;
280
+ app?: string | undefined;
281
+ browser?: Browser | undefined;
282
+ manifestVersion?: 2 | 3 | undefined;
283
+ inputDir?: string | undefined;
284
+ outputDir?: string | undefined;
285
+ srcDir?: string | undefined;
286
+ sharedDir?: string | undefined;
287
+ appsDir?: string | undefined;
288
+ jsDir?: string | undefined;
289
+ cssDir?: string | undefined;
290
+ assetsDir?: string | undefined;
291
+ htmlDir?: string | undefined;
292
+ analyze?: boolean | undefined;
293
+ mergeBackground?: boolean | undefined;
294
+ mergeCommands?: boolean | undefined;
295
+ mergeContentScripts?: boolean | undefined;
296
+ concatContentScripts?: boolean | undefined;
297
+ }>;
298
+ declare const ConfigOptionsSchema: z.ZodObject<{
299
+ config: z.ZodReadonly<z.ZodObject<{
300
+ debug: z.ZodBoolean;
301
+ command: z.ZodNativeEnum<typeof Command>;
302
+ mode: z.ZodNativeEnum<typeof Mode>;
303
+ app: z.ZodString;
304
+ browser: z.ZodNativeEnum<typeof Browser>;
305
+ manifestVersion: z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>;
306
+ inputDir: z.ZodString;
307
+ outputDir: z.ZodString;
308
+ srcDir: z.ZodString;
309
+ sharedDir: z.ZodString;
310
+ appsDir: z.ZodString;
311
+ jsDir: z.ZodString;
312
+ cssDir: z.ZodString;
313
+ assetsDir: z.ZodString;
314
+ htmlDir: z.ZodString;
315
+ plugins: z.ZodArray<z.ZodAny, "many">;
316
+ analyze: z.ZodBoolean;
317
+ configFile: z.ZodString;
318
+ mergeBackground: z.ZodBoolean;
319
+ mergeCommands: z.ZodBoolean;
320
+ mergeContentScripts: z.ZodBoolean;
321
+ concatContentScripts: z.ZodBoolean;
322
+ }, "strip", z.ZodTypeAny, {
323
+ command: Command;
324
+ plugins: any[];
325
+ debug: boolean;
326
+ mode: Mode;
327
+ app: string;
328
+ browser: Browser;
329
+ manifestVersion: 2 | 3;
330
+ inputDir: string;
331
+ outputDir: string;
332
+ srcDir: string;
333
+ sharedDir: string;
334
+ appsDir: string;
335
+ jsDir: string;
336
+ cssDir: string;
337
+ assetsDir: string;
338
+ htmlDir: string;
339
+ analyze: boolean;
340
+ configFile: string;
341
+ mergeBackground: boolean;
342
+ mergeCommands: boolean;
343
+ mergeContentScripts: boolean;
344
+ concatContentScripts: boolean;
345
+ }, {
346
+ command: Command;
347
+ plugins: any[];
348
+ debug: boolean;
349
+ mode: Mode;
350
+ app: string;
351
+ browser: Browser;
352
+ manifestVersion: 2 | 3;
353
+ inputDir: string;
354
+ outputDir: string;
355
+ srcDir: string;
356
+ sharedDir: string;
357
+ appsDir: string;
358
+ jsDir: string;
359
+ cssDir: string;
360
+ assetsDir: string;
361
+ htmlDir: string;
362
+ analyze: boolean;
363
+ configFile: string;
364
+ mergeBackground: boolean;
365
+ mergeCommands: boolean;
366
+ mergeContentScripts: boolean;
367
+ concatContentScripts: boolean;
368
+ }>>;
369
+ }, "strip", z.ZodTypeAny, {
370
+ config: Readonly<{
371
+ command: Command;
372
+ plugins: any[];
373
+ debug: boolean;
374
+ mode: Mode;
375
+ app: string;
376
+ browser: Browser;
377
+ manifestVersion: 2 | 3;
378
+ inputDir: string;
379
+ outputDir: string;
380
+ srcDir: string;
381
+ sharedDir: string;
382
+ appsDir: string;
383
+ jsDir: string;
384
+ cssDir: string;
385
+ assetsDir: string;
386
+ htmlDir: string;
387
+ analyze: boolean;
388
+ configFile: string;
389
+ mergeBackground: boolean;
390
+ mergeCommands: boolean;
391
+ mergeContentScripts: boolean;
392
+ concatContentScripts: boolean;
393
+ }>;
394
+ }, {
395
+ config: Readonly<{
396
+ command: Command;
397
+ plugins: any[];
398
+ debug: boolean;
399
+ mode: Mode;
400
+ app: string;
401
+ browser: Browser;
402
+ manifestVersion: 2 | 3;
403
+ inputDir: string;
404
+ outputDir: string;
405
+ srcDir: string;
406
+ sharedDir: string;
407
+ appsDir: string;
408
+ jsDir: string;
409
+ cssDir: string;
410
+ assetsDir: string;
411
+ htmlDir: string;
412
+ analyze: boolean;
413
+ configFile: string;
414
+ mergeBackground: boolean;
415
+ mergeCommands: boolean;
416
+ mergeContentScripts: boolean;
417
+ concatContentScripts: boolean;
418
+ }>;
419
+ }>;
420
+ declare const UserConfigCallbackSchema: z.ZodFunction<z.ZodTuple<[z.ZodObject<{
421
+ config: z.ZodReadonly<z.ZodObject<{
422
+ debug: z.ZodBoolean;
423
+ command: z.ZodNativeEnum<typeof Command>;
424
+ mode: z.ZodNativeEnum<typeof Mode>;
425
+ app: z.ZodString;
426
+ browser: z.ZodNativeEnum<typeof Browser>;
427
+ manifestVersion: z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>;
428
+ inputDir: z.ZodString;
429
+ outputDir: z.ZodString;
430
+ srcDir: z.ZodString;
431
+ sharedDir: z.ZodString;
432
+ appsDir: z.ZodString;
433
+ jsDir: z.ZodString;
434
+ cssDir: z.ZodString;
435
+ assetsDir: z.ZodString;
436
+ htmlDir: z.ZodString;
437
+ plugins: z.ZodArray<z.ZodAny, "many">;
438
+ analyze: z.ZodBoolean;
439
+ configFile: z.ZodString;
440
+ mergeBackground: z.ZodBoolean;
441
+ mergeCommands: z.ZodBoolean;
442
+ mergeContentScripts: z.ZodBoolean;
443
+ concatContentScripts: z.ZodBoolean;
444
+ }, "strip", z.ZodTypeAny, {
445
+ command: Command;
446
+ plugins: any[];
447
+ debug: boolean;
448
+ mode: Mode;
449
+ app: string;
450
+ browser: Browser;
451
+ manifestVersion: 2 | 3;
452
+ inputDir: string;
453
+ outputDir: string;
454
+ srcDir: string;
455
+ sharedDir: string;
456
+ appsDir: string;
457
+ jsDir: string;
458
+ cssDir: string;
459
+ assetsDir: string;
460
+ htmlDir: string;
461
+ analyze: boolean;
462
+ configFile: string;
463
+ mergeBackground: boolean;
464
+ mergeCommands: boolean;
465
+ mergeContentScripts: boolean;
466
+ concatContentScripts: boolean;
467
+ }, {
468
+ command: Command;
469
+ plugins: any[];
470
+ debug: boolean;
471
+ mode: Mode;
472
+ app: string;
473
+ browser: Browser;
474
+ manifestVersion: 2 | 3;
475
+ inputDir: string;
476
+ outputDir: string;
477
+ srcDir: string;
478
+ sharedDir: string;
479
+ appsDir: string;
480
+ jsDir: string;
481
+ cssDir: string;
482
+ assetsDir: string;
483
+ htmlDir: string;
484
+ analyze: boolean;
485
+ configFile: string;
486
+ mergeBackground: boolean;
487
+ mergeCommands: boolean;
488
+ mergeContentScripts: boolean;
489
+ concatContentScripts: boolean;
490
+ }>>;
491
+ }, "strip", z.ZodTypeAny, {
492
+ config: Readonly<{
493
+ command: Command;
494
+ plugins: any[];
495
+ debug: boolean;
496
+ mode: Mode;
497
+ app: string;
498
+ browser: Browser;
499
+ manifestVersion: 2 | 3;
500
+ inputDir: string;
501
+ outputDir: string;
502
+ srcDir: string;
503
+ sharedDir: string;
504
+ appsDir: string;
505
+ jsDir: string;
506
+ cssDir: string;
507
+ assetsDir: string;
508
+ htmlDir: string;
509
+ analyze: boolean;
510
+ configFile: string;
511
+ mergeBackground: boolean;
512
+ mergeCommands: boolean;
513
+ mergeContentScripts: boolean;
514
+ concatContentScripts: boolean;
515
+ }>;
516
+ }, {
517
+ config: Readonly<{
518
+ command: Command;
519
+ plugins: any[];
520
+ debug: boolean;
521
+ mode: Mode;
522
+ app: string;
523
+ browser: Browser;
524
+ manifestVersion: 2 | 3;
525
+ inputDir: string;
526
+ outputDir: string;
527
+ srcDir: string;
528
+ sharedDir: string;
529
+ appsDir: string;
530
+ jsDir: string;
531
+ cssDir: string;
532
+ assetsDir: string;
533
+ htmlDir: string;
534
+ analyze: boolean;
535
+ configFile: string;
536
+ mergeBackground: boolean;
537
+ mergeCommands: boolean;
538
+ mergeContentScripts: boolean;
539
+ concatContentScripts: boolean;
540
+ }>;
541
+ }>], z.ZodUnknown>, z.ZodObject<Omit<{
542
+ debug: z.ZodOptional<z.ZodBoolean>;
543
+ command: z.ZodOptional<z.ZodNativeEnum<typeof Command>>;
544
+ mode: z.ZodOptional<z.ZodNativeEnum<typeof Mode>>;
545
+ app: z.ZodOptional<z.ZodString>;
546
+ browser: z.ZodOptional<z.ZodNativeEnum<typeof Browser>>;
547
+ manifestVersion: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
548
+ inputDir: z.ZodOptional<z.ZodString>;
549
+ outputDir: z.ZodOptional<z.ZodString>;
550
+ srcDir: z.ZodOptional<z.ZodString>;
551
+ sharedDir: z.ZodOptional<z.ZodString>;
552
+ appsDir: z.ZodOptional<z.ZodString>;
553
+ jsDir: z.ZodOptional<z.ZodString>;
554
+ cssDir: z.ZodOptional<z.ZodString>;
555
+ assetsDir: z.ZodOptional<z.ZodString>;
556
+ htmlDir: z.ZodOptional<z.ZodString>;
557
+ plugins: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
558
+ analyze: z.ZodOptional<z.ZodBoolean>;
559
+ configFile: z.ZodOptional<z.ZodString>;
560
+ mergeBackground: z.ZodOptional<z.ZodBoolean>;
561
+ mergeCommands: z.ZodOptional<z.ZodBoolean>;
562
+ mergeContentScripts: z.ZodOptional<z.ZodBoolean>;
563
+ concatContentScripts: z.ZodOptional<z.ZodBoolean>;
564
+ }, "command" | "configFile">, "strip", z.ZodTypeAny, {
565
+ plugins?: any[] | undefined;
566
+ debug?: boolean | undefined;
567
+ mode?: Mode | undefined;
568
+ app?: string | undefined;
569
+ browser?: Browser | undefined;
570
+ manifestVersion?: 2 | 3 | undefined;
571
+ inputDir?: string | undefined;
572
+ outputDir?: string | undefined;
573
+ srcDir?: string | undefined;
574
+ sharedDir?: string | undefined;
575
+ appsDir?: string | undefined;
576
+ jsDir?: string | undefined;
577
+ cssDir?: string | undefined;
578
+ assetsDir?: string | undefined;
579
+ htmlDir?: string | undefined;
580
+ analyze?: boolean | undefined;
581
+ mergeBackground?: boolean | undefined;
582
+ mergeCommands?: boolean | undefined;
583
+ mergeContentScripts?: boolean | undefined;
584
+ concatContentScripts?: boolean | undefined;
585
+ }, {
586
+ plugins?: any[] | undefined;
587
+ debug?: boolean | undefined;
588
+ mode?: Mode | undefined;
589
+ app?: string | undefined;
590
+ browser?: Browser | undefined;
591
+ manifestVersion?: 2 | 3 | undefined;
592
+ inputDir?: string | undefined;
593
+ outputDir?: string | undefined;
594
+ srcDir?: string | undefined;
595
+ sharedDir?: string | undefined;
596
+ appsDir?: string | undefined;
597
+ jsDir?: string | undefined;
598
+ cssDir?: string | undefined;
599
+ assetsDir?: string | undefined;
600
+ htmlDir?: string | undefined;
601
+ analyze?: boolean | undefined;
602
+ mergeBackground?: boolean | undefined;
603
+ mergeCommands?: boolean | undefined;
604
+ mergeContentScripts?: boolean | undefined;
605
+ concatContentScripts?: boolean | undefined;
606
+ }>>;
607
+ declare const ConfigDefinitionSchema: z.ZodUnion<[z.ZodFunction<z.ZodTuple<[z.ZodObject<{
608
+ config: z.ZodReadonly<z.ZodObject<{
609
+ debug: z.ZodBoolean;
610
+ command: z.ZodNativeEnum<typeof Command>;
611
+ mode: z.ZodNativeEnum<typeof Mode>;
612
+ app: z.ZodString;
613
+ browser: z.ZodNativeEnum<typeof Browser>;
614
+ manifestVersion: z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>;
615
+ inputDir: z.ZodString;
616
+ outputDir: z.ZodString;
617
+ srcDir: z.ZodString;
618
+ sharedDir: z.ZodString;
619
+ appsDir: z.ZodString;
620
+ jsDir: z.ZodString;
621
+ cssDir: z.ZodString;
622
+ assetsDir: z.ZodString;
623
+ htmlDir: z.ZodString;
624
+ plugins: z.ZodArray<z.ZodAny, "many">;
625
+ analyze: z.ZodBoolean;
626
+ configFile: z.ZodString;
627
+ mergeBackground: z.ZodBoolean;
628
+ mergeCommands: z.ZodBoolean;
629
+ mergeContentScripts: z.ZodBoolean;
630
+ concatContentScripts: z.ZodBoolean;
631
+ }, "strip", z.ZodTypeAny, {
632
+ command: Command;
633
+ plugins: any[];
634
+ debug: boolean;
635
+ mode: Mode;
636
+ app: string;
637
+ browser: Browser;
638
+ manifestVersion: 2 | 3;
639
+ inputDir: string;
640
+ outputDir: string;
641
+ srcDir: string;
642
+ sharedDir: string;
643
+ appsDir: string;
644
+ jsDir: string;
645
+ cssDir: string;
646
+ assetsDir: string;
647
+ htmlDir: string;
648
+ analyze: boolean;
649
+ configFile: string;
650
+ mergeBackground: boolean;
651
+ mergeCommands: boolean;
652
+ mergeContentScripts: boolean;
653
+ concatContentScripts: boolean;
654
+ }, {
655
+ command: Command;
656
+ plugins: any[];
657
+ debug: boolean;
658
+ mode: Mode;
659
+ app: string;
660
+ browser: Browser;
661
+ manifestVersion: 2 | 3;
662
+ inputDir: string;
663
+ outputDir: string;
664
+ srcDir: string;
665
+ sharedDir: string;
666
+ appsDir: string;
667
+ jsDir: string;
668
+ cssDir: string;
669
+ assetsDir: string;
670
+ htmlDir: string;
671
+ analyze: boolean;
672
+ configFile: string;
673
+ mergeBackground: boolean;
674
+ mergeCommands: boolean;
675
+ mergeContentScripts: boolean;
676
+ concatContentScripts: boolean;
677
+ }>>;
678
+ }, "strip", z.ZodTypeAny, {
679
+ config: Readonly<{
680
+ command: Command;
681
+ plugins: any[];
682
+ debug: boolean;
683
+ mode: Mode;
684
+ app: string;
685
+ browser: Browser;
686
+ manifestVersion: 2 | 3;
687
+ inputDir: string;
688
+ outputDir: string;
689
+ srcDir: string;
690
+ sharedDir: string;
691
+ appsDir: string;
692
+ jsDir: string;
693
+ cssDir: string;
694
+ assetsDir: string;
695
+ htmlDir: string;
696
+ analyze: boolean;
697
+ configFile: string;
698
+ mergeBackground: boolean;
699
+ mergeCommands: boolean;
700
+ mergeContentScripts: boolean;
701
+ concatContentScripts: boolean;
702
+ }>;
703
+ }, {
704
+ config: Readonly<{
705
+ command: Command;
706
+ plugins: any[];
707
+ debug: boolean;
708
+ mode: Mode;
709
+ app: string;
710
+ browser: Browser;
711
+ manifestVersion: 2 | 3;
712
+ inputDir: string;
713
+ outputDir: string;
714
+ srcDir: string;
715
+ sharedDir: string;
716
+ appsDir: string;
717
+ jsDir: string;
718
+ cssDir: string;
719
+ assetsDir: string;
720
+ htmlDir: string;
721
+ analyze: boolean;
722
+ configFile: string;
723
+ mergeBackground: boolean;
724
+ mergeCommands: boolean;
725
+ mergeContentScripts: boolean;
726
+ concatContentScripts: boolean;
727
+ }>;
728
+ }>], z.ZodUnknown>, z.ZodObject<Omit<{
729
+ debug: z.ZodOptional<z.ZodBoolean>;
730
+ command: z.ZodOptional<z.ZodNativeEnum<typeof Command>>;
731
+ mode: z.ZodOptional<z.ZodNativeEnum<typeof Mode>>;
732
+ app: z.ZodOptional<z.ZodString>;
733
+ browser: z.ZodOptional<z.ZodNativeEnum<typeof Browser>>;
734
+ manifestVersion: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
735
+ inputDir: z.ZodOptional<z.ZodString>;
736
+ outputDir: z.ZodOptional<z.ZodString>;
737
+ srcDir: z.ZodOptional<z.ZodString>;
738
+ sharedDir: z.ZodOptional<z.ZodString>;
739
+ appsDir: z.ZodOptional<z.ZodString>;
740
+ jsDir: z.ZodOptional<z.ZodString>;
741
+ cssDir: z.ZodOptional<z.ZodString>;
742
+ assetsDir: z.ZodOptional<z.ZodString>;
743
+ htmlDir: z.ZodOptional<z.ZodString>;
744
+ plugins: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
745
+ analyze: z.ZodOptional<z.ZodBoolean>;
746
+ configFile: z.ZodOptional<z.ZodString>;
747
+ mergeBackground: z.ZodOptional<z.ZodBoolean>;
748
+ mergeCommands: z.ZodOptional<z.ZodBoolean>;
749
+ mergeContentScripts: z.ZodOptional<z.ZodBoolean>;
750
+ concatContentScripts: z.ZodOptional<z.ZodBoolean>;
751
+ }, "command" | "configFile">, "strip", z.ZodTypeAny, {
752
+ plugins?: any[] | undefined;
753
+ debug?: boolean | undefined;
754
+ mode?: Mode | undefined;
755
+ app?: string | undefined;
756
+ browser?: Browser | undefined;
757
+ manifestVersion?: 2 | 3 | undefined;
758
+ inputDir?: string | undefined;
759
+ outputDir?: string | undefined;
760
+ srcDir?: string | undefined;
761
+ sharedDir?: string | undefined;
762
+ appsDir?: string | undefined;
763
+ jsDir?: string | undefined;
764
+ cssDir?: string | undefined;
765
+ assetsDir?: string | undefined;
766
+ htmlDir?: string | undefined;
767
+ analyze?: boolean | undefined;
768
+ mergeBackground?: boolean | undefined;
769
+ mergeCommands?: boolean | undefined;
770
+ mergeContentScripts?: boolean | undefined;
771
+ concatContentScripts?: boolean | undefined;
772
+ }, {
773
+ plugins?: any[] | undefined;
774
+ debug?: boolean | undefined;
775
+ mode?: Mode | undefined;
776
+ app?: string | undefined;
777
+ browser?: Browser | undefined;
778
+ manifestVersion?: 2 | 3 | undefined;
779
+ inputDir?: string | undefined;
780
+ outputDir?: string | undefined;
781
+ srcDir?: string | undefined;
782
+ sharedDir?: string | undefined;
783
+ appsDir?: string | undefined;
784
+ jsDir?: string | undefined;
785
+ cssDir?: string | undefined;
786
+ assetsDir?: string | undefined;
787
+ htmlDir?: string | undefined;
788
+ analyze?: boolean | undefined;
789
+ mergeBackground?: boolean | undefined;
790
+ mergeCommands?: boolean | undefined;
791
+ mergeContentScripts?: boolean | undefined;
792
+ concatContentScripts?: boolean | undefined;
793
+ }>>, z.ZodObject<Omit<{
794
+ debug: z.ZodOptional<z.ZodBoolean>;
795
+ command: z.ZodOptional<z.ZodNativeEnum<typeof Command>>;
796
+ mode: z.ZodOptional<z.ZodNativeEnum<typeof Mode>>;
797
+ app: z.ZodOptional<z.ZodString>;
798
+ browser: z.ZodOptional<z.ZodNativeEnum<typeof Browser>>;
799
+ manifestVersion: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
800
+ inputDir: z.ZodOptional<z.ZodString>;
801
+ outputDir: z.ZodOptional<z.ZodString>;
802
+ srcDir: z.ZodOptional<z.ZodString>;
803
+ sharedDir: z.ZodOptional<z.ZodString>;
804
+ appsDir: z.ZodOptional<z.ZodString>;
805
+ jsDir: z.ZodOptional<z.ZodString>;
806
+ cssDir: z.ZodOptional<z.ZodString>;
807
+ assetsDir: z.ZodOptional<z.ZodString>;
808
+ htmlDir: z.ZodOptional<z.ZodString>;
809
+ plugins: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
810
+ analyze: z.ZodOptional<z.ZodBoolean>;
811
+ configFile: z.ZodOptional<z.ZodString>;
812
+ mergeBackground: z.ZodOptional<z.ZodBoolean>;
813
+ mergeCommands: z.ZodOptional<z.ZodBoolean>;
814
+ mergeContentScripts: z.ZodOptional<z.ZodBoolean>;
815
+ concatContentScripts: z.ZodOptional<z.ZodBoolean>;
816
+ }, "command" | "configFile">, "strip", z.ZodTypeAny, {
817
+ plugins?: any[] | undefined;
818
+ debug?: boolean | undefined;
819
+ mode?: Mode | undefined;
820
+ app?: string | undefined;
821
+ browser?: Browser | undefined;
822
+ manifestVersion?: 2 | 3 | undefined;
823
+ inputDir?: string | undefined;
824
+ outputDir?: string | undefined;
825
+ srcDir?: string | undefined;
826
+ sharedDir?: string | undefined;
827
+ appsDir?: string | undefined;
828
+ jsDir?: string | undefined;
829
+ cssDir?: string | undefined;
830
+ assetsDir?: string | undefined;
831
+ htmlDir?: string | undefined;
832
+ analyze?: boolean | undefined;
833
+ mergeBackground?: boolean | undefined;
834
+ mergeCommands?: boolean | undefined;
835
+ mergeContentScripts?: boolean | undefined;
836
+ concatContentScripts?: boolean | undefined;
837
+ }, {
838
+ plugins?: any[] | undefined;
839
+ debug?: boolean | undefined;
840
+ mode?: Mode | undefined;
841
+ app?: string | undefined;
842
+ browser?: Browser | undefined;
843
+ manifestVersion?: 2 | 3 | undefined;
844
+ inputDir?: string | undefined;
845
+ outputDir?: string | undefined;
846
+ srcDir?: string | undefined;
847
+ sharedDir?: string | undefined;
848
+ appsDir?: string | undefined;
849
+ jsDir?: string | undefined;
850
+ cssDir?: string | undefined;
851
+ assetsDir?: string | undefined;
852
+ htmlDir?: string | undefined;
853
+ analyze?: boolean | undefined;
854
+ mergeBackground?: boolean | undefined;
855
+ mergeCommands?: boolean | undefined;
856
+ mergeContentScripts?: boolean | undefined;
857
+ concatContentScripts?: boolean | undefined;
858
+ }>]>;
859
+ type Config = z.infer<typeof ConfigSchema>;
860
+ type ConfigOptions = z.infer<typeof ConfigOptionsSchema>;
861
+ type OptionalConfig = z.infer<typeof OptionalConfigSchema>;
862
+ type UserConfig = z.infer<typeof UserConfigSchema>;
863
+ type ReadonlyConfig = z.infer<typeof ReadonlyConfigSchema>;
864
+ type ConfigDefinition = z.infer<typeof ConfigDefinitionSchema>;
865
+
866
+ declare enum EntrypointType {
867
+ Background = "background",
868
+ Command = "command",
869
+ ContentScript = "content",
870
+ OptionsPage = "options",
871
+ Popup = "popup",
872
+ Sidebar = "sidebar"
873
+ }
874
+ declare const EntrypointOptionsSchema: z.ZodObject<{
4
875
  /**
5
876
  * List of target browsers to include this entrypoint in. Defaults to being included in all
6
877
  * builds. Cannot be used with `exclude`. You must choose one of the two options.
7
878
  *
8
879
  * @default undefined
9
880
  */
10
- includeBrowser?: Browser[];
881
+ includeBrowser: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Browser>, "many">>;
11
882
  /**
12
883
  * List of target browsers to exclude this entrypoint from. Cannot be used with `include`. You
13
884
  * must choose one of the two options.
14
885
  *
15
886
  * @default undefined
16
887
  */
17
- excludeBrowser?: Browser[];
888
+ excludeBrowser: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Browser>, "many">>;
18
889
  /**
19
890
  * List of target apps to include this entrypoint in. Defaults to being included in all builds.
20
891
  * Cannot be used with `excludeApp`. You must choose one of the two options.
21
892
  *
22
893
  * @default undefined
23
894
  */
24
- excludeApp?: string[];
895
+ includeApp: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
25
896
  /**
26
897
  * List of target apps to exclude this entrypoint from. Cannot be used with `includeApp`. You
27
898
  * must choose one of the two options.
28
899
  *
29
900
  * @default undefined
30
901
  */
31
- includeApp?: string[];
32
- }
33
- interface EntrypointFile {
902
+ excludeApp: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
903
+ }, "strip", z.ZodTypeAny, {
904
+ includeBrowser?: Browser[] | undefined;
905
+ excludeBrowser?: Browser[] | undefined;
906
+ includeApp?: string[] | undefined;
907
+ excludeApp?: string[] | undefined;
908
+ }, {
909
+ includeBrowser?: Browser[] | undefined;
910
+ excludeBrowser?: Browser[] | undefined;
911
+ includeApp?: string[] | undefined;
912
+ excludeApp?: string[] | undefined;
913
+ }>;
914
+ declare const EntrypointFileSchema: z.ZodObject<{
915
+ file: z.ZodString;
916
+ import: z.ZodString;
917
+ external: z.ZodOptional<z.ZodBoolean>;
918
+ }, "strip", z.ZodTypeAny, {
34
919
  file: string;
35
920
  import: string;
921
+ external?: boolean | undefined;
922
+ }, {
923
+ file: string;
924
+ import: string;
925
+ external?: boolean | undefined;
926
+ }>;
927
+ type EntrypointOptions = z.infer<typeof EntrypointOptionsSchema>;
928
+ type EntrypointFile = z.infer<typeof EntrypointFileSchema>;
929
+
930
+ interface BackgroundConfig {
931
+ persistent?: boolean;
932
+ }
933
+ type BackgroundOptions = BackgroundConfig & EntrypointOptions;
934
+ type BackgroundEntrypointOptions = BackgroundOptions;
935
+ interface BackgroundDefinition extends BackgroundEntrypointOptions {
936
+ main?(options: BackgroundOptions): any;
36
937
  }
938
+ type BackgroundEntrypointMap = Map<EntrypointFile, BackgroundDefinition>;
37
939
 
38
940
  type ExecutionWorld = chrome.scripting.ExecutionWorld;
39
941
  type RunAt = chrome.userScripts.RunAt;
@@ -85,14 +987,23 @@ interface ContentScriptDefinition extends ContentScriptEntrypointOptions {
85
987
  render?(): Promise<void>;
86
988
  }
87
989
 
88
- interface BackgroundConfig {
89
- persistent?: boolean;
990
+ type Tab = chrome.tabs.Tab;
991
+ interface CommandConfig {
992
+ name: string;
993
+ description?: string;
994
+ global?: boolean;
995
+ defaultKey?: string;
996
+ windowsKey?: string;
997
+ macKey?: string;
998
+ chromeosKey?: string;
999
+ linuxKey?: string;
90
1000
  }
91
- type BackgroundEntrypointOptions = BackgroundConfig & EntrypointOptions;
92
- interface BackgroundDefinition extends BackgroundEntrypointOptions {
93
- main?(options: BackgroundEntrypointOptions): any;
1001
+ type CommandOptions = CommandConfig & EntrypointOptions;
1002
+ type CommandEntrypointOptions = Optional<CommandOptions>;
1003
+ interface CommandDefinition extends CommandEntrypointOptions {
1004
+ main(options: CommandOptions, tab?: Tab): any;
94
1005
  }
95
- type BackgroundEntrypointMap = Map<EntrypointFile, BackgroundDefinition>;
1006
+ type CommandEntrypointMap = Map<EntrypointFile, CommandOptions>;
96
1007
 
97
1008
  type ManifestCommon = chrome.runtime.Manifest;
98
1009
  type ManifestBase = chrome.runtime.ManifestBase;
@@ -105,7 +1016,8 @@ interface ManifestUnstable {
105
1016
  permissions?: (chrome.runtime.ManifestPermissions | (string & Record<never, never>))[];
106
1017
  web_accessible_resources?: string[] | chrome.runtime.ManifestV3['web_accessible_resources'];
107
1018
  }
108
- type ManifestVersion = 2 | 3;
1019
+ declare const ManifestVersionSchema: z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>;
1020
+ type ManifestVersion = z.infer<typeof ManifestVersionSchema>;
109
1021
  type ManifestMapping = {
110
1022
  [Key in ManifestVersion]: Key extends 2 ? ManifestFixed<ManifestV2> : ManifestFixed<ManifestV3>;
111
1023
  };
@@ -148,11 +1060,13 @@ interface ManifestBuilder<T extends CoreManifest = Manifest> {
148
1060
  setName(name: string): this;
149
1061
  setShortName(shortName: string): this;
150
1062
  setDescription(description: string): this;
151
- resetBackground(background: ManifestBackground): this;
152
- pushContentScript(...contentScript: ManifestContentScript[]): this;
1063
+ setBackground(background?: ManifestBackground): this;
1064
+ setCommands(commands?: ManifestCommandMap): this;
1065
+ setContentScripts(contentScripts?: ManifestContentScriptMap): this;
153
1066
  setDependencies(dependencies: ManifestDependenciesMap): this;
154
1067
  get(): T;
155
1068
  }
1069
+ declare const ManifestBuilderSchema: z.ZodType<ManifestBuilder<Manifest>, z.ZodTypeDef, ManifestBuilder<Manifest>>;
156
1070
  interface ManifestEntry {
157
1071
  entry: string;
158
1072
  }
@@ -161,6 +1075,9 @@ interface ManifestEntryFile extends ManifestEntry {
161
1075
  }
162
1076
  type ManifestBackground = ManifestEntry & BackgroundConfig;
163
1077
  type ManifestContentScript = ManifestEntry & ContentScriptConfig;
1078
+ type ManifestContentScriptMap = Map<string, ManifestContentScript>;
1079
+ type ManifestCommand = CommandConfig;
1080
+ type ManifestCommandMap = Set<ManifestCommand>;
164
1081
  interface ManifestDependencies {
165
1082
  js: Set<string>;
166
1083
  css: Set<string>;
@@ -168,34 +1085,1130 @@ interface ManifestDependencies {
168
1085
  }
169
1086
  type ManifestDependenciesMap = Map<string, ManifestDependencies>;
170
1087
 
171
- interface PluginManifestOptions extends ConfigOptions {
172
- manifest: ManifestBuilder;
173
- }
174
- interface PluginWebpackOptions extends ConfigOptions {
175
- webpack: Partial<Configuration>;
176
- }
177
- interface PluginContentOptions extends ConfigOptions {
178
- entries: ContentScriptEntrypointMap;
179
- }
180
- type PluginContentResult = true | string | string[] | Record<string, string>;
181
- interface PluginBackgroundOptions extends ConfigOptions {
182
- entries: BackgroundEntrypointMap;
183
- }
184
- type PluginBackgroundResult = true | string;
185
- interface PluginName {
1088
+ declare const PluginEntrypointResultSchema: z.ZodUnion<[z.ZodLiteral<true>, z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodObject<{
1089
+ file: z.ZodString;
1090
+ import: z.ZodString;
1091
+ external: z.ZodOptional<z.ZodBoolean>;
1092
+ }, "strip", z.ZodTypeAny, {
1093
+ file: string;
1094
+ import: string;
1095
+ external?: boolean | undefined;
1096
+ }, {
1097
+ file: string;
1098
+ import: string;
1099
+ external?: boolean | undefined;
1100
+ }>, z.ZodArray<z.ZodObject<{
1101
+ file: z.ZodString;
1102
+ import: z.ZodString;
1103
+ external: z.ZodOptional<z.ZodBoolean>;
1104
+ }, "strip", z.ZodTypeAny, {
1105
+ file: string;
1106
+ import: string;
1107
+ external?: boolean | undefined;
1108
+ }, {
1109
+ file: string;
1110
+ import: string;
1111
+ external?: boolean | undefined;
1112
+ }>, "many">, z.ZodSet<z.ZodObject<{
1113
+ file: z.ZodString;
1114
+ import: z.ZodString;
1115
+ external: z.ZodOptional<z.ZodBoolean>;
1116
+ }, "strip", z.ZodTypeAny, {
1117
+ file: string;
1118
+ import: string;
1119
+ external?: boolean | undefined;
1120
+ }, {
1121
+ file: string;
1122
+ import: string;
1123
+ external?: boolean | undefined;
1124
+ }>>]>;
1125
+ type PluginEntrypointResult = z.infer<typeof PluginEntrypointResultSchema>;
1126
+ declare const PluginManifestOptionsSchema: z.ZodObject<z.objectUtil.extendShape<{
1127
+ config: z.ZodReadonly<z.ZodObject<{
1128
+ debug: z.ZodBoolean;
1129
+ command: z.ZodNativeEnum<typeof Command>;
1130
+ mode: z.ZodNativeEnum<typeof Mode>;
1131
+ app: z.ZodString;
1132
+ browser: z.ZodNativeEnum<typeof Browser>;
1133
+ manifestVersion: z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>;
1134
+ inputDir: z.ZodString;
1135
+ outputDir: z.ZodString;
1136
+ srcDir: z.ZodString;
1137
+ sharedDir: z.ZodString;
1138
+ appsDir: z.ZodString;
1139
+ jsDir: z.ZodString;
1140
+ cssDir: z.ZodString;
1141
+ assetsDir: z.ZodString;
1142
+ htmlDir: z.ZodString;
1143
+ plugins: z.ZodArray<z.ZodAny, "many">;
1144
+ analyze: z.ZodBoolean;
1145
+ configFile: z.ZodString;
1146
+ mergeBackground: z.ZodBoolean;
1147
+ mergeCommands: z.ZodBoolean;
1148
+ mergeContentScripts: z.ZodBoolean;
1149
+ concatContentScripts: z.ZodBoolean;
1150
+ }, "strip", z.ZodTypeAny, {
1151
+ command: Command;
1152
+ plugins: any[];
1153
+ debug: boolean;
1154
+ mode: Mode;
1155
+ app: string;
1156
+ browser: Browser;
1157
+ manifestVersion: 2 | 3;
1158
+ inputDir: string;
1159
+ outputDir: string;
1160
+ srcDir: string;
1161
+ sharedDir: string;
1162
+ appsDir: string;
1163
+ jsDir: string;
1164
+ cssDir: string;
1165
+ assetsDir: string;
1166
+ htmlDir: string;
1167
+ analyze: boolean;
1168
+ configFile: string;
1169
+ mergeBackground: boolean;
1170
+ mergeCommands: boolean;
1171
+ mergeContentScripts: boolean;
1172
+ concatContentScripts: boolean;
1173
+ }, {
1174
+ command: Command;
1175
+ plugins: any[];
1176
+ debug: boolean;
1177
+ mode: Mode;
1178
+ app: string;
1179
+ browser: Browser;
1180
+ manifestVersion: 2 | 3;
1181
+ inputDir: string;
1182
+ outputDir: string;
1183
+ srcDir: string;
1184
+ sharedDir: string;
1185
+ appsDir: string;
1186
+ jsDir: string;
1187
+ cssDir: string;
1188
+ assetsDir: string;
1189
+ htmlDir: string;
1190
+ analyze: boolean;
1191
+ configFile: string;
1192
+ mergeBackground: boolean;
1193
+ mergeCommands: boolean;
1194
+ mergeContentScripts: boolean;
1195
+ concatContentScripts: boolean;
1196
+ }>>;
1197
+ }, {
1198
+ manifest: z.ZodType<ManifestBuilder<Manifest>, z.ZodTypeDef, ManifestBuilder<Manifest>>;
1199
+ }>, "strip", z.ZodTypeAny, {
1200
+ config: Readonly<{
1201
+ command: Command;
1202
+ plugins: any[];
1203
+ debug: boolean;
1204
+ mode: Mode;
1205
+ app: string;
1206
+ browser: Browser;
1207
+ manifestVersion: 2 | 3;
1208
+ inputDir: string;
1209
+ outputDir: string;
1210
+ srcDir: string;
1211
+ sharedDir: string;
1212
+ appsDir: string;
1213
+ jsDir: string;
1214
+ cssDir: string;
1215
+ assetsDir: string;
1216
+ htmlDir: string;
1217
+ analyze: boolean;
1218
+ configFile: string;
1219
+ mergeBackground: boolean;
1220
+ mergeCommands: boolean;
1221
+ mergeContentScripts: boolean;
1222
+ concatContentScripts: boolean;
1223
+ }>;
1224
+ manifest: ManifestBuilder<Manifest>;
1225
+ }, {
1226
+ config: Readonly<{
1227
+ command: Command;
1228
+ plugins: any[];
1229
+ debug: boolean;
1230
+ mode: Mode;
1231
+ app: string;
1232
+ browser: Browser;
1233
+ manifestVersion: 2 | 3;
1234
+ inputDir: string;
1235
+ outputDir: string;
1236
+ srcDir: string;
1237
+ sharedDir: string;
1238
+ appsDir: string;
1239
+ jsDir: string;
1240
+ cssDir: string;
1241
+ assetsDir: string;
1242
+ htmlDir: string;
1243
+ analyze: boolean;
1244
+ configFile: string;
1245
+ mergeBackground: boolean;
1246
+ mergeCommands: boolean;
1247
+ mergeContentScripts: boolean;
1248
+ concatContentScripts: boolean;
1249
+ }>;
1250
+ manifest: ManifestBuilder<Manifest>;
1251
+ }>;
1252
+ declare const PluginWebpackOptionsSchema: z.ZodObject<z.objectUtil.extendShape<{
1253
+ config: z.ZodReadonly<z.ZodObject<{
1254
+ debug: z.ZodBoolean;
1255
+ command: z.ZodNativeEnum<typeof Command>;
1256
+ mode: z.ZodNativeEnum<typeof Mode>;
1257
+ app: z.ZodString;
1258
+ browser: z.ZodNativeEnum<typeof Browser>;
1259
+ manifestVersion: z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>;
1260
+ inputDir: z.ZodString;
1261
+ outputDir: z.ZodString;
1262
+ srcDir: z.ZodString;
1263
+ sharedDir: z.ZodString;
1264
+ appsDir: z.ZodString;
1265
+ jsDir: z.ZodString;
1266
+ cssDir: z.ZodString;
1267
+ assetsDir: z.ZodString;
1268
+ htmlDir: z.ZodString;
1269
+ plugins: z.ZodArray<z.ZodAny, "many">;
1270
+ analyze: z.ZodBoolean;
1271
+ configFile: z.ZodString;
1272
+ mergeBackground: z.ZodBoolean;
1273
+ mergeCommands: z.ZodBoolean;
1274
+ mergeContentScripts: z.ZodBoolean;
1275
+ concatContentScripts: z.ZodBoolean;
1276
+ }, "strip", z.ZodTypeAny, {
1277
+ command: Command;
1278
+ plugins: any[];
1279
+ debug: boolean;
1280
+ mode: Mode;
1281
+ app: string;
1282
+ browser: Browser;
1283
+ manifestVersion: 2 | 3;
1284
+ inputDir: string;
1285
+ outputDir: string;
1286
+ srcDir: string;
1287
+ sharedDir: string;
1288
+ appsDir: string;
1289
+ jsDir: string;
1290
+ cssDir: string;
1291
+ assetsDir: string;
1292
+ htmlDir: string;
1293
+ analyze: boolean;
1294
+ configFile: string;
1295
+ mergeBackground: boolean;
1296
+ mergeCommands: boolean;
1297
+ mergeContentScripts: boolean;
1298
+ concatContentScripts: boolean;
1299
+ }, {
1300
+ command: Command;
1301
+ plugins: any[];
1302
+ debug: boolean;
1303
+ mode: Mode;
1304
+ app: string;
1305
+ browser: Browser;
1306
+ manifestVersion: 2 | 3;
1307
+ inputDir: string;
1308
+ outputDir: string;
1309
+ srcDir: string;
1310
+ sharedDir: string;
1311
+ appsDir: string;
1312
+ jsDir: string;
1313
+ cssDir: string;
1314
+ assetsDir: string;
1315
+ htmlDir: string;
1316
+ analyze: boolean;
1317
+ configFile: string;
1318
+ mergeBackground: boolean;
1319
+ mergeCommands: boolean;
1320
+ mergeContentScripts: boolean;
1321
+ concatContentScripts: boolean;
1322
+ }>>;
1323
+ }, {
1324
+ webpack: z.ZodOptional<z.ZodType<Configuration, z.ZodTypeDef, Configuration>>;
1325
+ }>, "strip", z.ZodTypeAny, {
1326
+ config: Readonly<{
1327
+ command: Command;
1328
+ plugins: any[];
1329
+ debug: boolean;
1330
+ mode: Mode;
1331
+ app: string;
1332
+ browser: Browser;
1333
+ manifestVersion: 2 | 3;
1334
+ inputDir: string;
1335
+ outputDir: string;
1336
+ srcDir: string;
1337
+ sharedDir: string;
1338
+ appsDir: string;
1339
+ jsDir: string;
1340
+ cssDir: string;
1341
+ assetsDir: string;
1342
+ htmlDir: string;
1343
+ analyze: boolean;
1344
+ configFile: string;
1345
+ mergeBackground: boolean;
1346
+ mergeCommands: boolean;
1347
+ mergeContentScripts: boolean;
1348
+ concatContentScripts: boolean;
1349
+ }>;
1350
+ webpack?: Configuration | undefined;
1351
+ }, {
1352
+ config: Readonly<{
1353
+ command: Command;
1354
+ plugins: any[];
1355
+ debug: boolean;
1356
+ mode: Mode;
1357
+ app: string;
1358
+ browser: Browser;
1359
+ manifestVersion: 2 | 3;
1360
+ inputDir: string;
1361
+ outputDir: string;
1362
+ srcDir: string;
1363
+ sharedDir: string;
1364
+ appsDir: string;
1365
+ jsDir: string;
1366
+ cssDir: string;
1367
+ assetsDir: string;
1368
+ htmlDir: string;
1369
+ analyze: boolean;
1370
+ configFile: string;
1371
+ mergeBackground: boolean;
1372
+ mergeCommands: boolean;
1373
+ mergeContentScripts: boolean;
1374
+ concatContentScripts: boolean;
1375
+ }>;
1376
+ webpack?: Configuration | undefined;
1377
+ }>;
1378
+ declare const PluginNameSchema: z.ZodObject<{
1379
+ name: z.ZodString;
1380
+ }, "strip", z.ZodTypeAny, {
186
1381
  name: string;
187
- }
188
- interface Plugin extends PluginName {
189
- content?: PluginHandler<PluginContentOptions, PluginContentResult>;
190
- background?: PluginHandler<PluginBackgroundOptions, PluginBackgroundResult>;
191
- manifest?: PluginHandlerCallback<PluginManifestOptions>;
192
- webpack?: PluginHandler<PluginWebpackOptions, Configuration>;
193
- }
1382
+ }, {
1383
+ name: string;
1384
+ }>;
1385
+ declare const PluginSchema: z.ZodObject<z.objectUtil.extendShape<{
1386
+ name: z.ZodString;
1387
+ }, {
1388
+ content: z.ZodUnion<[z.ZodType<string | true | string[] | {
1389
+ file: string;
1390
+ import: string;
1391
+ external?: boolean | undefined;
1392
+ } | {
1393
+ file: string;
1394
+ import: string;
1395
+ external?: boolean | undefined;
1396
+ }[] | Set<{
1397
+ file: string;
1398
+ import: string;
1399
+ external?: boolean | undefined;
1400
+ }>, z.ZodTypeDef, string | true | string[] | {
1401
+ file: string;
1402
+ import: string;
1403
+ external?: boolean | undefined;
1404
+ } | {
1405
+ file: string;
1406
+ import: string;
1407
+ external?: boolean | undefined;
1408
+ }[] | Set<{
1409
+ file: string;
1410
+ import: string;
1411
+ external?: boolean | undefined;
1412
+ }>>, z.ZodType<PluginHandlerCallback<{
1413
+ config: Readonly<{
1414
+ command: Command;
1415
+ plugins: any[];
1416
+ debug: boolean;
1417
+ mode: Mode;
1418
+ app: string;
1419
+ browser: Browser;
1420
+ manifestVersion: 2 | 3;
1421
+ inputDir: string;
1422
+ outputDir: string;
1423
+ srcDir: string;
1424
+ sharedDir: string;
1425
+ appsDir: string;
1426
+ jsDir: string;
1427
+ cssDir: string;
1428
+ assetsDir: string;
1429
+ htmlDir: string;
1430
+ analyze: boolean;
1431
+ configFile: string;
1432
+ mergeBackground: boolean;
1433
+ mergeCommands: boolean;
1434
+ mergeContentScripts: boolean;
1435
+ concatContentScripts: boolean;
1436
+ }>;
1437
+ }, string | true | string[] | {
1438
+ file: string;
1439
+ import: string;
1440
+ external?: boolean | undefined;
1441
+ } | {
1442
+ file: string;
1443
+ import: string;
1444
+ external?: boolean | undefined;
1445
+ }[] | Set<{
1446
+ file: string;
1447
+ import: string;
1448
+ external?: boolean | undefined;
1449
+ }>>, z.ZodTypeDef, PluginHandlerCallback<{
1450
+ config: Readonly<{
1451
+ command: Command;
1452
+ plugins: any[];
1453
+ debug: boolean;
1454
+ mode: Mode;
1455
+ app: string;
1456
+ browser: Browser;
1457
+ manifestVersion: 2 | 3;
1458
+ inputDir: string;
1459
+ outputDir: string;
1460
+ srcDir: string;
1461
+ sharedDir: string;
1462
+ appsDir: string;
1463
+ jsDir: string;
1464
+ cssDir: string;
1465
+ assetsDir: string;
1466
+ htmlDir: string;
1467
+ analyze: boolean;
1468
+ configFile: string;
1469
+ mergeBackground: boolean;
1470
+ mergeCommands: boolean;
1471
+ mergeContentScripts: boolean;
1472
+ concatContentScripts: boolean;
1473
+ }>;
1474
+ }, string | true | string[] | {
1475
+ file: string;
1476
+ import: string;
1477
+ external?: boolean | undefined;
1478
+ } | {
1479
+ file: string;
1480
+ import: string;
1481
+ external?: boolean | undefined;
1482
+ }[] | Set<{
1483
+ file: string;
1484
+ import: string;
1485
+ external?: boolean | undefined;
1486
+ }>>>]>;
1487
+ background: z.ZodUnion<[z.ZodType<string | true | string[] | {
1488
+ file: string;
1489
+ import: string;
1490
+ external?: boolean | undefined;
1491
+ } | {
1492
+ file: string;
1493
+ import: string;
1494
+ external?: boolean | undefined;
1495
+ }[] | Set<{
1496
+ file: string;
1497
+ import: string;
1498
+ external?: boolean | undefined;
1499
+ }>, z.ZodTypeDef, string | true | string[] | {
1500
+ file: string;
1501
+ import: string;
1502
+ external?: boolean | undefined;
1503
+ } | {
1504
+ file: string;
1505
+ import: string;
1506
+ external?: boolean | undefined;
1507
+ }[] | Set<{
1508
+ file: string;
1509
+ import: string;
1510
+ external?: boolean | undefined;
1511
+ }>>, z.ZodType<PluginHandlerCallback<{
1512
+ config: Readonly<{
1513
+ command: Command;
1514
+ plugins: any[];
1515
+ debug: boolean;
1516
+ mode: Mode;
1517
+ app: string;
1518
+ browser: Browser;
1519
+ manifestVersion: 2 | 3;
1520
+ inputDir: string;
1521
+ outputDir: string;
1522
+ srcDir: string;
1523
+ sharedDir: string;
1524
+ appsDir: string;
1525
+ jsDir: string;
1526
+ cssDir: string;
1527
+ assetsDir: string;
1528
+ htmlDir: string;
1529
+ analyze: boolean;
1530
+ configFile: string;
1531
+ mergeBackground: boolean;
1532
+ mergeCommands: boolean;
1533
+ mergeContentScripts: boolean;
1534
+ concatContentScripts: boolean;
1535
+ }>;
1536
+ }, string | true | string[] | {
1537
+ file: string;
1538
+ import: string;
1539
+ external?: boolean | undefined;
1540
+ } | {
1541
+ file: string;
1542
+ import: string;
1543
+ external?: boolean | undefined;
1544
+ }[] | Set<{
1545
+ file: string;
1546
+ import: string;
1547
+ external?: boolean | undefined;
1548
+ }>>, z.ZodTypeDef, PluginHandlerCallback<{
1549
+ config: Readonly<{
1550
+ command: Command;
1551
+ plugins: any[];
1552
+ debug: boolean;
1553
+ mode: Mode;
1554
+ app: string;
1555
+ browser: Browser;
1556
+ manifestVersion: 2 | 3;
1557
+ inputDir: string;
1558
+ outputDir: string;
1559
+ srcDir: string;
1560
+ sharedDir: string;
1561
+ appsDir: string;
1562
+ jsDir: string;
1563
+ cssDir: string;
1564
+ assetsDir: string;
1565
+ htmlDir: string;
1566
+ analyze: boolean;
1567
+ configFile: string;
1568
+ mergeBackground: boolean;
1569
+ mergeCommands: boolean;
1570
+ mergeContentScripts: boolean;
1571
+ concatContentScripts: boolean;
1572
+ }>;
1573
+ }, string | true | string[] | {
1574
+ file: string;
1575
+ import: string;
1576
+ external?: boolean | undefined;
1577
+ } | {
1578
+ file: string;
1579
+ import: string;
1580
+ external?: boolean | undefined;
1581
+ }[] | Set<{
1582
+ file: string;
1583
+ import: string;
1584
+ external?: boolean | undefined;
1585
+ }>>>]>;
1586
+ command: z.ZodUnion<[z.ZodType<string | true | string[] | {
1587
+ file: string;
1588
+ import: string;
1589
+ external?: boolean | undefined;
1590
+ } | {
1591
+ file: string;
1592
+ import: string;
1593
+ external?: boolean | undefined;
1594
+ }[] | Set<{
1595
+ file: string;
1596
+ import: string;
1597
+ external?: boolean | undefined;
1598
+ }>, z.ZodTypeDef, string | true | string[] | {
1599
+ file: string;
1600
+ import: string;
1601
+ external?: boolean | undefined;
1602
+ } | {
1603
+ file: string;
1604
+ import: string;
1605
+ external?: boolean | undefined;
1606
+ }[] | Set<{
1607
+ file: string;
1608
+ import: string;
1609
+ external?: boolean | undefined;
1610
+ }>>, z.ZodType<PluginHandlerCallback<{
1611
+ config: Readonly<{
1612
+ command: Command;
1613
+ plugins: any[];
1614
+ debug: boolean;
1615
+ mode: Mode;
1616
+ app: string;
1617
+ browser: Browser;
1618
+ manifestVersion: 2 | 3;
1619
+ inputDir: string;
1620
+ outputDir: string;
1621
+ srcDir: string;
1622
+ sharedDir: string;
1623
+ appsDir: string;
1624
+ jsDir: string;
1625
+ cssDir: string;
1626
+ assetsDir: string;
1627
+ htmlDir: string;
1628
+ analyze: boolean;
1629
+ configFile: string;
1630
+ mergeBackground: boolean;
1631
+ mergeCommands: boolean;
1632
+ mergeContentScripts: boolean;
1633
+ concatContentScripts: boolean;
1634
+ }>;
1635
+ }, string | true | string[] | {
1636
+ file: string;
1637
+ import: string;
1638
+ external?: boolean | undefined;
1639
+ } | {
1640
+ file: string;
1641
+ import: string;
1642
+ external?: boolean | undefined;
1643
+ }[] | Set<{
1644
+ file: string;
1645
+ import: string;
1646
+ external?: boolean | undefined;
1647
+ }>>, z.ZodTypeDef, PluginHandlerCallback<{
1648
+ config: Readonly<{
1649
+ command: Command;
1650
+ plugins: any[];
1651
+ debug: boolean;
1652
+ mode: Mode;
1653
+ app: string;
1654
+ browser: Browser;
1655
+ manifestVersion: 2 | 3;
1656
+ inputDir: string;
1657
+ outputDir: string;
1658
+ srcDir: string;
1659
+ sharedDir: string;
1660
+ appsDir: string;
1661
+ jsDir: string;
1662
+ cssDir: string;
1663
+ assetsDir: string;
1664
+ htmlDir: string;
1665
+ analyze: boolean;
1666
+ configFile: string;
1667
+ mergeBackground: boolean;
1668
+ mergeCommands: boolean;
1669
+ mergeContentScripts: boolean;
1670
+ concatContentScripts: boolean;
1671
+ }>;
1672
+ }, string | true | string[] | {
1673
+ file: string;
1674
+ import: string;
1675
+ external?: boolean | undefined;
1676
+ } | {
1677
+ file: string;
1678
+ import: string;
1679
+ external?: boolean | undefined;
1680
+ }[] | Set<{
1681
+ file: string;
1682
+ import: string;
1683
+ external?: boolean | undefined;
1684
+ }>>>]>;
1685
+ webpack: z.ZodUnion<[z.ZodType<Configuration | undefined, z.ZodTypeDef, Configuration | undefined>, z.ZodType<PluginHandlerCallback<{
1686
+ config: Readonly<{
1687
+ command: Command;
1688
+ plugins: any[];
1689
+ debug: boolean;
1690
+ mode: Mode;
1691
+ app: string;
1692
+ browser: Browser;
1693
+ manifestVersion: 2 | 3;
1694
+ inputDir: string;
1695
+ outputDir: string;
1696
+ srcDir: string;
1697
+ sharedDir: string;
1698
+ appsDir: string;
1699
+ jsDir: string;
1700
+ cssDir: string;
1701
+ assetsDir: string;
1702
+ htmlDir: string;
1703
+ analyze: boolean;
1704
+ configFile: string;
1705
+ mergeBackground: boolean;
1706
+ mergeCommands: boolean;
1707
+ mergeContentScripts: boolean;
1708
+ concatContentScripts: boolean;
1709
+ }>;
1710
+ webpack?: Configuration | undefined;
1711
+ }, Configuration | undefined>, z.ZodTypeDef, PluginHandlerCallback<{
1712
+ config: Readonly<{
1713
+ command: Command;
1714
+ plugins: any[];
1715
+ debug: boolean;
1716
+ mode: Mode;
1717
+ app: string;
1718
+ browser: Browser;
1719
+ manifestVersion: 2 | 3;
1720
+ inputDir: string;
1721
+ outputDir: string;
1722
+ srcDir: string;
1723
+ sharedDir: string;
1724
+ appsDir: string;
1725
+ jsDir: string;
1726
+ cssDir: string;
1727
+ assetsDir: string;
1728
+ htmlDir: string;
1729
+ analyze: boolean;
1730
+ configFile: string;
1731
+ mergeBackground: boolean;
1732
+ mergeCommands: boolean;
1733
+ mergeContentScripts: boolean;
1734
+ concatContentScripts: boolean;
1735
+ }>;
1736
+ webpack?: Configuration | undefined;
1737
+ }, Configuration | undefined>>]>;
1738
+ manifest: z.ZodUnion<[z.ZodType<void, z.ZodTypeDef, void>, z.ZodType<PluginHandlerCallback<{
1739
+ config: Readonly<{
1740
+ command: Command;
1741
+ plugins: any[];
1742
+ debug: boolean;
1743
+ mode: Mode;
1744
+ app: string;
1745
+ browser: Browser;
1746
+ manifestVersion: 2 | 3;
1747
+ inputDir: string;
1748
+ outputDir: string;
1749
+ srcDir: string;
1750
+ sharedDir: string;
1751
+ appsDir: string;
1752
+ jsDir: string;
1753
+ cssDir: string;
1754
+ assetsDir: string;
1755
+ htmlDir: string;
1756
+ analyze: boolean;
1757
+ configFile: string;
1758
+ mergeBackground: boolean;
1759
+ mergeCommands: boolean;
1760
+ mergeContentScripts: boolean;
1761
+ concatContentScripts: boolean;
1762
+ }>;
1763
+ manifest: ManifestBuilder<Manifest>;
1764
+ }, void>, z.ZodTypeDef, PluginHandlerCallback<{
1765
+ config: Readonly<{
1766
+ command: Command;
1767
+ plugins: any[];
1768
+ debug: boolean;
1769
+ mode: Mode;
1770
+ app: string;
1771
+ browser: Browser;
1772
+ manifestVersion: 2 | 3;
1773
+ inputDir: string;
1774
+ outputDir: string;
1775
+ srcDir: string;
1776
+ sharedDir: string;
1777
+ appsDir: string;
1778
+ jsDir: string;
1779
+ cssDir: string;
1780
+ assetsDir: string;
1781
+ htmlDir: string;
1782
+ analyze: boolean;
1783
+ configFile: string;
1784
+ mergeBackground: boolean;
1785
+ mergeCommands: boolean;
1786
+ mergeContentScripts: boolean;
1787
+ concatContentScripts: boolean;
1788
+ }>;
1789
+ manifest: ManifestBuilder<Manifest>;
1790
+ }, void>>]>;
1791
+ }>, "strip", z.ZodTypeAny, {
1792
+ background: string | true | string[] | {
1793
+ file: string;
1794
+ import: string;
1795
+ external?: boolean | undefined;
1796
+ } | {
1797
+ file: string;
1798
+ import: string;
1799
+ external?: boolean | undefined;
1800
+ }[] | Set<{
1801
+ file: string;
1802
+ import: string;
1803
+ external?: boolean | undefined;
1804
+ }> | PluginHandlerCallback<{
1805
+ config: Readonly<{
1806
+ command: Command;
1807
+ plugins: any[];
1808
+ debug: boolean;
1809
+ mode: Mode;
1810
+ app: string;
1811
+ browser: Browser;
1812
+ manifestVersion: 2 | 3;
1813
+ inputDir: string;
1814
+ outputDir: string;
1815
+ srcDir: string;
1816
+ sharedDir: string;
1817
+ appsDir: string;
1818
+ jsDir: string;
1819
+ cssDir: string;
1820
+ assetsDir: string;
1821
+ htmlDir: string;
1822
+ analyze: boolean;
1823
+ configFile: string;
1824
+ mergeBackground: boolean;
1825
+ mergeCommands: boolean;
1826
+ mergeContentScripts: boolean;
1827
+ concatContentScripts: boolean;
1828
+ }>;
1829
+ }, string | true | string[] | {
1830
+ file: string;
1831
+ import: string;
1832
+ external?: boolean | undefined;
1833
+ } | {
1834
+ file: string;
1835
+ import: string;
1836
+ external?: boolean | undefined;
1837
+ }[] | Set<{
1838
+ file: string;
1839
+ import: string;
1840
+ external?: boolean | undefined;
1841
+ }>>;
1842
+ command: string | true | string[] | {
1843
+ file: string;
1844
+ import: string;
1845
+ external?: boolean | undefined;
1846
+ } | {
1847
+ file: string;
1848
+ import: string;
1849
+ external?: boolean | undefined;
1850
+ }[] | Set<{
1851
+ file: string;
1852
+ import: string;
1853
+ external?: boolean | undefined;
1854
+ }> | PluginHandlerCallback<{
1855
+ config: Readonly<{
1856
+ command: Command;
1857
+ plugins: any[];
1858
+ debug: boolean;
1859
+ mode: Mode;
1860
+ app: string;
1861
+ browser: Browser;
1862
+ manifestVersion: 2 | 3;
1863
+ inputDir: string;
1864
+ outputDir: string;
1865
+ srcDir: string;
1866
+ sharedDir: string;
1867
+ appsDir: string;
1868
+ jsDir: string;
1869
+ cssDir: string;
1870
+ assetsDir: string;
1871
+ htmlDir: string;
1872
+ analyze: boolean;
1873
+ configFile: string;
1874
+ mergeBackground: boolean;
1875
+ mergeCommands: boolean;
1876
+ mergeContentScripts: boolean;
1877
+ concatContentScripts: boolean;
1878
+ }>;
1879
+ }, string | true | string[] | {
1880
+ file: string;
1881
+ import: string;
1882
+ external?: boolean | undefined;
1883
+ } | {
1884
+ file: string;
1885
+ import: string;
1886
+ external?: boolean | undefined;
1887
+ }[] | Set<{
1888
+ file: string;
1889
+ import: string;
1890
+ external?: boolean | undefined;
1891
+ }>>;
1892
+ content: string | true | string[] | {
1893
+ file: string;
1894
+ import: string;
1895
+ external?: boolean | undefined;
1896
+ } | {
1897
+ file: string;
1898
+ import: string;
1899
+ external?: boolean | undefined;
1900
+ }[] | Set<{
1901
+ file: string;
1902
+ import: string;
1903
+ external?: boolean | undefined;
1904
+ }> | PluginHandlerCallback<{
1905
+ config: Readonly<{
1906
+ command: Command;
1907
+ plugins: any[];
1908
+ debug: boolean;
1909
+ mode: Mode;
1910
+ app: string;
1911
+ browser: Browser;
1912
+ manifestVersion: 2 | 3;
1913
+ inputDir: string;
1914
+ outputDir: string;
1915
+ srcDir: string;
1916
+ sharedDir: string;
1917
+ appsDir: string;
1918
+ jsDir: string;
1919
+ cssDir: string;
1920
+ assetsDir: string;
1921
+ htmlDir: string;
1922
+ analyze: boolean;
1923
+ configFile: string;
1924
+ mergeBackground: boolean;
1925
+ mergeCommands: boolean;
1926
+ mergeContentScripts: boolean;
1927
+ concatContentScripts: boolean;
1928
+ }>;
1929
+ }, string | true | string[] | {
1930
+ file: string;
1931
+ import: string;
1932
+ external?: boolean | undefined;
1933
+ } | {
1934
+ file: string;
1935
+ import: string;
1936
+ external?: boolean | undefined;
1937
+ }[] | Set<{
1938
+ file: string;
1939
+ import: string;
1940
+ external?: boolean | undefined;
1941
+ }>>;
1942
+ name: string;
1943
+ manifest?: void | PluginHandlerCallback<{
1944
+ config: Readonly<{
1945
+ command: Command;
1946
+ plugins: any[];
1947
+ debug: boolean;
1948
+ mode: Mode;
1949
+ app: string;
1950
+ browser: Browser;
1951
+ manifestVersion: 2 | 3;
1952
+ inputDir: string;
1953
+ outputDir: string;
1954
+ srcDir: string;
1955
+ sharedDir: string;
1956
+ appsDir: string;
1957
+ jsDir: string;
1958
+ cssDir: string;
1959
+ assetsDir: string;
1960
+ htmlDir: string;
1961
+ analyze: boolean;
1962
+ configFile: string;
1963
+ mergeBackground: boolean;
1964
+ mergeCommands: boolean;
1965
+ mergeContentScripts: boolean;
1966
+ concatContentScripts: boolean;
1967
+ }>;
1968
+ manifest: ManifestBuilder<Manifest>;
1969
+ }, void> | undefined;
1970
+ webpack?: Configuration | PluginHandlerCallback<{
1971
+ config: Readonly<{
1972
+ command: Command;
1973
+ plugins: any[];
1974
+ debug: boolean;
1975
+ mode: Mode;
1976
+ app: string;
1977
+ browser: Browser;
1978
+ manifestVersion: 2 | 3;
1979
+ inputDir: string;
1980
+ outputDir: string;
1981
+ srcDir: string;
1982
+ sharedDir: string;
1983
+ appsDir: string;
1984
+ jsDir: string;
1985
+ cssDir: string;
1986
+ assetsDir: string;
1987
+ htmlDir: string;
1988
+ analyze: boolean;
1989
+ configFile: string;
1990
+ mergeBackground: boolean;
1991
+ mergeCommands: boolean;
1992
+ mergeContentScripts: boolean;
1993
+ concatContentScripts: boolean;
1994
+ }>;
1995
+ webpack?: Configuration | undefined;
1996
+ }, Configuration | undefined> | undefined;
1997
+ }, {
1998
+ background: string | true | string[] | {
1999
+ file: string;
2000
+ import: string;
2001
+ external?: boolean | undefined;
2002
+ } | {
2003
+ file: string;
2004
+ import: string;
2005
+ external?: boolean | undefined;
2006
+ }[] | Set<{
2007
+ file: string;
2008
+ import: string;
2009
+ external?: boolean | undefined;
2010
+ }> | PluginHandlerCallback<{
2011
+ config: Readonly<{
2012
+ command: Command;
2013
+ plugins: any[];
2014
+ debug: boolean;
2015
+ mode: Mode;
2016
+ app: string;
2017
+ browser: Browser;
2018
+ manifestVersion: 2 | 3;
2019
+ inputDir: string;
2020
+ outputDir: string;
2021
+ srcDir: string;
2022
+ sharedDir: string;
2023
+ appsDir: string;
2024
+ jsDir: string;
2025
+ cssDir: string;
2026
+ assetsDir: string;
2027
+ htmlDir: string;
2028
+ analyze: boolean;
2029
+ configFile: string;
2030
+ mergeBackground: boolean;
2031
+ mergeCommands: boolean;
2032
+ mergeContentScripts: boolean;
2033
+ concatContentScripts: boolean;
2034
+ }>;
2035
+ }, string | true | string[] | {
2036
+ file: string;
2037
+ import: string;
2038
+ external?: boolean | undefined;
2039
+ } | {
2040
+ file: string;
2041
+ import: string;
2042
+ external?: boolean | undefined;
2043
+ }[] | Set<{
2044
+ file: string;
2045
+ import: string;
2046
+ external?: boolean | undefined;
2047
+ }>>;
2048
+ command: string | true | string[] | {
2049
+ file: string;
2050
+ import: string;
2051
+ external?: boolean | undefined;
2052
+ } | {
2053
+ file: string;
2054
+ import: string;
2055
+ external?: boolean | undefined;
2056
+ }[] | Set<{
2057
+ file: string;
2058
+ import: string;
2059
+ external?: boolean | undefined;
2060
+ }> | PluginHandlerCallback<{
2061
+ config: Readonly<{
2062
+ command: Command;
2063
+ plugins: any[];
2064
+ debug: boolean;
2065
+ mode: Mode;
2066
+ app: string;
2067
+ browser: Browser;
2068
+ manifestVersion: 2 | 3;
2069
+ inputDir: string;
2070
+ outputDir: string;
2071
+ srcDir: string;
2072
+ sharedDir: string;
2073
+ appsDir: string;
2074
+ jsDir: string;
2075
+ cssDir: string;
2076
+ assetsDir: string;
2077
+ htmlDir: string;
2078
+ analyze: boolean;
2079
+ configFile: string;
2080
+ mergeBackground: boolean;
2081
+ mergeCommands: boolean;
2082
+ mergeContentScripts: boolean;
2083
+ concatContentScripts: boolean;
2084
+ }>;
2085
+ }, string | true | string[] | {
2086
+ file: string;
2087
+ import: string;
2088
+ external?: boolean | undefined;
2089
+ } | {
2090
+ file: string;
2091
+ import: string;
2092
+ external?: boolean | undefined;
2093
+ }[] | Set<{
2094
+ file: string;
2095
+ import: string;
2096
+ external?: boolean | undefined;
2097
+ }>>;
2098
+ content: string | true | string[] | {
2099
+ file: string;
2100
+ import: string;
2101
+ external?: boolean | undefined;
2102
+ } | {
2103
+ file: string;
2104
+ import: string;
2105
+ external?: boolean | undefined;
2106
+ }[] | Set<{
2107
+ file: string;
2108
+ import: string;
2109
+ external?: boolean | undefined;
2110
+ }> | PluginHandlerCallback<{
2111
+ config: Readonly<{
2112
+ command: Command;
2113
+ plugins: any[];
2114
+ debug: boolean;
2115
+ mode: Mode;
2116
+ app: string;
2117
+ browser: Browser;
2118
+ manifestVersion: 2 | 3;
2119
+ inputDir: string;
2120
+ outputDir: string;
2121
+ srcDir: string;
2122
+ sharedDir: string;
2123
+ appsDir: string;
2124
+ jsDir: string;
2125
+ cssDir: string;
2126
+ assetsDir: string;
2127
+ htmlDir: string;
2128
+ analyze: boolean;
2129
+ configFile: string;
2130
+ mergeBackground: boolean;
2131
+ mergeCommands: boolean;
2132
+ mergeContentScripts: boolean;
2133
+ concatContentScripts: boolean;
2134
+ }>;
2135
+ }, string | true | string[] | {
2136
+ file: string;
2137
+ import: string;
2138
+ external?: boolean | undefined;
2139
+ } | {
2140
+ file: string;
2141
+ import: string;
2142
+ external?: boolean | undefined;
2143
+ }[] | Set<{
2144
+ file: string;
2145
+ import: string;
2146
+ external?: boolean | undefined;
2147
+ }>>;
2148
+ name: string;
2149
+ manifest?: void | PluginHandlerCallback<{
2150
+ config: Readonly<{
2151
+ command: Command;
2152
+ plugins: any[];
2153
+ debug: boolean;
2154
+ mode: Mode;
2155
+ app: string;
2156
+ browser: Browser;
2157
+ manifestVersion: 2 | 3;
2158
+ inputDir: string;
2159
+ outputDir: string;
2160
+ srcDir: string;
2161
+ sharedDir: string;
2162
+ appsDir: string;
2163
+ jsDir: string;
2164
+ cssDir: string;
2165
+ assetsDir: string;
2166
+ htmlDir: string;
2167
+ analyze: boolean;
2168
+ configFile: string;
2169
+ mergeBackground: boolean;
2170
+ mergeCommands: boolean;
2171
+ mergeContentScripts: boolean;
2172
+ concatContentScripts: boolean;
2173
+ }>;
2174
+ manifest: ManifestBuilder<Manifest>;
2175
+ }, void> | undefined;
2176
+ webpack?: Configuration | PluginHandlerCallback<{
2177
+ config: Readonly<{
2178
+ command: Command;
2179
+ plugins: any[];
2180
+ debug: boolean;
2181
+ mode: Mode;
2182
+ app: string;
2183
+ browser: Browser;
2184
+ manifestVersion: 2 | 3;
2185
+ inputDir: string;
2186
+ outputDir: string;
2187
+ srcDir: string;
2188
+ sharedDir: string;
2189
+ appsDir: string;
2190
+ jsDir: string;
2191
+ cssDir: string;
2192
+ assetsDir: string;
2193
+ htmlDir: string;
2194
+ analyze: boolean;
2195
+ configFile: string;
2196
+ mergeBackground: boolean;
2197
+ mergeCommands: boolean;
2198
+ mergeContentScripts: boolean;
2199
+ concatContentScripts: boolean;
2200
+ }>;
2201
+ webpack?: Configuration | undefined;
2202
+ }, Configuration | undefined> | undefined;
2203
+ }>;
2204
+ type PluginName = z.infer<typeof PluginNameSchema>;
2205
+ type Plugin = z.infer<typeof PluginSchema>;
194
2206
  type PluginHandler<O, T = void> = T | PluginHandlerCallback<O, T>;
195
2207
  type PluginHandlerCallback<O, T = void> = {
196
2208
  (options: O): T | Promise<T>;
197
2209
  };
198
2210
  type PluginHandlerKeys = keyof Omit<Plugin, 'name'>;
2211
+ type PluginEntrypointKeys = keyof Pick<Plugin, 'content' | 'background' | 'command'>;
199
2212
  type PluginHandlerType<T extends Plugin[PluginHandlerKeys]> = T extends PluginHandlerCallback<infer O, infer R> ? {
200
2213
  options: O;
201
2214
  result: R;
@@ -207,58 +2220,11 @@ interface PluginNameHandlerResult<K extends PluginHandlerKeys> extends PluginNam
207
2220
  }
208
2221
  type PluginDefinition<T> = ((options?: T) => Plugin) | Plugin;
209
2222
 
210
- declare enum Browser {
211
- Chrome = "chrome",
212
- Chromium = "chromium",
213
- Edge = "edge",
214
- Firefox = "firefox",
215
- Opera = "opera",
216
- Safari = "safari"
217
- }
218
- declare enum Mode {
219
- None = "none",
220
- Development = "development",
221
- Production = "production"
222
- }
223
- declare enum Command {
224
- Build = "build",
225
- Watch = "watch"
226
- }
227
- interface Config {
228
- debug: boolean;
229
- mode: Mode;
230
- app: string;
231
- browser: Browser;
232
- manifestVersion: ManifestVersion;
233
- inputDir: string;
234
- outputDir: string;
235
- srcDir: string;
236
- sharedDir: string;
237
- appsDir: string;
238
- jsDir: string;
239
- cssDir: string;
240
- assetsDir: string;
241
- htmlDir: string;
242
- plugins: Plugin[];
243
- analyze: boolean;
244
- configFile: string;
245
- mergeBackground: boolean;
246
- mergeContentScripts: boolean;
247
- concatContentScripts: boolean;
248
- }
249
- interface ConfigOptions {
250
- config: ReadonlyConfig;
251
- }
252
- type OptionalConfig = Partial<Config>;
253
- type UserConfig = Omit<OptionalConfig, 'configFile'>;
254
- type ReadonlyConfig = Readonly<Config>;
255
- type UserConfigCallback = (config: ReadonlyConfig) => UserConfig;
256
- type ConfigDefinition = UserConfigCallback | UserConfig;
257
-
258
2223
  declare function defineConfig(config: ConfigDefinition): ConfigDefinition;
259
2224
  declare function definePlugin<T>(plugin: (options?: T) => Plugin): (options?: T) => Plugin;
260
2225
  declare function definePlugin(plugin: Plugin): Plugin;
261
2226
  declare function defineBackground(options: BackgroundDefinition): BackgroundDefinition;
2227
+ declare function defineCommand(options: CommandDefinition): CommandDefinition;
262
2228
  declare function defineContentScript(options: ContentScriptDefinition): ContentScriptDefinition;
263
2229
 
264
2230
  declare const getEnv: {
@@ -268,4 +2234,4 @@ declare const getEnv: {
268
2234
  declare const getBrowser: () => Browser;
269
2235
  declare const getManifestVersion: () => ManifestVersion;
270
2236
 
271
- export { type BackgroundConfig, type BackgroundDefinition, type BackgroundEntrypointMap, type BackgroundEntrypointOptions, Browser, type ChromeManifest, Command, type Config, type ConfigDefinition, type ConfigOptions, type ContentScriptConfig, type ContentScriptDefinition, type ContentScriptEntrypointMap, type ContentScriptEntrypointOptions, type CoreManifest, type EntrypointFile, type EntrypointOptions, type FirefoxManifest, type Manifest, type ManifestBackground, type ManifestBuilder, type ManifestContentScript, type ManifestDependencies, type ManifestDependenciesMap, type ManifestEntry, type ManifestEntryFile, type ManifestMapping, type ManifestVersion, Mode, type OptionalConfig, type Plugin, type PluginBackgroundOptions, type PluginBackgroundResult, type PluginContentOptions, type PluginContentResult, type PluginDefinition, type PluginHandler, type PluginHandlerCallback, type PluginHandlerKeys, type PluginHandlerOptions, type PluginHandlerResult, type PluginHandlerType, type PluginManifestOptions, type PluginNameHandlerResult, type PluginWebpackOptions, type ReadonlyConfig, type SafariManifest, type UserConfig, type UserConfigCallback, defineBackground, defineConfig, defineContentScript, definePlugin, getBrowser, getEnv, getManifestVersion };
2237
+ export { type BackgroundConfig, type BackgroundDefinition, type BackgroundEntrypointMap, type BackgroundEntrypointOptions, type BackgroundOptions, Browser, type ChromeManifest, Command, type CommandConfig, type CommandDefinition, type CommandEntrypointMap, type CommandEntrypointOptions, type CommandOptions, type Config, type ConfigDefinition, ConfigDefinitionSchema, type ConfigOptions, ConfigOptionsSchema, ConfigSchema, type ContentScriptConfig, type ContentScriptDefinition, type ContentScriptEntrypointMap, type ContentScriptEntrypointOptions, type CoreManifest, type EntrypointFile, EntrypointFileSchema, type EntrypointOptions, EntrypointOptionsSchema, EntrypointType, type FirefoxManifest, type Manifest, type ManifestBackground, type ManifestBuilder, ManifestBuilderSchema, type ManifestCommand, type ManifestCommandMap, type ManifestContentScript, type ManifestContentScriptMap, type ManifestDependencies, type ManifestDependenciesMap, type ManifestEntry, type ManifestEntryFile, type ManifestMapping, type ManifestVersion, ManifestVersionSchema, Mode, type OptionalConfig, OptionalConfigSchema, type Plugin, type PluginDefinition, type PluginEntrypointKeys, type PluginEntrypointResult, PluginEntrypointResultSchema, type PluginHandler, type PluginHandlerCallback, type PluginHandlerKeys, type PluginHandlerOptions, type PluginHandlerResult, type PluginHandlerType, PluginManifestOptionsSchema, type PluginNameHandlerResult, PluginNameSchema, PluginSchema, PluginWebpackOptionsSchema, type ReadonlyConfig, ReadonlyConfigSchema, type SafariManifest, type UserConfig, UserConfigCallbackSchema, UserConfigSchema, defineBackground, defineCommand, defineConfig, defineContentScript, definePlugin, getBrowser, getEnv, getManifestVersion };