@@ -183,9 +183,7 @@ export interface SourceReference {
183
183
* tagName, and another `Module` should contain the
184
184
* `CustomElementExport`.
185
185
*/
186
- export interface CustomElementDeclaration
187
- extends ClassDeclaration ,
188
- CustomElement { }
186
+ export type CustomElementDeclaration = ClassDeclaration & CustomElement ;
189
187
190
188
/**
191
189
* The additional fields that a custom element adds to classes and mixins.
@@ -226,8 +224,12 @@ export interface CustomElement extends ClassLike {
226
224
* custom element class
227
225
*/
228
226
customElement : true ;
227
+
228
+ members ?: Array < CustomElementMember > ;
229
229
}
230
230
231
+ export type CustomElementMember = CustomElementField | ClassMethod ;
232
+
231
233
export interface Attribute {
232
234
name : string ;
233
235
@@ -328,9 +330,9 @@ export interface CssCustomProperty {
328
330
*
329
331
* The syntax must be a valid CSS [syntax string](https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax)
330
332
* as defined in the CSS Properties and Values API.
331
- *
333
+ *
332
334
* Examples:
333
- *
335
+ *
334
336
* "<color>": accepts a color
335
337
* "<length> | <percentage>": accepts lengths or percentages but not calc expressions with a combination of the two
336
338
* "small | medium | large": accepts one of these values set as custom idents.
@@ -489,6 +491,23 @@ export interface ClassField extends PropertyLike {
489
491
source ?: SourceReference ;
490
492
}
491
493
494
+ /**
495
+ * Additional metadata for fields on custom elements.
496
+ */
497
+ export interface CustomElementField extends ClassField {
498
+ /**
499
+ * The corresponding attribute name if there is one.
500
+ */
501
+ attribute ?: string ;
502
+
503
+ /**
504
+ * If the property reflects to an attribute.
505
+ *
506
+ * If this is true, `attribute` must be defined.
507
+ */
508
+ reflects ?: boolean ;
509
+ }
510
+
492
511
export interface ClassMethod extends FunctionLike {
493
512
kind : 'method' ;
494
513
static ?: boolean ;
@@ -556,9 +575,7 @@ export interface MixinDeclaration extends ClassLike, FunctionLike {
556
575
/**
557
576
* A class mixin that also adds custom element related properties.
558
577
*/
559
- export interface CustomElementMixinDeclaration
560
- extends MixinDeclaration ,
561
- CustomElement { }
578
+ export type CustomElementMixinDeclaration = MixinDeclaration & CustomElement ;
562
579
563
580
export interface VariableDeclaration extends PropertyLike {
564
581
kind : 'variable' ;
0 commit comments