Skip to content

Commit 2570079

Browse files
authored
Adds CSSCustomState to schema (#128)
1 parent efaf2fc commit 2570079

File tree

2 files changed

+73
-3
lines changed

2 files changed

+73
-3
lines changed

schema.d.ts

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export interface JavaScriptModule {
5656
kind: 'javascript-module';
5757

5858
/**
59-
* Path to the javascript file needed to be imported.
59+
* Path to the javascript file needed to be imported.
6060
* (not the path for example to a typescript file.)
6161
*/
6262
path: string;
@@ -250,6 +250,8 @@ export interface CustomElement extends ClassLike {
250250

251251
cssProperties?: CssCustomProperty[];
252252

253+
cssStates?: CssCustomState[];
254+
253255
demos?: Demo[];
254256

255257
/**
@@ -372,6 +374,34 @@ export interface CssPart {
372374
deprecated?: boolean | string;
373375
}
374376

377+
/**
378+
* The description of a CSS Custom State
379+
* https://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet
380+
*/
381+
export interface CssCustomState {
382+
/**
383+
* The name of the state. Note: Unlike CSS custom properties, custom states
384+
* do not have a leading `--`.
385+
*/
386+
name: string;
387+
388+
/**
389+
* A markdown summary suitable for display in a listing.
390+
*/
391+
summary?: string;
392+
393+
/**
394+
* A markdown description.
395+
*/
396+
description?: string;
397+
398+
/**
399+
* Whether the CSS custom state is deprecated.
400+
* If the value is a string, it's the reason for the deprecation.
401+
*/
402+
deprecated?: boolean | string;
403+
}
404+
375405
export interface CssCustomProperty {
376406
/**
377407
* The name of the property, including leading `--`.
@@ -573,7 +603,7 @@ export interface ClassField extends PropertyLike {
573603
export interface CustomElementField extends ClassField {
574604
/**
575605
* The corresponding attribute name if there is one.
576-
*
606+
*
577607
* If this property is defined, the attribute must be listed in the classes'
578608
* `attributes` array.
579609
*/

schema.json

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,34 @@
258258
],
259259
"type": "object"
260260
},
261+
"CssCustomState": {
262+
"description": "The description of a CSS Custom State\nhttps://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet",
263+
"properties": {
264+
"deprecated": {
265+
"description": "Whether the CSS custom state is deprecated.\nIf the value is a string, it's the reason for the deprecation.",
266+
"type": [
267+
"string",
268+
"boolean"
269+
]
270+
},
271+
"description": {
272+
"description": "A markdown description.",
273+
"type": "string"
274+
},
275+
"name": {
276+
"description": "The name of the state. Note: Unlike CSS custom properties, custom states\ndo not have a leading `--`.",
277+
"type": "string"
278+
},
279+
"summary": {
280+
"description": "A markdown summary suitable for display in a listing.",
281+
"type": "string"
282+
}
283+
},
284+
"required": [
285+
"name"
286+
],
287+
"type": "object"
288+
},
261289
"CssPart": {
262290
"description": "The description of a CSS Part",
263291
"properties": {
@@ -307,6 +335,12 @@
307335
},
308336
"type": "array"
309337
},
338+
"cssStates": {
339+
"items": {
340+
"$ref": "#/definitions/CssCustomState"
341+
},
342+
"type": "array"
343+
},
310344
"customElement": {
311345
"description": "Distinguishes a regular JavaScript class from a\ncustom element class",
312346
"enum": [
@@ -451,6 +485,12 @@
451485
},
452486
"type": "array"
453487
},
488+
"cssStates": {
489+
"items": {
490+
"$ref": "#/definitions/CssCustomState"
491+
},
492+
"type": "array"
493+
},
454494
"customElement": {
455495
"description": "Distinguishes a regular JavaScript class from a\ncustom element class",
456496
"enum": [
@@ -765,7 +805,7 @@
765805
"type": "string"
766806
},
767807
"path": {
768-
"description": "Path to the javascript file needed to be imported. \n(not the path for example to a typescript file.)",
808+
"description": "Path to the javascript file needed to be imported.\n(not the path for example to a typescript file.)",
769809
"type": "string"
770810
},
771811
"summary": {

0 commit comments

Comments
 (0)