@stencil/core 5.0.0-alpha.9 → 5.0.0-beta.0

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