Skip to content

Commit 3957ced

Browse files
authored
feat: add deprecated flag (#89)
1 parent 80b48f1 commit 3957ced

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

schema.d.ts

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ export interface Package {
4040
* An array of the modules this package contains.
4141
*/
4242
modules: Array<Module>;
43+
44+
/**
45+
* Whether the package is deprecated.
46+
* If the value is a string, it's the reason for the deprecation.
47+
*/
48+
deprecated?: boolean|string;
4349
}
4450

4551
// This type may expand in the future to include JSON, CSS, or HTML
@@ -75,6 +81,12 @@ export interface JavaScriptModule {
7581
* custom element definitions.
7682
*/
7783
exports?: Array<Export>;
84+
85+
/**
86+
* Whether the module is deprecated.
87+
* If the value is a string, it's the reason for the deprecation.
88+
*/
89+
deprecated?: boolean|string;
7890
}
7991

8092
export type Export = JavaScriptExport | CustomElementExport;
@@ -102,6 +114,12 @@ export interface JavaScriptExport {
102114
* defined and the `name` field must be `"*"`.
103115
*/
104116
declaration: Reference;
117+
118+
/**
119+
* Whether the export is deprecated. For example, the name of the export was changed.
120+
* If the value is a string, it's the reason for the deprecation.
121+
*/
122+
deprecated?: boolean|string;
105123
}
106124

107125
/**
@@ -124,6 +142,13 @@ export interface CustomElementExport {
124142
* custom element.
125143
*/
126144
declaration: Reference;
145+
146+
/**
147+
* Whether the custom-element export is deprecated.
148+
* For example, a future version will not register the custom element in this file.
149+
* If the value is a string, it's the reason for the deprecation.
150+
*/
151+
deprecated?: boolean|string;
127152
}
128153

129154
export type Declaration =
@@ -226,6 +251,12 @@ export interface CustomElement extends ClassLike {
226251
customElement: true;
227252

228253
members?: Array<CustomElementMember>;
254+
255+
/**
256+
* Whether the custom element is deprecated.
257+
* If the value is a string, it's the reason for the deprecation.
258+
*/
259+
deprecated?: boolean|string;
229260
}
230261

231262
export type CustomElementMember = CustomElementField | ClassMethod;
@@ -262,6 +293,12 @@ export interface Attribute {
262293
* The name of the field this attribute is associated with, if any.
263294
*/
264295
fieldName?: string;
296+
297+
/**
298+
* Whether the attribute is deprecated.
299+
* If the value is a string, it's the reason for the deprecation.
300+
*/
301+
deprecated?: boolean|string;
265302
}
266303

267304
export interface Event {
@@ -283,6 +320,12 @@ export interface Event {
283320
type: Type;
284321

285322
inheritedFrom?: Reference;
323+
324+
/**
325+
* Whether the event is deprecated.
326+
* If the value is a string, it's the reason for the deprecation.
327+
*/
328+
deprecated?: boolean|string;
286329
}
287330

288331
export interface Slot {
@@ -300,6 +343,12 @@ export interface Slot {
300343
* A markdown description.
301344
*/
302345
description?: string;
346+
347+
/**
348+
* Whether the slot is deprecated.
349+
* If the value is a string, it's the reason for the deprecation.
350+
*/
351+
deprecated?: boolean|string;
303352
}
304353

305354
/**
@@ -317,6 +366,12 @@ export interface CssPart {
317366
* A markdown description.
318367
*/
319368
description?: string;
369+
370+
/**
371+
* Whether the CSS shadow part is deprecated.
372+
* If the value is a string, it's the reason for the deprecation.
373+
*/
374+
deprecated?: boolean|string;
320375
}
321376

322377
export interface CssCustomProperty {
@@ -351,6 +406,12 @@ export interface CssCustomProperty {
351406
* A markdown description.
352407
*/
353408
description?: string;
409+
410+
/**
411+
* Whether the CSS custom property is deprecated.
412+
* If the value is a string, it's the reason for the deprecation.
413+
*/
414+
deprecated?: boolean|string;
354415
}
355416

356417
export interface Type {
@@ -453,6 +514,12 @@ export interface ClassLike {
453514
members?: Array<ClassMember>;
454515

455516
source?: SourceReference;
517+
518+
/**
519+
* Whether the class or mixin is deprecated.
520+
* If the value is a string, it's the reason for the deprecation.
521+
*/
522+
deprecated?: boolean|string;
456523
}
457524

458525
export interface ClassDeclaration extends ClassLike {
@@ -481,6 +548,12 @@ export interface PropertyLike {
481548
type?: Type;
482549

483550
default?: string;
551+
552+
/**
553+
* Whether the property is deprecated.
554+
* If the value is a string, it's the reason for the deprecation.
555+
*/
556+
deprecated?: boolean|string;
484557
}
485558

486559
export interface ClassField extends PropertyLike {

0 commit comments

Comments
 (0)