Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds CSSCustomState to schema #128

Merged
merged 3 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface JavaScriptModule {
kind: 'javascript-module';

/**
* Path to the javascript file needed to be imported.
* Path to the javascript file needed to be imported.
* (not the path for example to a typescript file.)
*/
path: string;
Expand Down Expand Up @@ -250,6 +250,8 @@ export interface CustomElement extends ClassLike {

cssProperties?: CssCustomProperty[];

cssStates?: CssCustomState[];

demos?: Demo[];

/**
Expand Down Expand Up @@ -372,6 +374,34 @@ export interface CssPart {
deprecated?: boolean | string;
}

/**
* The description of a CSS Custom State
justinfagnani marked this conversation as resolved.
Show resolved Hide resolved
* https://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet
*/
export interface CssCustomState {
/**
* The name of the state. Note: Unlike CSS custom properties, custom states
* do not have a leading `--`.
*/
name: string;
lukewarlow marked this conversation as resolved.
Show resolved Hide resolved

/**
* A markdown summary suitable for display in a listing.
*/
summary?: string;

/**
* A markdown description.
*/
description?: string;

/**
* Whether the CSS custom state is deprecated.
* If the value is a string, it's the reason for the deprecation.
*/
deprecated?: boolean | string;
}

export interface CssCustomProperty {
/**
* The name of the property, including leading `--`.
Expand Down Expand Up @@ -573,7 +603,7 @@ export interface ClassField extends PropertyLike {
export interface CustomElementField extends ClassField {
/**
* The corresponding attribute name if there is one.
*
*
* If this property is defined, the attribute must be listed in the classes'
* `attributes` array.
*/
Expand Down
42 changes: 41 additions & 1 deletion schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,34 @@
],
"type": "object"
},
"CssCustomState": {
"description": "The description of a CSS Custom State\nhttps://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet",
"properties": {
"deprecated": {
"description": "Whether the CSS custom state is deprecated.\nIf the value is a string, it's the reason for the deprecation.",
"type": [
"string",
"boolean"
]
},
"description": {
"description": "A markdown description.",
"type": "string"
},
"name": {
"description": "The name of the state. Note: Unlike CSS custom properties, custom states\ndo not have a leading `--`.",
"type": "string"
},
"summary": {
"description": "A markdown summary suitable for display in a listing.",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"CssPart": {
"description": "The description of a CSS Part",
"properties": {
Expand Down Expand Up @@ -307,6 +335,12 @@
},
"type": "array"
},
"cssStates": {
"items": {
"$ref": "#/definitions/CssCustomState"
},
"type": "array"
},
"customElement": {
"description": "Distinguishes a regular JavaScript class from a\ncustom element class",
"enum": [
Expand Down Expand Up @@ -451,6 +485,12 @@
},
"type": "array"
},
"cssStates": {
"items": {
"$ref": "#/definitions/CssCustomState"
},
"type": "array"
},
"customElement": {
"description": "Distinguishes a regular JavaScript class from a\ncustom element class",
"enum": [
Expand Down Expand Up @@ -765,7 +805,7 @@
"type": "string"
},
"path": {
"description": "Path to the javascript file needed to be imported. \n(not the path for example to a typescript file.)",
"description": "Path to the javascript file needed to be imported.\n(not the path for example to a typescript file.)",
"type": "string"
},
"summary": {
Expand Down
Loading