|
269 | 269 | ],
|
270 | 270 | "type": "object"
|
271 | 271 | },
|
272 |
| - "CustomElement": { |
273 |
| - "description": "The additional fields that a custom element adds to classes and mixins.", |
| 272 | + "CustomElementDeclaration": { |
| 273 | + "description": "A description of a custom element class.\n\nCustom elements are JavaScript classes, so this extends from\n`ClassDeclaration` and adds custom-element-specific features like\nattributes, events, and slots.\n\nNote that `tagName` in this interface is optional. Tag names are not\nneccessarily part of a custom element class, but belong to the definition\n(often called the \"registration\") or the `customElements.define()` call.\n\nBecause classes and tag names can only be registered once, there's a\none-to-one relationship between classes and tag names. For ease of use,\nwe allow the tag name here.\n\nSome packages define and register custom elements in separate modules. In\nthese cases one `Module` should contain the `CustomElement` without a\ntagName, and another `Module` should contain the\n`CustomElementExport`.", |
274 | 274 | "properties": {
|
275 | 275 | "attributes": {
|
276 | 276 | "description": "The attributes that this element is known to understand.",
|
|
305 | 305 | "type": "array"
|
306 | 306 | },
|
307 | 307 | "deprecated": {
|
308 |
| - "description": "Whether the custom element is deprecated.\nIf the value is a string, it's the reason for the deprecation.", |
| 308 | + "description": "Whether the class or mixin is deprecated.\nIf the value is a string, it's the reason for the deprecation.", |
309 | 309 | "type": [
|
310 | 310 | "string",
|
311 | 311 | "boolean"
|
|
322 | 322 | },
|
323 | 323 | "type": "array"
|
324 | 324 | },
|
| 325 | + "kind": { |
| 326 | + "enum": [ |
| 327 | + "class" |
| 328 | + ], |
| 329 | + "type": "string" |
| 330 | + }, |
325 | 331 | "members": {
|
326 | 332 | "items": {
|
327 | 333 | "anyOf": [
|
328 | 334 | {
|
329 |
| - "$ref": "#/definitions/CustomElementField" |
| 335 | + "$ref": "#/definitions/ClassField" |
330 | 336 | },
|
331 | 337 | {
|
332 | 338 | "$ref": "#/definitions/ClassMethod"
|
|
370 | 376 | },
|
371 | 377 | "required": [
|
372 | 378 | "customElement",
|
| 379 | + "kind", |
373 | 380 | "name"
|
374 | 381 | ],
|
375 | 382 | "type": "object"
|
|
406 | 413 | ],
|
407 | 414 | "type": "object"
|
408 | 415 | },
|
409 |
| - "CustomElementField": { |
410 |
| - "description": "Additional metadata for fields on custom elements.", |
| 416 | + "CustomElementMixinDeclaration": { |
| 417 | + "description": "A class mixin that also adds custom element related properties.", |
411 | 418 | "properties": {
|
412 |
| - "attribute": { |
413 |
| - "description": "The corresponding attribute name if there is one.", |
414 |
| - "type": "string" |
| 419 | + "attributes": { |
| 420 | + "description": "The attributes that this element is known to understand.", |
| 421 | + "items": { |
| 422 | + "$ref": "#/definitions/Attribute" |
| 423 | + }, |
| 424 | + "type": "array" |
415 | 425 | },
|
416 |
| - "default": { |
417 |
| - "type": "string" |
| 426 | + "cssParts": { |
| 427 | + "items": { |
| 428 | + "$ref": "#/definitions/CssPart" |
| 429 | + }, |
| 430 | + "type": "array" |
| 431 | + }, |
| 432 | + "cssProperties": { |
| 433 | + "items": { |
| 434 | + "$ref": "#/definitions/CssCustomProperty" |
| 435 | + }, |
| 436 | + "type": "array" |
| 437 | + }, |
| 438 | + "customElement": { |
| 439 | + "description": "Distinguishes a regular JavaScript class from a\ncustom element class", |
| 440 | + "enum": [ |
| 441 | + true |
| 442 | + ], |
| 443 | + "type": "boolean" |
| 444 | + }, |
| 445 | + "demos": { |
| 446 | + "items": { |
| 447 | + "$ref": "#/definitions/Demo" |
| 448 | + }, |
| 449 | + "type": "array" |
418 | 450 | },
|
419 | 451 | "deprecated": {
|
420 |
| - "description": "Whether the property is deprecated.\nIf the value is a string, it's the reason for the deprecation.", |
| 452 | + "description": "Whether the class or mixin is deprecated.\nIf the value is a string, it's the reason for the deprecation.", |
421 | 453 | "type": [
|
422 | 454 | "string",
|
423 | 455 | "boolean"
|
424 | 456 | ]
|
425 | 457 | },
|
426 | 458 | "description": {
|
427 |
| - "description": "A markdown description of the field.", |
| 459 | + "description": "A markdown description of the class.", |
428 | 460 | "type": "string"
|
429 | 461 | },
|
430 |
| - "inheritedFrom": { |
431 |
| - "$ref": "#/definitions/Reference" |
| 462 | + "events": { |
| 463 | + "description": "The events that this element fires.", |
| 464 | + "items": { |
| 465 | + "$ref": "#/definitions/Event" |
| 466 | + }, |
| 467 | + "type": "array" |
432 | 468 | },
|
433 | 469 | "kind": {
|
434 | 470 | "enum": [
|
435 |
| - "field" |
| 471 | + "mixin" |
436 | 472 | ],
|
437 | 473 | "type": "string"
|
438 | 474 | },
|
| 475 | + "members": { |
| 476 | + "items": { |
| 477 | + "anyOf": [ |
| 478 | + { |
| 479 | + "$ref": "#/definitions/ClassField" |
| 480 | + }, |
| 481 | + { |
| 482 | + "$ref": "#/definitions/ClassMethod" |
| 483 | + } |
| 484 | + ] |
| 485 | + }, |
| 486 | + "type": "array" |
| 487 | + }, |
| 488 | + "mixins": { |
| 489 | + "description": "Any class mixins applied in the extends clause of this class.\n\nIf mixins are applied in the class definition, then the true superclass\nof this class is the result of applying mixins in order to the superclass.\n\nMixins must be listed in order of their application to the superclass or\nprevious mixin application. This means that the innermost mixin is listed\nfirst. This may read backwards from the common order in JavaScript, but\nmatches the order of language used to describe mixin application, like\n\"S with A, B\".", |
| 490 | + "items": { |
| 491 | + "$ref": "#/definitions/Reference" |
| 492 | + }, |
| 493 | + "type": "array" |
| 494 | + }, |
439 | 495 | "name": {
|
440 | 496 | "type": "string"
|
441 | 497 | },
|
442 |
| - "privacy": { |
443 |
| - "$ref": "#/definitions/Privacy" |
| 498 | + "parameters": { |
| 499 | + "items": { |
| 500 | + "$ref": "#/definitions/Parameter" |
| 501 | + }, |
| 502 | + "type": "array" |
444 | 503 | },
|
445 |
| - "reflects": { |
446 |
| - "description": "If the property reflects to an attribute.\n\nIf this is true, `attribute` must be defined.", |
447 |
| - "type": "boolean" |
| 504 | + "return": { |
| 505 | + "properties": { |
| 506 | + "description": { |
| 507 | + "type": "string" |
| 508 | + }, |
| 509 | + "type": { |
| 510 | + "$ref": "#/definitions/Type" |
| 511 | + } |
| 512 | + }, |
| 513 | + "type": "object" |
| 514 | + }, |
| 515 | + "slots": { |
| 516 | + "description": "The shadow dom content slots that this element accepts.", |
| 517 | + "items": { |
| 518 | + "$ref": "#/definitions/Slot" |
| 519 | + }, |
| 520 | + "type": "array" |
448 | 521 | },
|
449 | 522 | "source": {
|
450 | 523 | "$ref": "#/definitions/SourceReference"
|
451 | 524 | },
|
452 |
| - "static": { |
453 |
| - "type": "boolean" |
454 |
| - }, |
455 | 525 | "summary": {
|
456 | 526 | "description": "A markdown summary suitable for display in a listing.",
|
457 | 527 | "type": "string"
|
458 | 528 | },
|
459 |
| - "type": { |
460 |
| - "$ref": "#/definitions/Type" |
| 529 | + "superclass": { |
| 530 | + "$ref": "#/definitions/Reference", |
| 531 | + "description": "The superclass of this class.\n\nIf this class is defined with mixin\napplications, the prototype chain includes the mixin applications\nand the true superclass is computed from them." |
| 532 | + }, |
| 533 | + "tagName": { |
| 534 | + "description": "An optional tag name that should be specified if this is a\nself-registering element.\n\nSelf-registering elements must also include a CustomElementExport\nin the module's exports.", |
| 535 | + "type": "string" |
461 | 536 | }
|
462 | 537 | },
|
463 | 538 | "required": [
|
| 539 | + "customElement", |
464 | 540 | "kind",
|
465 | 541 | "name"
|
466 | 542 | ],
|
|
615 | 691 | "$ref": "#/definitions/VariableDeclaration"
|
616 | 692 | },
|
617 | 693 | {
|
618 |
| - "allOf": [ |
619 |
| - { |
620 |
| - "$ref": "#/definitions/ClassDeclaration" |
621 |
| - }, |
622 |
| - { |
623 |
| - "$ref": "#/definitions/CustomElement" |
624 |
| - } |
625 |
| - ], |
626 |
| - "description": "A description of a custom element class.\n\nCustom elements are JavaScript classes, so this extends from\n`ClassDeclaration` and adds custom-element-specific features like\nattributes, events, and slots.\n\nNote that `tagName` in this interface is optional. Tag names are not\nneccessarily part of a custom element class, but belong to the definition\n(often called the \"registration\") or the `customElements.define()` call.\n\nBecause classes and tag names can only be registered once, there's a\none-to-one relationship between classes and tag names. For ease of use,\nwe allow the tag name here.\n\nSome packages define and register custom elements in separate modules. In\nthese cases one `Module` should contain the `CustomElement` without a\ntagName, and another `Module` should contain the\n`CustomElementExport`." |
| 694 | + "$ref": "#/definitions/CustomElementDeclaration" |
627 | 695 | },
|
628 | 696 | {
|
629 |
| - "allOf": [ |
630 |
| - { |
631 |
| - "$ref": "#/definitions/MixinDeclaration" |
632 |
| - }, |
633 |
| - { |
634 |
| - "$ref": "#/definitions/CustomElement" |
635 |
| - } |
636 |
| - ], |
637 |
| - "description": "A class mixin that also adds custom element related properties." |
| 697 | + "$ref": "#/definitions/CustomElementMixinDeclaration" |
638 | 698 | }
|
639 | 699 | ]
|
640 | 700 | },
|
|
0 commit comments