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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +94 -0
  2. package/bin/stencil.mjs +1 -1
  3. package/dist/app-data/index.d.ts +2 -0
  4. package/dist/{runtime/app-data → app-data}/index.js +23 -15
  5. package/dist/{runtime/app-globals → app-globals}/index.js +1 -2
  6. package/dist/client-BMtGBEQV.mjs +2498 -0
  7. package/dist/compiler/browser.d.ts +1573 -0
  8. package/dist/compiler/browser.js +16998 -0
  9. package/dist/compiler/index.d.mts +284 -7
  10. package/dist/compiler/index.mjs +3 -9
  11. package/dist/compiler/utils/index.d.mts +272 -3
  12. package/dist/compiler/utils/index.mjs +4 -5
  13. package/dist/{transpile-CJQcQEVa.mjs → compiler-C_Y38j4m.mjs} +20984 -15554
  14. package/dist/declarations/stencil-ext-modules.d.ts +8 -8
  15. package/dist/declarations/stencil-public-compiler.d.ts +1016 -840
  16. package/dist/declarations/stencil-public-compiler.js +3 -5
  17. package/dist/declarations/stencil-public-docs.d.ts +441 -376
  18. package/dist/declarations/stencil-public-docs.js +0 -0
  19. package/dist/declarations/stencil-public-runtime.d.ts +361 -113
  20. package/dist/fragment-Di1hWOC8.mjs +4 -0
  21. package/dist/helpers-pTCZhNi0.mjs +529 -0
  22. package/dist/{index-szczUd2l.d.mts → index-CFiy6MZ3.d.mts} +1471 -2044
  23. package/dist/index-CViiWNQ9.d.mts +104 -0
  24. package/dist/{stencil-private-Cgcr414u.d.ts → index-XQHZl0MW.d.ts} +308 -114
  25. package/dist/index.d.mts +14 -2
  26. package/dist/index.mjs +171 -4
  27. package/dist/jsx-runtime.d.mts +24 -0
  28. package/dist/jsx-runtime.mjs +3 -0
  29. package/dist/mock-doc.mjs +2 -3
  30. package/dist/{node-sys-BGURUNOZ.mjs → node-Bkq8vRnu.mjs} +176 -197
  31. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  32. package/dist/{client-DR9zhmKG.mjs → runtime/client/lazy.js} +3794 -2659
  33. package/dist/runtime/client/{index.d.ts → runtime.d.ts} +516 -227
  34. package/dist/runtime/client/{index.js → runtime.js} +3596 -2857
  35. package/dist/runtime/index.d.ts +90 -72
  36. package/dist/runtime/index.js +3528 -2897
  37. package/dist/runtime/server/index.d.mts +243 -219
  38. package/dist/runtime/server/index.mjs +3770 -3352
  39. package/dist/runtime/server/runner.d.mts +114 -47
  40. package/dist/runtime/server/runner.mjs +12710 -763
  41. package/dist/signals/index.d.ts +58 -0
  42. package/dist/signals/index.js +182 -0
  43. package/dist/sys/node/index.d.mts +1 -3
  44. package/dist/sys/node/index.mjs +2 -7
  45. package/dist/sys/node/worker.d.mts +1 -1
  46. package/dist/sys/node/worker.mjs +3 -12
  47. package/dist/testing/index.d.mts +4763 -12
  48. package/dist/testing/index.mjs +7945 -618
  49. package/dist/util-CP6-333M.mjs +731 -0
  50. package/dist/validation-C1mr0klL.mjs +825 -0
  51. package/package.json +91 -59
  52. package/dist/chunk-ClPoSABd.mjs +0 -21
  53. package/dist/index-Bxo2jCf6.d.mts +0 -77
  54. package/dist/runtime/app-data/index.d.ts +0 -30
  55. package/dist/serialize-BJvhE9aQ.mjs +0 -775
  56. package/dist/validation-BdcPruW_.mjs +0 -1451
  57. /package/{LICENSE.md → LICENSE} +0 -0
  58. /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
@@ -1,75 +1,110 @@
1
+ import "rolldown";
2
+ import "typescript";
3
+ //#region src/declarations/stencil-private.d.ts
4
+ /**
5
+ * Information about a type used in a Stencil component or exported
6
+ * from a Stencil project.
7
+ */
1
8
  interface ComponentCompilerPropertyComplexType {
2
- /**
3
- * The string of the original type annotation in the Stencil source code
4
- */
5
- original: string;
6
- /**
7
- * A 'resolved' type, where e.g. imported types have been resolved and inlined
8
- *
9
- * For instance, an annotation like `(foo: Foo) => string;` will be
10
- * converted to `(foo: { foo: string }) => string;`.
11
- */
12
- resolved: string;
13
- /**
14
- * A record of the types which were referenced in the assorted type
15
- * annotation in the original source file.
16
- */
17
- references: ComponentCompilerTypeReferences;
9
+ /**
10
+ * The string of the original type annotation in the Stencil source code
11
+ */
12
+ original: string;
13
+ /**
14
+ * A 'resolved' type, where e.g. imported types have been resolved and inlined
15
+ *
16
+ * For instance, an annotation like `(foo: Foo) => string;` will be
17
+ * converted to `(foo: { foo: string }) => string;`.
18
+ */
19
+ resolved: string;
20
+ /**
21
+ * A record of the types which were referenced in the assorted type
22
+ * annotation in the original source file.
23
+ */
24
+ references: ComponentCompilerTypeReferences;
25
+ /**
26
+ * @internal TypeScript AST node used for semantic type analysis during compilation.
27
+ * Not serialized, only used internally for improved type renaming logic.
28
+ */
29
+ _astNode?: any;
18
30
  }
31
+ /**
32
+ * A record of `ComponentCompilerTypeReference` entities.
33
+ *
34
+ * Each key in this record is intended to be the names of the types used by a component. However, this is not enforced
35
+ * by the type system (I.E. any string can be used as a key).
36
+ *
37
+ * Note any key can be a user defined type or a TypeScript standard type.
38
+ */
19
39
  type ComponentCompilerTypeReferences = Record<string, ComponentCompilerTypeReference>;
40
+ /**
41
+ * Describes a reference to a type used by a component.
42
+ */
20
43
  interface ComponentCompilerTypeReference {
21
- /**
22
- * A type may be defined:
23
- * - locally (in the same file as the component that uses it)
24
- * - globally
25
- * - by importing it into a file (and is defined elsewhere)
26
- */
27
- location: "local" | "global" | "import";
28
- /**
29
- * The path to the type reference, if applicable (global types should not need a path associated with them)
30
- */
31
- path?: string;
32
- /**
33
- * An ID for this type which is unique within a Stencil project.
34
- */
35
- id: string;
36
- /**
37
- * Whether this type was imported as a default import (e.g., `import MyEnum from './my-enum'`)
38
- * vs a named import (e.g., `import { MyType } from './my-type'`)
39
- */
40
- isDefault?: boolean;
41
- /**
42
- * The name used in the import statement (before any user-defined alias).
43
- * For `import { XAxisOption as moo }`, this would be "XAxisOption".
44
- * This is the name exported by the source module.
45
- */
46
- referenceLocation?: string;
44
+ /**
45
+ * A type may be defined:
46
+ * - locally (in the same file as the component that uses it)
47
+ * - globally
48
+ * - by importing it into a file (and is defined elsewhere)
49
+ */
50
+ location: 'local' | 'global' | 'import';
51
+ /**
52
+ * The path to the type reference, if applicable (global types should not need a path associated with them)
53
+ */
54
+ path?: string;
55
+ /**
56
+ * An ID for this type which is unique within a Stencil project.
57
+ */
58
+ id: string;
59
+ /**
60
+ * Whether this type was imported as a default import (e.g., `import MyEnum from './my-enum'`)
61
+ * vs a named import (e.g., `import { MyType } from './my-type'`)
62
+ */
63
+ isDefault?: boolean;
64
+ /**
65
+ * The name used in the import statement (before any user-defined alias).
66
+ * For `import { XAxisOption as moo }`, this would be "XAxisOption".
67
+ * This is the name exported by the source module.
68
+ */
69
+ referenceLocation?: string;
47
70
  }
71
+ /**
72
+ * Information about a type which is referenced by another type on a Stencil
73
+ * component, for instance a {@link ComponentCompilerPropertyComplexType} or a
74
+ * {@link ComponentCompilerEventComplexType}.
75
+ */
48
76
  interface ComponentCompilerReferencedType {
49
- /**
50
- * The path to the module where the type is declared.
51
- */
52
- path: string;
53
- /**
54
- * The string of the original type annotation in the Stencil source code
55
- */
56
- declaration: string;
57
- /**
58
- * An extracted docstring
59
- */
60
- docstring: string;
77
+ /**
78
+ * The path to the module where the type is declared.
79
+ */
80
+ path: string;
81
+ /**
82
+ * The string of the original type annotation in the Stencil source code
83
+ */
84
+ declaration: string;
85
+ /**
86
+ * An extracted docstring
87
+ */
88
+ docstring: string;
61
89
  }
62
90
  interface ComponentCompilerEventComplexType {
63
- original: string;
64
- resolved: string;
65
- references: ComponentCompilerTypeReferences;
91
+ original: string;
92
+ resolved: string;
93
+ references: ComponentCompilerTypeReferences;
66
94
  }
67
95
  interface ComponentCompilerMethodComplexType {
68
- signature: string;
69
- parameters: JsonDocMethodParameter[];
70
- references: ComponentCompilerTypeReferences;
71
- return: string;
96
+ signature: string;
97
+ parameters: JsonDocMethodParameter[];
98
+ references: ComponentCompilerTypeReferences;
99
+ return: string;
100
+ /**
101
+ * @internal TypeScript AST method node used for semantic type analysis during compilation.
102
+ * Not serialized, only used internally for improved type renaming logic.
103
+ */
104
+ _astNode?: any;
72
105
  }
106
+ //#endregion
107
+ //#region src/declarations/stencil-public-docs.d.ts
73
108
  /**
74
109
  * The Type Library holds information about the types which are used in a
75
110
  * Stencil project. During compilation, Stencil gathers information about the
@@ -81,167 +116,179 @@ interface ComponentCompilerMethodComplexType {
81
116
  * This information is included in the file written by the `docs-json` output
82
117
  * target (see {@link JsonDocs.typeLibrary}).
83
118
  */
84
- export type JsonDocsTypeLibrary = Record<string, ComponentCompilerReferencedType>;
119
+ type JsonDocsTypeLibrary = Record<string, ComponentCompilerReferencedType>;
85
120
  /**
86
121
  * A container for JSDoc metadata for a project
87
122
  */
88
- export interface JsonDocs {
89
- /**
90
- * The metadata for the JSDocs for each component in a Stencil project
91
- */
92
- components: JsonDocsComponent[];
93
- /**
94
- * The timestamp at which the metadata was generated, in the format YYYY-MM-DDThh:mm:ss
95
- */
96
- timestamp: string;
97
- compiler: {
98
- /**
99
- * The name of the compiler that generated the metadata
100
- */
101
- name: string;
102
- /**
103
- * The version of the Stencil compiler that generated the metadata
104
- */
105
- version: string;
106
- /**
107
- * The version of TypeScript that was used to generate the metadata
108
- */
109
- typescriptVersion: string;
110
- };
111
- typeLibrary: JsonDocsTypeLibrary;
123
+ interface JsonDocs {
124
+ /**
125
+ * The metadata for the JSDocs for each component in a Stencil project
126
+ */
127
+ components: JsonDocsComponent[];
128
+ /**
129
+ * Project-level usage content, collected from markdown files in a `usage`
130
+ * directory at the project's {@link Config.srcDir} root (as opposed to
131
+ * per-component usage content, which lives in {@link JsonDocsComponent.usage}).
132
+ * Keyed by file name (without extension), same shape as component usage.
133
+ */
134
+ usage?: JsonDocsUsage;
135
+ /**
136
+ * The timestamp at which the metadata was generated, in the format YYYY-MM-DDThh:mm:ss
137
+ */
138
+ timestamp: string;
139
+ compiler: {
140
+ /**
141
+ * The name of the compiler that generated the metadata
142
+ */
143
+ name: string;
144
+ /**
145
+ * The version of the Stencil compiler that generated the metadata
146
+ */
147
+ version: string;
148
+ /**
149
+ * The version of TypeScript that was used to generate the metadata
150
+ */
151
+ typescriptVersion: string;
152
+ };
153
+ typeLibrary: JsonDocsTypeLibrary;
112
154
  }
113
155
  /**
114
156
  * Container for JSDoc metadata for a single Stencil component
115
157
  */
116
- export interface JsonDocsComponent {
117
- /**
118
- * The directory containing the Stencil component, minus the file name.
119
- *
120
- * @example /workspaces/stencil-project/src/components/my-component
121
- */
122
- dirPath?: string;
123
- /**
124
- * The name of the file containing the Stencil component, with no path
125
- *
126
- * @example my-component.tsx
127
- */
128
- fileName?: string;
129
- /**
130
- * The full path of the file containing the Stencil component
131
- *
132
- * @example /workspaces/stencil-project/src/components/my-component/my-component.tsx
133
- */
134
- filePath?: string;
135
- /**
136
- * The path to the component's `readme.md` file, including the filename
137
- *
138
- * @example /workspaces/stencil-project/src/components/my-component/readme.md
139
- */
140
- readmePath?: string;
141
- /**
142
- * The path to the component's `usage` directory
143
- *
144
- * @example /workspaces/stencil-project/src/components/my-component/usage/
145
- */
146
- usagesDir?: string;
147
- /**
148
- * The encapsulation strategy for a component
149
- */
150
- encapsulation: "shadow" | "scoped" | "none";
151
- /**
152
- * The tag name for the component, for use in HTML
153
- */
154
- tag: string;
155
- /**
156
- * The contents of a component's `readme.md` that are user generated.
157
- *
158
- * Auto-generated contents are not stored in this reference.
159
- */
160
- readme: string;
161
- /**
162
- * The description of a Stencil component, found in the JSDoc that sits above the component's declaration
163
- */
164
- docs: string;
165
- /**
166
- * JSDoc tags found in the JSDoc comment written atop a component's declaration
167
- */
168
- docsTags: JsonDocsTag[];
169
- /**
170
- * The text from the class-level JSDoc for a Stencil component, if present.
171
- */
172
- overview?: string;
173
- /**
174
- * A mapping of usage example file names to their contents for the component.
175
- */
176
- usage: JsonDocsUsage;
177
- /**
178
- * Array of metadata for a component's `@Prop`s
179
- */
180
- props: JsonDocsProp[];
181
- /**
182
- * Array of metadata for a component's `@Method`s
183
- */
184
- methods: JsonDocsMethod[];
185
- /**
186
- * Array of metadata for a component's `@Event`s
187
- */
188
- events: JsonDocsEvent[];
189
- /**
190
- * Array of metadata for a component's `@Listen` handlers
191
- */
192
- listeners: JsonDocsListener[];
193
- /**
194
- * Array of metadata for a component's CSS styling information
195
- */
196
- styles: JsonDocsStyle[];
197
- /**
198
- * Array of component Slot information, generated from `@slot` tags
199
- */
200
- slots: JsonDocsSlot[];
201
- /**
202
- * Array of component Parts information, generate from `@part` tags
203
- */
204
- parts: JsonDocsPart[];
205
- /**
206
- * Array of custom states defined via @AttachInternals({ states: {...} })
207
- */
208
- customStates: JsonDocsCustomState[];
209
- /**
210
- * Array of metadata describing where the current component is used
211
- */
212
- dependents: string[];
213
- /**
214
- * Array of metadata listing the components which are used in current component
215
- */
216
- dependencies: string[];
217
- /**
218
- * Describes a tree of components coupling
219
- */
220
- dependencyGraph: JsonDocsDependencyGraph;
221
- /**
222
- * A deprecation reason/description found following a `@deprecated` tag
223
- */
224
- deprecation?: string;
158
+ interface JsonDocsComponent {
159
+ /**
160
+ * The directory containing the Stencil component, minus the file name.
161
+ *
162
+ * @example /workspaces/stencil-project/src/components/my-component
163
+ */
164
+ dirPath?: string;
165
+ /**
166
+ * The name of the file containing the Stencil component, with no path
167
+ *
168
+ * @example my-component.tsx
169
+ */
170
+ fileName?: string;
171
+ /**
172
+ * The full path of the file containing the Stencil component
173
+ *
174
+ * @example /workspaces/stencil-project/src/components/my-component/my-component.tsx
175
+ */
176
+ filePath?: string;
177
+ /**
178
+ * The path to the component's `readme.md` file, including the filename
179
+ *
180
+ * @example /workspaces/stencil-project/src/components/my-component/readme.md
181
+ */
182
+ readmePath?: string;
183
+ /**
184
+ * The path to the component's `usage` directory
185
+ *
186
+ * @example /workspaces/stencil-project/src/components/my-component/usage/
187
+ */
188
+ usagesDir?: string;
189
+ /**
190
+ * The encapsulation strategy for a component
191
+ */
192
+ encapsulation: 'shadow' | 'scoped' | 'none';
193
+ /**
194
+ * The tag name for the component, for use in HTML
195
+ */
196
+ tag: string;
197
+ /**
198
+ * The contents of a component's `readme.md` that are user generated.
199
+ *
200
+ * Auto-generated contents are not stored in this reference.
201
+ */
202
+ readme: string;
203
+ /**
204
+ * The description of a Stencil component, found in the JSDoc that sits above the component's declaration
205
+ */
206
+ docs: string;
207
+ /**
208
+ * JSDoc tags found in the JSDoc comment written atop a component's declaration
209
+ */
210
+ docsTags: JsonDocsTag[];
211
+ /**
212
+ * The text from the class-level JSDoc for a Stencil component, if present.
213
+ */
214
+ overview?: string;
215
+ /**
216
+ * A mapping of usage example file names to their contents for the component.
217
+ */
218
+ usage: JsonDocsUsage;
219
+ /**
220
+ * Array of metadata for a component's `@Prop`s
221
+ */
222
+ props: JsonDocsProp[];
223
+ /**
224
+ * Array of metadata for a component's `@Method`s
225
+ */
226
+ methods: JsonDocsMethod[];
227
+ /**
228
+ * Array of metadata for a component's `@Event`s
229
+ */
230
+ events: JsonDocsEvent[];
231
+ /**
232
+ * Array of metadata for a component's `@Listen` handlers
233
+ */
234
+ listeners: JsonDocsListener[];
235
+ /**
236
+ * Array of metadata for a component's CSS styling information
237
+ */
238
+ styles: JsonDocsStyle[];
239
+ /**
240
+ * Array of component Slot information, generated from `@slot` tags
241
+ */
242
+ slots: JsonDocsSlot[];
243
+ /**
244
+ * Array of component Parts information, generate from `@part` tags
245
+ */
246
+ parts: JsonDocsPart[];
247
+ /**
248
+ * Array of custom states defined via @AttachInternals({ states: {...} })
249
+ */
250
+ customStates: JsonDocsCustomState[];
251
+ /**
252
+ * Array of metadata describing where the current component is used
253
+ */
254
+ dependents: string[];
255
+ /**
256
+ * Array of metadata listing the components which are used in current component
257
+ */
258
+ dependencies: string[];
259
+ /**
260
+ * Describes a tree of components coupling
261
+ */
262
+ dependencyGraph: JsonDocsDependencyGraph;
263
+ /**
264
+ * A deprecation reason/description found following a `@deprecated` tag
265
+ */
266
+ deprecation?: string;
267
+ /**
268
+ * `true` if this is a "CSS-only component"
269
+ * discovered in .css file via `@component`-marked JSDoc block
270
+ */
271
+ cssOnly?: boolean;
225
272
  }
226
- export interface JsonDocsDependencyGraph {
227
- [tagName: string]: string[];
273
+ interface JsonDocsDependencyGraph {
274
+ [tagName: string]: string[];
228
275
  }
229
276
  /**
230
277
  * A descriptor for a single JSDoc tag found in a block comment
231
278
  */
232
- export interface JsonDocsTag {
233
- /**
234
- * The tag name (immediately following the '@')
235
- */
236
- name: string;
237
- /**
238
- * The description that immediately follows the tag name
239
- */
240
- text?: string;
279
+ interface JsonDocsTag {
280
+ /**
281
+ * The tag name (immediately following the '@')
282
+ */
283
+ name: string;
284
+ /**
285
+ * The description that immediately follows the tag name
286
+ */
287
+ text?: string;
241
288
  }
242
- export interface JsonDocsValue {
243
- value?: string;
244
- type: string;
289
+ interface JsonDocsValue {
290
+ value?: string;
291
+ type: string;
245
292
  }
246
293
  /**
247
294
  * A mapping of file names to their contents.
@@ -263,149 +310,159 @@ export interface JsonDocsValue {
263
310
  * }
264
311
  * ```
265
312
  */
266
- export interface JsonDocsUsage {
267
- [key: string]: string;
313
+ interface JsonDocsUsage {
314
+ [key: string]: string;
268
315
  }
269
316
  /**
270
317
  * An intermediate representation of a `@Prop` decorated member's JSDoc
271
318
  */
272
- export interface JsonDocsProp {
273
- /**
274
- * the name of the prop
275
- */
276
- name: string;
277
- complexType?: ComponentCompilerPropertyComplexType;
278
- /**
279
- * the type of the prop, in terms of the TypeScript type system (as opposed to JavaScript's or HTML's)
280
- */
281
- type: string;
282
- /**
283
- * `true` if the prop was configured as "mutable" where it was declared, `false` otherwise
284
- */
285
- mutable: boolean;
286
- /**
287
- * The name of the attribute that is exposed to configure a compiled web component
288
- */
289
- attr?: string;
290
- /**
291
- * `true` if the prop was configured to "reflect" back to HTML where it (the prop) was declared, `false` otherwise
292
- */
293
- reflectToAttr: boolean;
294
- /**
295
- * the JSDoc description text associated with the prop
296
- */
297
- docs: string;
298
- /**
299
- * JSDoc tags associated with the prop
300
- */
301
- docsTags: JsonDocsTag[];
302
- /**
303
- * The default value of the prop
304
- */
305
- default?: string;
306
- /**
307
- * Deprecation text associated with the prop. This is the text that immediately follows a `@deprecated` tag
308
- */
309
- deprecation?: string;
310
- values: JsonDocsValue[];
311
- /**
312
- * `true` if a component is declared with a '?', `false` otherwise
313
- *
314
- * @example
315
- * ```tsx
316
- * @Prop() componentProps?: any;
317
- * ```
318
- */
319
- optional: boolean;
320
- /**
321
- * `true` if a component is declared with a '!', `false` otherwise
322
- *
323
- * @example
324
- * ```tsx
325
- * @Prop() componentProps!: any;
326
- * ```
327
- */
328
- required: boolean;
329
- /**
330
- * `true` if the prop has a `get()`. `false` otherwise
331
- */
332
- getter: boolean;
333
- /**
334
- * `true` if the prop has a `set()`. `false` otherwise
335
- */
336
- setter: boolean;
319
+ interface JsonDocsProp {
320
+ /**
321
+ * the name of the prop
322
+ */
323
+ name: string;
324
+ complexType?: ComponentCompilerPropertyComplexType;
325
+ /**
326
+ * the type of the prop, in terms of the TypeScript type system (as opposed to JavaScript's or HTML's)
327
+ */
328
+ type: string;
329
+ /**
330
+ * `true` if the prop was configured as "mutable" where it was declared, `false` otherwise
331
+ */
332
+ mutable: boolean;
333
+ /**
334
+ * The name of the attribute that is exposed to configure a compiled web component
335
+ */
336
+ attr?: string;
337
+ /**
338
+ * `true` if the prop was configured to "reflect" back to HTML where it (the prop) was declared, `false` otherwise
339
+ */
340
+ reflectToAttr: boolean;
341
+ /**
342
+ * the JSDoc description text associated with the prop
343
+ */
344
+ docs: string;
345
+ /**
346
+ * JSDoc tags associated with the prop
347
+ */
348
+ docsTags: JsonDocsTag[];
349
+ /**
350
+ * The default value of the prop
351
+ */
352
+ default?: string;
353
+ /**
354
+ * Deprecation text associated with the prop. This is the text that immediately follows a `@deprecated` tag
355
+ */
356
+ deprecation?: string;
357
+ values: JsonDocsValue[];
358
+ /**
359
+ * `true` if a component is declared with a '?', `false` otherwise
360
+ *
361
+ * @example
362
+ * ```tsx
363
+ * @Prop() componentProps?: any;
364
+ * ```
365
+ */
366
+ optional: boolean;
367
+ /**
368
+ * `true` if a component is declared with a '!', `false` otherwise
369
+ *
370
+ * @example
371
+ * ```tsx
372
+ * @Prop() componentProps!: any;
373
+ * ```
374
+ */
375
+ required: boolean;
376
+ /**
377
+ * `true` if the prop has a `get()`. `false` otherwise
378
+ */
379
+ getter: boolean;
380
+ /**
381
+ * `true` if the prop has a `set()`. `false` otherwise
382
+ */
383
+ setter: boolean;
337
384
  }
338
- export interface JsonDocsMethod {
339
- name: string;
340
- docs: string;
341
- docsTags: JsonDocsTag[];
342
- deprecation?: string;
343
- signature: string;
344
- returns: JsonDocsMethodReturn;
345
- parameters: JsonDocMethodParameter[];
346
- complexType: ComponentCompilerMethodComplexType;
385
+ interface JsonDocsMethod {
386
+ name: string;
387
+ docs: string;
388
+ docsTags: JsonDocsTag[];
389
+ deprecation?: string;
390
+ signature: string;
391
+ returns: JsonDocsMethodReturn;
392
+ parameters: JsonDocMethodParameter[];
393
+ complexType: ComponentCompilerMethodComplexType;
347
394
  }
348
- export interface JsonDocsMethodReturn {
349
- type: string;
350
- docs: string;
395
+ interface JsonDocsMethodReturn {
396
+ type: string;
397
+ docs: string;
351
398
  }
352
- export interface JsonDocMethodParameter {
353
- name: string;
354
- type: string;
355
- docs: string;
399
+ interface JsonDocMethodParameter {
400
+ name: string;
401
+ type: string;
402
+ docs: string;
356
403
  }
357
- export interface JsonDocsEvent {
358
- event: string;
359
- bubbles: boolean;
360
- cancelable: boolean;
361
- composed: boolean;
362
- complexType: ComponentCompilerEventComplexType;
363
- docs: string;
364
- docsTags: JsonDocsTag[];
365
- deprecation?: string;
366
- detail: string;
404
+ interface JsonDocsEvent {
405
+ event: string;
406
+ bubbles: boolean;
407
+ cancelable: boolean;
408
+ composed: boolean;
409
+ complexType: ComponentCompilerEventComplexType;
410
+ docs: string;
411
+ docsTags: JsonDocsTag[];
412
+ deprecation?: string;
413
+ detail: string;
367
414
  }
368
415
  /**
369
416
  * Type describing a CSS Style, as described by a JSDoc-style comment
370
417
  */
371
- export interface JsonDocsStyle {
372
- /**
373
- * The name of the style
374
- */
375
- name: string;
376
- /**
377
- * The type/description associated with the style
378
- */
379
- docs: string;
380
- /**
381
- * The annotation used in the JSDoc of the style (e.g. `@prop`)
382
- */
383
- annotation: string;
384
- /**
385
- * The mode associated with the style
386
- */
387
- mode: string | undefined;
418
+ interface JsonDocsStyle {
419
+ /**
420
+ * The name of the style
421
+ */
422
+ name: string;
423
+ /**
424
+ * The type/description associated with the style
425
+ */
426
+ docs: string;
427
+ /**
428
+ * The annotation used in the JSDoc of the style (e.g. `@prop`)
429
+ */
430
+ annotation: string;
431
+ /**
432
+ * The CSS `syntax` descriptor for a custom property, if it was registered via a native
433
+ * `@property` at-rule (e.g. `"<length>"`).
434
+ */
435
+ syntax?: string;
436
+ /**
437
+ * The `initial-value` descriptor for a custom property, if it was registered via a native
438
+ * `@property` at-rule.
439
+ */
440
+ default?: string;
441
+ /**
442
+ * The mode associated with the style
443
+ */
444
+ mode: string | undefined;
388
445
  }
389
- export interface JsonDocsListener {
390
- event: string;
391
- target?: string;
392
- capture: boolean;
393
- passive: boolean;
446
+ interface JsonDocsListener {
447
+ event: string;
448
+ target?: string;
449
+ capture: boolean;
450
+ passive: boolean;
394
451
  }
395
452
  /**
396
453
  * A descriptor for a slot
397
454
  *
398
455
  * Objects of this type are translated from the JSDoc tag, `@slot`
399
456
  */
400
- export interface JsonDocsSlot {
401
- /**
402
- * The name of the slot. Defaults to an empty string for an unnamed slot.
403
- */
404
- name: string;
405
- /**
406
- * A textual description of the slot.
407
- */
408
- docs: string;
457
+ interface JsonDocsSlot {
458
+ /**
459
+ * The name of the slot. Defaults to an empty string for an unnamed slot.
460
+ */
461
+ name: string;
462
+ /**
463
+ * A textual description of the slot.
464
+ */
465
+ docs: string;
409
466
  }
410
467
  /**
411
468
  * A descriptor of a CSS Shadow Part
@@ -413,15 +470,15 @@ export interface JsonDocsSlot {
413
470
  * Objects of this type are translated from the JSDoc tag, `@part`, or the 'part'
414
471
  * attribute on a component in TSX
415
472
  */
416
- export interface JsonDocsPart {
417
- /**
418
- * The name of the Shadow part
419
- */
420
- name: string;
421
- /**
422
- * A textual description of the Shadow part.
423
- */
424
- docs: string;
473
+ interface JsonDocsPart {
474
+ /**
475
+ * The name of the Shadow part
476
+ */
477
+ name: string;
478
+ /**
479
+ * A textual description of the Shadow part.
480
+ */
481
+ docs: string;
425
482
  }
426
483
  /**
427
484
  * A descriptor for a Custom State defined via @AttachInternals({ states: {...} })
@@ -431,42 +488,50 @@ export interface JsonDocsPart {
431
488
  *
432
489
  * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet
433
490
  */
434
- export interface JsonDocsCustomState {
435
- /**
436
- * The name of the custom state (without dashes)
437
- */
438
- name: string;
439
- /**
440
- * The initial/default value of the state
441
- */
442
- initialValue: boolean;
443
- /**
444
- * A textual description of the custom state
445
- */
446
- docs: string;
491
+ interface JsonDocsCustomState {
492
+ /**
493
+ * The name of the custom state (without dashes)
494
+ */
495
+ name: string;
496
+ /**
497
+ * The initial/default value of the state
498
+ */
499
+ initialValue: boolean;
500
+ /**
501
+ * A textual description of the custom state
502
+ */
503
+ docs: string;
447
504
  }
448
505
  /**
449
506
  * Represents a parsed block comment in a CSS, Sass, etc. file for a custom property.
450
507
  */
451
- export interface StyleDoc {
452
- /**
453
- * The name of the CSS property
454
- */
455
- name: string;
456
- /**
457
- * The user-defined description of the CSS property
458
- */
459
- docs: string;
460
- /**
461
- * The JSDoc-style annotation (e.g. `@prop`) that was used in the block comment to detect the comment.
462
- * Used to inform Stencil where the start of a new property's description starts (and where the previous description
463
- * ends).
464
- */
465
- annotation: "prop";
466
- /**
467
- * The Stencil style-mode that is associated with this property.
468
- */
469
- mode: string | undefined;
508
+ interface StyleDoc {
509
+ /**
510
+ * The name of the CSS property
511
+ */
512
+ name: string;
513
+ /**
514
+ * The user-defined description of the CSS property
515
+ */
516
+ docs: string;
517
+ /**
518
+ * The JSDoc-style annotation (e.g. `@prop`) that was used in the block comment to detect the comment.
519
+ * Used to inform Stencil where the start of a new property's description starts (and where the previous description
520
+ * ends).
521
+ */
522
+ annotation: 'prop';
523
+ /**
524
+ * The Stencil style-mode that is associated with this property.
525
+ */
526
+ mode: string | undefined;
527
+ /**
528
+ * The CSS `syntax` descriptor, if this property was registered via a native `@property` at-rule.
529
+ */
530
+ syntax?: string;
531
+ /**
532
+ * The `initial-value` descriptor, if this property was registered via a native `@property` at-rule.
533
+ */
534
+ default?: string;
470
535
  }
471
-
472
- export {};
536
+ //#endregion
537
+ export { JsonDocMethodParameter, JsonDocs, JsonDocsComponent, JsonDocsCustomState, JsonDocsDependencyGraph, JsonDocsEvent, JsonDocsListener, JsonDocsMethod, JsonDocsMethodReturn, JsonDocsPart, JsonDocsProp, JsonDocsSlot, JsonDocsStyle, JsonDocsTag, JsonDocsTypeLibrary, JsonDocsUsage, JsonDocsValue, StyleDoc };