@stencil/core 5.0.0-next.0 → 5.0.0-rc.1

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.
Files changed (58) hide show
  1. package/README.md +94 -0
  2. package/bin/stencil.mjs +1 -1
  3. package/dist/app-data/index.d.ts +2 -0
  4. package/dist/{runtime/app-data → app-data}/index.js +23 -15
  5. package/dist/{runtime/app-globals → app-globals}/index.js +1 -2
  6. package/dist/client-BMtGBEQV.mjs +2498 -0
  7. package/dist/compiler/browser.d.ts +1573 -0
  8. package/dist/compiler/browser.js +16998 -0
  9. package/dist/compiler/index.d.mts +284 -7
  10. package/dist/compiler/index.mjs +3 -9
  11. package/dist/compiler/utils/index.d.mts +272 -3
  12. package/dist/compiler/utils/index.mjs +4 -5
  13. package/dist/{transpile-CJQcQEVa.mjs → compiler-C_Y38j4m.mjs} +20984 -15554
  14. package/dist/declarations/stencil-ext-modules.d.ts +8 -8
  15. package/dist/declarations/stencil-public-compiler.d.ts +1016 -840
  16. package/dist/declarations/stencil-public-compiler.js +3 -5
  17. package/dist/declarations/stencil-public-docs.d.ts +441 -376
  18. package/dist/declarations/stencil-public-docs.js +0 -0
  19. package/dist/declarations/stencil-public-runtime.d.ts +361 -113
  20. package/dist/fragment-Di1hWOC8.mjs +4 -0
  21. package/dist/helpers-pTCZhNi0.mjs +529 -0
  22. package/dist/{index-szczUd2l.d.mts → index-CFiy6MZ3.d.mts} +1471 -2044
  23. package/dist/index-CViiWNQ9.d.mts +104 -0
  24. package/dist/{stencil-private-Cgcr414u.d.ts → index-XQHZl0MW.d.ts} +308 -114
  25. package/dist/index.d.mts +14 -2
  26. package/dist/index.mjs +171 -4
  27. package/dist/jsx-runtime.d.mts +24 -0
  28. package/dist/jsx-runtime.mjs +3 -0
  29. package/dist/mock-doc.mjs +2 -3
  30. package/dist/{node-sys-BGURUNOZ.mjs → node-Bkq8vRnu.mjs} +176 -197
  31. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  32. package/dist/{client-DR9zhmKG.mjs → runtime/client/lazy.js} +3794 -2659
  33. package/dist/runtime/client/{index.d.ts → runtime.d.ts} +516 -227
  34. package/dist/runtime/client/{index.js → runtime.js} +3596 -2857
  35. package/dist/runtime/index.d.ts +90 -72
  36. package/dist/runtime/index.js +3528 -2897
  37. package/dist/runtime/server/index.d.mts +243 -219
  38. package/dist/runtime/server/index.mjs +3770 -3352
  39. package/dist/runtime/server/runner.d.mts +114 -47
  40. package/dist/runtime/server/runner.mjs +12710 -763
  41. package/dist/signals/index.d.ts +58 -0
  42. package/dist/signals/index.js +182 -0
  43. package/dist/sys/node/index.d.mts +1 -3
  44. package/dist/sys/node/index.mjs +2 -7
  45. package/dist/sys/node/worker.d.mts +1 -1
  46. package/dist/sys/node/worker.mjs +3 -12
  47. package/dist/testing/index.d.mts +4763 -12
  48. package/dist/testing/index.mjs +7945 -618
  49. package/dist/util-CP6-333M.mjs +731 -0
  50. package/dist/validation-C1mr0klL.mjs +825 -0
  51. package/package.json +91 -59
  52. package/dist/chunk-ClPoSABd.mjs +0 -21
  53. package/dist/index-Bxo2jCf6.d.mts +0 -77
  54. package/dist/runtime/app-data/index.d.ts +0 -30
  55. package/dist/serialize-BJvhE9aQ.mjs +0 -775
  56. package/dist/validation-BdcPruW_.mjs +0 -1451
  57. /package/{LICENSE.md → LICENSE} +0 -0
  58. /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
@@ -1,8 +1,4727 @@
1
- import "../chunk-ClPoSABd.mjs";
2
- import { B as ComponentCompilerMeta, Ct as HostElement, E as CompilerCtx, Rr as Diagnostic, Rt as Module, Ut as NewSpecPageOptions, _a as ErrorHandler, a as BuildCtx, ai as LoggerTimeSpan, ei as LoadConfigInit, fa as UnvalidatedConfig, ft as ComponentRuntimeMeta, gr as CompilerSystem, ia as Testing, ni as LogLevel, pa as ValidatedConfig, pn as RuntimeRef, ri as Logger, vn as SpecPage, wt as HostRef, xa as UserBuildConditionals, ya as RafCallback } from "../index-szczUd2l.mjs";
3
- import { c as Mixin, d as getElement, f as getAssetPath, i as getRenderingRef, l as Fragment, m as Env, n as h, o as getMode, p as setAssetPath, r as forceUpdate, t as Host, u as createEvent } from "../index-Bxo2jCf6.mjs";
1
+ import "typescript";
2
+ import { InputOptions, Plugin, SourceMap } from "rolldown";
4
3
  import { Mock } from "vitest";
5
-
4
+ //#region src/utils/result.d.ts
5
+ /**
6
+ * A Result wraps up a success state and a failure state, allowing you to
7
+ * return a single type from a function and discriminate between the two
8
+ * possible states in a principled way.
9
+ *
10
+ * Using it could look something like this:
11
+ *
12
+ * ```ts
13
+ * import { result } from './';
14
+ *
15
+ * const mightFail = (input: number): Result<number, string> => {
16
+ * try {
17
+ * let value: number = calculateSomethingWithInput(input);
18
+ * return result.ok(value);
19
+ * } catch (e) {
20
+ * return result.err(e.message);
21
+ * }
22
+ * }
23
+ *
24
+ * const sumResult = mightFail(2);
25
+ *
26
+ * const msg = result.map(sumResult, (sum: number) => `the sum was: ${sum}`);
27
+ * ```
28
+ *
29
+ * A few utility methods are defined in this module, like `map` and `unwrap`,
30
+ * which are (probably obviously) inspired by the correspond methods on
31
+ * `std::result::Result` in Rust.
32
+ */
33
+ type Result<OnSuccess, OnFailure> = Ok<OnSuccess> | Err<OnFailure>;
34
+ /**
35
+ * Type for the Ok state of a Result
36
+ */
37
+ type Ok<T> = {
38
+ isOk: true;
39
+ isErr: false;
40
+ value: T;
41
+ };
42
+ /**
43
+ * Type for the Err state of a Result
44
+ */
45
+ type Err<T> = {
46
+ isOk: false;
47
+ isErr: true;
48
+ value: T;
49
+ };
50
+ //#endregion
51
+ //#region src/compiler/sys/in-memory-fs.d.ts
52
+ /**
53
+ * An in-memory FS which proxies the underlying OS filesystem using a simple
54
+ * in-memory cache. FS writes can accumulate on the in-memory system, using an
55
+ * API similar to Node.js' `"fs"` module, and then be committed to disk as a
56
+ * unit.
57
+ *
58
+ * Files written to the in-memory system can be edited, deleted, and so on.
59
+ * This allows the compiler to proceed freely as if it is modifying the
60
+ * filesystem, modifying the world in whatever way suits it, while deferring
61
+ * actual FS writes until the end of the compilation process, making actual
62
+ * changes to the filesystem on disk contingent on an error-free build or any
63
+ * other condition.
64
+ *
65
+ * Usage example:
66
+ *
67
+ * ```ts
68
+ * // create an in-memory FS
69
+ * const sys = createSystem();
70
+ * const inMemoryFs = createInMemoryFs(sys);
71
+ *
72
+ * // do a few fs operations
73
+ * await inMemoryFs.writeFile("path/to/file.js", 'console.log("hey!");')
74
+ * await inMemoryFs.remove("path/to/another_file.ts");
75
+ *
76
+ * // commit the results to disk
77
+ * const commitStats = await inMemoryFs.commit();
78
+ * ```
79
+ *
80
+ * In the above example the write operation and the delete operation (w/
81
+ * `.remove`) are both queued in the in-memory proxy but not committed to
82
+ * disk until the `.commit` method is called.
83
+ */
84
+ type InMemoryFileSystem = ReturnType<typeof createInMemoryFs>;
85
+ /**
86
+ * A node in the in-memory file system. This may represent a file or
87
+ * a directory, and pending copy, write, and delete operations may be stored
88
+ * on it.
89
+ */
90
+ interface FsItem {
91
+ fileText: string;
92
+ isFile: boolean;
93
+ isDirectory: boolean;
94
+ size: number;
95
+ mtimeMs: number;
96
+ exists: boolean;
97
+ queueCopyFileToDest: string;
98
+ queueWriteToDisk: boolean;
99
+ queueDeleteFromDisk?: boolean;
100
+ useCache: boolean;
101
+ }
102
+ /**
103
+ * Options supported by write methods on the in-memory filesystem.
104
+ */
105
+ interface FsWriteOptions {
106
+ /**
107
+ * only use the in-memory cache and do not write the file to disk
108
+ */
109
+ inMemoryOnly?: boolean;
110
+ clearFileCache?: boolean;
111
+ /**
112
+ * flush the write to disk immediately, skipping the in-memory cache
113
+ */
114
+ immediateWrite?: boolean;
115
+ /**
116
+ * specify that the cache should be used
117
+ */
118
+ useCache?: boolean;
119
+ /**
120
+ * An optional tag for the current output target for which this file is being
121
+ * written.
122
+ */
123
+ outputTargetType?: string;
124
+ }
125
+ /**
126
+ * Results from a write operation on the in-memory filesystem.
127
+ */
128
+ interface FsWriteResults {
129
+ changedContent: boolean;
130
+ queuedWrite: boolean;
131
+ ignored: boolean;
132
+ }
133
+ /**
134
+ * Options supported by read methods on the in-memory filesystem.
135
+ */
136
+ interface FsReadOptions {
137
+ useCache?: boolean;
138
+ setHash?: boolean;
139
+ }
140
+ /**
141
+ * Options supported by the readdir option on the in-memory filesystem.
142
+ */
143
+ interface FsReaddirOptions {
144
+ inMemoryOnly?: boolean;
145
+ recursive?: boolean;
146
+ /**
147
+ * Directory names to exclude. Just the basename,
148
+ * not the entire path. Basically for "node_modules".
149
+ */
150
+ excludeDirNames?: string[];
151
+ /**
152
+ * Extensions we know we can avoid. Each extension
153
+ * should include the `.` so that we can test for both
154
+ * `.d.ts.` and `.ts`. If `excludeExtensions` isn't provided it
155
+ * doesn't try to exclude anything. This only checks against
156
+ * the filename, not directory names when recursive.
157
+ */
158
+ excludeExtensions?: string[];
159
+ }
160
+ /**
161
+ * A result from a directory read operation
162
+ */
163
+ interface FsReaddirItem {
164
+ absPath: string;
165
+ relPath: string;
166
+ isDirectory: boolean;
167
+ isFile: boolean;
168
+ }
169
+ /**
170
+ * Information about a file in the in-memory filesystem.
171
+ */
172
+ interface FsStat {
173
+ exists: boolean;
174
+ isFile: boolean;
175
+ isDirectory: boolean;
176
+ size: number;
177
+ }
178
+ /**
179
+ * Create an in-memory FS which proxies the underlying OS filesystem using an
180
+ * in-memory cache. FS writes can accumulate on the in-memory system, using an
181
+ * API similar to Node.js' `"fs"` module, and then be committed to disk as a
182
+ * unit.
183
+ *
184
+ * Files written to the in-memory system can be edited, deleted, and so on.
185
+ * This allows the compiler to proceed freely as if it is modifying the
186
+ * filesystem, modifying the world in whatever way suits it, while deferring
187
+ * actual FS writes until the end of the compilation process, making actual
188
+ * changes to the filesystem on disk contingent on an error-free build or any
189
+ * other condition.
190
+ *
191
+ * @param sys a compiler system object
192
+ * @returns an in-memory filesystem interface
193
+ */
194
+ declare const createInMemoryFs: (sys: CompilerSystem) => {
195
+ access: (filePath: string) => Promise<boolean>;
196
+ accessSync: (filePath: string) => boolean;
197
+ cancelDeleteDirectoriesFromDisk: (dirPaths: string[]) => void;
198
+ cancelDeleteFilesFromDisk: (filePaths: string[]) => void;
199
+ clearCache: () => void;
200
+ clearDirCache: (dirPath: string) => void;
201
+ clearFileCache: (filePath: string) => void;
202
+ commit: () => Promise<FsCommitResults>;
203
+ copyFile: (src: string, dest: string) => Promise<void>;
204
+ emptyDirs: (dirs: string[]) => Promise<void>;
205
+ getBuildOutputs: () => BuildOutput[];
206
+ getItem: (itemPath: string) => FsItem;
207
+ getMemoryStats: () => string;
208
+ readFile: (filePath: string, opts?: FsReadOptions) => Promise<string>;
209
+ readFileSync: (filePath: string, opts?: FsReadOptions) => string;
210
+ readdir: (dirPath: string, opts?: FsReaddirOptions) => Promise<FsReaddirItem[]>;
211
+ remove: (itemPath: string) => Promise<void>;
212
+ stat: (itemPath: string) => Promise<FsStat>;
213
+ statSync: (itemPath: string) => FsStat;
214
+ sys: CompilerSystem;
215
+ writeFile: (filePath: string, content: string, opts?: FsWriteOptions) => Promise<FsWriteResults>;
216
+ writeFiles: (files: {
217
+ [filePath: string]: string;
218
+ } | Map<string, string>, opts?: FsWriteOptions) => Promise<FsWriteResults[]>;
219
+ };
220
+ /**
221
+ * The information needed to carry out a file copy operation.
222
+ *
223
+ * `[ source, destination ]`
224
+ */
225
+ type FileCopyTuple = [string, string];
226
+ /**
227
+ * Results from committing pending filesystem operations
228
+ */
229
+ interface FsCommitResults {
230
+ filesCopied: FileCopyTuple[];
231
+ filesWritten: string[];
232
+ filesDeleted: string[];
233
+ dirsDeleted: string[];
234
+ dirsAdded: string[];
235
+ }
236
+ //#endregion
237
+ //#region src/declarations/stencil-public-docs.d.ts
238
+ /**
239
+ * The Type Library holds information about the types which are used in a
240
+ * Stencil project. During compilation, Stencil gathers information about the
241
+ * types which form part of a component's public API, such as properties
242
+ * decorated with `@Prop`, `@Event`, `@Watch`, etc. This type information is
243
+ * then added to the Type Library, where it can be accessed later on for
244
+ * generating documentation.
245
+ *
246
+ * This information is included in the file written by the `docs-json` output
247
+ * target (see {@link JsonDocs.typeLibrary}).
248
+ */
249
+ type JsonDocsTypeLibrary = Record<string, ComponentCompilerReferencedType>;
250
+ /**
251
+ * A container for JSDoc metadata for a project
252
+ */
253
+ interface JsonDocs {
254
+ /**
255
+ * The metadata for the JSDocs for each component in a Stencil project
256
+ */
257
+ components: JsonDocsComponent[];
258
+ /**
259
+ * Project-level usage content, collected from markdown files in a `usage`
260
+ * directory at the project's {@link Config.srcDir} root (as opposed to
261
+ * per-component usage content, which lives in {@link JsonDocsComponent.usage}).
262
+ * Keyed by file name (without extension), same shape as component usage.
263
+ */
264
+ usage?: JsonDocsUsage;
265
+ /**
266
+ * The timestamp at which the metadata was generated, in the format YYYY-MM-DDThh:mm:ss
267
+ */
268
+ timestamp: string;
269
+ compiler: {
270
+ /**
271
+ * The name of the compiler that generated the metadata
272
+ */
273
+ name: string;
274
+ /**
275
+ * The version of the Stencil compiler that generated the metadata
276
+ */
277
+ version: string;
278
+ /**
279
+ * The version of TypeScript that was used to generate the metadata
280
+ */
281
+ typescriptVersion: string;
282
+ };
283
+ typeLibrary: JsonDocsTypeLibrary;
284
+ }
285
+ /**
286
+ * Container for JSDoc metadata for a single Stencil component
287
+ */
288
+ interface JsonDocsComponent {
289
+ /**
290
+ * The directory containing the Stencil component, minus the file name.
291
+ *
292
+ * @example /workspaces/stencil-project/src/components/my-component
293
+ */
294
+ dirPath?: string;
295
+ /**
296
+ * The name of the file containing the Stencil component, with no path
297
+ *
298
+ * @example my-component.tsx
299
+ */
300
+ fileName?: string;
301
+ /**
302
+ * The full path of the file containing the Stencil component
303
+ *
304
+ * @example /workspaces/stencil-project/src/components/my-component/my-component.tsx
305
+ */
306
+ filePath?: string;
307
+ /**
308
+ * The path to the component's `readme.md` file, including the filename
309
+ *
310
+ * @example /workspaces/stencil-project/src/components/my-component/readme.md
311
+ */
312
+ readmePath?: string;
313
+ /**
314
+ * The path to the component's `usage` directory
315
+ *
316
+ * @example /workspaces/stencil-project/src/components/my-component/usage/
317
+ */
318
+ usagesDir?: string;
319
+ /**
320
+ * The encapsulation strategy for a component
321
+ */
322
+ encapsulation: 'shadow' | 'scoped' | 'none';
323
+ /**
324
+ * The tag name for the component, for use in HTML
325
+ */
326
+ tag: string;
327
+ /**
328
+ * The contents of a component's `readme.md` that are user generated.
329
+ *
330
+ * Auto-generated contents are not stored in this reference.
331
+ */
332
+ readme: string;
333
+ /**
334
+ * The description of a Stencil component, found in the JSDoc that sits above the component's declaration
335
+ */
336
+ docs: string;
337
+ /**
338
+ * JSDoc tags found in the JSDoc comment written atop a component's declaration
339
+ */
340
+ docsTags: JsonDocsTag[];
341
+ /**
342
+ * The text from the class-level JSDoc for a Stencil component, if present.
343
+ */
344
+ overview?: string;
345
+ /**
346
+ * A mapping of usage example file names to their contents for the component.
347
+ */
348
+ usage: JsonDocsUsage;
349
+ /**
350
+ * Array of metadata for a component's `@Prop`s
351
+ */
352
+ props: JsonDocsProp[];
353
+ /**
354
+ * Array of metadata for a component's `@Method`s
355
+ */
356
+ methods: JsonDocsMethod[];
357
+ /**
358
+ * Array of metadata for a component's `@Event`s
359
+ */
360
+ events: JsonDocsEvent[];
361
+ /**
362
+ * Array of metadata for a component's `@Listen` handlers
363
+ */
364
+ listeners: JsonDocsListener[];
365
+ /**
366
+ * Array of metadata for a component's CSS styling information
367
+ */
368
+ styles: JsonDocsStyle[];
369
+ /**
370
+ * Array of component Slot information, generated from `@slot` tags
371
+ */
372
+ slots: JsonDocsSlot[];
373
+ /**
374
+ * Array of component Parts information, generate from `@part` tags
375
+ */
376
+ parts: JsonDocsPart[];
377
+ /**
378
+ * Array of custom states defined via @AttachInternals({ states: {...} })
379
+ */
380
+ customStates: JsonDocsCustomState[];
381
+ /**
382
+ * Array of metadata describing where the current component is used
383
+ */
384
+ dependents: string[];
385
+ /**
386
+ * Array of metadata listing the components which are used in current component
387
+ */
388
+ dependencies: string[];
389
+ /**
390
+ * Describes a tree of components coupling
391
+ */
392
+ dependencyGraph: JsonDocsDependencyGraph;
393
+ /**
394
+ * A deprecation reason/description found following a `@deprecated` tag
395
+ */
396
+ deprecation?: string;
397
+ /**
398
+ * `true` if this is a "CSS-only component"
399
+ * discovered in .css file via `@component`-marked JSDoc block
400
+ */
401
+ cssOnly?: boolean;
402
+ }
403
+ interface JsonDocsDependencyGraph {
404
+ [tagName: string]: string[];
405
+ }
406
+ /**
407
+ * A descriptor for a single JSDoc tag found in a block comment
408
+ */
409
+ interface JsonDocsTag {
410
+ /**
411
+ * The tag name (immediately following the '@')
412
+ */
413
+ name: string;
414
+ /**
415
+ * The description that immediately follows the tag name
416
+ */
417
+ text?: string;
418
+ }
419
+ interface JsonDocsValue {
420
+ value?: string;
421
+ type: string;
422
+ }
423
+ /**
424
+ * A mapping of file names to their contents.
425
+ *
426
+ * This type is meant to be used when reading one or more usage markdown files associated with a component. For the
427
+ * given directory structure:
428
+ * ```
429
+ * src/components/my-component
430
+ * ├── my-component.tsx
431
+ * └── usage
432
+ * ├── bar.md
433
+ * └── foo.md
434
+ * ```
435
+ * an instance of this type would include the name of the markdown file, mapped to its contents:
436
+ * ```ts
437
+ * {
438
+ * 'bar': STRING_CONTENTS_OF_BAR.MD
439
+ * 'foo': STRING_CONTENTS_OF_FOO.MD
440
+ * }
441
+ * ```
442
+ */
443
+ interface JsonDocsUsage {
444
+ [key: string]: string;
445
+ }
446
+ /**
447
+ * An intermediate representation of a `@Prop` decorated member's JSDoc
448
+ */
449
+ interface JsonDocsProp {
450
+ /**
451
+ * the name of the prop
452
+ */
453
+ name: string;
454
+ complexType?: ComponentCompilerPropertyComplexType;
455
+ /**
456
+ * the type of the prop, in terms of the TypeScript type system (as opposed to JavaScript's or HTML's)
457
+ */
458
+ type: string;
459
+ /**
460
+ * `true` if the prop was configured as "mutable" where it was declared, `false` otherwise
461
+ */
462
+ mutable: boolean;
463
+ /**
464
+ * The name of the attribute that is exposed to configure a compiled web component
465
+ */
466
+ attr?: string;
467
+ /**
468
+ * `true` if the prop was configured to "reflect" back to HTML where it (the prop) was declared, `false` otherwise
469
+ */
470
+ reflectToAttr: boolean;
471
+ /**
472
+ * the JSDoc description text associated with the prop
473
+ */
474
+ docs: string;
475
+ /**
476
+ * JSDoc tags associated with the prop
477
+ */
478
+ docsTags: JsonDocsTag[];
479
+ /**
480
+ * The default value of the prop
481
+ */
482
+ default?: string;
483
+ /**
484
+ * Deprecation text associated with the prop. This is the text that immediately follows a `@deprecated` tag
485
+ */
486
+ deprecation?: string;
487
+ values: JsonDocsValue[];
488
+ /**
489
+ * `true` if a component is declared with a '?', `false` otherwise
490
+ *
491
+ * @example
492
+ * ```tsx
493
+ * @Prop() componentProps?: any;
494
+ * ```
495
+ */
496
+ optional: boolean;
497
+ /**
498
+ * `true` if a component is declared with a '!', `false` otherwise
499
+ *
500
+ * @example
501
+ * ```tsx
502
+ * @Prop() componentProps!: any;
503
+ * ```
504
+ */
505
+ required: boolean;
506
+ /**
507
+ * `true` if the prop has a `get()`. `false` otherwise
508
+ */
509
+ getter: boolean;
510
+ /**
511
+ * `true` if the prop has a `set()`. `false` otherwise
512
+ */
513
+ setter: boolean;
514
+ }
515
+ interface JsonDocsMethod {
516
+ name: string;
517
+ docs: string;
518
+ docsTags: JsonDocsTag[];
519
+ deprecation?: string;
520
+ signature: string;
521
+ returns: JsonDocsMethodReturn;
522
+ parameters: JsonDocMethodParameter[];
523
+ complexType: ComponentCompilerMethodComplexType;
524
+ }
525
+ interface JsonDocsMethodReturn {
526
+ type: string;
527
+ docs: string;
528
+ }
529
+ interface JsonDocMethodParameter {
530
+ name: string;
531
+ type: string;
532
+ docs: string;
533
+ }
534
+ interface JsonDocsEvent {
535
+ event: string;
536
+ bubbles: boolean;
537
+ cancelable: boolean;
538
+ composed: boolean;
539
+ complexType: ComponentCompilerEventComplexType;
540
+ docs: string;
541
+ docsTags: JsonDocsTag[];
542
+ deprecation?: string;
543
+ detail: string;
544
+ }
545
+ /**
546
+ * Type describing a CSS Style, as described by a JSDoc-style comment
547
+ */
548
+ interface JsonDocsStyle {
549
+ /**
550
+ * The name of the style
551
+ */
552
+ name: string;
553
+ /**
554
+ * The type/description associated with the style
555
+ */
556
+ docs: string;
557
+ /**
558
+ * The annotation used in the JSDoc of the style (e.g. `@prop`)
559
+ */
560
+ annotation: string;
561
+ /**
562
+ * The CSS `syntax` descriptor for a custom property, if it was registered via a native
563
+ * `@property` at-rule (e.g. `"<length>"`).
564
+ */
565
+ syntax?: string;
566
+ /**
567
+ * The `initial-value` descriptor for a custom property, if it was registered via a native
568
+ * `@property` at-rule.
569
+ */
570
+ default?: string;
571
+ /**
572
+ * The mode associated with the style
573
+ */
574
+ mode: string | undefined;
575
+ }
576
+ interface JsonDocsListener {
577
+ event: string;
578
+ target?: string;
579
+ capture: boolean;
580
+ passive: boolean;
581
+ }
582
+ /**
583
+ * A descriptor for a slot
584
+ *
585
+ * Objects of this type are translated from the JSDoc tag, `@slot`
586
+ */
587
+ interface JsonDocsSlot {
588
+ /**
589
+ * The name of the slot. Defaults to an empty string for an unnamed slot.
590
+ */
591
+ name: string;
592
+ /**
593
+ * A textual description of the slot.
594
+ */
595
+ docs: string;
596
+ }
597
+ /**
598
+ * A descriptor of a CSS Shadow Part
599
+ *
600
+ * Objects of this type are translated from the JSDoc tag, `@part`, or the 'part'
601
+ * attribute on a component in TSX
602
+ */
603
+ interface JsonDocsPart {
604
+ /**
605
+ * The name of the Shadow part
606
+ */
607
+ name: string;
608
+ /**
609
+ * A textual description of the Shadow part.
610
+ */
611
+ docs: string;
612
+ }
613
+ /**
614
+ * A descriptor for a Custom State defined via @AttachInternals({ states: {...} })
615
+ *
616
+ * Custom states are exposed via the ElementInternals.states CustomStateSet
617
+ * and can be targeted with the CSS `:state()` pseudo-class.
618
+ *
619
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet
620
+ */
621
+ interface JsonDocsCustomState {
622
+ /**
623
+ * The name of the custom state (without dashes)
624
+ */
625
+ name: string;
626
+ /**
627
+ * The initial/default value of the state
628
+ */
629
+ initialValue: boolean;
630
+ /**
631
+ * A textual description of the custom state
632
+ */
633
+ docs: string;
634
+ }
635
+ /**
636
+ * Represents a parsed block comment in a CSS, Sass, etc. file for a custom property.
637
+ */
638
+ interface StyleDoc {
639
+ /**
640
+ * The name of the CSS property
641
+ */
642
+ name: string;
643
+ /**
644
+ * The user-defined description of the CSS property
645
+ */
646
+ docs: string;
647
+ /**
648
+ * The JSDoc-style annotation (e.g. `@prop`) that was used in the block comment to detect the comment.
649
+ * Used to inform Stencil where the start of a new property's description starts (and where the previous description
650
+ * ends).
651
+ */
652
+ annotation: 'prop';
653
+ /**
654
+ * The Stencil style-mode that is associated with this property.
655
+ */
656
+ mode: string | undefined;
657
+ /**
658
+ * The CSS `syntax` descriptor, if this property was registered via a native `@property` at-rule.
659
+ */
660
+ syntax?: string;
661
+ /**
662
+ * The `initial-value` descriptor, if this property was registered via a native `@property` at-rule.
663
+ */
664
+ default?: string;
665
+ }
666
+ //#endregion
667
+ //#region src/declarations/stencil-public-runtime.d.ts
668
+ type ListenTargetOptions = 'body' | 'document' | 'window';
669
+ interface UserBuildConditionals {
670
+ isDev: boolean;
671
+ isBrowser: boolean;
672
+ isServer: boolean;
673
+ isTesting: boolean;
674
+ }
675
+ type ErrorHandler = (err: any, element?: HTMLElement) => void;
676
+ /**
677
+ * A constructor type that can be used as the base for mixin factories.
678
+ *
679
+ * ```ts
680
+ * import { MixedInCtor } from '@stencil/core';
681
+ *
682
+ * const AFactoryFn = <B extends MixedInCtor>(Base: B) => {class A extends Base { propA = A }; return A;}
683
+ * ```
684
+ */
685
+ type MixedInCtor<T = {}> = new (...args: any[]) => T;
686
+ /**
687
+ * A map of `@Prop`/`@State` property names to their new and previous
688
+ * values, passed to `componentShouldUpdate` once per render cycle.
689
+ *
690
+ * Pass `this` as `T` to type `changes` against your component's own
691
+ * members, e.g. `componentShouldUpdate(changes: ComponentShouldUpdateChanges<this>)`.
692
+ */
693
+ type ComponentShouldUpdateChanges<T = any> = { [K in Extract<keyof T, string>]?: {
694
+ newVal: T[K];
695
+ oldVal: T[K];
696
+ }; };
697
+ interface ComponentInterface {
698
+ connectedCallback?(): void;
699
+ disconnectedCallback?(): void;
700
+ componentWillRender?(): Promise<void> | void;
701
+ componentDidRender?(): void;
702
+ /**
703
+ * The component is about to load and it has not
704
+ * rendered yet.
705
+ *
706
+ * This is the best place to make any data updates
707
+ * before the first render.
708
+ *
709
+ * componentWillLoad will only be called once.
710
+ */
711
+ componentWillLoad?(): Promise<void> | void;
712
+ /**
713
+ * The component has loaded and has already rendered.
714
+ *
715
+ * Updating data in this method will cause the
716
+ * component to re-render.
717
+ *
718
+ * componentDidLoad will only be called once.
719
+ */
720
+ componentDidLoad?(): void;
721
+ /**
722
+ * One or more `@Prop` or `@State` properties changed and a rerender is
723
+ * about to be requested. `changes` contains every property that changed
724
+ * since the last render, keyed by property name.
725
+ *
726
+ * Called once per render cycle, batching all properties that changed
727
+ * synchronously since the last render.
728
+ *
729
+ * Return `false` to prevent the pending render.
730
+ *
731
+ * componentShouldUpdate is not called on the first render.
732
+ */
733
+ componentShouldUpdate?(changes: ComponentShouldUpdateChanges<this>): boolean | void;
734
+ /**
735
+ * The component is about to update and re-render.
736
+ *
737
+ * Called multiple times throughout the life of
738
+ * the component as it updates.
739
+ *
740
+ * componentWillUpdate is not called on the first render.
741
+ */
742
+ componentWillUpdate?(): Promise<void> | void;
743
+ /**
744
+ * The component has just re-rendered.
745
+ *
746
+ * Called multiple times throughout the life of
747
+ * the component as it updates.
748
+ *
749
+ * componentWillUpdate is not called on the
750
+ * first render.
751
+ */
752
+ componentDidUpdate?(): void;
753
+ render?(): any;
754
+ [memberName: string]: any;
755
+ }
756
+ /**
757
+ * A reusable behavior that hooks into a `ReactiveControllerHost`'s lifecycle. Modeled after Lit's
758
+ * `ReactiveController` pattern: implement the hooks you need, then register an instance with a host
759
+ * via `host.addController(this)`.
760
+ */
761
+ interface ReactiveController {
762
+ hostConnected?(): void;
763
+ hostDisconnected?(): void;
764
+ hostWillLoad?(): Promise<void> | void;
765
+ hostDidLoad?(): void;
766
+ hostWillRender?(): Promise<void> | void;
767
+ hostDidRender?(): void;
768
+ hostWillUpdate?(): Promise<void> | void;
769
+ hostDidUpdate?(): void;
770
+ }
771
+ /**
772
+ * The shape added to a component by mixing in `ReactiveControllerHost` (see below).
773
+ */
774
+ interface ReactiveControllerHostInterface extends ComponentInterface, HTMLElement {
775
+ readonly controllers: ReadonlySet<ReactiveController>;
776
+ addController(controller: ReactiveController): void;
777
+ removeController(controller: ReactiveController): void;
778
+ requestUpdate(): void;
779
+ /**
780
+ * Resolves once the next pending render commits. Matches the shape of Lit's
781
+ * `ReactiveControllerHost.updateComplete`, for interop with controllers written against Lit's API
782
+ * (e.g. `@lit/context`).
783
+ */
784
+ readonly updateComplete: Promise<boolean>;
785
+ }
786
+ interface RafCallback {
787
+ (timeStamp: number): void;
788
+ }
789
+ /**
790
+ * Utilities for working with functional Stencil components. An object
791
+ * conforming to this interface is passed by the Stencil runtime as the third
792
+ * argument to a functional component, allowing component authors to work with
793
+ * features like children.
794
+ *
795
+ * The children of a functional component will be passed as the second
796
+ * argument, so a functional component which uses these utils to transform its
797
+ * children might look like the following:
798
+ *
799
+ * ```ts
800
+ * export const AddClass: FunctionalComponent = (_, children, utils) => (
801
+ * utils.map(children, child => ({
802
+ * ...child,
803
+ * vattrs: {
804
+ * ...child.vattrs,
805
+ * class: `${child.vattrs.class} add-class`
806
+ * }
807
+ * }))
808
+ * );
809
+ * ```
810
+ *
811
+ * For more see the Stencil documentation, here:
812
+ * https://stenciljs.com/docs/functional-components
813
+ */
814
+ interface FunctionalUtilities {
815
+ /**
816
+ * Utility for reading the children of a functional component at runtime.
817
+ * Since the Stencil runtime uses a different interface for children it is
818
+ * not recommended to read the children directly, and is preferable to use
819
+ * this utility to, for instance, perform a side effect for each child.
820
+ */
821
+ forEach: (children: VNode[], cb: (vnode: ChildNode$1, index: number, array: ChildNode$1[]) => void) => void;
822
+ /**
823
+ * Utility for transforming the children of a functional component. Given an
824
+ * array of children and a callback this will return a list of the results of
825
+ * passing each child to the supplied callback.
826
+ */
827
+ map: (children: VNode[], cb: (vnode: ChildNode$1, index: number, array: ChildNode$1[]) => ChildNode$1) => VNode[];
828
+ }
829
+ interface FunctionalComponent<T = {}> {
830
+ (props: T, children: VNode[], utils: FunctionalUtilities): VNode | null;
831
+ }
832
+ /**
833
+ * A Child VDOM node
834
+ *
835
+ * This has most of the same properties as {@link VNode} but friendlier names
836
+ * (i.e. `vtag` instead of `$tag$`, `vchildren` instead of `$children$`) in
837
+ * order to provide a friendlier public interface for users of the
838
+ * {@link FunctionalUtilities}).
839
+ */
840
+ interface ChildNode$1 {
841
+ vtag?: string | number | Function | symbol | null;
842
+ vkey?: string | number;
843
+ vtext?: string;
844
+ vchildren?: VNode[];
845
+ vattrs?: any;
846
+ vname?: string;
847
+ }
848
+ /**
849
+ * A virtual DOM node
850
+ */
851
+ interface VNode {
852
+ $flags$: number;
853
+ $tag$: string | number | Function | symbol | null;
854
+ $elm$: any;
855
+ $text$: string;
856
+ $children$: VNode[];
857
+ $attrs$?: any;
858
+ $name$?: string;
859
+ $key$?: string | number;
860
+ /** Signal reference for vdom bypass: signal text nodes store the signal here. */
861
+ $signal$?: any;
862
+ }
863
+ //#endregion
864
+ //#region src/declarations/stencil-public-compiler.d.ts
865
+ /**
866
+ * https://stenciljs.com/docs/config/
867
+ */
868
+ interface StencilConfig {
869
+ /**
870
+ * By default, Stencil will attempt to optimize small scripts by inlining them in HTML. Setting
871
+ * this flag to `false` will prevent this optimization and keep all scripts separate from HTML.
872
+ */
873
+ allowInlineScripts?: boolean;
874
+ /**
875
+ * By setting `autoprefixCss` to `true`, Stencil will use the appropriate config to automatically
876
+ * prefix css. For example, developers can write modern and standard css properties, such as
877
+ * "transform", and Stencil will automatically add in the prefixed version, such as "-webkit-transform".
878
+ * As of Stencil v2, autoprefixing CSS is no longer the default.
879
+ * Defaults to `false`
880
+ */
881
+ autoprefixCss?: boolean | any;
882
+ /**
883
+ * By default, Stencil will statically analyze the application and generate a component graph of
884
+ * how all the components are interconnected.
885
+ *
886
+ * From the component graph it is able to best decide how components should be grouped
887
+ * depending on their usage with one another within the app.
888
+ * By doing so it's able to bundle components together in order to reduce network requests.
889
+ * However, bundles can be manually generated using the bundles config.
890
+ *
891
+ * The bundles config is an array of objects that represent how components are grouped together
892
+ * in lazy-loaded bundles.
893
+ * This config is rarely needed as Stencil handles this automatically behind the scenes.
894
+ */
895
+ bundles?: ConfigBundle[];
896
+ /**
897
+ * Stencil will cache build results in order to speed up rebuilds.
898
+ * To disable this feature, set enableCache to false.
899
+ */
900
+ enableCache?: boolean;
901
+ /**
902
+ * The directory where sub-directories will be created for caching when `enableCache` is set
903
+ * `true` or if using Stencil's Screenshot Connector.
904
+ *
905
+ * @default '.stencil'
906
+ *
907
+ * @example
908
+ *
909
+ * A Stencil config like the following:
910
+ * ```ts
911
+ * export const config = {
912
+ * ...,
913
+ * enableCache: true,
914
+ * cacheDir: '.cache',
915
+ * testing: {
916
+ * screenshotConnector: 'connector.js'
917
+ * }
918
+ * }
919
+ * ```
920
+ *
921
+ * Will result in the following file structure:
922
+ * ```tree
923
+ * stencil-project-root
924
+ * └── .cache
925
+ * ├── .build <-- Where build related file caching is written
926
+ * |
927
+ * └── screenshot-cache.json <-- Where screenshot caching is written
928
+ * ```
929
+ */
930
+ cacheDir?: string;
931
+ /**
932
+ * Stencil is traditionally used to compile many components into an app,
933
+ * and each component comes with its own compartmentalized styles.
934
+ * However, it's still common to have styles which should be "global" across all components and the website.
935
+ * A global CSS file is often useful to set CSS Variables.
936
+ *
937
+ * Additionally, the globalStyle config can be used to precompile styles with Sass, PostCSS, etc.
938
+ * Below is an example folder structure containing a webapp's global sass file, named app.css.
939
+ */
940
+ globalStyle?: string;
941
+ /**
942
+ * Will generate {@link https://nodejs.org/api/packages.html#packages_exports export map} entry points
943
+ * for each component in the build when `true`.
944
+ *
945
+ * @default false
946
+ */
947
+ generateExportMaps?: boolean;
948
+ /**
949
+ * Set to `false` to disable discovery of "CSS-only components" - pure-CSS custom-element
950
+ * definitions marked with a `@component` JSDoc tag in `.css` files under `srcDir`. No JS
951
+ * class, never registered via `customElements.define()` - just a documented,
952
+ * type-checked tag name and its CSS custom properties/attribute variants.
953
+ *
954
+ * Defaults to `true`.
955
+ */
956
+ enableCssOnlyComponents?: boolean;
957
+ /**
958
+ * The namespace config is a string representing a namespace for the app.
959
+ * For apps that are not meant to be a library of reusable components,
960
+ * the default of App is just fine. However, if the app is meant to be consumed
961
+ * as a third-party library, such as Ionic, a unique namespace is required.
962
+ */
963
+ namespace?: string;
964
+ /**
965
+ * Stencil is able to take an app's source and compile it to numerous targets,
966
+ * such as an app to be deployed on an http server, or as a third-party library
967
+ * to be distributed on npm. By default, Stencil apps have an output target type of www.
968
+ *
969
+ * The outputTargets config is an array of objects, with types of www and dist.
970
+ */
971
+ outputTargets?: OutputTarget[];
972
+ /**
973
+ * The plugins config can be used to add your own rolldown plugins, or Stencil's own
974
+ * legacy `resolveId`/`load`/`transform` style plugins (identified by a `pluginType`
975
+ * property). By default, Stencil does not come with Sass or PostCSS support.
976
+ * However, either can be added using the plugin array.
977
+ */
978
+ plugins?: (Plugin$1 | Plugin)[];
979
+ /**
980
+ * Generate js source map files for all bundles.
981
+ * Set to `true` to always generate source maps, `false` to never generate source maps.
982
+ * Set to `'dev'` to only generate source maps when the `--dev` flag is passed.
983
+ * Defaults to `'dev'`.
984
+ */
985
+ sourceMap?: boolean | 'dev';
986
+ /**
987
+ * The srcDir config specifies the directory which should contain the source typescript files
988
+ * for each component. The standard for Stencil apps is to use src, which is the default.
989
+ */
990
+ srcDir?: string;
991
+ /**
992
+ * Sets whether or not Stencil should transform path aliases set in a project's
993
+ * `tsconfig.json` from the assigned module aliases to resolved relative paths.
994
+ *
995
+ * This behavior defaults to `true`, but may be opted-out of by setting this flag to `false`.
996
+ */
997
+ transformAliasedImportPaths?: boolean;
998
+ /**
999
+ * Passes custom configuration to Rolldown's module resolution (its `resolve` option), e.g. `alias`.
1000
+ * For further information: https://stenciljs.com/docs/module-bundling
1001
+ */
1002
+ nodeResolve?: NodeResolveConfig;
1003
+ /**
1004
+ * Passes custom configuration down to rolldown itself, not all rolldown options can be overridden.
1005
+ */
1006
+ rolldownConfig?: RolldownConfig;
1007
+ /**
1008
+ * Sets if the JS browser files are minified or not.
1009
+ * Defaults to `false` in dev mode and `true` in production mode.
1010
+ */
1011
+ minifyJs?: boolean;
1012
+ /**
1013
+ * Which minifier to use for JS output when `minifyJs` is enabled.
1014
+ *
1015
+ * - `oxc`: built into rolldown. Much faster than terser. Output may be slightly larger.
1016
+ * - `terser`: slower, but currently produces the smallest output.
1017
+ *
1018
+ * Defaults to `oxc`.
1019
+ */
1020
+ jsMinifier?: 'terser' | 'oxc';
1021
+ /**
1022
+ * Sets if the CSS is minified or not.
1023
+ * Defaults to `false` in dev mode and `true` in production mode.
1024
+ */
1025
+ minifyCss?: boolean;
1026
+ /**
1027
+ * Object to provide a custom logger. By default a `logger` is already provided for the
1028
+ * platform the compiler is running on, such as NodeJS or a browser.
1029
+ */
1030
+ logger?: Logger;
1031
+ /**
1032
+ * Compatibility and workaround flags for framework/bundler edge cases
1033
+ * and rarely-needed diagnostic suppressions.
1034
+ */
1035
+ compat?: ConfigCompat;
1036
+ /**
1037
+ * Replace `@State` and `@Prop` internals with `@preact/signals-core` signal primitives.
1038
+ * Enables cross-framework reactive interop - component state becomes subscribable by
1039
+ * Solid, Angular, Preact and any TC39-signal-compatible library without event/attribute
1040
+ * roundtrips. No API changes required in component code.
1041
+ * Defaults to `false`.
1042
+ */
1043
+ signalBacking?: boolean;
1044
+ /**
1045
+ * The hydrated flag identifies if a component and all of its child components
1046
+ * have finished hydrating. This helps prevent any flash of unstyled content (FOUC)
1047
+ * as various components are asynchronously downloaded and rendered. By default it
1048
+ * will add the `hydrated` CSS class to the element. The `hydratedFlag` config can be used
1049
+ * to change the name of the CSS class, change it to an attribute, or change which
1050
+ * type of CSS properties and values are assigned before and after hydrating. This config
1051
+ * can also be used to not include the hydrated flag at all by setting it to `null`.
1052
+ */
1053
+ hydratedFlag?: HydratedFlag | null;
1054
+ /**
1055
+ * Ionic prefers to hide all components prior to hydration with a style tag appended
1056
+ * to the head of the document containing some `visibility: hidden;` css rules.
1057
+ *
1058
+ * Disabling this will remove the style tag that sets `visibility: hidden;` on all
1059
+ * un-hydrated web components. This more closely follows the HTML spec, and allows
1060
+ * you to set your own fallback content.
1061
+ *
1062
+ */
1063
+ invisiblePrehydration?: boolean;
1064
+ /**
1065
+ * Sets the task queue used by stencil's runtime. The task queue schedules DOM read and writes
1066
+ * across the frames to efficiently render and reduce layout thrashing. By default,
1067
+ * `async` is used. It's recommended to also try each setting to decide which works
1068
+ * best for your use-case. In all cases, if your app has many CPU intensive tasks causing the
1069
+ * main thread to periodically lock-up, it's always recommended to try
1070
+ * [Web Workers](https://stenciljs.com/docs/web-workers) for those tasks.
1071
+ *
1072
+ * - `async`: DOM read and writes are scheduled in the next frame to prevent layout thrashing.
1073
+ * During intensive CPU tasks it will not reschedule rendering to happen in the next frame.
1074
+ * `async` is ideal for most apps, and if the app has many intensive tasks causing the main
1075
+ * thread to lock-up, it's recommended to try [Web Workers](https://stenciljs.com/docs/web-workers)
1076
+ * rather than the congestion async queue.
1077
+ *
1078
+ * - `congestionAsync`: DOM reads and writes are scheduled in the next frame to prevent layout
1079
+ * thrashing. When the app is heavily tasked and the queue becomes congested it will then
1080
+ * split the work across multiple frames to prevent blocking the main thread. However, it can
1081
+ * also introduce unnecessary reflows in some cases, especially during startup. `congestionAsync`
1082
+ * is ideal for apps running animations while also simultaneously executing intensive tasks
1083
+ * which may lock-up the main thread.
1084
+ *
1085
+ * - `immediate`: Makes writeTask() and readTask() callbacks to be executed synchronously. Tasks
1086
+ * are not scheduled to run in the next frame, but do note there is at least one microtask.
1087
+ * The `immediate` setting is ideal for apps that do not provide long running and smooth
1088
+ * animations. Like the async setting, if the app has intensive tasks causing the main thread
1089
+ * to lock-up, it's recommended to try [Web Workers](https://stenciljs.com/docs/web-workers).
1090
+ */
1091
+ taskQueue?: 'async' | 'immediate' | 'congestionAsync';
1092
+ /**
1093
+ * Provide a object of key/values accessible within the app, using the `Env` object.
1094
+ */
1095
+ env?: {
1096
+ [prop: string]: string | undefined;
1097
+ };
1098
+ docs?: StencilDocsConfig;
1099
+ globalScript?: string;
1100
+ srcIndexHtml?: string;
1101
+ maxConcurrentWorkers?: number;
1102
+ preamble?: string;
1103
+ rolldownPlugins?: {
1104
+ before?: Plugin[];
1105
+ after?: Plugin[];
1106
+ };
1107
+ entryComponentsHint?: string[];
1108
+ buildLogFilePath?: string;
1109
+ devInspector?: boolean;
1110
+ devServer?: StencilDevServerConfig;
1111
+ sys?: CompilerSystem;
1112
+ tsconfig?: string;
1113
+ validateTypes?: boolean;
1114
+ /**
1115
+ * Sets whether Stencil will watch for changes in the source files and rebuild the project automatically.
1116
+ * @default true
1117
+ */
1118
+ watch?: boolean;
1119
+ /**
1120
+ * External directories to watch for changes. By default, Stencil will watch the root and {@link StencilConfig.srcDir}
1121
+ * directory for changes. If you want to watch additional directories, including e.g. `node_modules`, you can add them here.
1122
+ * @default []
1123
+ */
1124
+ watchExternalDirs?: string[];
1125
+ /**
1126
+ * An array of RegExp patterns that are matched against all source files before adding
1127
+ * to the watch list in watch mode. If the file path matches any of the patterns, when it
1128
+ * is updated, it will not trigger a re-run of tests.
1129
+ */
1130
+ watchIgnoredRegex?: RegExp | RegExp[];
1131
+ /**
1132
+ * An array of component tag names to exclude from production builds.
1133
+ * Useful to remove test, demo or experimental components from final output.
1134
+ *
1135
+ * **Note:** Exclusion only applies to production builds (the default).
1136
+ * Development builds (with `--dev` flag) will include all components to support local testing.
1137
+ *
1138
+ * Supports glob patterns for matching multiple components:
1139
+ * - `['demo-*']` - Excludes all components starting with "demo-"
1140
+ * - `['*-test', '*-demo']` - Excludes components ending with "-test" or "-demo"
1141
+ * - `['my-component']` - Excludes a specific component
1142
+ *
1143
+ * Components matching these patterns will be completely excluded from all output targets.
1144
+ *
1145
+ * @example
1146
+ * ```ts
1147
+ * export const config: Config = {
1148
+ * excludeComponents: ['demo-*', 'test-component', '*-internal'],
1149
+ * };
1150
+ * ```
1151
+ *
1152
+ * @default []
1153
+ */
1154
+ excludeComponents?: string[];
1155
+ /**
1156
+ * Set whether unused dependencies should be excluded from the built output.
1157
+ */
1158
+ excludeUnusedDependencies?: boolean;
1159
+ /**
1160
+ * Declares the set of valid style "modes" (e.g. `ios`, `md`) used by mode-keyed
1161
+ * `styleUrls`/`styles` in `@Component()`. When set, the compiler validates that
1162
+ * every mode key used in a component matches one of these entries, catching typos
1163
+ * at build time. Entries marked `required` must be present on every component that
1164
+ * defines any mode-keyed styles.
1165
+ *
1166
+ * @example
1167
+ * ```ts
1168
+ * export const config: Config = {
1169
+ * modes: ['ios', { mode: 'md', required: true }],
1170
+ * };
1171
+ * ```
1172
+ *
1173
+ * @default []
1174
+ */
1175
+ modes?: (string | ModeConfig)[];
1176
+ /**
1177
+ * Explicitly declare which npm packages are Stencil collections to be re-bundled into this project.
1178
+ *
1179
+ * Without this option, collection ingestion is triggered only by a side-effect import:
1180
+ * ```ts
1181
+ * import '@ionic/core';
1182
+ * ```
1183
+ * @example
1184
+ * ```ts
1185
+ * export const config: Config = {
1186
+ * collections: ['@ionic/core', '@my-org/design-system'],
1187
+ * };
1188
+ * ```
1189
+ *
1190
+ * @default []
1191
+ */
1192
+ collections?: string[];
1193
+ }
1194
+ /**
1195
+ * DOM patches for light-dom / scoped components that use `<slot>`.
1196
+ *
1197
+ * These patches shield the component's slot machinery from framework DOM mutations
1198
+ * (e.g. when Angular or React insert / remove nodes they route directly to the host
1199
+ * element, bypassing the slot polyfill) and prevent hydration errors when a framework
1200
+ * encounters Stencil's internal slot reference nodes during SSR reconciliation.
1201
+ *
1202
+ * Patches are only applied at runtime when a component is both non-shadow **and**
1203
+ * declares at least one `<slot>`, so enabling them has no effect on pure shadow-DOM
1204
+ * components.
1205
+ *
1206
+ * Set to `true` (default) to enable all patches, `false` to disable all, or an object
1207
+ * for granular control.
1208
+ */
1209
+ type LightDomPatches = {
1210
+ /** Patches `childNodes`/`children` getters to return only slotted content. */
1211
+ childNodes?: boolean;
1212
+ /** Patches `cloneNode()` to correctly deep-clone slotted content. */
1213
+ cloneNode?: boolean;
1214
+ /** Patches `appendChild()`, `insertBefore()`, and `removeChild()` to route to the correct slot, and the `innerHTML` / `innerText` setters to replace only slotted content. */
1215
+ domMutations?: boolean;
1216
+ /** Patches `textContent` to act like shadow DOM (reads/writes slotted text only). */
1217
+ textContent?: boolean;
1218
+ };
1219
+ /**
1220
+ * Compatibility and workaround flags, primarily for shielding non-shadow DOM components
1221
+ * from consuming frameworks that mutate internals they don't know about, plus other
1222
+ * framework/bundler integration edge cases and rarely-needed diagnostic suppressions.
1223
+ * These are opt-in behaviors that aren't needed by every project.
1224
+ */
1225
+ interface ConfigCompat {
1226
+ /**
1227
+ * Projects that use a Stencil library built using the `dist` output target may have trouble lazily
1228
+ * loading components when using a bundler such as Vite or Parcel. Setting this flag to `true` will change how Stencil
1229
+ * lazily loads components in a way that works with additional bundlers. Setting this flag to `true` will increase
1230
+ * the size of the compiled output. Defaults to `true`.
1231
+ */
1232
+ enableImportInjection?: boolean;
1233
+ /**
1234
+ * Dispatches component lifecycle events. Mainly used for testing. Defaults to `false`.
1235
+ */
1236
+ lifecycleDOMEvents?: boolean;
1237
+ /**
1238
+ * When a component is first attached to the DOM, this setting will wait a single tick before
1239
+ * rendering. This works around an Angular issue, where Angular attaches the elements before
1240
+ * settings their initial state, leading to double renders and unnecessary event dispatches.
1241
+ * Defaults to `false`.
1242
+ */
1243
+ initializeNextTick?: boolean;
1244
+ /**
1245
+ * Adds `transformTag` calls to css strings and querySelector(All) calls.
1246
+ * Use `'prod'` to enable only in production builds.
1247
+ */
1248
+ additionalTagTransformers?: boolean | 'prod';
1249
+ /**
1250
+ * DOM patches for light-dom / scoped components that use `<slot>`.
1251
+ * See {@link LightDomPatches} for granular control. Defaults to `true`.
1252
+ */
1253
+ lightDomPatches?: boolean | LightDomPatches;
1254
+ /**
1255
+ * When `true`, Stencil will suppress diagnostics which warn about public members using reserved names
1256
+ * (for example, decorating a method named `focus` with `@Method()`). Defaults to `false`.
1257
+ */
1258
+ suppressPublicNameWarnings?: boolean;
1259
+ /**
1260
+ * When `true`, Stencil will suppress diagnostics which warn about event names conflicting with native DOM event names. Defaults to `false`.
1261
+ */
1262
+ suppressEventNameWarnings?: boolean;
1263
+ }
1264
+ interface Config extends StencilConfig {
1265
+ buildAppCore?: boolean;
1266
+ configPath?: string;
1267
+ writeLog?: boolean;
1268
+ devServer?: DevServerConfig;
1269
+ fsNamespace?: string;
1270
+ logLevel?: LogLevel;
1271
+ rootDir?: string;
1272
+ packageJsonFilePath?: string;
1273
+ suppressLogs?: boolean;
1274
+ profile?: boolean;
1275
+ tsCompilerOptions?: any;
1276
+ tsWatchOptions?: any;
1277
+ _isValidated?: boolean;
1278
+ _isTesting?: boolean;
1279
+ /**
1280
+ * Whether running in a CI environment (disables interactive features, adjusts worker count)
1281
+ */
1282
+ ci?: boolean;
1283
+ /**
1284
+ * Enable server-side rendering mode
1285
+ */
1286
+ ssr?: boolean;
1287
+ /**
1288
+ * Enable prerendering
1289
+ */
1290
+ prerender?: boolean;
1291
+ /**
1292
+ * Path to output docs JSON file (when --docsJson flag is used)
1293
+ */
1294
+ docsJsonPath?: string;
1295
+ /**
1296
+ * Path to output stats JSON file, or true to use default path
1297
+ */
1298
+ statsJsonPath?: string | boolean;
1299
+ /**
1300
+ * Whether to generate service worker
1301
+ */
1302
+ generateServiceWorker?: boolean;
1303
+ /**
1304
+ * Dev server address override
1305
+ */
1306
+ devServerAddress?: string;
1307
+ /**
1308
+ * Dev server port override
1309
+ */
1310
+ devServerPort?: number;
1311
+ /**
1312
+ * Whether to open browser on dev server start
1313
+ */
1314
+ devServerOpen?: boolean;
1315
+ }
1316
+ /**
1317
+ * A 'loose' type useful for wrapping an incomplete / possible malformed
1318
+ * object as we work on getting it comply with a particular Interface T.
1319
+ *
1320
+ * Example:
1321
+ *
1322
+ * ```ts
1323
+ * interface Foo {
1324
+ * bar: string
1325
+ * }
1326
+ *
1327
+ * function validateFoo(foo: Loose<Foo>): Foo {
1328
+ * let validatedFoo = {
1329
+ * ...foo,
1330
+ * bar: foo.bar || DEFAULT_BAR
1331
+ * }
1332
+ *
1333
+ * return validatedFoo
1334
+ * }
1335
+ * ```
1336
+ *
1337
+ * Use this when you need to take user input or something from some other part
1338
+ * of the world that we don't control and transform it into something
1339
+ * conforming to a given interface. For best results, pair with a validation
1340
+ * function as shown in the example.
1341
+ */
1342
+ type Loose<T extends object> = Record<string, any> & Partial<T>;
1343
+ /**
1344
+ * A Loose version of the Config interface. This is intended to let us load a partial config
1345
+ * and have type information carry though as we construct an object which is a valid `Config`.
1346
+ */
1347
+ type UnvalidatedConfig = Loose<Config>;
1348
+ /**
1349
+ * Helper type to strip optional markers from keys in a type, while preserving other type information for the key.
1350
+ * This type takes a union of keys, K, in type T to allow for the type T to be gradually updated.
1351
+ *
1352
+ * ```typescript
1353
+ * type Foo { bar?: number, baz?: string }
1354
+ * type ReqFieldFoo = RequireFields<Foo, 'bar'>; // { bar: number, baz?: string }
1355
+ * ```
1356
+ */
1357
+ type RequireFields<T, K extends keyof T> = T & { [P in K]-?: T[P]; };
1358
+ /**
1359
+ * Fields in {@link Config} to make required for {@link ValidatedConfig}
1360
+ */
1361
+ type StrictConfigFields = keyof Pick<Config, 'cacheDir' | 'devServer' | 'compat' | 'fsNamespace' | 'hydratedFlag' | 'jsMinifier' | 'logLevel' | 'logger' | 'minifyCss' | 'minifyJs' | 'namespace' | 'outputTargets' | 'packageJsonFilePath' | 'rolldownConfig' | 'rootDir' | 'srcDir' | 'srcIndexHtml' | 'sys' | 'transformAliasedImportPaths'>;
1362
+ /**
1363
+ * A version of {@link Config} that makes certain fields required. This type represents a valid configuration entity.
1364
+ * When a configuration is received by the user, it is a bag of unverified data. In order to make stricter guarantees
1365
+ * about the data from a type-safety perspective, this type is intended to be used throughout the codebase once
1366
+ * validations have occurred at runtime.
1367
+ */
1368
+ type ValidatedConfig = RequireFields<Config, StrictConfigFields> & {
1369
+ /**
1370
+ * Whether the build is running in development mode.
1371
+ * Set by the `--dev` CLI flag. Not user-configurable in `stencil.config.ts`.
1372
+ */
1373
+ devMode: boolean;
1374
+ sourceMap: boolean;
1375
+ };
1376
+ interface ModeConfig {
1377
+ /**
1378
+ * The mode name, matched against `styleUrls`/`styles` object keys in `@Component()`.
1379
+ */
1380
+ mode: string;
1381
+ /**
1382
+ * When `true`, every component that defines mode-keyed `styleUrls` or `styles`
1383
+ * must include this mode. Defaults to `false`.
1384
+ */
1385
+ required?: boolean;
1386
+ }
1387
+ interface HydratedFlag {
1388
+ /**
1389
+ * Defaults to `hydrated`.
1390
+ */
1391
+ name?: string;
1392
+ /**
1393
+ * Can be either `class` or `attribute`. Defaults to `class`.
1394
+ */
1395
+ selector?: 'class' | 'attribute';
1396
+ /**
1397
+ * The CSS property used to show and hide components. Defaults to use the CSS `visibility`
1398
+ * property. Other commonly used CSS properties would be `display` with the `initialValue`
1399
+ * setting as `none`, or `opacity` with the `initialValue` as `0`. Defaults to `visibility`
1400
+ * and the default `initialValue` is `hidden`.
1401
+ */
1402
+ property?: string;
1403
+ /**
1404
+ * This is the CSS value to give all components before it has been hydrated.
1405
+ * Defaults to `hidden`.
1406
+ */
1407
+ initialValue?: string;
1408
+ /**
1409
+ * This is the CSS value to assign once a component has finished hydrating.
1410
+ * This is the CSS value that'll allow the component to show. Defaults to `inherit`.
1411
+ */
1412
+ hydratedValue?: string;
1413
+ }
1414
+ interface StencilDevServerConfig {
1415
+ /**
1416
+ * IP address used by the dev server. The default is `0.0.0.0`, which points to all IPv4 addresses
1417
+ * on the local machine, such as `localhost`.
1418
+ */
1419
+ address?: string;
1420
+ /**
1421
+ * Base path to be used by the server. Defaults to the root pathname.
1422
+ */
1423
+ basePath?: string;
1424
+ /**
1425
+ * EXPERIMENTAL!
1426
+ * During development, node modules can be independently requested and bundled, making for
1427
+ * faster build times. This is only available using the Stencil Dev Server throughout
1428
+ * development. Production builds will override this setting to `false`. Default is `false`.
1429
+ */
1430
+ experimentalDevModules?: boolean;
1431
+ /**
1432
+ * If the dev server should respond with gzip compressed content. Defaults to `true`.
1433
+ */
1434
+ gzip?: boolean;
1435
+ /**
1436
+ * When set, the dev server will run via https using the SSL certificate and key you provide
1437
+ * (use `fs` if you want to read them from files).
1438
+ */
1439
+ https?: Credentials;
1440
+ /**
1441
+ * The URL the dev server should first open to. Defaults to `/`.
1442
+ */
1443
+ initialLoadUrl?: string;
1444
+ /**
1445
+ * When `true`, every request to the server will be logged within the terminal.
1446
+ * Defaults to `false`.
1447
+ */
1448
+ logRequests?: boolean;
1449
+ /**
1450
+ * When set to `true`, the local dev URL is opened in your default browser when the dev server starts.
1451
+ * Defaults to `false`.
1452
+ */
1453
+ openBrowser?: boolean;
1454
+ /**
1455
+ * Sets the server's port. Defaults to `3333`.
1456
+ */
1457
+ port?: number;
1458
+ /**
1459
+ * When set to `true`, the dev server will exit with an error if the specified port is already in use.
1460
+ * When set to `false`, the dev server will automatically try the next available port.
1461
+ * Defaults to `false`.
1462
+ */
1463
+ strictPort?: boolean;
1464
+ /**
1465
+ * When files are watched and updated, by default the dev server will use `hmr` (Hot Module Replacement)
1466
+ * to update the page without a full page refresh. To have the page do a full refresh use `pageReload`.
1467
+ * To disable any reloading, use `null`. Defaults to `hmr`.
1468
+ */
1469
+ reloadStrategy?: PageReloadStrategy;
1470
+ /**
1471
+ * Local path to a NodeJs file with a dev server request listener as the default export.
1472
+ * The user's request listener is given the first chance to handle every request the dev server
1473
+ * receives, and can choose to handle it or instead pass it on to the default dev server
1474
+ * by calling `next()`.
1475
+ *
1476
+ * Below is an example of a NodeJs file the `requestListenerPath` config is using.
1477
+ * The request and response arguments are the same as Node's `http` module and `RequestListener`
1478
+ * callback. https://nodejs.org/api/http.html#http_http_createserver_options_requestlistener
1479
+ *
1480
+ * ```js
1481
+ * module.exports = function (req, res, next) {
1482
+ * if (req.url === '/ping') {
1483
+ * // custom response overriding the dev server
1484
+ * res.setHeader('Content-Type', 'text/plain');
1485
+ * res.writeHead(200);
1486
+ * res.end('pong');
1487
+ * } else {
1488
+ * // pass request on to the default dev server
1489
+ * next();
1490
+ * }
1491
+ * };
1492
+ * ```
1493
+ */
1494
+ requestListenerPath?: string;
1495
+ /**
1496
+ * The root directory to serve the files from.
1497
+ */
1498
+ root?: string;
1499
+ /**
1500
+ * If the dev server should Server-Side Render (SSR) each page, meaning it'll dynamically generate
1501
+ * server-side rendered html on each page load. The `--ssr` flag will most commonly be used with
1502
+ * the`--dev --watch --serve` flags during development. Note that this is for development purposes
1503
+ * only, and the built-in dev server should not be used for production. Defaults to `false`.
1504
+ */
1505
+ ssr?: boolean;
1506
+ /**
1507
+ * If the dev server fails to start up within the given timeout (in milliseconds), the startup will
1508
+ * be canceled. Set to zero to disable the timeout. Defaults to `15000`.
1509
+ */
1510
+ startupTimeout?: number;
1511
+ /**
1512
+ * Whether to use the dev server's websocket client or not. Defaults to `true`.
1513
+ */
1514
+ websocket?: boolean;
1515
+ /**
1516
+ * If the dev server should fork a worker for the server process or not. A singled-threaded dev server
1517
+ * is slower, however it is useful for debugging http requests and responses. Defaults to `true`.
1518
+ */
1519
+ worker?: boolean;
1520
+ }
1521
+ interface DevServerConfig extends StencilDevServerConfig {
1522
+ browserUrl?: string;
1523
+ devServerDir?: string;
1524
+ /**
1525
+ * A list of glob patterns like `subdir/*.js` to exclude from hot-module
1526
+ * reloading updates.
1527
+ */
1528
+ excludeHmr?: string[];
1529
+ /** Serve `index` for page requests that match no file (single-page app routes). `null` turns it off. */
1530
+ historyApiFallback?: HistoryApiFallback | null;
1531
+ openBrowser?: boolean;
1532
+ prerenderConfig?: string;
1533
+ protocol?: 'http' | 'https';
1534
+ srcIndexHtml?: string;
1535
+ /**
1536
+ * Route to be used for the "ping" sub-route of the Stencil dev server.
1537
+ * This route will return a 200 status code once the Stencil build has finished.
1538
+ * Setting this to `null` will disable the ping route.
1539
+ *
1540
+ * Defaults to `/ping`
1541
+ */
1542
+ pingRoute?: string | null;
1543
+ }
1544
+ interface HistoryApiFallback {
1545
+ index?: string;
1546
+ disableDotRule?: boolean;
1547
+ }
1548
+ type PageReloadStrategy = 'hmr' | 'pageReload' | null;
1549
+ /**
1550
+ * Common system used by the compiler. All file reads, writes, access, etc. will all use
1551
+ * this system. Additionally, throughout each build, the compiler will use an internal
1552
+ * in-memory file system as to prevent unnecessary fs reads and writes. At the end of each
1553
+ * build all actions the in-memory fs performed will be written to disk using this system.
1554
+ * A NodeJS based system will use APIs such as `fs` and `crypto`, and a web-based system
1555
+ * will use in-memory Maps and browser APIs. Either way, the compiler itself is unaware
1556
+ * of the actual platform it's being ran on top of.
1557
+ */
1558
+ interface CompilerSystem {
1559
+ name: 'node' | 'in-memory';
1560
+ version: string;
1561
+ events?: BuildEvents;
1562
+ details: SystemDetails;
1563
+ /**
1564
+ * Add a callback which will be ran when destroy() is called.
1565
+ */
1566
+ addDestroy(cb: () => void): void;
1567
+ /**
1568
+ * Always returns a boolean, does not throw.
1569
+ */
1570
+ access(p: string): Promise<boolean>;
1571
+ /**
1572
+ * SYNC! Always returns a boolean, does not throw.
1573
+ */
1574
+ accessSync(p: string): boolean;
1575
+ applyPrerenderGlobalPatch?(opts: {
1576
+ devServerHostUrl: string;
1577
+ window: any;
1578
+ }): void;
1579
+ /**
1580
+ * Check npm for a newer Stencil version. Resolves a function that logs the result.
1581
+ */
1582
+ checkVersion(logger: Logger, currentVersion: string): Promise<() => void>;
1583
+ copy(copyTasks: Required<CopyTask>[], srcDir: string): Promise<CopyResults>;
1584
+ /**
1585
+ * Always returns a boolean if the files were copied or not. Does not throw.
1586
+ */
1587
+ copyFile(src: string, dst: string): Promise<boolean>;
1588
+ /**
1589
+ * Used to destroy any listeners, file watchers or child processes.
1590
+ */
1591
+ destroy(): Promise<void>;
1592
+ /**
1593
+ * Does not throw.
1594
+ */
1595
+ createDir(p: string, opts?: CompilerSystemCreateDirectoryOptions): Promise<CompilerSystemCreateDirectoryResults>;
1596
+ /**
1597
+ * SYNC! Does not throw.
1598
+ */
1599
+ createDirSync(p: string, opts?: CompilerSystemCreateDirectoryOptions): CompilerSystemCreateDirectoryResults;
1600
+ homeDir(): string;
1601
+ /**
1602
+ * Used to determine if the current context of the terminal is TTY.
1603
+ */
1604
+ isTTY(): boolean;
1605
+ /**
1606
+ * Each platform has a different way to dynamically import modules.
1607
+ */
1608
+ dynamicImport(p: string): Promise<any>;
1609
+ /**
1610
+ * Creates the worker controller for the current system.
1611
+ *
1612
+ * @param maxConcurrentWorkers the max number of concurrent workers to
1613
+ * support
1614
+ * @returns a worker controller appropriate for the current platform (node.js)
1615
+ */
1616
+ createWorkerController?(maxConcurrentWorkers: number): WorkerMainController;
1617
+ encodeToBase64(str: string): string;
1618
+ /**
1619
+ * process.exit()
1620
+ */
1621
+ exit(exitCode: number): Promise<void>;
1622
+ /**
1623
+ * Generates a sha1 digest encoded as HEX
1624
+ */
1625
+ generateContentHash(content: string | any, length?: number): Promise<string>;
1626
+ /**
1627
+ * Generates a sha1 digest encoded as HEX from a file path
1628
+ */
1629
+ generateFileHash(filePath: string | any, length?: number): Promise<string>;
1630
+ /**
1631
+ * Get the current directory.
1632
+ */
1633
+ getCurrentDirectory(): string;
1634
+ /**
1635
+ * The compiler's executing path.
1636
+ */
1637
+ getCompilerExecutingPath(): string;
1638
+ /**
1639
+ * Gets the absolute file path when for a dependency module.
1640
+ */
1641
+ getLocalModulePath(opts: {
1642
+ rootDir: string;
1643
+ moduleId: string;
1644
+ path: string;
1645
+ }): string;
1646
+ /**
1647
+ * Gets the full url when requesting a dependency module to fetch from a CDN.
1648
+ */
1649
+ getRemoteModuleUrl(opts: {
1650
+ moduleId: string;
1651
+ path?: string;
1652
+ version?: string;
1653
+ }): string;
1654
+ /**
1655
+ * Async glob task. Only available in NodeJS compiler system.
1656
+ */
1657
+ glob?(pattern: string, options: {
1658
+ cwd?: string;
1659
+ nodir?: boolean;
1660
+ [key: string]: any;
1661
+ }): Promise<string[]>;
1662
+ /**
1663
+ * The number of logical processors available to run threads on the user's computer (cpus).
1664
+ */
1665
+ hardwareConcurrency: number;
1666
+ /**
1667
+ * Tests if the path is a symbolic link or not. Always resolves a boolean. Does not throw.
1668
+ */
1669
+ isSymbolicLink(p: string): Promise<boolean>;
1670
+ lazyRequire?: LazyRequire;
1671
+ nextTick(cb: () => void): void;
1672
+ /**
1673
+ * Normalize file system path.
1674
+ */
1675
+ normalizePath(p: string): string;
1676
+ onProcessInterrupt(cb: () => void): void;
1677
+ platformPath: PlatformPath;
1678
+ /**
1679
+ * All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
1680
+ */
1681
+ readDir(p: string): Promise<string[]>;
1682
+ /**
1683
+ * SYNC! All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
1684
+ */
1685
+ readDirSync(p: string): string[];
1686
+ /**
1687
+ * Returns undefined if file is not found. Does not throw.
1688
+ */
1689
+ readFile(p: string): Promise<string>;
1690
+ readFile(p: string, encoding: 'utf8'): Promise<string>;
1691
+ readFile(p: string, encoding: 'binary'): Promise<any>;
1692
+ /**
1693
+ * SYNC! Returns undefined if file is not found. Does not throw.
1694
+ */
1695
+ readFileSync(p: string, encoding?: string): string;
1696
+ /**
1697
+ * Does not throw.
1698
+ */
1699
+ realpath(p: string): Promise<CompilerSystemRealpathResults>;
1700
+ /**
1701
+ * SYNC! Does not throw.
1702
+ */
1703
+ realpathSync(p: string): CompilerSystemRealpathResults;
1704
+ /**
1705
+ * Remove a callback which will be ran when destroy() is called.
1706
+ */
1707
+ removeDestroy(cb: () => void): void;
1708
+ /**
1709
+ * Rename old path to new path. Does not throw.
1710
+ */
1711
+ rename(oldPath: string, newPath: string): Promise<CompilerSystemRenameResults>;
1712
+ /**
1713
+ * Assigned by the compiler. Used by plugins (e.g. `@stencil/sass`) to resolve `~` imports.
1714
+ */
1715
+ resolveModuleId?(opts: ResolveModuleIdOptions): Promise<ResolveModuleIdResults>;
1716
+ resolvePath(p: string): string;
1717
+ /**
1718
+ * Does not throw.
1719
+ */
1720
+ removeDir(p: string, opts?: CompilerSystemRemoveDirectoryOptions): Promise<CompilerSystemRemoveDirectoryResults>;
1721
+ /**
1722
+ * SYNC! Does not throw.
1723
+ */
1724
+ removeDirSync(p: string, opts?: CompilerSystemRemoveDirectoryOptions): CompilerSystemRemoveDirectoryResults;
1725
+ /**
1726
+ * Does not throw.
1727
+ */
1728
+ removeFile(p: string): Promise<CompilerSystemRemoveFileResults>;
1729
+ /**
1730
+ * SYNC! Does not throw.
1731
+ */
1732
+ removeFileSync(p: string): CompilerSystemRemoveFileResults;
1733
+ setupCompiler?: (c: {
1734
+ ts: any;
1735
+ }) => void;
1736
+ /**
1737
+ * Always returns an object. Does not throw. Check for "error" property if there's an error.
1738
+ */
1739
+ stat(p: string): Promise<CompilerFsStats>;
1740
+ /**
1741
+ * SYNC! Always returns an object. Does not throw. Check for "error" property if there's an error.
1742
+ */
1743
+ statSync(p: string): CompilerFsStats;
1744
+ tmpDirSync(): string;
1745
+ watchDirectory?(p: string, callback: CompilerFileWatcherCallback, recursive?: boolean): CompilerFileWatcher;
1746
+ /**
1747
+ * A `watchFile` implementation in order to hook into the rest of the {@link CompilerSystem} implementation that is
1748
+ * used when running Stencil's compiler in "watch mode".
1749
+ *
1750
+ * It is analogous to TypeScript's `watchFile` implementation.
1751
+ *
1752
+ * Note, this function may be called for full builds of Stencil projects by the TypeScript compiler. It should not
1753
+ * assume that it will only be called in watch mode.
1754
+ *
1755
+ * This function should not perform any file watcher registration itself. Each `path` provided to it when called
1756
+ * should already have been registered as a file to watch.
1757
+ *
1758
+ * @param path the path to the file that is being watched
1759
+ * @param callback a callback to invoke when a file that is being watched has changed in some way
1760
+ * @returns an object with a method for unhooking the file watcher from the system
1761
+ */
1762
+ watchFile?(path: string, callback: CompilerFileWatcherCallback): CompilerFileWatcher;
1763
+ /**
1764
+ * How many milliseconds to wait after a change before calling watch callbacks.
1765
+ */
1766
+ watchTimeout?: number;
1767
+ /**
1768
+ * Does not throw.
1769
+ */
1770
+ writeFile(p: string, content: string): Promise<CompilerSystemWriteFileResults>;
1771
+ /**
1772
+ * SYNC! Does not throw.
1773
+ */
1774
+ writeFileSync(p: string, content: string): CompilerSystemWriteFileResults;
1775
+ }
1776
+ interface ParsedPath {
1777
+ root: string;
1778
+ dir: string;
1779
+ base: string;
1780
+ ext: string;
1781
+ name: string;
1782
+ }
1783
+ interface PlatformPath {
1784
+ normalize(p: string): string;
1785
+ join(...paths: string[]): string;
1786
+ resolve(...pathSegments: string[]): string;
1787
+ isAbsolute(p: string): boolean;
1788
+ relative(from: string, to: string): string;
1789
+ dirname(p: string): string;
1790
+ basename(p: string, ext?: string): string;
1791
+ extname(p: string): string;
1792
+ parse(p: string): ParsedPath;
1793
+ sep: string;
1794
+ delimiter: string;
1795
+ posix: any;
1796
+ win32: any;
1797
+ }
1798
+ interface ResolveModuleIdOptions {
1799
+ moduleId: string;
1800
+ containingFile?: string;
1801
+ exts?: string[];
1802
+ packageFilter?: (pkg: any, pkgFile: string) => any;
1803
+ }
1804
+ interface ResolveModuleIdResults {
1805
+ moduleId: string;
1806
+ resolveId: string;
1807
+ pkgData: {
1808
+ name: string;
1809
+ version: string;
1810
+ [key: string]: any;
1811
+ };
1812
+ pkgDirPath: string;
1813
+ }
1814
+ /**
1815
+ * A controller which provides for communication and coordination between
1816
+ * threaded workers.
1817
+ */
1818
+ interface WorkerMainController<T extends Record<string, (...args: any[]) => Promise<any>> = Record<string, (...args: any[]) => Promise<any>>> {
1819
+ /**
1820
+ * Send a given set of arguments to a worker
1821
+ */
1822
+ send<K extends keyof T>(methodName: K, ...args: Parameters<T[K]>): ReturnType<T[K]>;
1823
+ /**
1824
+ * Handle a particular method
1825
+ *
1826
+ * @param name of the method to be passed to a worker
1827
+ * @returns a Promise wrapping the results
1828
+ */
1829
+ handler<K extends keyof T>(name: K): T[K];
1830
+ /**
1831
+ * Destroy the worker represented by this instance, rejecting all outstanding
1832
+ * tasks and killing the child process.
1833
+ */
1834
+ destroy(): void;
1835
+ /**
1836
+ * The current setting for the max number of workers
1837
+ */
1838
+ maxWorkers: number;
1839
+ }
1840
+ interface CopyResults {
1841
+ diagnostics: Diagnostic[];
1842
+ filePaths: string[];
1843
+ dirPaths: string[];
1844
+ }
1845
+ interface SystemDetails {
1846
+ cpuModel: string;
1847
+ freemem(): number;
1848
+ platform: 'darwin' | 'windows' | 'linux' | '';
1849
+ release: string;
1850
+ totalmem: number;
1851
+ }
1852
+ interface BuildOnEvents {
1853
+ on(cb: (eventName: CompilerEventName, data: any) => void): BuildOnEventRemove;
1854
+ on(eventName: CompilerEventFileAdd, cb: (path: string) => void): BuildOnEventRemove;
1855
+ on(eventName: CompilerEventFileDelete, cb: (path: string) => void): BuildOnEventRemove;
1856
+ on(eventName: CompilerEventFileUpdate, cb: (path: string) => void): BuildOnEventRemove;
1857
+ on(eventName: CompilerEventDirAdd, cb: (path: string) => void): BuildOnEventRemove;
1858
+ on(eventName: CompilerEventDirDelete, cb: (path: string) => void): BuildOnEventRemove;
1859
+ on(eventName: CompilerEventBuildStart, cb: (buildStart: CompilerBuildStart) => void): BuildOnEventRemove;
1860
+ on(eventName: CompilerEventBuildFinish, cb: (buildResults: CompilerBuildResults) => void): BuildOnEventRemove;
1861
+ on(eventName: CompilerEventBuildLog, cb: (buildLog: BuildLog) => void): BuildOnEventRemove;
1862
+ on(eventName: CompilerEventBuildNoChange, cb: () => void): BuildOnEventRemove;
1863
+ }
1864
+ interface BuildEmitEvents {
1865
+ emit(eventName: CompilerEventName, path: string): void;
1866
+ emit(eventName: CompilerEventFileAdd, path: string): void;
1867
+ emit(eventName: CompilerEventFileDelete, path: string): void;
1868
+ emit(eventName: CompilerEventFileUpdate, path: string): void;
1869
+ emit(eventName: CompilerEventDirAdd, path: string): void;
1870
+ emit(eventName: CompilerEventDirDelete, path: string): void;
1871
+ emit(eventName: CompilerEventBuildStart, buildStart: CompilerBuildStart): void;
1872
+ emit(eventName: CompilerEventBuildFinish, buildResults: CompilerBuildResults): void;
1873
+ emit(eventName: CompilerEventBuildNoChange, buildNoChange: BuildNoChangeResults): void;
1874
+ emit(eventName: CompilerEventBuildLog, buildLog: BuildLog): void;
1875
+ emit(eventName: CompilerEventFsChange, fsWatchResults: FsWatchResults): void;
1876
+ }
1877
+ interface FsWatchResults {
1878
+ dirsAdded: string[];
1879
+ dirsDeleted: string[];
1880
+ filesUpdated: string[];
1881
+ filesAdded: string[];
1882
+ filesDeleted: string[];
1883
+ }
1884
+ interface BuildLog {
1885
+ buildId: number;
1886
+ messages: string[];
1887
+ progress: number;
1888
+ }
1889
+ interface BuildNoChangeResults {
1890
+ buildId: number;
1891
+ noChange: boolean;
1892
+ }
1893
+ interface CompilerBuildResults {
1894
+ buildId: number;
1895
+ componentGraph?: BuildResultsComponentGraph;
1896
+ components: ComponentCompilerMeta[];
1897
+ cssOnlyComponents: ComponentCompilerMeta[];
1898
+ diagnostics: Diagnostic[];
1899
+ dirsAdded: string[];
1900
+ dirsDeleted: string[];
1901
+ duration: number;
1902
+ filesAdded: string[];
1903
+ filesChanged: string[];
1904
+ filesDeleted: string[];
1905
+ filesUpdated: string[];
1906
+ hasError: boolean;
1907
+ hasSuccessfulBuild: boolean;
1908
+ hmr?: HotModuleReplacement;
1909
+ ssrAppFilePath?: string;
1910
+ isRebuild: boolean;
1911
+ namespace: string;
1912
+ fsNamespace: string;
1913
+ outputs: BuildOutput[];
1914
+ /**
1915
+ * Absolute paths to every global stylesheet, in cascade order: each `global-style` output
1916
+ * target's compiled CSS in the order those targets are declared in `config.outputTargets` - or,
1917
+ * with none configured, the generated `{fsNamespace}.css` holding Stencil's auto-placed CSS (when
1918
+ * emitted). Unlike `outputs`, which groups files by type and sorts them alphabetically, this
1919
+ * preserves author-intended order for consumers like the dev-server's auto-generated component
1920
+ * preview.
1921
+ */
1922
+ globalStyleFiles: string[];
1923
+ rootDir: string;
1924
+ srcDir: string;
1925
+ timestamp: string;
1926
+ }
1927
+ interface BuildResultsComponentGraph {
1928
+ [scopeId: string]: string[];
1929
+ }
1930
+ interface BuildOutput {
1931
+ type: string;
1932
+ files: string[];
1933
+ }
1934
+ interface HotModuleReplacement {
1935
+ componentsUpdated?: string[];
1936
+ excludeHmr?: string[];
1937
+ externalStylesUpdated?: string[];
1938
+ globalStylesUpdated?: HmrGlobalStyleUpdate[];
1939
+ imagesUpdated?: string[];
1940
+ indexHtmlUpdated?: boolean;
1941
+ inlineStylesUpdated?: HmrStyleUpdate[];
1942
+ reloadStrategy: PageReloadStrategy;
1943
+ scriptsAdded?: string[];
1944
+ scriptsDeleted?: string[];
1945
+ serviceWorkerUpdated?: boolean;
1946
+ versionId?: string;
1947
+ }
1948
+ interface HmrStyleUpdate {
1949
+ styleId: string;
1950
+ styleTag: string;
1951
+ styleText: string;
1952
+ }
1953
+ /**
1954
+ * A live-reload update for a `global-style` output target's CSS. Applied on
1955
+ * the client by matching `fileName` against the `<link>` that loads it and
1956
+ * inserting/updating an adjacent `<style>` override
1957
+ */
1958
+ interface HmrGlobalStyleUpdate {
1959
+ fileName: string;
1960
+ styleText: string;
1961
+ }
1962
+ type BuildOnEventRemove = () => boolean;
1963
+ interface BuildEvents extends BuildOnEvents, BuildEmitEvents {
1964
+ unsubscribeAll(): void;
1965
+ }
1966
+ interface CompilerBuildStart {
1967
+ buildId: number;
1968
+ timestamp: string;
1969
+ }
1970
+ /**
1971
+ * A type describing a function to call when an event is emitted by a file watcher
1972
+ * @param fileName the path of the file tied to event
1973
+ * @param eventKind a variant describing the type of event that was emitter (added, edited, etc.)
1974
+ */
1975
+ type CompilerFileWatcherCallback = (fileName: string, eventKind: CompilerFileWatcherEvent) => void;
1976
+ /**
1977
+ * A type describing the different types of events that Stencil expects may happen when a file being watched is altered
1978
+ * in some way
1979
+ */
1980
+ type CompilerFileWatcherEvent = CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventFileUpdate | CompilerEventDirAdd | CompilerEventDirDelete;
1981
+ type CompilerEventName = CompilerEventFsChange | CompilerEventFileUpdate | CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventDirAdd | CompilerEventDirDelete | CompilerEventBuildStart | CompilerEventBuildFinish | CompilerEventBuildNoChange | CompilerEventBuildLog;
1982
+ type CompilerEventFsChange = 'fsChange';
1983
+ type CompilerEventFileUpdate = 'fileUpdate';
1984
+ type CompilerEventFileAdd = 'fileAdd';
1985
+ type CompilerEventFileDelete = 'fileDelete';
1986
+ type CompilerEventDirAdd = 'dirAdd';
1987
+ type CompilerEventDirDelete = 'dirDelete';
1988
+ type CompilerEventBuildStart = 'buildStart';
1989
+ type CompilerEventBuildFinish = 'buildFinish';
1990
+ type CompilerEventBuildLog = 'buildLog';
1991
+ type CompilerEventBuildNoChange = 'buildNoChange';
1992
+ interface CompilerFileWatcher {
1993
+ close(): void | Promise<void>;
1994
+ }
1995
+ interface CompilerFsStats {
1996
+ /**
1997
+ * If it's a directory. `false` if there was an error.
1998
+ */
1999
+ isDirectory: boolean;
2000
+ /**
2001
+ * If it's a file. `false` if there was an error.
2002
+ */
2003
+ isFile: boolean;
2004
+ /**
2005
+ * If it's a symlink. `false` if there was an error.
2006
+ */
2007
+ isSymbolicLink: boolean;
2008
+ /**
2009
+ * The size of the file in bytes. `0` for directories or if there was an error.
2010
+ */
2011
+ size: number;
2012
+ /**
2013
+ * The timestamp indicating the last time this file was modified expressed in milliseconds since the POSIX Epoch.
2014
+ */
2015
+ mtimeMs?: number;
2016
+ /**
2017
+ * Error if there was one, otherwise `null`. `stat` and `statSync` do not throw errors but always returns this interface.
2018
+ */
2019
+ error: any;
2020
+ }
2021
+ interface CompilerSystemCreateDirectoryOptions {
2022
+ /**
2023
+ * Indicates whether parent directories should be created.
2024
+ * @default false
2025
+ */
2026
+ recursive?: boolean;
2027
+ /**
2028
+ * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
2029
+ * @default 0o777.
2030
+ */
2031
+ mode?: number;
2032
+ }
2033
+ interface CompilerSystemCreateDirectoryResults {
2034
+ basename: string;
2035
+ dirname: string;
2036
+ path: string;
2037
+ newDirs: string[];
2038
+ error: any;
2039
+ }
2040
+ interface CompilerSystemRemoveDirectoryOptions {
2041
+ /**
2042
+ * Indicates whether child files and subdirectories should be removed.
2043
+ * @default false
2044
+ */
2045
+ recursive?: boolean;
2046
+ }
2047
+ interface CompilerSystemRemoveDirectoryResults {
2048
+ basename: string;
2049
+ dirname: string;
2050
+ path: string;
2051
+ removedDirs: string[];
2052
+ removedFiles: string[];
2053
+ error: any;
2054
+ }
2055
+ interface CompilerSystemRenameResults extends CompilerSystemRenamedPath {
2056
+ renamed: CompilerSystemRenamedPath[];
2057
+ oldDirs: string[];
2058
+ oldFiles: string[];
2059
+ newDirs: string[];
2060
+ newFiles: string[];
2061
+ error: any;
2062
+ }
2063
+ interface CompilerSystemRenamedPath {
2064
+ oldPath: string;
2065
+ newPath: string;
2066
+ isFile: boolean;
2067
+ isDirectory: boolean;
2068
+ }
2069
+ interface CompilerSystemRealpathResults {
2070
+ path: string;
2071
+ error: any;
2072
+ }
2073
+ interface CompilerSystemRemoveFileResults {
2074
+ basename: string;
2075
+ dirname: string;
2076
+ path: string;
2077
+ error: any;
2078
+ }
2079
+ interface CompilerSystemWriteFileResults {
2080
+ path: string;
2081
+ error: any;
2082
+ }
2083
+ interface Credentials {
2084
+ key: string;
2085
+ cert: string;
2086
+ }
2087
+ interface ConfigBundle {
2088
+ components: string[];
2089
+ }
2090
+ /**
2091
+ * A file and/or directory copy operation that may be specified as part of
2092
+ * certain output targets for Stencil (in particular `loader-bundle`,
2093
+ * `standalone`, and `www`).
2094
+ */
2095
+ interface CopyTask {
2096
+ /**
2097
+ * The source file path for a copy operation. This may be an absolute or
2098
+ * relative path to a directory or a file, and may also include a glob
2099
+ * pattern.
2100
+ *
2101
+ * If the path is a relative path it will be treated as relative to
2102
+ * `Config.srcDir`.
2103
+ */
2104
+ src: string;
2105
+ /**
2106
+ * An optional destination file path for a copy operation. This may be an
2107
+ * absolute or relative path.
2108
+ *
2109
+ * If relative, this will be treated as relative to the output directory for
2110
+ * the output target for which this copy operation is configured.
2111
+ */
2112
+ dest?: string;
2113
+ /**
2114
+ * Additional glob patterns to exclude from the copy operation, merged with
2115
+ * the built-in defaults: `__mocks__`, `__fixtures__`, `dist`, hidden dirs,
2116
+ * `.ds_store`, `.gitignore`, `desktop.ini`, `thumbs.db`. For a directory
2117
+ * `src`, patterns match paths relative to that directory; an explicitly
2118
+ * named `src` file is never ignored.
2119
+ */
2120
+ ignore?: string[];
2121
+ /**
2122
+ * Whether or not Stencil should issue warnings if it cannot find the
2123
+ * specified source files or directories. Defaults to `false`.
2124
+ *
2125
+ * To receive warnings if a copy task source can't be found set this to
2126
+ * `true`.
2127
+ */
2128
+ warn?: boolean;
2129
+ /**
2130
+ * Whether or not directory structure should be preserved when copying files
2131
+ * from a source directory. Defaults to `true` if no `dest` path is supplied,
2132
+ * else it defaults to `false`.
2133
+ *
2134
+ * If this is set to `false`, all the files from a source directory will be
2135
+ * copied directly to the destination directory, but if it's set to `true` they
2136
+ * will be copied to a new directory inside the destination directory with
2137
+ * the same name as their original source directory.
2138
+ *
2139
+ * So if, for instance, `src` is set to `"images"` and `keepDirStructure` is
2140
+ * set to `true` the copy task will then produce the following directory
2141
+ * structure:
2142
+ *
2143
+ * ```
2144
+ * images
2145
+ * └── foo.png
2146
+ * dist
2147
+ * └── images
2148
+ * └── foo.png
2149
+ * ```
2150
+ *
2151
+ * Conversely if `keepDirStructure` is set to `false` then files in `images/`
2152
+ * will be copied to `dist` without first creating a new subdirectory,
2153
+ * resulting in the following directory structure:
2154
+ *
2155
+ * ```
2156
+ * images
2157
+ * └── foo.png
2158
+ * dist
2159
+ * └── foo.png
2160
+ * ```
2161
+ *
2162
+ * If a `dest` path is supplied then `keepDirStructure`
2163
+ * will default to `false`, so that Stencil will write the
2164
+ * copied files directly into the `dest` directory without creating a new
2165
+ * subdirectory. This behavior can be overridden by setting
2166
+ * `keepDirStructure` to `true`.
2167
+ */
2168
+ keepDirStructure?: boolean;
2169
+ }
2170
+ /**
2171
+ * Configuration for generating documentation from Stencil components.
2172
+ */
2173
+ interface StencilDocsConfig {
2174
+ /**
2175
+ * Options for processing and rendering Markdown documentation files.
2176
+ */
2177
+ markdown?: {
2178
+ /**
2179
+ * Styling for how the target component will be represented within documentation (e.g., in component diagrams).
2180
+ */
2181
+ targetComponent?: {
2182
+ /**
2183
+ * Background color used for nodes representing the component in diagrams (e.g., Mermaid graphs).
2184
+ * Use standard color names or hex codes.
2185
+ * @example '#f0f0f0' (light gray)
2186
+ */
2187
+ background?: string;
2188
+ /**
2189
+ * Text color used within nodes representing the component in diagrams (e.g., Mermaid graphs).
2190
+ * Use standard color names or hex codes.
2191
+ * @example '#333' (dark gray)
2192
+ */
2193
+ textColor?: string;
2194
+ };
2195
+ };
2196
+ }
2197
+ /** Options for rolldown's built-in module resolver, passed directly to rolldown's `resolve` input option. */
2198
+ type NodeResolveConfig = NonNullable<InputOptions['resolve']>;
2199
+ interface RolldownConfig {
2200
+ treeshake?: boolean;
2201
+ external?: (string | RegExp)[] | string | RegExp | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | null | undefined);
2202
+ }
2203
+ /**
2204
+ * This sets the log level hierarchy for our terminal logger, ranging from
2205
+ * most to least verbose.
2206
+ *
2207
+ * Ordering the levels like this lets us easily check whether we should log a
2208
+ * message at a given time. For instance, if the log level is set to `'warn'`,
2209
+ * then anything passed to the logger with level `'warn'` or `'error'` should
2210
+ * be logged, but we should _not_ log anything with level `'info'` or `'debug'`.
2211
+ *
2212
+ * If we have a current log level `currentLevel` and a message with level
2213
+ * `msgLevel` is passed to the logger, we can determine whether or not we should
2214
+ * log it by checking if the log level on the message is further up or at the
2215
+ * same level in the hierarchy than `currentLevel`, like so:
2216
+ *
2217
+ * ```ts
2218
+ * LOG_LEVELS.indexOf(msgLevel) >= LOG_LEVELS.indexOf(currentLevel)
2219
+ * ```
2220
+ *
2221
+ * NOTE: for the reasons described above, do not change the order of the entries
2222
+ * in this array without good reason!
2223
+ */
2224
+ declare const LOG_LEVELS: readonly ["debug", "info", "warn", "error"];
2225
+ type LogLevel = (typeof LOG_LEVELS)[number];
2226
+ /**
2227
+ * Abstract interface representing a logger with the capability to accept log
2228
+ * messages at various levels (debug, info, warn, and error), set colors, log
2229
+ * time spans, print diagnostic messages, and more.
2230
+ *
2231
+ * A Node.js-specific implementation of this interface is used when Stencil is
2232
+ * building and compiling a project.
2233
+ */
2234
+ interface Logger {
2235
+ enableColors: (useColors: boolean) => void;
2236
+ setLevel: (level: LogLevel) => void;
2237
+ getLevel: () => LogLevel;
2238
+ debug: (...msg: any[]) => void;
2239
+ info: (...msg: any[]) => void;
2240
+ warn: (...msg: any[]) => void;
2241
+ error: (...msg: any[]) => void;
2242
+ createTimeSpan: (startMsg: string, debug?: boolean, appendTo?: string[]) => LoggerTimeSpan;
2243
+ printDiagnostics: (diagnostics: Diagnostic[], cwd?: string) => void;
2244
+ red: (msg: string) => string;
2245
+ green: (msg: string) => string;
2246
+ yellow: (msg: string) => string;
2247
+ blue: (msg: string) => string;
2248
+ magenta: (msg: string) => string;
2249
+ cyan: (msg: string) => string;
2250
+ gray: (msg: string) => string;
2251
+ bold: (msg: string) => string;
2252
+ dim: (msg: string) => string;
2253
+ bgRed: (msg: string) => string;
2254
+ emoji: (e: string) => string;
2255
+ setLogFilePath?: (p: string) => void;
2256
+ writeLogs?: (append: boolean) => void;
2257
+ createLineUpdater?: () => Promise<LoggerLineUpdater>;
2258
+ }
2259
+ interface LoggerLineUpdater {
2260
+ update(text: string): Promise<void>;
2261
+ stop(): Promise<void>;
2262
+ }
2263
+ interface LoggerTimeSpan {
2264
+ duration(): number;
2265
+ finish(finishedMsg: string, color?: string, bold?: boolean, newLineSuffix?: boolean): number;
2266
+ }
2267
+ /**
2268
+ * Output target for generating lazy-loaded component bundles with a loader infrastructure.
2269
+ * This creates an optimized distribution for CDN usage and applications that benefit from
2270
+ * lazy-loading components on demand.
2271
+ *
2272
+ * Formerly known as 'dist' in v4.
2273
+ *
2274
+ * @example
2275
+ * ```typescript
2276
+ * {
2277
+ * type: 'loader-bundle',
2278
+ * dir: 'dist/loader-bundle'
2279
+ * }
2280
+ * ```
2281
+ */
2282
+ interface OutputTargetLoaderBundle extends OutputTargetBaseNext {
2283
+ type: 'loader-bundle';
2284
+ /**
2285
+ * Directory where lazy-loaded bundles will be written.
2286
+ * @default '' (root of output directory)
2287
+ */
2288
+ buildDir?: string;
2289
+ copy?: CopyTask[];
2290
+ empty?: boolean;
2291
+ /**
2292
+ * Whether to generate CommonJS (CJS) bundles.
2293
+ *
2294
+ * When `true`, generates CJS output in `cjs/` subdirectory.
2295
+ * When `false` (default in v5+), only ESM bundles are generated.
2296
+ *
2297
+ * @default false
2298
+ */
2299
+ cjs?: boolean;
2300
+ /**
2301
+ * Custom path for the loader directory; files you can import
2302
+ * in an initiation script within your application to register all your components for
2303
+ * lazy loading.
2304
+ *
2305
+ * @default 'loader' (relative to output directory)
2306
+ */
2307
+ loaderPath?: string;
2308
+ /**
2309
+ * Hash the filenames of generated chunks based on their content.
2310
+ * Enables forever-caching of CDN-served bundles.
2311
+ *
2312
+ * @default true in production, false in dev mode
2313
+ */
2314
+ hashFileNames?: boolean;
2315
+ /**
2316
+ * Number of characters to use for the content hash in filenames.
2317
+ *
2318
+ * @default 8
2319
+ */
2320
+ hashedFileNameLength?: number;
2321
+ /**
2322
+ * When `true`, marks `@stencil/core` as an external dependency in the bundler (ESM/CJS)
2323
+ * distribution output. Consumers must provide `@stencil/core` themselves.
2324
+ *
2325
+ * Has no effect on the browser/CDN build - the runtime is always bundled there.
2326
+ *
2327
+ * @default false
2328
+ */
2329
+ externalRuntime?: boolean;
2330
+ }
2331
+ /**
2332
+ * Output target for generating Stencil component source for downstream re-bundling.
2333
+ * This output contains transpiled source code, component metadata, and configuration
2334
+ * that downstream Stencil projects can re-compile and bundle.
2335
+ *
2336
+ * Formerly 'dist-collection' sub-output in v4, now a first-class output target in v5.
2337
+ *
2338
+ * In production builds, this output is auto-generated unless explicitly configured.
2339
+ *
2340
+ * @example
2341
+ * ```typescript
2342
+ * {
2343
+ * type: 'collection',
2344
+ * dir: 'dist/collection',
2345
+ * transformAliasedImportPaths: true
2346
+ * }
2347
+ * ```
2348
+ */
2349
+ interface OutputTargetCollection extends OutputTargetBaseNext {
2350
+ type: 'collection';
2351
+ empty?: boolean;
2352
+ /**
2353
+ * When `true` this flag will transform aliased import paths defined in
2354
+ * a project's `tsconfig.json` to relative import paths in the compiled output.
2355
+ *
2356
+ * Paths will be left in aliased format if `false`. Defaults to `true`.
2357
+ *
2358
+ * @example
2359
+ * // tsconfig.json
2360
+ * {
2361
+ * paths: {
2362
+ * "@utils/*": ['/src/utils/*']
2363
+ * }
2364
+ * }
2365
+ *
2366
+ * // Source file
2367
+ * import * as dateUtils from '@utils/date-utils';
2368
+ * // Output file
2369
+ * import * as dateUtils from '../utils/date-utils';
2370
+ */
2371
+ transformAliasedImportPaths?: boolean | null;
2372
+ }
2373
+ /**
2374
+ * Output target for generating TypeScript type definitions (.d.ts files).
2375
+ *
2376
+ * Formerly a sub-output of 'dist' and 'dist-custom-elements' in v4,
2377
+ * now a first-class output target in v5 that can be shared across multiple outputs.
2378
+ *
2379
+ * In production builds, this output is auto-generated unless explicitly configured.
2380
+ *
2381
+ * @example
2382
+ * ```typescript
2383
+ * {
2384
+ * type: 'types',
2385
+ * dir: 'dist/types'
2386
+ * }
2387
+ * ```
2388
+ */
2389
+ interface OutputTargetTypes extends OutputTargetBaseNext {
2390
+ type: 'types';
2391
+ empty?: boolean;
2392
+ }
2393
+ interface OutputTargetDistLazy extends OutputTargetBase {
2394
+ type: 'dist-lazy';
2395
+ dir?: string;
2396
+ esmDir?: string;
2397
+ cjsDir?: string;
2398
+ isBrowserBuild?: boolean;
2399
+ esmIndexFile?: string;
2400
+ cjsIndexFile?: string;
2401
+ loaderDir?: string;
2402
+ typesDir?: string;
2403
+ empty?: boolean;
2404
+ /** Inherited from parent output target (loader-bundle or www). Only meaningful for browser builds. */
2405
+ hashFileNames?: boolean;
2406
+ /** Inherited from parent output target (loader-bundle or www). */
2407
+ hashedFileNameLength?: number;
2408
+ /** Inherited from loader-bundle. When true, @stencil/core is external in this bundler output. */
2409
+ externalRuntime?: boolean;
2410
+ }
2411
+ /**
2412
+ * Output target for global styles.
2413
+ * Generates a CSS file from an input stylesheet.
2414
+ *
2415
+ * Can be configured in two ways:
2416
+ * 1. **Implicit** (backwards compat): Set `globalStyle` in the config and this output is auto-generated
2417
+ * 2. **Explicit**: Define this output target with an `input` property
2418
+ *
2419
+ * Multiple `global-style` outputs are supported for building separate CSS bundles.
2420
+ *
2421
+ * @example
2422
+ * ```typescript
2423
+ * // Explicit configuration with custom input/output
2424
+ * {
2425
+ * type: 'global-style',
2426
+ * input: './src/theme.css',
2427
+ * fileName: 'theme.css',
2428
+ * dir: 'dist/assets',
2429
+ * copyToLoaderBrowser: false
2430
+ * }
2431
+ * ```
2432
+ */
2433
+ interface OutputTargetGlobalStyle extends OutputTargetBaseNext {
2434
+ type: 'global-style';
2435
+ /**
2436
+ * Path to the input CSS file to compile.
2437
+ * When specified, this takes precedence over the `globalStyle` config option.
2438
+ *
2439
+ * If neither `input` nor `globalStyle` config is set, no CSS will be built.
2440
+ */
2441
+ input?: string;
2442
+ /**
2443
+ * Output filename for the compiled CSS.
2444
+ * @default '{namespace}.css' when using globalStyle config, or basename of input file
2445
+ */
2446
+ fileName?: string;
2447
+ /**
2448
+ * When `true`, also copies the global style CSS to the loader-bundle browser directory
2449
+ * for backwards compatibility with existing CDN consumers who have hardcoded CSS paths.
2450
+ *
2451
+ * @default true
2452
+ */
2453
+ copyToLoaderBrowser?: boolean;
2454
+ /**
2455
+ * Controls whether this global stylesheet is injected into component shadow DOMs
2456
+ * as a constructable stylesheet at runtime.
2457
+ *
2458
+ * - `'none'`: Don't inject - stylesheet must be loaded externally (e.g., via `<link>`)
2459
+ * - `'client'`: Inject only in client builds, not SSR (reduces SSR output size)
2460
+ * - `'all'`: Inject in both client and SSR builds
2461
+ *
2462
+ * @default 'client' when the stylesheet comes from `globalStyle` (or an auto-detected `src/global.*`), 'none' when `input` is set
2463
+ */
2464
+ inject?: 'none' | 'client' | 'all';
2465
+ }
2466
+ /**
2467
+ * Output target for component assets.
2468
+ * Copies all component `assetsDirs` to a unified location.
2469
+ *
2470
+ * auto-generated when components have `assetsDirs` unless explicitly configured.
2471
+ * The output is placed in `dist/assets/` by default and is available to all distribution strategies.
2472
+ *
2473
+ * @example
2474
+ * ```typescript
2475
+ * {
2476
+ * type: 'assets',
2477
+ * dir: 'dist/assets'
2478
+ * }
2479
+ * ```
2480
+ */
2481
+ interface OutputTargetAssets extends OutputTargetBaseNext {
2482
+ type: 'assets';
2483
+ }
2484
+ /**
2485
+ * Output target for server-side rendering (SSR) and hydration.
2486
+ * Generates a script that can be used for SSR and static site generation (prerendering).
2487
+ *
2488
+ * Formerly known as 'dist-hydrate-script' in v4.
2489
+ *
2490
+ * @example
2491
+ * ```typescript
2492
+ * {
2493
+ * type: 'ssr',
2494
+ * dir: 'dist/ssr',
2495
+ * minify: true
2496
+ * }
2497
+ * ```
2498
+ */
2499
+ interface OutputTargetSsr extends OutputTargetBase {
2500
+ type: 'ssr';
2501
+ dir?: string;
2502
+ /**
2503
+ * Module IDs that should not be bundled into the script.
2504
+ * By default, all node builtin's, such as `fs` or `path`
2505
+ * will be considered "external" and not bundled.
2506
+ */
2507
+ external?: string[];
2508
+ empty?: boolean;
2509
+ minify?: boolean;
2510
+ /**
2511
+ * Whether to generate CommonJS (CJS) bundles.
2512
+ *
2513
+ * When `true`, generates CJS output as `index.cjs` alongside ESM `index.js`.
2514
+ * When `false` (default in v5+), only ESM bundles are generated.
2515
+ *
2516
+ * @default false
2517
+ */
2518
+ cjs?: boolean;
2519
+ }
2520
+ /**
2521
+ * Compiles the SSR hydrate app to a WASM plugin (via `extism-js`/QuickJS-ng) that can run
2522
+ * outside of Node
2523
+ */
2524
+ interface OutputTargetSsrWasm extends OutputTargetBase {
2525
+ type: 'ssr-wasm';
2526
+ /** Output directory. @default 'dist/ssr-wasm' */
2527
+ dir?: string;
2528
+ empty?: boolean;
2529
+ minify?: boolean;
2530
+ }
2531
+ interface OutputTargetCustom extends OutputTargetBase {
2532
+ type: 'custom';
2533
+ name: string;
2534
+ /**
2535
+ * Indicate when the output target should be executed.
2536
+ *
2537
+ * - `"onBuildOnly"`: Executed only when `stencil build` is called without `--watch`.
2538
+ * - `"always"`: Executed on every build, including in `watch` mode.
2539
+ *
2540
+ * Defaults to "always".
2541
+ */
2542
+ taskShouldRun?: 'onBuildOnly' | 'always';
2543
+ validate?: (config: Config, diagnostics: Diagnostic[]) => void;
2544
+ generator: (config: Config, compilerCtx: CompilerCtx, buildCtx: BuildCtx, docs: JsonDocs) => Promise<void>;
2545
+ copy?: CopyTask[];
2546
+ }
2547
+ /**
2548
+ * Output target for generating [custom data](https://github.com/microsoft/vscode-custom-data) for VS Code as a JSON
2549
+ * file.
2550
+ */
2551
+ interface OutputTargetDocsVscode extends OutputTargetBase {
2552
+ /**
2553
+ * Designates this output target to be used for generating VS Code custom data.
2554
+ * @see OutputTargetBase#type
2555
+ */
2556
+ type: 'docs-vscode';
2557
+ /**
2558
+ * The location on disk to write the JSON file.
2559
+ */
2560
+ file: string;
2561
+ /**
2562
+ * A base URL to find the source code of the component(s) described in the JSON file.
2563
+ */
2564
+ sourceCodeBaseUrl?: string;
2565
+ }
2566
+ interface OutputTargetDocsReadme extends OutputTargetBase {
2567
+ type: 'docs-readme';
2568
+ /**
2569
+ * The root directory where README files should be written
2570
+ *
2571
+ * defaults to {@link Config.srcDir}
2572
+ */
2573
+ dir?: string;
2574
+ dependencies?: boolean;
2575
+ /**
2576
+ * Controls how READMEs are written to the destination directory.
2577
+ *
2578
+ * - `true`: Always overwrite the destination README with the full content.
2579
+ * - `false` (default): Only update the autogenerated content, preserving existing custom content above it.
2580
+ * - `'if-missing'`: Write the full README only if no file exists at the destination.
2581
+ *
2582
+ * This option enables workflows requiring consistent, idempotent output across builds,
2583
+ * and supports setups where custom documentation may need to coexist or vary between environments.
2584
+ */
2585
+ overwriteExisting?: boolean | 'if-missing';
2586
+ footer?: string;
2587
+ strict?: boolean;
2588
+ /**
2589
+ * Add extra columns to the generated Properties/Events tables, e.g. to
2590
+ * surface custom JSDoc tags as a column of their own.
2591
+ */
2592
+ customColumns?: {
2593
+ props?: DocsReadmeCustomColumn<JsonDocsProp>[];
2594
+ events?: DocsReadmeCustomColumn<JsonDocsEvent>[];
2595
+ };
2596
+ }
2597
+ /**
2598
+ * A custom column to render in a `docs-readme` Properties/Events table.
2599
+ * `content` is invoked once per row.
2600
+ */
2601
+ interface DocsReadmeCustomColumn<T> {
2602
+ header: string;
2603
+ content: (member: T, cmp: JsonDocsComponent) => string;
2604
+ }
2605
+ interface OutputTargetDocsJson extends OutputTargetBase {
2606
+ type: 'docs-json';
2607
+ file: string;
2608
+ /**
2609
+ * Set an optional file path where Stencil should write a `d.ts` file to disk
2610
+ * at build-time containing type declarations for {@link JsonDocs} and related
2611
+ * interfaces. If this is omitted or set to `null` Stencil will not write such
2612
+ * a file.
2613
+ */
2614
+ typesFile?: string | null;
2615
+ strict?: boolean;
2616
+ /**
2617
+ * An optional file path pointing to a public type library which should be
2618
+ * included and documented in the same way as other types which are included
2619
+ * in this output target.
2620
+ *
2621
+ * This could be useful if, for instance, there are some important interfaces
2622
+ * used in a few places in a Stencil project which don't form part of the
2623
+ * public API for any of the project's components. Such interfaces will not
2624
+ * be included in the `docs-json` output by default, but if they're declared
2625
+ * and exported from a 'supplemental' file designated with this property then
2626
+ * they'll be included in the output, facilitating their documentation.
2627
+ */
2628
+ supplementalPublicTypes?: string;
2629
+ }
2630
+ interface OutputTargetDocsCustomElementsManifest extends OutputTargetBase {
2631
+ type: 'docs-custom-elements-manifest';
2632
+ /**
2633
+ * The file path where the custom-elements.json manifest will be written.
2634
+ * Defaults to 'dist/custom-elements.json'.
2635
+ *
2636
+ * The `customElements` field of the project's `package.json` is set to this path.
2637
+ */
2638
+ file?: string;
2639
+ strict?: boolean;
2640
+ }
2641
+ interface OutputTargetDocsCustom extends OutputTargetBase {
2642
+ type: 'docs-custom';
2643
+ generator: (docs: JsonDocs, config: Config) => void | Promise<void>;
2644
+ strict?: boolean;
2645
+ }
2646
+ /**
2647
+ * Output target for generating an [Agent Skill](https://agentskills.io)
2648
+ * (`SKILL.md` + per-component reference files) describing a component
2649
+ * library, so AI coding agents can consume its API and usage examples
2650
+ * directly.
2651
+ */
2652
+ interface OutputTargetDocsAgentSkill extends OutputTargetBase {
2653
+ type: 'docs-agent-skill';
2654
+ /**
2655
+ * The root directory where the skill (`SKILL.md` + `components/*.md`) is written.
2656
+ *
2657
+ * defaults to `dist/skill`
2658
+ */
2659
+ dir?: string;
2660
+ /**
2661
+ * The skill's name, used in the `SKILL.md` frontmatter.
2662
+ *
2663
+ * Defaults to {@link Config.namespace}, lowercased, with anything other than letters and numbers replaced by `-`.
2664
+ */
2665
+ name?: string;
2666
+ /**
2667
+ * The skill's description, used in the `SKILL.md` frontmatter - this is the
2668
+ * text agents use to decide when to load the skill.
2669
+ *
2670
+ * Defaults to an auto-generated sentence built from the project's
2671
+ * {@link JsonDocs.usage} (if present) or its component tags.
2672
+ */
2673
+ description?: string;
2674
+ }
2675
+ interface OutputTargetStats extends OutputTargetBase {
2676
+ type: 'stats';
2677
+ file?: string;
2678
+ }
2679
+ interface OutputTargetBaseNext extends OutputTargetBase {
2680
+ dir?: string;
2681
+ }
2682
+ /**
2683
+ * The collection of valid export behaviors.
2684
+ * Used to generate a type for typed configs as well as output target validation
2685
+ * for the `standalone` output target.
2686
+ *
2687
+ * Adding a value to this const array will automatically add it as a valid option on the
2688
+ * output target configuration for `customElementsExportBehavior`.
2689
+ *
2690
+ * - `default`: No additional export or definition behavior will happen.
2691
+ * - `auto-define-custom-elements`: Enables the auto-definition of a component and its children (recursively) in the custom elements registry. This
2692
+ * functionality allows consumers to bypass the explicit call to define a component, its children, its children's
2693
+ * children, etc. Users of this flag should be aware that enabling this functionality may increase bundle size.
2694
+ * - `bundle`: A `defineCustomElements` function will be exported from the distribution directory.
2695
+ * - `single-export-module`: All components will be re-exported from the specified directory's root `index.js` file.
2696
+ */
2697
+ declare const CustomElementsExportBehaviorOptions: readonly ["default", "auto-define-custom-elements", "bundle", "single-export-module"];
2698
+ /**
2699
+ * This type is auto-generated based on the values in `CustomElementsExportBehaviorOptions` array.
2700
+ * This is used on the output target config for intellisense in typed configs.
2701
+ */
2702
+ type CustomElementsExportBehavior = (typeof CustomElementsExportBehaviorOptions)[number];
2703
+ /**
2704
+ * Output target for generating standalone component modules.
2705
+ * Each component is output as an individual ES module that can be directly imported.
2706
+ *
2707
+ * This output target is ideal for npm consumption and tree-shaking, as consumers
2708
+ * can import only the components they need.
2709
+ *
2710
+ * Formerly known as 'dist-custom-elements' in v4.
2711
+ *
2712
+ * @example
2713
+ * ```typescript
2714
+ * {
2715
+ * type: 'standalone',
2716
+ * dir: 'dist/standalone',
2717
+ * externalRuntime: true,
2718
+ * autoLoader: true
2719
+ * }
2720
+ * ```
2721
+ */
2722
+ interface OutputTargetStandalone extends OutputTargetBaseNext {
2723
+ type: 'standalone';
2724
+ empty?: boolean;
2725
+ /**
2726
+ * When `true`, all `@stencil/core/*` module references are treated as external
2727
+ * during bundling rather than being included in the generated output.
2728
+ *
2729
+ * @default false
2730
+ */
2731
+ externalRuntime?: boolean;
2732
+ copy?: CopyTask[];
2733
+ includeGlobalScripts?: boolean;
2734
+ minify?: boolean;
2735
+ /**
2736
+ * Define the export/definition behavior for the output target's generated output.
2737
+ * This controls if/how custom elements will be defined or where components will be exported from.
2738
+ * If omitted, no auto-definition behavior or re-exporting will happen.
2739
+ */
2740
+ customElementsExportBehavior?: CustomElementsExportBehavior;
2741
+ /**
2742
+ * Generate an auto-loader script that uses MutationObserver to lazily load
2743
+ * and define custom elements as they appear in the DOM.
2744
+ *
2745
+ * @default true
2746
+ *
2747
+ * When set to `true`, generates a `loader.js` file that auto-starts on import.
2748
+ * Can also be configured with an object for more control:
2749
+ * - `fileName`: Custom filename for the loader (default: 'loader.js')
2750
+ * - `autoStart`: Whether to auto-start the loader on import (default: true)
2751
+ *
2752
+ * @example
2753
+ * ```typescript
2754
+ * // Simple usage
2755
+ * autoLoader: true
2756
+ *
2757
+ * // With options
2758
+ * autoLoader: {
2759
+ * fileName: 'my-loader.js',
2760
+ * autoStart: false
2761
+ * }
2762
+ * ```
2763
+ */
2764
+ autoLoader?: boolean | {
2765
+ /**
2766
+ * Custom filename for the generated loader script.
2767
+ * @default 'loader.js'
2768
+ */
2769
+ fileName?: string;
2770
+ /**
2771
+ * Whether to automatically start the loader when the script is imported.
2772
+ * If false, you must call `start()` manually.
2773
+ * @default true
2774
+ */
2775
+ autoStart?: boolean;
2776
+ };
2777
+ }
2778
+ /**
2779
+ * The base type for output targets. All output targets should extend this base type.
2780
+ */
2781
+ interface OutputTargetBase {
2782
+ /**
2783
+ * A unique string to differentiate one output target from another
2784
+ */
2785
+ type: string;
2786
+ /**
2787
+ * When `true`, this output target will be skipped during development builds (`--dev`).
2788
+ * This improves dev build times by not generating production-only artifacts.
2789
+ *
2790
+ * Defaults vary by output target type:
2791
+ * - `loader-bundle`: `true` (skips the npm distribution files; the browser bundle always builds)
2792
+ * - `standalone`: `true` if `loader-bundle` is also configured, otherwise `false`
2793
+ * - `types`, `collection`, `ssr-wasm`: `true` (skips in dev)
2794
+ * - `assets`, `global-style`: `false` (always runs)
2795
+ * - `ssr`: `true` (skips in dev, unless `devServer.ssr` is enabled)
2796
+ * - `docs-*`: `true` (skips in dev)
2797
+ * - `custom`: `true` (skips in dev)
2798
+ * - `www`, `copy`, `stats`: `false` (always runs)
2799
+ */
2800
+ skipInDev?: boolean;
2801
+ }
2802
+ interface OutputTargetCopy extends OutputTargetBase {
2803
+ type: 'copy';
2804
+ dir: string;
2805
+ copy?: CopyTask[];
2806
+ }
2807
+ interface OutputTargetWww extends OutputTargetBase {
2808
+ /**
2809
+ * Webapp output target.
2810
+ */
2811
+ type: 'www';
2812
+ /**
2813
+ * Choose how components are bundled for the www output.
2814
+ *
2815
+ * - `'loader'` (default): Uses the loader-bundle architecture with chunk
2816
+ * splitting and a loader infrastructure. Best for production apps with many
2817
+ * components where you want optimal loading performance.
2818
+ *
2819
+ * - `'standalone'`: Uses standalone component modules with an auto-loader that
2820
+ * uses MutationObserver to dynamically import components as they appear in
2821
+ * the DOM. Simpler architecture, easier debugging, one module per component.
2822
+ *
2823
+ * Default: `'loader'`
2824
+ */
2825
+ bundleMode?: 'loader' | 'standalone';
2826
+ /**
2827
+ * The directory to write the app's JavaScript and CSS build
2828
+ * files to. The default is to place this directory as a child
2829
+ * to the `dir` config. Default: `build`
2830
+ */
2831
+ buildDir?: string;
2832
+ /**
2833
+ * The directory to write the entire application to.
2834
+ * Note, the `buildDir` is where the app's JavaScript and CSS build
2835
+ * files are written. Default: `www`
2836
+ */
2837
+ dir?: string;
2838
+ /**
2839
+ * Empty the build directory of all files and directories on first build.
2840
+ * Default: `true`
2841
+ */
2842
+ empty?: boolean;
2843
+ /**
2844
+ * The default index html file of the app, commonly found at the
2845
+ * root of the `src` directory.
2846
+ * Default: `index.html`
2847
+ */
2848
+ indexHtml?: string;
2849
+ /**
2850
+ * The copy config is an array of objects that defines any files or folders that should
2851
+ * be copied over to the build directory.
2852
+ *
2853
+ * Each object in the array must include a src property which can be either an absolute path,
2854
+ * a relative path or a glob pattern. The config can also provide an optional dest property
2855
+ * which can be either an absolute path or a path relative to the build directory.
2856
+ * Also note that any files within src/assets are automatically copied to www/assets for convenience.
2857
+ *
2858
+ * In the copy config below, it will copy the entire directory from src/docs-content over to www/docs-content.
2859
+ */
2860
+ copy?: CopyTask[];
2861
+ /**
2862
+ * The base url of the app, it's required during prerendering to be the absolute path
2863
+ * of your app, such as: `https://my.app.com/app`.
2864
+ *
2865
+ * Default: `/`
2866
+ */
2867
+ baseUrl?: string;
2868
+ /**
2869
+ * Path to an external node module which has exports of the prerender config object.
2870
+ * ```
2871
+ * module.exports = {
2872
+ * afterSsr(document, url) {
2873
+ * document.title = `URL: ${url.href}`;
2874
+ * }
2875
+ * }
2876
+ * ```
2877
+ */
2878
+ prerenderConfig?: string;
2879
+ /**
2880
+ * Service worker config for production builds. In development mode, a script
2881
+ * to deregister existing service workers is always injected. Defaults to
2882
+ * `null` (disabled). Set to `true` to enable with default settings, or provide
2883
+ * a config object for custom settings.
2884
+ */
2885
+ serviceWorker?: ServiceWorkerConfig | true | null;
2886
+ appDir?: string;
2887
+ /**
2888
+ * Hash the filenames of generated chunks based on their content.
2889
+ * Enables forever-caching of CDN-served bundles.
2890
+ *
2891
+ * @default true in production, false in dev mode
2892
+ */
2893
+ hashFileNames?: boolean;
2894
+ /**
2895
+ * Number of characters to use for the content hash in filenames.
2896
+ *
2897
+ * @default 8
2898
+ */
2899
+ hashedFileNameLength?: number;
2900
+ }
2901
+ type OutputTarget = OutputTargetCopy | OutputTargetCustom | OutputTargetLoaderBundle | OutputTargetStandalone | OutputTargetSsr | OutputTargetSsrWasm | OutputTargetCollection | OutputTargetTypes | OutputTargetGlobalStyle | OutputTargetAssets | OutputTargetDistLazy | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetDocsCustomElementsManifest | OutputTargetDocsAgentSkill | OutputTargetWww | OutputTargetStats;
2902
+ /**
2903
+ * Our custom configuration interface for generated caching Service Workers
2904
+ * using the Workbox library (see https://developer.chrome.com/docs/workbox/).
2905
+ *
2906
+ * Although we are using Workbox we are unfortunately unable to depend on the
2907
+ * published types for the library because they must be compiled using the
2908
+ * `webworker` lib for TypeScript, which cannot be used at the same time as
2909
+ * the `dom` lib. So as a workaround we maintain our own interface here. See
2910
+ * here to refer to the published version:
2911
+ * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/c7b4dadae5b320ad1311a8f82242b8f2f41b7b8c/types/workbox-build/generate-sw.d.ts#L3
2912
+ */
2913
+ interface ServiceWorkerConfig {
2914
+ unregister?: boolean;
2915
+ swDest?: string;
2916
+ swSrc?: string;
2917
+ globPatterns?: string[];
2918
+ globDirectory?: string | string[];
2919
+ globIgnores?: string | string[];
2920
+ templatedUrls?: any;
2921
+ maximumFileSizeToCacheInBytes?: number;
2922
+ manifestTransforms?: any;
2923
+ modifyUrlPrefix?: any;
2924
+ dontCacheBustURLsMatching?: RegExp;
2925
+ navigateFallback?: string;
2926
+ navigateFallbackWhitelist?: RegExp[];
2927
+ navigateFallbackBlacklist?: RegExp[];
2928
+ cacheId?: string;
2929
+ skipWaiting?: boolean;
2930
+ clientsClaim?: boolean;
2931
+ directoryIndex?: string;
2932
+ runtimeCaching?: any[];
2933
+ ignoreUrlParametersMatching?: any[];
2934
+ handleFetch?: boolean;
2935
+ }
2936
+ interface LoadConfigInit {
2937
+ /**
2938
+ * User config object to merge into default config and
2939
+ * config loaded from a file path.
2940
+ */
2941
+ config?: UnvalidatedConfig;
2942
+ /**
2943
+ * Absolute path to a Stencil config file. This path cannot be
2944
+ * relative and it does not resolve config files within a directory.
2945
+ */
2946
+ configPath?: string;
2947
+ logger?: Logger;
2948
+ sys?: CompilerSystem;
2949
+ }
2950
+ interface Diagnostic {
2951
+ absFilePath?: string | undefined;
2952
+ code?: string;
2953
+ columnNumber?: number | undefined;
2954
+ debugText?: string;
2955
+ header?: string;
2956
+ language?: string;
2957
+ level: 'error' | 'warn' | 'info' | 'log' | 'debug';
2958
+ lineNumber?: number | undefined;
2959
+ lines: PrintLine[];
2960
+ messageText: string;
2961
+ relFilePath?: string | undefined;
2962
+ type: string;
2963
+ }
2964
+ /**
2965
+ * Input for CSS optimization functions, including the input CSS
2966
+ * string and a few boolean options which turn on or off various
2967
+ * optimizations.
2968
+ */
2969
+ interface OptimizeCssInput {
2970
+ input: string;
2971
+ filePath?: string;
2972
+ autoprefixer?: boolean | null | AutoprefixerOptions;
2973
+ minify?: boolean;
2974
+ sourceMap?: boolean;
2975
+ resolveUrl?: (url: string) => Promise<string> | string;
2976
+ }
2977
+ /**
2978
+ * Options for autoprefixing CSS via Lightning CSS.
2979
+ *
2980
+ * The `targets` field accepts a browserslist query array. When omitted,
2981
+ * Stencil uses a modern default browser list suitable for Stencil v5+.
2982
+ *
2983
+ * @example
2984
+ * ```ts
2985
+ * autoprefixer: {
2986
+ * targets: ['last 2 Chrome versions', 'last 2 Safari versions', 'iOS >= 14'],
2987
+ * }
2988
+ * ```
2989
+ */
2990
+ interface AutoprefixerOptions {
2991
+ /**
2992
+ * A browserslist query array describing which browsers to generate vendor
2993
+ * prefixes for. Defaults to a modern set of browsers appropriate for
2994
+ * Stencil v5+.
2995
+ */
2996
+ targets?: string[];
2997
+ }
2998
+ /**
2999
+ * Output from CSS optimization functions, wrapping up optimized
3000
+ * CSS and any diagnostics produced during optimization.
3001
+ */
3002
+ interface OptimizeCssOutput {
3003
+ output: string;
3004
+ diagnostics: Diagnostic[];
3005
+ }
3006
+ interface LazyRequire {
3007
+ ensure(fromDir: string, moduleIds: string[]): Promise<Diagnostic[]>;
3008
+ require(fromDir: string, moduleId: string): any;
3009
+ getModulePath(fromDir: string, moduleId: string): string;
3010
+ }
3011
+ /**
3012
+ * A Stencil `resolveId`/`load`/`transform` plugin, as accepted by {@link StencilConfig.plugins}.
3013
+ */
3014
+ interface Plugin$1 {
3015
+ name?: string;
3016
+ pluginType?: string;
3017
+ load?: (id: string, context: PluginCtx) => Promise<string> | string;
3018
+ resolveId?: (importee: string, importer: string, context: PluginCtx) => Promise<string> | string;
3019
+ transform?: (sourceText: string, id: string, context: PluginCtx) => Promise<PluginTransformResults> | PluginTransformResults;
3020
+ }
3021
+ type PluginTransformResults = PluginTransformationDescriptor | string | null;
3022
+ interface PluginTransformationDescriptor {
3023
+ code?: string;
3024
+ map?: string;
3025
+ id?: string;
3026
+ diagnostics?: Diagnostic[];
3027
+ dependencies?: string[];
3028
+ }
3029
+ interface PluginCtx {
3030
+ config: Config;
3031
+ sys: CompilerSystem;
3032
+ fs: InMemoryFileSystem;
3033
+ cache: Cache;
3034
+ diagnostics: Diagnostic[];
3035
+ }
3036
+ //#endregion
3037
+ //#region src/declarations/stencil-private.d.ts
3038
+ /** Build-time virtual `@import`s a `global-style` input can use to place Stencil-generated CSS. */
3039
+ type StencilVirtualImport = 'stencil-hydrate' | 'stencil-component-globals' | 'stencil-css-components';
3040
+ interface SourceMap$1 {
3041
+ file: string;
3042
+ mappings: string;
3043
+ names: string[];
3044
+ sourceRoot?: string;
3045
+ sources: string[];
3046
+ sourcesContent?: (string | null)[];
3047
+ version: number;
3048
+ }
3049
+ interface PrintLine {
3050
+ lineIndex: number;
3051
+ lineNumber: number;
3052
+ text: string;
3053
+ errorCharStart: number;
3054
+ errorLength?: number;
3055
+ }
3056
+ interface BuildFeatures {
3057
+ style: boolean;
3058
+ mode: boolean;
3059
+ formAssociated: boolean;
3060
+ shadowDom: boolean;
3061
+ shadowDelegatesFocus: boolean;
3062
+ shadowModeClosed: boolean;
3063
+ shadowSlotAssignmentManual: boolean;
3064
+ shadowClonable: boolean;
3065
+ shadowSerializable: boolean;
3066
+ shadowReferenceTarget: boolean;
3067
+ scoped: boolean;
3068
+ /**
3069
+ * Every component has a render function
3070
+ */
3071
+ allRenderFn: boolean;
3072
+ /**
3073
+ * At least one component has a render function
3074
+ */
3075
+ hasRenderFn: boolean;
3076
+ vdomRender: boolean;
3077
+ vdomAttribute: boolean;
3078
+ vdomClass: boolean;
3079
+ vdomFunctional: boolean;
3080
+ vdomKey: boolean;
3081
+ vdomListener: boolean;
3082
+ vdomPropOrAttr: boolean;
3083
+ /** True when at least one component uses the explicit `attr:`/`prop:` JSX prefix. */
3084
+ vdomPropOrAttrPrefix: boolean;
3085
+ vdomRef: boolean;
3086
+ vdomStyle: boolean;
3087
+ vdomText: boolean;
3088
+ vdomXlink: boolean;
3089
+ vdomSignals: boolean;
3090
+ slotRelocation: boolean;
3091
+ patchAll: boolean;
3092
+ patchChildren: boolean;
3093
+ patchClone: boolean;
3094
+ patchInsert: boolean;
3095
+ slot: boolean;
3096
+ svg: boolean;
3097
+ element: boolean;
3098
+ event: boolean;
3099
+ hostListener: boolean;
3100
+ hostListenerTargetWindow: boolean;
3101
+ hostListenerTargetDocument: boolean;
3102
+ hostListenerTargetBody: boolean;
3103
+ hostListenerTarget: boolean;
3104
+ method: boolean;
3105
+ prop: boolean;
3106
+ propChangeCallback: boolean;
3107
+ propMutable: boolean;
3108
+ state: boolean;
3109
+ member: boolean;
3110
+ updatable: boolean;
3111
+ propBoolean: boolean;
3112
+ propNumber: boolean;
3113
+ propString: boolean;
3114
+ serializer: boolean;
3115
+ deserializer: boolean;
3116
+ lifecycle: boolean;
3117
+ asyncLoading: boolean;
3118
+ observeAttribute: boolean;
3119
+ reflect: boolean;
3120
+ taskQueue: boolean;
3121
+ }
3122
+ interface BuildConditionals extends Partial<BuildFeatures> {
3123
+ hotModuleReplacement?: boolean;
3124
+ isDebug?: boolean;
3125
+ isTesting?: boolean;
3126
+ isDev?: boolean;
3127
+ devTools?: boolean;
3128
+ invisiblePrehydration?: boolean;
3129
+ hydrateServerSide?: boolean;
3130
+ hydrateClientSide?: boolean;
3131
+ lifecycleDOMEvents?: boolean;
3132
+ cssAnnotations?: boolean;
3133
+ lazyLoad?: boolean;
3134
+ profile?: boolean;
3135
+ constructableCSS?: boolean;
3136
+ /** True when `compat.lightDomPatches === true` - enables `applyLightDomPatches` shortcut. */
3137
+ lightDomPatches?: boolean;
3138
+ /** Patch `childNodes`/`children` getters on light-dom slotted components. */
3139
+ slotChildNodes?: boolean;
3140
+ /** Patch `cloneNode()` on light-dom slotted components. */
3141
+ slotCloneNode?: boolean;
3142
+ /** Patch `appendChild`/`insertBefore`/`removeChild` on light-dom slotted components. */
3143
+ slotDomMutations?: boolean;
3144
+ /** Patch `textContent` on light-dom slotted components. */
3145
+ slotTextContent?: boolean;
3146
+ hydratedAttribute?: boolean;
3147
+ hydratedClass?: boolean;
3148
+ hydratedSelectorName?: string;
3149
+ /** True when a global-style input contains `@import "stencil-hydrate"` - suppresses dynamic style injection in the loader. */
3150
+ staticHydrationStyles?: boolean;
3151
+ initializeNextTick?: boolean;
3152
+ asyncQueue?: boolean;
3153
+ additionalTagTransformers?: boolean | 'prod';
3154
+ signalBacking?: boolean;
3155
+ /** True when JSX signal bypass is active - text nodes and attributes backed by Signal objects update the DOM directly. Auto-enabled when `signalBacking: true`. */
3156
+ vdomSignals?: boolean;
3157
+ }
3158
+ type ModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd' | 'commonjs' | 'esm' | 'module' | 'systemjs';
3159
+ interface RolldownResultModule {
3160
+ id: string;
3161
+ }
3162
+ interface RolldownResults {
3163
+ modules: RolldownResultModule[];
3164
+ }
3165
+ interface BuildCtx {
3166
+ buildId: number;
3167
+ buildResults: CompilerBuildResults;
3168
+ buildStats?: Result<CompilerBuildStats, {
3169
+ diagnostics: Diagnostic[];
3170
+ }>;
3171
+ buildMessages: string[];
3172
+ bundleBuildCount: number;
3173
+ collections: CollectionCompilerMeta[];
3174
+ compilerCtx: CompilerCtx;
3175
+ esmBrowserComponentBundle: ReadonlyArray<BundleModule>;
3176
+ esmComponentBundle: ReadonlyArray<BundleModule>;
3177
+ commonJsComponentBundle: ReadonlyArray<BundleModule>;
3178
+ components: ComponentCompilerMeta[];
3179
+ cssOnlyComponents: ComponentCompilerMeta[];
3180
+ componentGraph: Map<string, string[]>;
3181
+ config: ValidatedConfig;
3182
+ createTimeSpan(msg: string, debug?: boolean): LoggerTimeSpan;
3183
+ data: any;
3184
+ debug: (msg: string) => void;
3185
+ diagnostics: Diagnostic[];
3186
+ dirsAdded: string[];
3187
+ dirsDeleted: string[];
3188
+ entryModules: EntryModule[];
3189
+ filesAdded: string[];
3190
+ filesChanged: string[];
3191
+ filesDeleted: string[];
3192
+ filesUpdated: string[];
3193
+ filesWritten: string[];
3194
+ globalStyle: string | undefined;
3195
+ hasConfigChanges: boolean;
3196
+ hasError: boolean;
3197
+ hasFinished: boolean;
3198
+ hasHtmlChanges: boolean;
3199
+ hasPrintedResults: boolean;
3200
+ hasServiceWorkerChanges: boolean;
3201
+ hasScriptChanges: boolean;
3202
+ hasStyleChanges: boolean;
3203
+ hasWarning: boolean;
3204
+ ssrAppFilePath: string;
3205
+ indexBuildCount: number;
3206
+ indexDoc: Document;
3207
+ /** All non-entry HTML files found in srcDir, keyed by path relative to srcDir */
3208
+ htmlDocs: Map<string, Document>;
3209
+ isRebuild: boolean;
3210
+ /**
3211
+ * A collection of Stencil's intermediate representation of components, tied to the current build
3212
+ */
3213
+ moduleFiles: Module[];
3214
+ packageJson: PackageJsonData | null;
3215
+ pendingCopyTasks: Promise<CopyResults>[];
3216
+ progress(task: BuildTask): void;
3217
+ requiresFullBuild: boolean;
3218
+ rolldownResults?: RolldownResults;
3219
+ scriptsAdded: string[];
3220
+ scriptsDeleted: string[];
3221
+ startTime: number;
3222
+ styleBuildCount: number;
3223
+ /**
3224
+ * A promise that resolves to the global styles for the current build.
3225
+ */
3226
+ stylesPromise: Promise<string>;
3227
+ stylesUpdated: BuildStyleUpdate[];
3228
+ globalStylesUpdated: BuildGlobalStyleLinkUpdate[];
3229
+ /** Absolute path of the generated `{fsNamespace}.css`, when this build emitted one */
3230
+ stencilCssFile?: string;
3231
+ timeSpan: LoggerTimeSpan;
3232
+ timestamp: string;
3233
+ transpileBuildCount: number;
3234
+ validateTypesBuild?(): Promise<void>;
3235
+ validateTypesHandler?: (results: any) => Promise<void>;
3236
+ validateTypesPromise?: Promise<any>;
3237
+ }
3238
+ interface BuildStyleUpdate {
3239
+ styleTag: string;
3240
+ styleText: string;
3241
+ styleMode: string;
3242
+ }
3243
+ /**
3244
+ * A live-reload update for a `global-style` output target's CSS, matched on
3245
+ * the client by `fileName` against the `<link>`
3246
+ */
3247
+ interface BuildGlobalStyleLinkUpdate {
3248
+ fileName: string;
3249
+ styleText: string;
3250
+ }
3251
+ type BuildTask = any;
3252
+ interface CompilerBuildStats {
3253
+ timestamp: string;
3254
+ compiler: {
3255
+ name: string;
3256
+ version: string;
3257
+ };
3258
+ app: {
3259
+ namespace: string;
3260
+ fsNamespace: string;
3261
+ components: number;
3262
+ entries: number;
3263
+ bundles: number;
3264
+ outputs: any;
3265
+ };
3266
+ options: {
3267
+ minifyJs: boolean;
3268
+ minifyCss: boolean;
3269
+ };
3270
+ formats: {
3271
+ esmBrowser: ReadonlyArray<CompilerBuildStatBundle>;
3272
+ esm: ReadonlyArray<CompilerBuildStatBundle>;
3273
+ commonjs: ReadonlyArray<CompilerBuildStatBundle>;
3274
+ };
3275
+ components: BuildComponent[];
3276
+ entries: EntryModule[];
3277
+ rolldownResults: RolldownResults;
3278
+ sourceGraph?: BuildSourceGraph;
3279
+ componentGraph: BuildResultsComponentGraph;
3280
+ collections: CompilerBuildStatCollection[];
3281
+ }
3282
+ interface CompilerBuildStatCollection {
3283
+ name: string;
3284
+ source: string;
3285
+ tags: string[][];
3286
+ }
3287
+ interface CompilerBuildStatBundle {
3288
+ key: string;
3289
+ components: string[];
3290
+ bundleId: string;
3291
+ fileName: string;
3292
+ imports: string[];
3293
+ originalByteSize: number;
3294
+ }
3295
+ interface BuildSourceGraph {
3296
+ [filePath: string]: string[];
3297
+ }
3298
+ interface BuildComponent {
3299
+ tag: string;
3300
+ dependencyOf?: string[];
3301
+ dependencies?: string[];
3302
+ }
3303
+ interface RolldownChunkResult {
3304
+ type: 'chunk';
3305
+ entryKey: string;
3306
+ fileName: string;
3307
+ code: string;
3308
+ isEntry: boolean;
3309
+ isComponent: boolean;
3310
+ isCore: boolean;
3311
+ isIndex: boolean;
3312
+ isBrowserLoader: boolean;
3313
+ imports: string[];
3314
+ moduleFormat: ModuleFormat;
3315
+ map?: SourceMap;
3316
+ }
3317
+ interface BundleModule {
3318
+ entryKey: string;
3319
+ rolldownResult: RolldownChunkResult;
3320
+ cmps: ComponentCompilerMeta[];
3321
+ output: BundleModuleOutput;
3322
+ }
3323
+ interface BundleModuleOutput {
3324
+ bundleId: string;
3325
+ fileName: string;
3326
+ code: string;
3327
+ }
3328
+ interface Cache {
3329
+ get(key: string): Promise<string | null>;
3330
+ put(key: string, value: string): Promise<boolean>;
3331
+ has(key: string): Promise<boolean>;
3332
+ createKey(domain: string, ...args: any[]): Promise<string>;
3333
+ commit(): Promise<void>;
3334
+ clear(): void;
3335
+ clearDiskCache(): Promise<void>;
3336
+ getMemoryStats(): string;
3337
+ initCacheDir(): Promise<void>;
3338
+ }
3339
+ interface CollectionCompilerMeta {
3340
+ collectionName: string;
3341
+ moduleId?: string;
3342
+ moduleDir: string;
3343
+ moduleFiles: Module[];
3344
+ global?: Module;
3345
+ compiler?: CollectionCompilerVersion;
3346
+ isInitialized?: boolean;
3347
+ hasExports?: boolean;
3348
+ dependencies?: string[];
3349
+ bundles?: {
3350
+ components: string[];
3351
+ }[];
3352
+ buildFlags?: Partial<BuildConditionals>;
3353
+ }
3354
+ interface CollectionCompilerVersion {
3355
+ name: string;
3356
+ version: string;
3357
+ typescriptVersion?: string;
3358
+ }
3359
+ /**
3360
+ * A memoized result of the SASS + Lightning CSS transformation for a single stylesheet, keyed by
3361
+ * the annotated Rolldown import id (e.g. `/path/to/comp.scss?tag=ion-button&encapsulation=shadow`).
3362
+ *
3363
+ * Storing this allows all output targets (customElements, lazy, hydrate) that process the same
3364
+ * stylesheets to share a single computation instead of repeating it N times.
3365
+ */
3366
+ interface CssTransformCacheEntry {
3367
+ /** Resolved file ID after plugin (SASS) transforms */
3368
+ pluginTransformId: string;
3369
+ /** CSS source produced by the SASS / plugin pipeline */
3370
+ pluginTransformCode: string;
3371
+ /** File dependencies discovered during the SASS transform (e.g. `@import`-ed partials) */
3372
+ pluginTransformDependencies: string[];
3373
+ /** Diagnostics emitted during the plugin transform pass */
3374
+ pluginTransformDiagnostics: Diagnostic[];
3375
+ /** Full output of the subsequent `transformCssToEsm` call */
3376
+ cssTransformOutput: TransformCssToEsmOutput;
3377
+ }
3378
+ interface CompilerCtx {
3379
+ version: number;
3380
+ activeBuildId: number;
3381
+ activeDirsAdded: string[];
3382
+ activeDirsDeleted: string[];
3383
+ activeFilesAdded: string[];
3384
+ activeFilesDeleted: string[];
3385
+ activeFilesUpdated: string[];
3386
+ addWatchDir: (path: string, recursive: boolean) => void;
3387
+ addWatchFile: (path: string) => void;
3388
+ cache: Cache;
3389
+ cssModuleImports: Map<string, string[]>;
3390
+ /** Cache of built global styles, keyed by input file path */
3391
+ globalStyleCache: Map<string, string>;
3392
+ /** Cache of discovered CSS-only components from the last scan, keyed by absolute .css file path */
3393
+ cssOnlyComponentsCache: Map<string, ComponentCompilerMeta[]>;
3394
+ /** Contents of the last auto-placed `stencil-*` CSS, used to detect changes for HMR */
3395
+ stencilCss?: string;
3396
+ /** Virtual imports found in each built global style (post-preprocessing), keyed by input path */
3397
+ globalStyleVirtualImports: Map<string, Set<StencilVirtualImport>>;
3398
+ collections: CollectionCompilerMeta[];
3399
+ compilerOptions: any;
3400
+ events: BuildEvents;
3401
+ fs: InMemoryFileSystem;
3402
+ hasSuccessfulBuild: boolean;
3403
+ isActivelyBuilding: boolean;
3404
+ lastBuildResults: CompilerBuildResults;
3405
+ /**
3406
+ * A mapping of a file path to a Stencil {@link Module}
3407
+ */
3408
+ moduleMap: ModuleMap;
3409
+ nodeMap: NodeMap;
3410
+ resolvedCollections: Set<string>;
3411
+ rolldownCacheSsr: any;
3412
+ rolldownCacheLazy: any;
3413
+ rolldownCacheNative: any;
3414
+ styleModeNames: Set<string>;
3415
+ changedModules: Set<string>;
3416
+ changedFiles: Set<string>;
3417
+ worker?: CompilerWorkerContext;
3418
+ rolldownCache: Map<string, any>;
3419
+ /**
3420
+ * Cross-build cache for {@link ts.transpileModule} results.
3421
+ * Keyed by `"${bundleId}:${normalizedFilePath}"`. Invalidated for any
3422
+ * file that appears in {@link changedModules} after TypeScript re-emits.
3423
+ * @see transpileCache in compiler-ctx.ts
3424
+ */
3425
+ transpileCache: Map<string, {
3426
+ outputText: string;
3427
+ sourceMapText: string | null;
3428
+ }>;
3429
+ /**
3430
+ * Cross-build cache of the last style text pushed to the HMR client.
3431
+ * Keyed by getScopeId result (e.g. "ion-accordion$ios"). Used by
3432
+ * extTransformsPlugin to avoid re-pushing unchanged styles on every rebuild.
3433
+ */
3434
+ prevStylesMap: Map<string, string>;
3435
+ /**
3436
+ * Cross-output-target cache for the SASS + Lightning CSS computation.
3437
+ * Keyed by the annotated Rolldown import id. Null entries indicate that the
3438
+ * source file could not be read (propagated as a `null` return from the
3439
+ * transform hook).
3440
+ *
3441
+ * Entries are invalidated in `invalidateRolldownCaches` whenever a
3442
+ * source file or one of its SASS dependencies is modified.
3443
+ */
3444
+ cssTransformCache: Map<string, CssTransformCacheEntry | null>;
3445
+ reset(): void;
3446
+ }
3447
+ type NodeMap = WeakMap<any, ComponentCompilerMeta>;
3448
+ /**
3449
+ * Record, for a specific component, whether or not it has various features
3450
+ * which need to be handled correctly in the compilation pipeline.
3451
+ *
3452
+ * Note: this must be serializable to JSON.
3453
+ */
3454
+ interface ComponentCompilerFeatures {
3455
+ hasAttribute: boolean;
3456
+ hasAttributeChangedCallbackFn: boolean;
3457
+ hasComponentWillLoadFn: boolean;
3458
+ hasComponentDidLoadFn: boolean;
3459
+ hasComponentShouldUpdateFn: boolean;
3460
+ hasComponentWillUpdateFn: boolean;
3461
+ hasComponentDidUpdateFn: boolean;
3462
+ hasComponentWillRenderFn: boolean;
3463
+ hasComponentDidRenderFn: boolean;
3464
+ hasConnectedCallbackFn: boolean;
3465
+ hasDeserializer: boolean;
3466
+ hasDisconnectedCallbackFn: boolean;
3467
+ hasElement: boolean;
3468
+ hasEvent: boolean;
3469
+ hasLifecycle: boolean;
3470
+ hasListener: boolean;
3471
+ hasListenerTarget: boolean;
3472
+ hasListenerTargetWindow: boolean;
3473
+ hasListenerTargetDocument: boolean;
3474
+ hasListenerTargetBody: boolean;
3475
+ hasMember: boolean;
3476
+ hasMethod: boolean;
3477
+ hasMode: boolean;
3478
+ hasModernPropertyDecls: boolean;
3479
+ hasPatchAll: boolean;
3480
+ hasPatchChildren: boolean;
3481
+ hasPatchClone: boolean;
3482
+ hasPatchInsert: boolean;
3483
+ hasProp: boolean;
3484
+ hasPropBoolean: boolean;
3485
+ hasPropNumber: boolean;
3486
+ hasPropString: boolean;
3487
+ hasPropMutable: boolean;
3488
+ hasReflect: boolean;
3489
+ hasRenderFn: boolean;
3490
+ hasSerializer: boolean;
3491
+ hasSlot: boolean;
3492
+ hasState: boolean;
3493
+ hasStyle: boolean;
3494
+ hasVdomAttribute: boolean;
3495
+ hasVdomClass: boolean;
3496
+ hasVdomFunctional: boolean;
3497
+ hasVdomKey: boolean;
3498
+ hasVdomListener: boolean;
3499
+ hasVdomPropOrAttr: boolean;
3500
+ hasVdomPropOrAttrPrefix: boolean;
3501
+ hasVdomRef: boolean;
3502
+ hasVdomRender: boolean;
3503
+ hasVdomStyle: boolean;
3504
+ hasVdomText: boolean;
3505
+ hasVdomXlink: boolean;
3506
+ hasSignalsImport: boolean;
3507
+ hasWatchCallback: boolean;
3508
+ htmlAttrNames: string[];
3509
+ htmlTagNames: string[];
3510
+ htmlParts: string[];
3511
+ htmlSlots: string[];
3512
+ isUpdateable: boolean;
3513
+ /**
3514
+ * A plain component is one that doesn't have:
3515
+ * - any members decorated with `@Prop()`, `@State()`, `@Element()`, `@Method()`
3516
+ * - any methods decorated with `@Listen()`
3517
+ * - any styles
3518
+ * - any lifecycle methods, including `render()`
3519
+ */
3520
+ isPlain: boolean;
3521
+ /**
3522
+ * A collection of tag names of web components that a component references in its JSX/h() function
3523
+ */
3524
+ potentialCmpRefs: string[];
3525
+ }
3526
+ /**
3527
+ * Metadata about a given component
3528
+ *
3529
+ * Note: must be serializable to JSON!
3530
+ */
3531
+ interface ComponentCompilerMeta extends ComponentCompilerFeatures {
3532
+ assetsDirs: CompilerAssetDir[];
3533
+ /**
3534
+ * The name to which an `ElementInternals` object (the return value of
3535
+ * `HTMLElement.attachInternals`) should be attached at runtime. If this is
3536
+ * `null` then `attachInternals` should not be called.
3537
+ */
3538
+ attachInternalsMemberName: string | null;
3539
+ /**
3540
+ * Custom states to initialize on the ElementInternals.states CustomStateSet.
3541
+ * These are defined via @AttachInternals({ states: {...} }).
3542
+ */
3543
+ attachInternalsCustomStates: JsonDocsCustomState[];
3544
+ componentClassName: string;
3545
+ /**
3546
+ * A list of web component tag names that are either:
3547
+ * - directly referenced in a Stencil component's JSX/h() function
3548
+ * - are referenced by a web component that is directly referenced in a Stencil component's JSX/h() function
3549
+ */
3550
+ dependencies: string[];
3551
+ /**
3552
+ * A list of web component tag names that either:
3553
+ * - directly reference the current component directly in their JSX/h() function
3554
+ * - indirectly/transitively reference the current component directly in their JSX/h() function
3555
+ */
3556
+ dependents: string[];
3557
+ deserializers: ComponentCompilerChangeHandler[];
3558
+ /**
3559
+ * A list of web component tag names that are directly referenced in a Stencil component's JSX/h() function
3560
+ */
3561
+ directDependencies: string[];
3562
+ /**
3563
+ * A list of web component tag names that the current component directly in their JSX/h() function
3564
+ */
3565
+ directDependents: string[];
3566
+ docs: CompilerJsDoc;
3567
+ doesExtend: boolean;
3568
+ elementRef: string;
3569
+ encapsulation: Encapsulation;
3570
+ events: ComponentCompilerEvent[];
3571
+ excludeFromCollection: boolean;
3572
+ /**
3573
+ * Whether or not the component is form-associated
3574
+ */
3575
+ formAssociated: boolean;
3576
+ internal: boolean;
3577
+ isCollectionDependency: boolean;
3578
+ jsFilePath: string;
3579
+ listeners: ComponentCompilerListener[];
3580
+ methods: ComponentCompilerMethod[];
3581
+ properties: ComponentCompilerProperty[];
3582
+ serializers: ComponentCompilerChangeHandler[];
3583
+ shadowDelegatesFocus: boolean;
3584
+ /**
3585
+ * Whether the shadow root is preserved when the host element is deep-cloned via
3586
+ * `Node.cloneNode(true)`. Only applicable when encapsulation is 'shadow'.
3587
+ */
3588
+ shadowClonable: boolean;
3589
+ /**
3590
+ * Whether the shadow root is marked serializable for `Element.getHTML({ serializableShadowRoots: true })`.
3591
+ * Only applicable when encapsulation is 'shadow'.
3592
+ */
3593
+ shadowSerializable: boolean;
3594
+ /**
3595
+ * Shadow DOM mode. 'open' (default) or 'closed'.
3596
+ * Only applicable when encapsulation is 'shadow'.
3597
+ */
3598
+ shadowMode: 'open' | 'closed' | null;
3599
+ /**
3600
+ * Slot assignment mode for shadow DOM. 'manual', enables imperative slotting
3601
+ * using HTMLSlotElement.assign(). Only applicable when encapsulation is 'shadow'.
3602
+ */
3603
+ slotAssignment: 'manual' | null;
3604
+ /**
3605
+ * `id` of the element within the shadow root that IDREFs targeting the host resolve to.
3606
+ * Only applicable when encapsulation is 'shadow'.
3607
+ */
3608
+ shadowReferenceTarget: string | null;
3609
+ /**
3610
+ * Per-component slot patches for non-shadow DOM components.
3611
+ * These patches enable proper slot behavior without native Shadow DOM.
3612
+ * Only applicable when encapsulation is 'none' or 'scoped'.
3613
+ */
3614
+ patches: ComponentPatches | null;
3615
+ sourceFilePath: string;
3616
+ sourceMapPath: string;
3617
+ states: ComponentCompilerState[];
3618
+ styleDocs: StyleDoc[];
3619
+ styles: StyleCompiler[];
3620
+ globalStyles: ComponentGlobalStyle[];
3621
+ tagName: string;
3622
+ virtualProperties: ComponentCompilerVirtualProperty[];
3623
+ watchers: ComponentCompilerChangeHandler[];
3624
+ }
3625
+ /**
3626
+ * The supported style encapsulation modes on a Stencil component:
3627
+ * 1. 'shadow' - native Shadow DOM
3628
+ * 2. 'scoped' - encapsulated styles and polyfilled slots
3629
+ * 3. 'none' - a basic HTML element
3630
+ */
3631
+ type Encapsulation = 'shadow' | 'scoped' | 'none';
3632
+ /**
3633
+ * Per-component slot patches for non-shadow DOM components.
3634
+ * These enable proper slot behavior when not using native Shadow DOM.
3635
+ */
3636
+ interface ComponentPatches {
3637
+ /** Apply all slot patches (equivalent to lightDomPatches) */
3638
+ all?: boolean;
3639
+ /** Patch child node accessors (children, firstChild, lastChild, etc.) */
3640
+ children?: boolean;
3641
+ /** Patch cloneNode() to handle slotted content */
3642
+ clone?: boolean;
3643
+ /** Patch appendChild(), insertBefore(), etc. for slot relocation */
3644
+ insert?: boolean;
3645
+ }
3646
+ /**
3647
+ * Intermediate Representation (IR) of a static property on a Stencil component
3648
+ */
3649
+ interface ComponentCompilerStaticProperty {
3650
+ mutable: boolean;
3651
+ optional: boolean;
3652
+ required: boolean;
3653
+ type: ComponentCompilerPropertyType;
3654
+ complexType: ComponentCompilerPropertyComplexType;
3655
+ attribute?: string;
3656
+ reflect?: boolean;
3657
+ docs: CompilerJsDoc;
3658
+ defaultValue?: string;
3659
+ getter: boolean;
3660
+ setter: boolean;
3661
+ ogPropName?: string;
3662
+ }
3663
+ /**
3664
+ * Intermediate Representation (IR) of a property on a Stencil component
3665
+ */
3666
+ interface ComponentCompilerProperty extends ComponentCompilerStaticProperty {
3667
+ name: string;
3668
+ internal: boolean;
3669
+ }
3670
+ interface ComponentCompilerVirtualProperty {
3671
+ name: string;
3672
+ type: string;
3673
+ docs: string;
3674
+ }
3675
+ type ComponentCompilerPropertyType = 'any' | 'string' | 'boolean' | 'number' | 'unknown';
3676
+ /**
3677
+ * Information about a type used in a Stencil component or exported
3678
+ * from a Stencil project.
3679
+ */
3680
+ interface ComponentCompilerPropertyComplexType {
3681
+ /**
3682
+ * The string of the original type annotation in the Stencil source code
3683
+ */
3684
+ original: string;
3685
+ /**
3686
+ * A 'resolved' type, where e.g. imported types have been resolved and inlined
3687
+ *
3688
+ * For instance, an annotation like `(foo: Foo) => string;` will be
3689
+ * converted to `(foo: { foo: string }) => string;`.
3690
+ */
3691
+ resolved: string;
3692
+ /**
3693
+ * A record of the types which were referenced in the assorted type
3694
+ * annotation in the original source file.
3695
+ */
3696
+ references: ComponentCompilerTypeReferences;
3697
+ /**
3698
+ * @internal TypeScript AST node used for semantic type analysis during compilation.
3699
+ * Not serialized, only used internally for improved type renaming logic.
3700
+ */
3701
+ _astNode?: any;
3702
+ }
3703
+ /**
3704
+ * A record of `ComponentCompilerTypeReference` entities.
3705
+ *
3706
+ * Each key in this record is intended to be the names of the types used by a component. However, this is not enforced
3707
+ * by the type system (I.E. any string can be used as a key).
3708
+ *
3709
+ * Note any key can be a user defined type or a TypeScript standard type.
3710
+ */
3711
+ type ComponentCompilerTypeReferences = Record<string, ComponentCompilerTypeReference>;
3712
+ /**
3713
+ * Describes a reference to a type used by a component.
3714
+ */
3715
+ interface ComponentCompilerTypeReference {
3716
+ /**
3717
+ * A type may be defined:
3718
+ * - locally (in the same file as the component that uses it)
3719
+ * - globally
3720
+ * - by importing it into a file (and is defined elsewhere)
3721
+ */
3722
+ location: 'local' | 'global' | 'import';
3723
+ /**
3724
+ * The path to the type reference, if applicable (global types should not need a path associated with them)
3725
+ */
3726
+ path?: string;
3727
+ /**
3728
+ * An ID for this type which is unique within a Stencil project.
3729
+ */
3730
+ id: string;
3731
+ /**
3732
+ * Whether this type was imported as a default import (e.g., `import MyEnum from './my-enum'`)
3733
+ * vs a named import (e.g., `import { MyType } from './my-type'`)
3734
+ */
3735
+ isDefault?: boolean;
3736
+ /**
3737
+ * The name used in the import statement (before any user-defined alias).
3738
+ * For `import { XAxisOption as moo }`, this would be "XAxisOption".
3739
+ * This is the name exported by the source module.
3740
+ */
3741
+ referenceLocation?: string;
3742
+ }
3743
+ /**
3744
+ * Information about a type which is referenced by another type on a Stencil
3745
+ * component, for instance a {@link ComponentCompilerPropertyComplexType} or a
3746
+ * {@link ComponentCompilerEventComplexType}.
3747
+ */
3748
+ interface ComponentCompilerReferencedType {
3749
+ /**
3750
+ * The path to the module where the type is declared.
3751
+ */
3752
+ path: string;
3753
+ /**
3754
+ * The string of the original type annotation in the Stencil source code
3755
+ */
3756
+ declaration: string;
3757
+ /**
3758
+ * An extracted docstring
3759
+ */
3760
+ docstring: string;
3761
+ }
3762
+ interface ComponentCompilerStaticEvent {
3763
+ name: string;
3764
+ method: string;
3765
+ bubbles: boolean;
3766
+ cancelable: boolean;
3767
+ composed: boolean;
3768
+ docs: CompilerJsDoc;
3769
+ complexType: ComponentCompilerEventComplexType;
3770
+ }
3771
+ interface ComponentCompilerEvent extends ComponentCompilerStaticEvent {
3772
+ internal: boolean;
3773
+ }
3774
+ interface ComponentCompilerEventComplexType {
3775
+ original: string;
3776
+ resolved: string;
3777
+ references: ComponentCompilerTypeReferences;
3778
+ }
3779
+ interface ComponentCompilerListener {
3780
+ name: string;
3781
+ method: string;
3782
+ capture: boolean;
3783
+ passive: boolean;
3784
+ target: ListenTargetOptions | undefined;
3785
+ }
3786
+ interface ComponentCompilerStaticMethod {
3787
+ docs: CompilerJsDoc;
3788
+ complexType: ComponentCompilerMethodComplexType;
3789
+ }
3790
+ interface ComponentCompilerMethodComplexType {
3791
+ signature: string;
3792
+ parameters: JsonDocMethodParameter[];
3793
+ references: ComponentCompilerTypeReferences;
3794
+ return: string;
3795
+ /**
3796
+ * @internal TypeScript AST method node used for semantic type analysis during compilation.
3797
+ * Not serialized, only used internally for improved type renaming logic.
3798
+ */
3799
+ _astNode?: any;
3800
+ }
3801
+ interface ComponentCompilerChangeHandler {
3802
+ propName: string;
3803
+ methodName: string;
3804
+ handlerOptions?: {
3805
+ immediate?: boolean;
3806
+ };
3807
+ }
3808
+ interface ComponentCompilerMethod extends ComponentCompilerStaticMethod {
3809
+ name: string;
3810
+ internal: boolean;
3811
+ }
3812
+ interface ComponentCompilerState {
3813
+ name: string;
3814
+ }
3815
+ /**
3816
+ * Metadata about a custom state defined via @AttachInternals({ states: {...} })
3817
+ *
3818
+ * Custom states are exposed via the ElementInternals.states CustomStateSet
3819
+ * and can be targeted with the CSS :state() pseudo-class.
3820
+ */
3821
+ /**
3822
+ * Representation of JSDoc that is pulled off a node in the AST
3823
+ */
3824
+ interface CompilerJsDoc {
3825
+ /**
3826
+ * The text associated with the JSDoc
3827
+ */
3828
+ text: string;
3829
+ /**
3830
+ * Tags included in the JSDoc
3831
+ */
3832
+ tags: JsonDocsTag[];
3833
+ }
3834
+ interface CompilerAssetDir {
3835
+ absolutePath?: string;
3836
+ cmpRelativePath?: string;
3837
+ originalComponentPath?: string;
3838
+ }
3839
+ /**
3840
+ * A mapping from class member names to a list of methods which are watching
3841
+ * them.
3842
+ */
3843
+ interface ComponentConstructorChangeHandlers {
3844
+ [propName: string]: {
3845
+ [methodName: string]: number;
3846
+ }[];
3847
+ }
3848
+ interface EntryModule {
3849
+ entryKey: string;
3850
+ cmps: ComponentCompilerMeta[];
3851
+ }
3852
+ /**
3853
+ * An interface extending `HTMLElement` which describes the fields added onto
3854
+ * host HTML elements by the Stencil runtime.
3855
+ */
3856
+ interface HostElement extends HTMLElement {
3857
+ connectedCallback?: () => void;
3858
+ attributeChangedCallback?: (attribName: string, oldVal: string, newVal: string, namespace: string) => void;
3859
+ disconnectedCallback?: () => void;
3860
+ host?: Element;
3861
+ forceUpdate?: () => void;
3862
+ __s_ghr?: () => HostRef;
3863
+ /** attaches the component's shadow root if it needs one and doesn't have one yet */
3864
+ __attachShadow?: () => void;
3865
+ /**
3866
+ * Unique stencil id for this element
3867
+ */
3868
+ ['s-id']?: string;
3869
+ /**
3870
+ * Content Reference:
3871
+ * Reference to the HTML Comment that's placed inside of the
3872
+ * host element's original content. This comment is used to
3873
+ * always represent where host element's light dom is.
3874
+ */
3875
+ ['s-cr']?: RenderNode;
3876
+ /**
3877
+ * Lifecycle ready
3878
+ */
3879
+ ['s-lr']?: boolean;
3880
+ /**
3881
+ * A reference to the `ElementInternals` object for the current host
3882
+ *
3883
+ * This is used for maintaining a reference to the object between HMR
3884
+ * refreshes in the lazy build.
3885
+ *
3886
+ * "stencil-element-internals"
3887
+ */
3888
+ ['s-ei']?: ElementInternals;
3889
+ /**
3890
+ * On Render Callbacks:
3891
+ * Array of callbacks to fire off after it has rendered.
3892
+ */
3893
+ ['s-rc']?: (() => void)[];
3894
+ /**
3895
+ * Scope Id
3896
+ * The scope id of this component when using scoped css encapsulation
3897
+ * or using shadow dom but the browser doesn't support it
3898
+ */
3899
+ ['s-sc']?: string;
3900
+ /**
3901
+ * Scope Ids
3902
+ * All the possible scope ids of this component when using scoped css encapsulation
3903
+ * or using shadow dom but the browser doesn't support it
3904
+ */
3905
+ ['s-scs']?: string[];
3906
+ /**
3907
+ * Hot Module Replacement, dev mode only
3908
+ *
3909
+ * This function should be defined by the HMR-supporting runtime and should
3910
+ * do the work of actually updating the component in-place.
3911
+ */
3912
+ ['s-hmr']?: (versionId: string) => void;
3913
+ /**
3914
+ * A list of nested nested hydration promises that
3915
+ * must be resolved for the top, ancestor component to be fully hydrated
3916
+ */
3917
+ ['s-p']?: Promise<void>[];
3918
+ /**
3919
+ * Pending Connects:
3920
+ * A list of {@link HostRef.$onFirstConnectPromise$} promises for descendants that
3921
+ * were already registered with this component (their nearest Stencil ancestor) by
3922
+ * the time this component's own initial `componentWillLoad` was scheduled. Awaited
3923
+ * so this component's `componentWillLoad` can't fire before those descendants'
3924
+ * real `connectedCallback`s have.
3925
+ */
3926
+ ['s-pc']?: Promise<void>[];
3927
+ componentOnReady?: () => Promise<this>;
3928
+ }
3929
+ /**
3930
+ * A mapping from a TypeScript or JavaScript source file path on disk, to a Stencil {@link Module}.
3931
+ *
3932
+ * It is advised that the key (path) be normalized before storing/retrieving the `Module` to avoid unnecessary lookup
3933
+ * failures.
3934
+ */
3935
+ type ModuleMap = Map<string, Module>;
3936
+ /**
3937
+ * Stencil's Intermediate Representation (IR) of a module, bundling together
3938
+ * various pieces of information like the classes declared within it, the path
3939
+ * to the original source file, HTML tag names defined in the file, and so on.
3940
+ *
3941
+ * Note that this gets serialized/parsed as JSON and therefore cannot contain a
3942
+ * `Map` or a `Set`.
3943
+ */
3944
+ interface Module {
3945
+ cmps: ComponentCompilerMeta[];
3946
+ isMixin: boolean;
3947
+ isExtended: boolean;
3948
+ /**
3949
+ * Indicates this module contains mixin/abstract classes that can be extended by other projects.
3950
+ * These are classes with Stencil static members (properties, states, etc.) but no @Component decorator.
3951
+ */
3952
+ hasExportableMixins: boolean;
3953
+ /**
3954
+ * A collection of modules that a component will need. The modules in this list must have import statements generated
3955
+ * in order for the component to function.
3956
+ */
3957
+ coreRuntimeApis: string[];
3958
+ /**
3959
+ * A collection of modules that a component will need for a specific output target. The modules in this list must
3960
+ * have import statements generated in order for the component to function, but only for a specific output target.
3961
+ */
3962
+ outputTargetCoreRuntimeApis: Partial<Record<OutputTarget['type'], string[]>>;
3963
+ collectionName: string;
3964
+ dtsFilePath: string;
3965
+ excludeFromCollection: boolean;
3966
+ externalImports: string[];
3967
+ htmlAttrNames: string[];
3968
+ htmlTagNames: string[];
3969
+ htmlParts: string[];
3970
+ htmlSlots: string[];
3971
+ isCollectionDependency: boolean;
3972
+ isLegacy: boolean;
3973
+ jsFilePath: string;
3974
+ localImports: string[];
3975
+ /**
3976
+ * Source file paths of functional components that are used in JSX/h() calls.
3977
+ * This is used to ensure htmlTagNames are properly propagated from functional
3978
+ * component dependencies even when they're accessed indirectly (e.g., via barrel files).
3979
+ */
3980
+ functionalComponentDeps: string[];
3981
+ originalImports: string[];
3982
+ originalCollectionComponentPath: string;
3983
+ potentialCmpRefs: string[];
3984
+ sourceFilePath: string;
3985
+ staticSourceFile: any;
3986
+ staticSourceFileText: string;
3987
+ sourceMapPath: string;
3988
+ sourceMapFileText: string;
3989
+ hasVdomAttribute: boolean;
3990
+ hasVdomClass: boolean;
3991
+ hasVdomFunctional: boolean;
3992
+ hasVdomKey: boolean;
3993
+ hasVdomListener: boolean;
3994
+ hasVdomPropOrAttr: boolean;
3995
+ hasVdomPropOrAttrPrefix: boolean;
3996
+ hasVdomRef: boolean;
3997
+ hasVdomRender: boolean;
3998
+ hasVdomStyle: boolean;
3999
+ hasVdomText: boolean;
4000
+ hasVdomXlink: boolean;
4001
+ hasSignalsImport: boolean;
4002
+ }
4003
+ interface PrerenderUrlResults {
4004
+ anchorUrls: string[];
4005
+ diagnostics: Diagnostic[];
4006
+ filePath: string;
4007
+ }
4008
+ interface PrerenderUrlRequest {
4009
+ appDir: string;
4010
+ buildId: string;
4011
+ baseUrl: string;
4012
+ componentGraphPath: string;
4013
+ devServerHostUrl: string;
4014
+ ssrAppFilePath: string;
4015
+ isDebug: boolean;
4016
+ prerenderConfigPath: string;
4017
+ staticSite: boolean;
4018
+ templateId: string;
4019
+ url: string;
4020
+ writeToFilePath: string;
4021
+ }
4022
+ /**
4023
+ * Generic node that represents all of the
4024
+ * different types of nodes we'd see when rendering
4025
+ */
4026
+ interface RenderNode extends HostElement {
4027
+ /**
4028
+ * Shadow root's host
4029
+ */
4030
+ host?: Element;
4031
+ /**
4032
+ * On Ref Function:
4033
+ * Callback function to be called when the slotted node ref is ready.
4034
+ */
4035
+ ['s-rf']?: (elm: Element) => unknown;
4036
+ /**
4037
+ * Is initially hidden
4038
+ * Whether this node was originally rendered with the `hidden` attribute.
4039
+ *
4040
+ * Used to reset the `hidden` state of a node during slot relocation.
4041
+ */
4042
+ ['s-ih']?: boolean;
4043
+ /**
4044
+ * Is Content Reference Node:
4045
+ * This node is a content reference node.
4046
+ */
4047
+ ['s-cn']?: boolean;
4048
+ /**
4049
+ * Is a `slot` node when `shadow: false` (or `scoped: true`).
4050
+ *
4051
+ * This is a node (either empty text-node or `<slot-fb>` element)
4052
+ * that represents where a `<slot>` is located in the original JSX.
4053
+ */
4054
+ ['s-sr']?: boolean;
4055
+ /**
4056
+ * Slot name of either the slot itself or the slotted node
4057
+ */
4058
+ ['s-sn']?: string;
4059
+ /**
4060
+ * `slot` attribute of a `<slot>` reference rendered as a text node (no fallback content),
4061
+ * since text nodes can't carry real DOM attributes.
4062
+ */
4063
+ ['s-sa']?: string;
4064
+ /**
4065
+ * Host element tag name:
4066
+ * The tag name of the host element that this
4067
+ * node was created in.
4068
+ */
4069
+ ['s-hn']?: string;
4070
+ /**
4071
+ * Slot host tag name:
4072
+ * This is the tag name of the element where this node
4073
+ * has been moved to during slot relocation.
4074
+ *
4075
+ * This allows us to check if the node has been moved and prevent
4076
+ * us from thinking a node _should_ be moved when it may already be in
4077
+ * its final destination.
4078
+ *
4079
+ * This value is set to `undefined` whenever the node is put back into its original location.
4080
+ */
4081
+ ['s-sh']?: string;
4082
+ /**
4083
+ * Original Location Reference:
4084
+ * A reference pointing to the comment
4085
+ * which represents the original location
4086
+ * before it was moved to its slot.
4087
+ */
4088
+ ['s-ol']?: RenderNode;
4089
+ /**
4090
+ * Node reference:
4091
+ * This is a reference from an original location node
4092
+ * back to the node that's been moved around.
4093
+ */
4094
+ ['s-nr']?: PatchedSlotNode | RenderNode;
4095
+ /**
4096
+ * Original Order:
4097
+ * During SSR; a number representing the order of a slotted node
4098
+ */
4099
+ ['s-oo']?: number;
4100
+ /**
4101
+ * Scope Id
4102
+ */
4103
+ ['s-si']?: string;
4104
+ /**
4105
+ * Host Id (hydrate only)
4106
+ */
4107
+ ['s-host-id']?: number;
4108
+ /**
4109
+ * Node Id (hydrate only)
4110
+ */
4111
+ ['s-node-id']?: number;
4112
+ /**
4113
+ * Used to know the components encapsulation.
4114
+ * empty "" for shadow, "c" from scoped
4115
+ */
4116
+ ['s-en']?: '' | /*shadow*/ 'c';
4117
+ /**
4118
+ * On a `scoped: true` component
4119
+ * with `lightDomPatches` flag enabled,
4120
+ * returns the internal `childNodes` of the component
4121
+ */
4122
+ readonly __childNodes?: NodeListOf<ChildNode>;
4123
+ /**
4124
+ * On a `scoped: true` component
4125
+ * with `lightDomPatches` flag enabled,
4126
+ * returns the internal `children` of the component
4127
+ */
4128
+ readonly __children?: HTMLCollectionOf<Element>;
4129
+ /**
4130
+ * On a `scoped: true` component
4131
+ * with `lightDomPatches` flag enabled,
4132
+ * returns the internal `firstChild` of the component
4133
+ */
4134
+ readonly __firstChild?: ChildNode;
4135
+ /**
4136
+ * On a `scoped: true` component
4137
+ * with `lightDomPatches` flag enabled,
4138
+ * returns the internal `lastChild` of the component
4139
+ */
4140
+ readonly __lastChild?: ChildNode;
4141
+ /**
4142
+ * On a `scoped: true` component
4143
+ * with `lightDomPatches` flag enabled,
4144
+ * returns the internal `textContent` of the component
4145
+ */
4146
+ __textContent?: string;
4147
+ /**
4148
+ * On a `scoped: true` component
4149
+ * with `lightDomPatches` flag enabled,
4150
+ * gives access to the original `append` method
4151
+ */
4152
+ __append?: (...nodes: (Node | string)[]) => void;
4153
+ /**
4154
+ * On a `scoped: true` component
4155
+ * with `lightDomPatches` flag enabled,
4156
+ * gives access to the original `prepend` method
4157
+ */
4158
+ __prepend?: (...nodes: (Node | string)[]) => void;
4159
+ /**
4160
+ * On a `scoped: true` component
4161
+ * with `lightDomPatches` flag enabled,
4162
+ * gives access to the original `appendChild` method
4163
+ */
4164
+ __appendChild?: <T extends Node>(newChild: T) => T;
4165
+ /**
4166
+ * On a `scoped: true` component
4167
+ * with `lightDomPatches` flag enabled,
4168
+ * gives access to the original `insertBefore` method
4169
+ */
4170
+ __insertBefore?: <T extends Node>(node: T, child: Node | null) => T;
4171
+ /**
4172
+ * On a `scoped: true` component
4173
+ * with `lightDomPatches` flag enabled,
4174
+ * gives access to the original `removeChild` method
4175
+ */
4176
+ __removeChild?: <T extends Node>(child: T) => T;
4177
+ }
4178
+ interface PatchedSlotNode extends Node {
4179
+ /**
4180
+ * Slot name
4181
+ */
4182
+ ['s-sn']?: string;
4183
+ /**
4184
+ * Original Location Reference:
4185
+ * A reference pointing to the comment
4186
+ * which represents the original location
4187
+ * before it was moved to its slot.
4188
+ */
4189
+ ['s-ol']?: RenderNode;
4190
+ /**
4191
+ * Slot host tag name:
4192
+ * This is the tag name of the element where this node
4193
+ * has been moved to during slot relocation.
4194
+ *
4195
+ * This allows us to check if the node has been moved and prevent
4196
+ * us from thinking a node _should_ be moved when it may already be in
4197
+ * its final destination.
4198
+ *
4199
+ * This value is set to `undefined` whenever the node is put back into its original location.
4200
+ */
4201
+ ['s-sh']?: string;
4202
+ /**
4203
+ * Is a `slot` node when `shadow: false` (or `scoped: true`).
4204
+ *
4205
+ * This is a node (either empty text-node or `<slot-fb>` element)
4206
+ * that represents where a `<slot>` is located in the original JSX.
4207
+ */
4208
+ ['s-sr']?: boolean;
4209
+ /**
4210
+ * On a `scoped: true` component
4211
+ * with `lightDomPatches` flag enabled,
4212
+ * returns the actual `parentNode` of the component
4213
+ */
4214
+ __parentNode?: RenderNode;
4215
+ /**
4216
+ * On a `scoped: true` component
4217
+ * with `lightDomPatches` flag enabled,
4218
+ * returns the actual `nextSibling` of the component
4219
+ */
4220
+ __nextSibling?: RenderNode;
4221
+ /**
4222
+ * On a `scoped: true` component
4223
+ * with `lightDomPatches` flag enabled,
4224
+ * returns the actual `previousSibling` of the component
4225
+ */
4226
+ __previousSibling?: RenderNode;
4227
+ /**
4228
+ * On a `scoped: true` component
4229
+ * with `lightDomPatches` flag enabled,
4230
+ * returns the actual `nextElementSibling` of the component
4231
+ */
4232
+ __nextElementSibling?: RenderNode;
4233
+ /**
4234
+ * On a `scoped: true` component
4235
+ * with `lightDomPatches` flag enabled,
4236
+ * returns the actual `nextElementSibling` of the component
4237
+ */
4238
+ __previousElementSibling?: RenderNode;
4239
+ }
4240
+ /**
4241
+ * Runtime metadata for a Stencil component
4242
+ */
4243
+ interface ComponentRuntimeMeta {
4244
+ /**
4245
+ * This number is used to hold a series of bitflags for various features we
4246
+ * support on components. The flags which this value is intended to store are
4247
+ * documented in the `CMP_FLAGS` enum.
4248
+ */
4249
+ $flags$: number;
4250
+ /**
4251
+ * Just what it says on the tin - the tag name for the component, as set in
4252
+ * the `@Component` decorator.
4253
+ */
4254
+ $tagName$: string;
4255
+ /**
4256
+ * A map of the component's members, which could include fields decorated
4257
+ * with `@Prop`, `@State`, etc as well as methods.
4258
+ */
4259
+ $members$?: ComponentRuntimeMembers;
4260
+ /**
4261
+ * Information about listeners on the component.
4262
+ */
4263
+ $listeners$?: ComponentRuntimeHostListener[];
4264
+ /**
4265
+ * Tuples containing information about `@Prop` fields on the component which
4266
+ * are set to be reflected (i.e. kept in sync) as HTML attributes when
4267
+ * updated.
4268
+ */
4269
+ $attrsToReflect$?: ComponentRuntimeReflectingAttr[];
4270
+ /**
4271
+ * Information about which class members have watchers attached on the component.
4272
+ */
4273
+ $watchers$?: ComponentConstructorChangeHandlers;
4274
+ /**
4275
+ * A bundle ID used for lazy loading.
4276
+ */
4277
+ $lazyBundleId$?: string;
4278
+ /**
4279
+ * Information about which class members have prop > attribute serializers attached on the component.
4280
+ */
4281
+ $serializers$?: ComponentConstructorChangeHandlers;
4282
+ /**
4283
+ * Information about which class members have attribute > prop deserializers attached on the component.
4284
+ */
4285
+ $deserializers$?: ComponentConstructorChangeHandlers;
4286
+ /**
4287
+ * `id` of the element within the shadow root that IDREFs targeting the host resolve to.
4288
+ */
4289
+ $referenceTarget$?: string;
4290
+ }
4291
+ /**
4292
+ * A mapping of the names of members on the component to some runtime-specific
4293
+ * information about them.
4294
+ */
4295
+ interface ComponentRuntimeMembers {
4296
+ [memberName: string]: ComponentRuntimeMember;
4297
+ }
4298
+ /**
4299
+ * A tuple with information about a class member that's relevant at runtime.
4300
+ * The fields are:
4301
+ *
4302
+ * 1. A number used to hold bitflags for component members. The bit flags which
4303
+ * this is intended to store are documented in the `MEMBER_FLAGS` enum.
4304
+ * 2. The attribute name to observe.
4305
+ */
4306
+ type ComponentRuntimeMember = [number, string?];
4307
+ /**
4308
+ * A tuple holding information about a host listener which is relevant at
4309
+ * runtime. The field are:
4310
+ *
4311
+ * 1. A number used to hold bitflags for listeners. The bit flags which this is
4312
+ * intended to store are documented in the `LISTENER_FLAGS` enum.
4313
+ * 2. The event name.
4314
+ * 3. The method name.
4315
+ */
4316
+ type ComponentRuntimeHostListener = [number, string, string];
4317
+ /**
4318
+ * A tuple containing information about props which are "reflected" at runtime,
4319
+ * meaning that HTML attributes on the component instance are kept in sync with
4320
+ * the prop value.
4321
+ *
4322
+ * The fields are:
4323
+ *
4324
+ * 1. the prop name
4325
+ * 2. the prop attribute.
4326
+ */
4327
+ type ComponentRuntimeReflectingAttr = [string, string | undefined];
4328
+ /**
4329
+ * A runtime component reference, consistent of either a host element _or_ an
4330
+ * empty object. This is used in particular in a few different places as the
4331
+ * keys in a `WeakMap` which maps {@link HostElement} instances to their
4332
+ * associated {@link HostRef} instance.
4333
+ */
4334
+ type RuntimeRef = HostElement | {
4335
+ __s_ghr?: () => HostRef;
4336
+ };
4337
+ /**
4338
+ * Interface used to track an Element, it's virtual Node (`VNode`), and other data
4339
+ */
4340
+ interface HostRef {
4341
+ $ancestorComponent$?: HostElement;
4342
+ $flags$: number;
4343
+ $cmpMeta$: ComponentRuntimeMeta;
4344
+ $hostElement$: HostElement;
4345
+ $instanceValues$?: Map<string, any>;
4346
+ /**
4347
+ * Prop/state changes accumulated since the last render, flushed to
4348
+ * `componentShouldUpdate` once per render cycle.
4349
+ */
4350
+ $queuedPropChanges$?: ComponentShouldUpdateChanges;
4351
+ $signalValues$?: Map<string, import('@preact/signals-core').Signal<any>>;
4352
+ /** Dispose function that tears down all signal effects for this component. */
4353
+ $signalCleanup$?: () => void;
4354
+ $serializerValues$?: Map<string, string>;
4355
+ $lazyInstance$?: ComponentInterface;
4356
+ /**
4357
+ * A list of callback functions called immediately after a lazy component module has been fetched.
4358
+ */
4359
+ $fetchedCbList$?: ((elm: HostElement) => void)[];
4360
+ /**
4361
+ * A promise that gets resolved if `BUILD.asyncLoading` is enabled and after the `componentDidLoad`
4362
+ * and before the `componentDidUpdate` lifecycle events are triggered.
4363
+ */
4364
+ $onReadyPromise$?: Promise<HostElement>;
4365
+ /**
4366
+ * A callback which resolves {@link HostRef.$onReadyPromise$}
4367
+ * @param elm host element
4368
+ */
4369
+ $onReadyResolve$?: (elm: HostElement) => void;
4370
+ /**
4371
+ * A promise which resolves with the host component once it has finished rendering
4372
+ * for the first time. This is primarily used to wait for the first `update` to be
4373
+ * called on a component.
4374
+ */
4375
+ $onInstancePromise$?: Promise<HostElement>;
4376
+ /**
4377
+ * A callback which resolves {@link HostRef.$onInstancePromise$}
4378
+ * @param elm host element
4379
+ */
4380
+ $onInstanceResolve$?: (elm: HostElement) => void;
4381
+ /**
4382
+ * A promise which resolves when the component has finished rendering for the first time.
4383
+ * It is called after {@link HostRef.$onInstancePromise$} resolves.
4384
+ */
4385
+ $onRenderResolve$?: () => void;
4386
+ /**
4387
+ * A promise that resolves once this component's real `connectedCallback` has fired
4388
+ * for the first time. Created lazily - either by a descendant that needs to wait for
4389
+ * this component's connection before firing its own real `connectedCallback`
4390
+ * ({@link HOST_FLAGS.hasFiredConnected}), or by this component registering itself
4391
+ * with its nearest Stencil ancestor's `s-pc` list. This is what lets a component's
4392
+ * real `connectedCallback` (and, transitively, a pending ancestor's initial
4393
+ * `componentWillLoad`) stay ordered correctly regardless of which of an
4394
+ * ancestor/descendant pair's lazy module happens to resolve first.
4395
+ */
4396
+ $onFirstConnectPromise$?: Promise<void>;
4397
+ /**
4398
+ * A callback which resolves {@link HostRef.$onFirstConnectPromise$}
4399
+ */
4400
+ $onFirstConnectResolve$?: () => void;
4401
+ $vnode$?: VNode;
4402
+ $queuedListeners$?: [string, any][];
4403
+ $rmListeners$?: (() => void)[];
4404
+ $modeName$?: string;
4405
+ $renderCount$?: number;
4406
+ /**
4407
+ * Defer connectedCallback until after first render for components with slot relocation.
4408
+ */
4409
+ $deferredConnectedCallback$?: boolean;
4410
+ /**
4411
+ * The number of times this host's lazy component load has failed and been retried.
4412
+ * Used to give up retrying after {@link MAX_LAZY_LOAD_RETRIES} failed attempts.
4413
+ */
4414
+ $loadRetryCount$?: number;
4415
+ }
4416
+ interface PlatformRuntime {
4417
+ /**
4418
+ * This number is used to hold a series of bitflags for various features we
4419
+ * support within the runtime. The flags which this value is intended to store are
4420
+ * documented in the {@link PLATFORM_FLAGS} enum.
4421
+ */
4422
+ $flags$: number;
4423
+ /**
4424
+ * Holds a map of nodes to be hydrated.
4425
+ */
4426
+ $orgLocNodes$?: Map<string, RenderNode>;
4427
+ /**
4428
+ * Holds the resource url for given platform environment.
4429
+ */
4430
+ $resourcesUrl$: string;
4431
+ /**
4432
+ * The nonce value to be applied to all script/style tags at runtime.
4433
+ * If `null`, the nonce attribute will not be applied.
4434
+ */
4435
+ $nonce$?: string | null;
4436
+ /**
4437
+ * A utility function that executes a given function and returns the result.
4438
+ * @param c The callback function to execute
4439
+ */
4440
+ jmp: (c: Function) => any;
4441
+ /**
4442
+ * A wrapper for {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame `requestAnimationFrame`}
4443
+ */
4444
+ raf: (c: FrameRequestCallback) => number;
4445
+ /**
4446
+ * A wrapper for {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener `addEventListener`}
4447
+ */
4448
+ ael: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
4449
+ /**
4450
+ * A wrapper for {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener `removeEventListener`}
4451
+ */
4452
+ rel: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
4453
+ /**
4454
+ * A wrapper for creating a {@link https://developer.mozilla.org/docs/Web/API/CustomEvent `CustomEvent`}
4455
+ */
4456
+ ce: (eventName: string, opts?: any) => CustomEvent;
4457
+ }
4458
+ interface StyleCompiler {
4459
+ modeName: string;
4460
+ styleId: string;
4461
+ styleStr: string;
4462
+ styleIdentifier: string;
4463
+ externalStyles: ExternalStyleCompiler[];
4464
+ }
4465
+ interface ExternalStyleCompiler {
4466
+ absolutePath: string;
4467
+ relativePath: string;
4468
+ originalComponentPath: string;
4469
+ }
4470
+ interface ComponentGlobalStyle {
4471
+ /** Absolute path to the CSS file, or null for inline styles */
4472
+ absolutePath: string | null;
4473
+ /** Raw inline CSS string, or null for file-based styles */
4474
+ styleStr: string | null;
4475
+ }
4476
+ /**
4477
+ * Input CSS to be transformed into ESM
4478
+ */
4479
+ interface TransformCssToEsmInput {
4480
+ input: string;
4481
+ module?: 'cjs' | 'esm' | string;
4482
+ file?: string;
4483
+ tag?: string;
4484
+ tags?: string[];
4485
+ addTagTransformers: boolean;
4486
+ encapsulation?: string;
4487
+ /**
4488
+ * The mode under which the CSS will be applied.
4489
+ *
4490
+ * Corresponds to a key used when `@Component`'s `styleUrls` field is an object:
4491
+ * ```ts
4492
+ * @Component({
4493
+ * tag: 'todo-list',
4494
+ * styleUrls: {
4495
+ * ios: 'todo-list.ios.scss',
4496
+ * md: 'todo-list.md.scss',
4497
+ * }
4498
+ * })
4499
+ * ```
4500
+ * In the example above, two `TransformCssToEsmInput`s should be created, one for 'ios' and one for 'md' (this field
4501
+ * is not shared by multiple fields, nor is it a composite of multiple modes).
4502
+ */
4503
+ mode?: string;
4504
+ sourceMap?: boolean;
4505
+ minify?: boolean;
4506
+ docs?: boolean;
4507
+ autoprefixer?: any;
4508
+ styleImportData?: string;
4509
+ }
4510
+ interface TransformCssToEsmOutput {
4511
+ styleText: string;
4512
+ output: string;
4513
+ map: any;
4514
+ diagnostics: Diagnostic[];
4515
+ defaultVarName: string;
4516
+ styleDocs: StyleDoc[];
4517
+ imports: {
4518
+ varName: string;
4519
+ importPath: string;
4520
+ }[];
4521
+ /**
4522
+ * Whether `output` itself has an observable side effect (a plain, untagged CSS file's
4523
+ * generated module self-injects CSSStyleSheets; a Stencil component's tagged `styleUrl`
4524
+ * output doesn't)
4525
+ */
4526
+ moduleSideEffects?: boolean;
4527
+ }
4528
+ interface PackageJsonData {
4529
+ name?: string;
4530
+ version?: string;
4531
+ type?: 'module' | 'commonjs';
4532
+ main?: string;
4533
+ exports?: {
4534
+ [key: string]: string | {
4535
+ [key: string]: string;
4536
+ };
4537
+ };
4538
+ description?: string;
4539
+ bin?: {
4540
+ [key: string]: string;
4541
+ };
4542
+ browser?: string;
4543
+ module?: string;
4544
+ 'jsnext:main'?: string;
4545
+ unpkg?: string;
4546
+ collection?: string;
4547
+ types?: string;
4548
+ files?: string[];
4549
+ ['dist-tags']?: {
4550
+ latest: string;
4551
+ };
4552
+ dependencies?: {
4553
+ [moduleId: string]: string;
4554
+ };
4555
+ devDependencies?: {
4556
+ [moduleId: string]: string;
4557
+ };
4558
+ repository?: {
4559
+ type?: string;
4560
+ url?: string;
4561
+ };
4562
+ private?: boolean;
4563
+ scripts?: {
4564
+ [runName: string]: string;
4565
+ };
4566
+ license?: string;
4567
+ keywords?: string[];
4568
+ }
4569
+ interface AnyHTMLElement extends HTMLElement {
4570
+ [key: string]: any;
4571
+ }
4572
+ interface SpecPage {
4573
+ /**
4574
+ * Mocked testing `document.body`.
4575
+ */
4576
+ body: HTMLBodyElement;
4577
+ /**
4578
+ * Mocked testing `document`.
4579
+ */
4580
+ doc: HTMLDocument;
4581
+ /**
4582
+ * The first component found within the mocked `document.body`. If a component isn't found, then it'll return `document.body.firstElementChild`.
4583
+ */
4584
+ root?: AnyHTMLElement;
4585
+ /**
4586
+ * Similar to `root`, except returns the component instance. If a root component was not found it'll return `null`.
4587
+ */
4588
+ rootInstance?: any;
4589
+ /**
4590
+ * Convenience function to set `document.body.innerHTML` and `waitForChanges()`. Function argument should be a HTML string.
4591
+ */
4592
+ setContent: (html: string) => Promise<any>;
4593
+ /**
4594
+ * After changes have been made to a component, such as a update to a property or attribute, the test page does not automatically apply the changes. In order to wait for, and apply the update, call `await page.waitForChanges()`.
4595
+ */
4596
+ waitForChanges: () => Promise<any>;
4597
+ /**
4598
+ * Mocked testing `window`.
4599
+ */
4600
+ win: Window;
4601
+ build: BuildConditionals;
4602
+ flushLoadModule: (bundleId?: string) => Promise<any>;
4603
+ flushQueue: () => Promise<any>;
4604
+ styles: Map<string, string>;
4605
+ }
4606
+ /**
4607
+ * Options pertaining to the creation and functionality of a {@link SpecPage}
4608
+ */
4609
+ interface NewSpecPageOptions {
4610
+ /**
4611
+ * An array of components to test. Component classes can be imported into the spec file, then their reference should be added to the `component` array in order to be used throughout the test.
4612
+ */
4613
+ components: any[];
4614
+ /**
4615
+ * Sets the mocked `document.cookie`.
4616
+ */
4617
+ cookie?: string;
4618
+ /**
4619
+ * Sets the mocked `dir` attribute on `<html>`.
4620
+ */
4621
+ direction?: string;
4622
+ /**
4623
+ * If `false`, do not flush the render queue on initial test setup.
4624
+ */
4625
+ flushQueue?: boolean;
4626
+ /**
4627
+ * The initial HTML used to generate the test. This can be useful to construct a collection of components working together, and assign HTML attributes. This value sets the mocked `document.body.innerHTML`.
4628
+ */
4629
+ html?: string;
4630
+ /**
4631
+ * The initial JSX used to generate the test.
4632
+ * Use `template` when you want to initialize a component using their properties, instead of their HTML attributes.
4633
+ * It will render the specified template (JSX) into `document.body`.
4634
+ */
4635
+ template?: () => any;
4636
+ /**
4637
+ * Sets the mocked `lang` attribute on `<html>`.
4638
+ */
4639
+ language?: string;
4640
+ /**
4641
+ * Useful for debugging hydrating components client-side. Sets that the `html` option already includes annotated prerender attributes and comments.
4642
+ */
4643
+ hydrateClientSide?: boolean;
4644
+ /**
4645
+ * Useful for debugging hydrating components server-side. The output HTML will also include prerender annotations.
4646
+ */
4647
+ hydrateServerSide?: boolean;
4648
+ /**
4649
+ * Sets the mocked `document.referrer`.
4650
+ */
4651
+ referrer?: string;
4652
+ /**
4653
+ * When a component is pre-rendered it includes HTML annotations, such as `s-id` attributes and `<!-t.0->` comments. This information is used by client-side hydrating. Default is `false`.
4654
+ */
4655
+ includeAnnotations?: boolean;
4656
+ /**
4657
+ * Sets the mocked browser's `location.href`.
4658
+ */
4659
+ url?: string;
4660
+ /**
4661
+ * Sets the mocked browser's `navigator.userAgent`.
4662
+ */
4663
+ userAgent?: string;
4664
+ /**
4665
+ * By default, any changes to component properties and attributes must `page.waitForChanges()` in order to test the updates. As an option, `autoApplyChanges` continuously flushes the queue on the background. Default is `false`.
4666
+ */
4667
+ autoApplyChanges?: boolean;
4668
+ /**
4669
+ * Set {@link BuildConditionals} for testing based off the metadata of the component under test.
4670
+ * When `true` all `BuildConditionals` will be assigned to the global testing `BUILD` object, regardless of their
4671
+ * value. When `false`, only `BuildConditionals` with a value of `true` will be assigned to the `BUILD` object.
4672
+ */
4673
+ strictBuild?: boolean;
4674
+ /**
4675
+ * Default values to be set on the platform runtime object {@see PlatformRuntime} when creating
4676
+ * the spec page.
4677
+ */
4678
+ platform?: Partial<PlatformRuntime>;
4679
+ /**
4680
+ * Controls how shadow DOM components are serialized during `hydrateServerSide`.
4681
+ * When set to `'scoped'`, shadow DOM components are rendered as scoped light DOM
4682
+ * (matching the behavior of `serializeShadowRoot: 'scoped'` in production SSR).
4683
+ * When set to `false`, shadow DOM components render with a real shadow root.
4684
+ * Default is `false`.
4685
+ */
4686
+ serializeShadowRoot?: 'scoped' | false;
4687
+ /**
4688
+ * Override individual {@link BuildConditionals} for this test. Applied after all other
4689
+ * BUILD setup so these values take final precedence. Useful for testing code paths that
4690
+ * are gated behind a build flag (e.g. `{ signalBacking: true }`).
4691
+ */
4692
+ buildFlags?: Partial<BuildConditionals>;
4693
+ }
4694
+ type ChildType = VNode | number | string;
4695
+ type PropsType = VNodeProdData | number | string | null;
4696
+ interface VNodeProdData {
4697
+ key?: string | number;
4698
+ class?: {
4699
+ [className: string]: boolean;
4700
+ } | string;
4701
+ className?: {
4702
+ [className: string]: boolean;
4703
+ } | string;
4704
+ style?: any;
4705
+ [key: string]: any;
4706
+ }
4707
+ /**
4708
+ * An abstraction to bundle up four methods which _may_ be handled by
4709
+ * dispatching work to workers running in other OS threads or may be called
4710
+ * synchronously. Environment and `CompilerSystem` related setup code will
4711
+ * determine which one, but in either case the call sites for these methods can
4712
+ * dispatch to this shared interface.
4713
+ */
4714
+ interface CompilerWorkerContext {
4715
+ optimizeCss(inputOpts: OptimizeCssInput): Promise<OptimizeCssOutput>;
4716
+ prepareModule(input: string, minifyOpts: any): Promise<{
4717
+ output: string;
4718
+ diagnostics: Diagnostic[];
4719
+ sourceMap?: SourceMap$1;
4720
+ }>;
4721
+ prerenderWorker(prerenderRequest: PrerenderUrlRequest): Promise<PrerenderUrlResults>;
4722
+ transformCssToEsm(input: TransformCssToEsmInput): Promise<TransformCssToEsmOutput>;
4723
+ }
4724
+ //#endregion
6
4725
  //#region src/testing/testing-logger.d.ts
7
4726
  declare class TestingLogger implements Logger {
8
4727
  private isEnabled;
@@ -73,8 +4792,6 @@ declare function mockConfig(overrides?: Partial<UnvalidatedConfig>): Unvalidated
73
4792
  * @returns the default configuration initialization object, with any overrides applied
74
4793
  */
75
4794
  declare const mockLoadConfigInit: (overrides?: Partial<LoadConfigInit>) => LoadConfigInit;
76
- declare function mockCompilerCtx(config?: ValidatedConfig): CompilerCtx;
77
- declare function mockBuildCtx(config?: ValidatedConfig, compilerCtx?: CompilerCtx): BuildCtx;
78
4795
  declare function mockLogger(): TestingLogger;
79
4796
  /**
80
4797
  * Create a {@link d.CompilerSystem} entity for testing the compiler.
@@ -111,6 +4828,9 @@ declare function newSpecPage(opts: NewSpecPageOptions): Promise<SpecPage>;
111
4828
  /**
112
4829
  * Shuffle an array using Fisher-Yates algorithm
113
4830
  * http://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array
4831
+ *
4832
+ * @param array - the array to shuffle
4833
+ * @returns the shuffled array
114
4834
  */
115
4835
  declare function shuffleArray(array: any[]): any[];
116
4836
  /**
@@ -155,11 +4875,6 @@ interface ConsoleMocker {
155
4875
  };
156
4876
  teardownConsoleMocks: () => void;
157
4877
  }
158
- /**
159
- * the callback that `withSilentWarn` expects to receive. Basically receives a mock
160
- * as its argument and returns a `Promise`, the value of which is returned by `withSilentWarn`
161
- * as well.
162
- */
163
4878
  //#endregion
164
4879
  //#region src/testing/platform/testing-build.d.ts
165
4880
  declare const Build: UserBuildConditionals;
@@ -201,7 +4916,43 @@ declare function writeTask(cb: RafCallback): void;
201
4916
  */
202
4917
  declare function readTask(cb: RafCallback): void;
203
4918
  //#endregion
4919
+ //#region src/app-data/index.d.ts
4920
+ declare const Env: {};
4921
+ //#endregion
4922
+ //#region src/runtime/asset-path.d.ts
4923
+ declare const getAssetPath: (path: string) => string;
4924
+ declare const setAssetPath: (path: string) => string;
4925
+ //#endregion
4926
+ //#region src/runtime/element.d.ts
4927
+ declare const getElement: (ref: any) => HostElement;
4928
+ //#endregion
4929
+ //#region src/runtime/event-emitter.d.ts
4930
+ declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
4931
+ emit: (detail: any) => CustomEvent<any>;
4932
+ };
4933
+ //#endregion
4934
+ //#region src/runtime/fragment.d.ts
4935
+ declare const Fragment: FunctionalComponent;
4936
+ //#endregion
4937
+ //#region src/runtime/mixin.d.ts
4938
+ type Ctor<T = {}> = new (...args: any[]) => T;
4939
+ declare function Mixin(...mixins: ((base: Ctor) => Ctor)[]): Ctor<{}>;
4940
+ //#endregion
4941
+ //#region src/runtime/mode.d.ts
4942
+ declare const getMode: (ref: RuntimeRef) => string;
4943
+ //#endregion
4944
+ //#region src/runtime/reactive-controller.d.ts
4945
+ declare const ReactiveControllerHost: <B extends MixedInCtor<ComponentInterface & HTMLElement>>(Base: B) => B & MixedInCtor<ReactiveControllerHostInterface>;
4946
+ //#endregion
4947
+ //#region src/runtime/update-component.d.ts
4948
+ declare const getRenderingRef: () => any;
4949
+ declare const forceUpdate: (ref: any) => boolean;
4950
+ //#endregion
4951
+ //#region src/runtime/vdom/h.d.ts
4952
+ declare const h: (nodeName: any, vnodeData: PropsType, ...children: ChildType[]) => VNode;
4953
+ declare const Host: {};
4954
+ //#endregion
204
4955
  //#region src/testing/platform/index.d.ts
205
4956
  declare const setMode: (handler: (elm: any) => string | undefined | null) => void;
206
4957
  //#endregion
207
- export { Build, Env, Fragment, Host, Mixin, type SpecPage, type Testing, createEvent, createTestingSystem, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, h, mockBuildCtx, mockCompilerCtx, mockCompilerSystem, mockComponentMeta, mockConfig, mockDocument, mockLoadConfigInit, mockLogger, mockModule, mockValidatedConfig, mockWindow, newSpecPage, readTask, registerHost, registerInstance, setAssetPath, setErrorHandler, setMode, setupConsoleMocker, shuffleArray, writeTask };
4958
+ export { Build, Env, Fragment, Host, Mixin, type NewSpecPageOptions, ReactiveControllerHost, type SpecPage, createEvent, createTestingSystem, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, h, mockCompilerSystem, mockComponentMeta, mockConfig, mockDocument, mockLoadConfigInit, mockLogger, mockModule, mockValidatedConfig, mockWindow, newSpecPage, readTask, registerHost, registerInstance, setAssetPath, setErrorHandler, setMode, setupConsoleMocker, shuffleArray, writeTask };