@ui5/webcomponents-tools 1.22.0-rc.0 → 1.22.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/components-package/nps.js +5 -5
- package/lib/amd-to-es6/index.js +104 -0
- package/lib/cem/custom-elements-manifest.config.mjs +57 -21
- package/lib/cem/event.mjs +24 -3
- package/lib/cem/types-internal.d.ts +554 -785
- package/lib/cem/types.d.ts +520 -655
- package/lib/cem/utils.mjs +9 -10
- package/lib/cem/validate.js +15 -13
- package/lib/create-illustrations/index.js +21 -31
- package/lib/create-new-component/tsFileContentTemplate.js +2 -11
- package/lib/generate-custom-elements-manifest/index.js +51 -107
- package/lib/generate-js-imports/illustrations.js +9 -9
- package/package.json +2 -2
- package/lib/esm-abs-to-rel/index.js +0 -61
- package/lib/replace-global-core/index.js +0 -25
@@ -1,4 +1,12 @@
|
|
1
|
-
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
* Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
|
4
|
+
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
5
|
+
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
6
|
+
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
7
|
+
* Code distributed by Google as part of the polymer project is also
|
8
|
+
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
9
|
+
*/
|
2
10
|
|
3
11
|
/**
|
4
12
|
* The top-level interface of a custom elements manifest file.
|
@@ -15,14 +23,10 @@ export type Privacy = "private" | "protected" | "public"
|
|
15
23
|
*/
|
16
24
|
export interface Package {
|
17
25
|
/**
|
18
|
-
*
|
19
|
-
* If the value is a string, it's the reason for the deprecation.
|
20
|
-
*/
|
21
|
-
deprecated?: string | boolean
|
22
|
-
/**
|
23
|
-
* An array of the modules this package contains.
|
26
|
+
* The version of the schema used in this file.
|
24
27
|
*/
|
25
|
-
|
28
|
+
schemaVersion: string;
|
29
|
+
|
26
30
|
/**
|
27
31
|
* The Markdown to use for the main readme of this package.
|
28
32
|
*
|
@@ -30,112 +34,137 @@ export interface Package {
|
|
30
34
|
* file contains information irrelevant to custom element catalogs and
|
31
35
|
* documentation viewers.
|
32
36
|
*/
|
33
|
-
readme?: string
|
37
|
+
readme?: string;
|
38
|
+
|
34
39
|
/**
|
35
|
-
*
|
40
|
+
* An array of the modules this package contains.
|
41
|
+
*/
|
42
|
+
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.
|
36
47
|
*/
|
37
|
-
|
48
|
+
deprecated?: boolean | string;
|
38
49
|
}
|
50
|
+
|
51
|
+
// This type may expand in the future to include JSON, CSS, or HTML
|
52
|
+
// modules.
|
53
|
+
export type Module = JavaScriptModule;
|
54
|
+
|
39
55
|
export interface JavaScriptModule {
|
56
|
+
kind: 'javascript-module';
|
57
|
+
|
40
58
|
/**
|
41
|
-
*
|
42
|
-
*
|
43
|
-
* For documentation purposes, all declarations that are reachable from
|
44
|
-
* exports should be described here. Ie, functions and objects that may be
|
45
|
-
* properties of exported objects, or passed as arguments to functions.
|
59
|
+
* Path to the javascript file needed to be imported.
|
60
|
+
* (not the path for example to a typescript file.)
|
46
61
|
*/
|
47
|
-
|
48
|
-
|
49
|
-
| EnumDeclaration
|
50
|
-
| InterfaceDeclaration
|
51
|
-
| FunctionDeclaration
|
52
|
-
| MixinDeclaration
|
53
|
-
| VariableDeclaration
|
54
|
-
| CustomElementDeclaration
|
55
|
-
| CustomElementMixinDeclaration
|
56
|
-
)[]
|
62
|
+
path: string;
|
63
|
+
|
57
64
|
/**
|
58
|
-
*
|
59
|
-
* If the value is a string, it's the reason for the deprecation.
|
65
|
+
* A markdown summary suitable for display in a listing.
|
60
66
|
*/
|
61
|
-
|
67
|
+
summary?: string;
|
68
|
+
|
62
69
|
/**
|
63
70
|
* A markdown description of the module.
|
64
71
|
*/
|
65
|
-
description?: string
|
72
|
+
description?: string;
|
73
|
+
|
74
|
+
/**
|
75
|
+
* The declarations of a module.
|
76
|
+
*
|
77
|
+
* For documentation purposes, all declarations that are reachable from
|
78
|
+
* exports should be described here. Ie, functions and objects that may be
|
79
|
+
* properties of exported objects, or passed as arguments to functions.
|
80
|
+
*/
|
81
|
+
declarations?: Array<Declaration>;
|
82
|
+
|
66
83
|
/**
|
67
84
|
* The exports of a module. This includes JavaScript exports and
|
68
85
|
* custom element definitions.
|
69
86
|
*/
|
70
|
-
exports?:
|
71
|
-
|
87
|
+
exports?: Array<Export>;
|
88
|
+
|
72
89
|
/**
|
73
|
-
*
|
74
|
-
*
|
90
|
+
* Whether the module is deprecated.
|
91
|
+
* If the value is a string, it's the reason for the deprecation.
|
75
92
|
*/
|
76
|
-
|
93
|
+
deprecated?: boolean | string;
|
94
|
+
}
|
95
|
+
|
96
|
+
export type Export = JavaScriptExport | CustomElementExport;
|
97
|
+
|
98
|
+
export interface JavaScriptExport {
|
99
|
+
kind: 'js';
|
100
|
+
|
77
101
|
/**
|
78
|
-
*
|
102
|
+
* The name of the exported symbol.
|
103
|
+
*
|
104
|
+
* JavaScript has a number of ways to export objects which determine the
|
105
|
+
* correct name to use.
|
106
|
+
*
|
107
|
+
* - Default exports must use the name "default".
|
108
|
+
* - Named exports use the name that is exported. If the export is renamed
|
109
|
+
* with the "as" clause, use the exported name.
|
110
|
+
* - Aggregating exports (`* from`) should use the name `*`
|
79
111
|
*/
|
80
|
-
|
81
|
-
|
82
|
-
export interface ClassDeclaration {
|
83
|
-
_ui5package?: string
|
84
|
-
_ui5implements?: Reference[]
|
85
|
-
_ui5privacy?: Privacy
|
112
|
+
name: string;
|
113
|
+
|
86
114
|
/**
|
87
|
-
*
|
115
|
+
* A reference to the exported declaration.
|
116
|
+
*
|
117
|
+
* In the case of aggregating exports, the reference's `module` field must be
|
118
|
+
* defined and the `name` field must be `"*"`.
|
88
119
|
*/
|
89
|
-
|
120
|
+
declaration: Reference;
|
121
|
+
|
90
122
|
/**
|
91
|
-
* Whether the
|
123
|
+
* Whether the export is deprecated. For example, the name of the export was changed.
|
92
124
|
* If the value is a string, it's the reason for the deprecation.
|
93
125
|
*/
|
94
|
-
deprecated?:
|
126
|
+
deprecated?: boolean | string;
|
127
|
+
}
|
128
|
+
|
129
|
+
/**
|
130
|
+
* A global custom element defintion, ie the result of a
|
131
|
+
* `customElements.define()` call.
|
132
|
+
*
|
133
|
+
* This is represented as an export because a definition makes the element
|
134
|
+
* available outside of the module it's defined it.
|
135
|
+
*/
|
136
|
+
export interface CustomElementExport {
|
137
|
+
kind: 'custom-element-definition';
|
138
|
+
|
95
139
|
/**
|
96
|
-
*
|
140
|
+
* The tag name of the custom element.
|
97
141
|
*/
|
98
|
-
|
99
|
-
|
100
|
-
members?: (ClassField | ClassMethod)[]
|
142
|
+
name: string;
|
143
|
+
|
101
144
|
/**
|
102
|
-
*
|
103
|
-
*
|
104
|
-
* If mixins are applied in the class definition, then the true superclass
|
105
|
-
* of this class is the result of applying mixins in order to the superclass.
|
106
|
-
*
|
107
|
-
* Mixins must be listed in order of their application to the superclass or
|
108
|
-
* previous mixin application. This means that the innermost mixin is listed
|
109
|
-
* first. This may read backwards from the common order in JavaScript, but
|
110
|
-
* matches the order of language used to describe mixin application, like
|
111
|
-
* "S with A, B".
|
145
|
+
* A reference to the class or other declaration that implements the
|
146
|
+
* custom element.
|
112
147
|
*/
|
113
|
-
|
114
|
-
|
115
|
-
source?: SourceReference
|
148
|
+
declaration: Reference;
|
149
|
+
|
116
150
|
/**
|
117
|
-
*
|
151
|
+
* Whether the custom-element export is deprecated.
|
152
|
+
* For example, a future version will not register the custom element in this file.
|
153
|
+
* If the value is a string, it's the reason for the deprecation.
|
118
154
|
*/
|
119
|
-
|
120
|
-
/**
|
121
|
-
* A reference to an export of a module.
|
122
|
-
*
|
123
|
-
* All references are required to be publically accessible, so the canonical
|
124
|
-
* representation of a reference is the export it's available from.
|
125
|
-
*
|
126
|
-
* `package` should generally refer to an npm package name. If `package` is
|
127
|
-
* undefined then the reference is local to this package. If `module` is
|
128
|
-
* undefined the reference is local to the containing module.
|
129
|
-
*
|
130
|
-
* References to global symbols like `Array`, `HTMLElement`, or `Event` should
|
131
|
-
* use a `package` name of `"global:"`.
|
132
|
-
*/
|
133
|
-
superclass?: {
|
134
|
-
module?: string
|
135
|
-
name: string
|
136
|
-
package?: string
|
137
|
-
}
|
155
|
+
deprecated?: boolean | string;
|
138
156
|
}
|
157
|
+
|
158
|
+
export type Declaration =
|
159
|
+
| ClassDeclaration
|
160
|
+
| FunctionDeclaration
|
161
|
+
| MixinDeclaration
|
162
|
+
| VariableDeclaration
|
163
|
+
| CustomElementDeclaration
|
164
|
+
| EnumDeclaration
|
165
|
+
| InterfaceDeclaration
|
166
|
+
| CustomElementMixinDeclaration;
|
167
|
+
|
139
168
|
/**
|
140
169
|
* A reference to an export of a module.
|
141
170
|
*
|
@@ -150,44 +179,11 @@ export interface ClassDeclaration {
|
|
150
179
|
* use a `package` name of `"global:"`.
|
151
180
|
*/
|
152
181
|
export interface Reference {
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
}
|
157
|
-
export interface ClassField {
|
158
|
-
_ui5validator?: string
|
159
|
-
_ui5formProperty?: boolean
|
160
|
-
_ui5formEvents?: string
|
161
|
-
/**
|
162
|
-
* Marks when the field was introduced
|
163
|
-
*/
|
164
|
-
_ui5since?: string
|
165
|
-
default?: string
|
166
|
-
/**
|
167
|
-
* Whether the property is deprecated.
|
168
|
-
* If the value is a string, it's the reason for the deprecation.
|
169
|
-
*/
|
170
|
-
deprecated?: string | boolean
|
171
|
-
/**
|
172
|
-
* A markdown description of the field.
|
173
|
-
*/
|
174
|
-
description?: string
|
175
|
-
inheritedFrom?: Reference
|
176
|
-
kind: "field"
|
177
|
-
name: string
|
178
|
-
privacy?: Privacy
|
179
|
-
/**
|
180
|
-
* Whether the property is read-only.
|
181
|
-
*/
|
182
|
-
readonly?: boolean
|
183
|
-
source?: SourceReference
|
184
|
-
static?: boolean
|
185
|
-
/**
|
186
|
-
* A markdown summary suitable for display in a listing.
|
187
|
-
*/
|
188
|
-
summary?: string
|
189
|
-
type?: Type
|
182
|
+
name: string;
|
183
|
+
package?: string;
|
184
|
+
module?: string;
|
190
185
|
}
|
186
|
+
|
191
187
|
/**
|
192
188
|
* A reference to the source of a declaration or member.
|
193
189
|
*/
|
@@ -195,432 +191,328 @@ export interface SourceReference {
|
|
195
191
|
/**
|
196
192
|
* An absolute URL to the source (ie. a GitHub URL).
|
197
193
|
*/
|
198
|
-
href: string
|
199
|
-
}
|
200
|
-
export interface Type {
|
201
|
-
/**
|
202
|
-
* An array of references to the types in the type string.
|
203
|
-
*
|
204
|
-
* These references have optional indices into the type string so that tools
|
205
|
-
* can understand the references in the type string independently of the type
|
206
|
-
* system and syntax. For example, a documentation viewer could display the
|
207
|
-
* type `Array<FooElement | BarElement>` with cross-references to `FooElement`
|
208
|
-
* and `BarElement` without understanding arrays, generics, or union types.
|
209
|
-
*/
|
210
|
-
references?: TypeReference[]
|
211
|
-
source?: SourceReference
|
212
|
-
/**
|
213
|
-
* The full string representation of the type, in whatever type syntax is
|
214
|
-
* used, such as JSDoc, Closure, or TypeScript.
|
215
|
-
*/
|
216
|
-
text: string
|
194
|
+
href: string;
|
217
195
|
}
|
196
|
+
|
218
197
|
/**
|
219
|
-
* A
|
220
|
-
* within the string.
|
198
|
+
* A description of a custom element class.
|
221
199
|
*
|
222
|
-
*
|
223
|
-
*
|
224
|
-
*
|
225
|
-
*
|
200
|
+
* Custom elements are JavaScript classes, so this extends from
|
201
|
+
* `ClassDeclaration` and adds custom-element-specific features like
|
202
|
+
* attributes, events, and slots.
|
203
|
+
*
|
204
|
+
* Note that `tagName` in this interface is optional. Tag names are not
|
205
|
+
* neccessarily part of a custom element class, but belong to the definition
|
206
|
+
* (often called the "registration") or the `customElements.define()` call.
|
207
|
+
*
|
208
|
+
* Because classes and tag names can only be registered once, there's a
|
209
|
+
* one-to-one relationship between classes and tag names. For ease of use,
|
210
|
+
* we allow the tag name here.
|
211
|
+
*
|
212
|
+
* Some packages define and register custom elements in separate modules. In
|
213
|
+
* these cases one `Module` should contain the `CustomElement` without a
|
214
|
+
* tagName, and another `Module` should contain the
|
215
|
+
* `CustomElementExport`.
|
226
216
|
*/
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
}
|
234
|
-
export interface ClassMethod {
|
217
|
+
// Note: this needs to be an interface to be included in the generated JSON
|
218
|
+
// Schema output.
|
219
|
+
export interface CustomElementDeclaration
|
220
|
+
extends ClassDeclaration,
|
221
|
+
CustomElement {
|
222
|
+
_ui5abstract?: boolean
|
235
223
|
/**
|
236
224
|
* Marks when the field was introduced
|
237
225
|
*/
|
238
226
|
_ui5since?: string
|
227
|
+
}
|
228
|
+
|
229
|
+
/**
|
230
|
+
* The additional fields that a custom element adds to classes and mixins.
|
231
|
+
*/
|
232
|
+
export interface CustomElement extends ClassLike {
|
239
233
|
/**
|
240
|
-
*
|
241
|
-
*
|
234
|
+
* An optional tag name that should be specified if this is a
|
235
|
+
* self-registering element.
|
236
|
+
*
|
237
|
+
* Self-registering elements must also include a CustomElementExport
|
238
|
+
* in the module's exports.
|
242
239
|
*/
|
243
|
-
|
240
|
+
tagName?: string;
|
241
|
+
|
244
242
|
/**
|
245
|
-
*
|
243
|
+
* The attributes that this element is known to understand.
|
246
244
|
*/
|
247
|
-
|
248
|
-
|
249
|
-
kind: "method"
|
250
|
-
name: string
|
251
|
-
parameters?: Parameter[]
|
252
|
-
privacy?: Privacy
|
253
|
-
return?: {
|
254
|
-
/**
|
255
|
-
* A markdown description.
|
256
|
-
*/
|
257
|
-
description?: string
|
258
|
-
/**
|
259
|
-
* A markdown summary suitable for display in a listing.
|
260
|
-
*/
|
261
|
-
summary?: string
|
262
|
-
type?: Type
|
263
|
-
[k: string]: unknown
|
264
|
-
}
|
265
|
-
source?: SourceReference
|
266
|
-
static?: boolean
|
245
|
+
attributes?: Attribute[];
|
246
|
+
|
267
247
|
/**
|
268
|
-
*
|
248
|
+
* The events that this element fires.
|
269
249
|
*/
|
270
|
-
|
271
|
-
|
272
|
-
export interface Parameter {
|
273
|
-
_ui5privacy?: Privacy
|
250
|
+
events?: Event[];
|
251
|
+
|
274
252
|
/**
|
275
|
-
*
|
253
|
+
* The shadow dom content slots that this element accepts.
|
276
254
|
*/
|
277
|
-
|
278
|
-
|
255
|
+
slots?: Slot[];
|
256
|
+
|
257
|
+
cssParts?: CssPart[];
|
258
|
+
|
259
|
+
cssProperties?: CssCustomProperty[];
|
260
|
+
|
261
|
+
demos?: Demo[];
|
262
|
+
|
279
263
|
/**
|
280
|
-
*
|
281
|
-
*
|
264
|
+
* Distinguishes a regular JavaScript class from a
|
265
|
+
* custom element class
|
282
266
|
*/
|
283
|
-
|
267
|
+
customElement: true;
|
268
|
+
}
|
269
|
+
|
270
|
+
export interface Attribute {
|
271
|
+
name: string;
|
272
|
+
|
284
273
|
/**
|
285
|
-
* A markdown
|
274
|
+
* A markdown summary suitable for display in a listing.
|
286
275
|
*/
|
287
|
-
|
288
|
-
|
276
|
+
summary?: string;
|
277
|
+
|
289
278
|
/**
|
290
|
-
*
|
279
|
+
* A markdown description.
|
291
280
|
*/
|
292
|
-
|
281
|
+
description?: string;
|
282
|
+
|
283
|
+
inheritedFrom?: Reference;
|
284
|
+
|
293
285
|
/**
|
294
|
-
*
|
286
|
+
* The type that the attribute will be serialized/deserialized as.
|
295
287
|
*/
|
296
|
-
|
288
|
+
type?: Type;
|
289
|
+
|
297
290
|
/**
|
298
|
-
*
|
299
|
-
*
|
291
|
+
* The default value of the attribute, if any.
|
292
|
+
*
|
293
|
+
* As attributes are always strings, this is the actual value, not a human
|
294
|
+
* readable description.
|
300
295
|
*/
|
301
|
-
|
296
|
+
default?: string;
|
297
|
+
|
302
298
|
/**
|
303
|
-
*
|
299
|
+
* The name of the field this attribute is associated with, if any.
|
300
|
+
*/
|
301
|
+
fieldName?: string;
|
302
|
+
|
303
|
+
/**
|
304
|
+
* Whether the attribute is deprecated.
|
305
|
+
* If the value is a string, it's the reason for the deprecation.
|
304
306
|
*/
|
305
|
-
|
306
|
-
type?: Type
|
307
|
+
deprecated?: boolean | string;
|
307
308
|
}
|
308
|
-
|
309
|
-
|
309
|
+
|
310
|
+
export interface EnumDeclaration extends ClassDeclaration {
|
311
|
+
kind: "enum"
|
312
|
+
};
|
313
|
+
|
314
|
+
export interface InterfaceDeclaration extends ClassDeclaration {
|
315
|
+
kind: "interface"
|
316
|
+
}
|
317
|
+
|
318
|
+
export interface Event {
|
319
|
+
_ui5package?: string;
|
320
|
+
_ui5parameters?: Parameter[]
|
310
321
|
_ui5privacy?: Privacy
|
322
|
+
/**
|
323
|
+
* Whether the parameter is optional. Undefined implies non-optional.
|
324
|
+
*/
|
325
|
+
_ui5allowPreventDefault?: boolean
|
311
326
|
/**
|
312
327
|
* Marks when the field was introduced
|
313
328
|
*/
|
314
329
|
_ui5since?: string
|
330
|
+
name: string;
|
331
|
+
|
315
332
|
/**
|
316
|
-
*
|
317
|
-
* If the value is a string, it's the reason for the deprecation.
|
333
|
+
* A markdown summary suitable for display in a listing.
|
318
334
|
*/
|
319
|
-
|
335
|
+
summary?: string;
|
336
|
+
|
320
337
|
/**
|
321
|
-
* A markdown description
|
338
|
+
* A markdown description.
|
322
339
|
*/
|
323
|
-
description?: string
|
324
|
-
|
325
|
-
members?: ClassField[]
|
340
|
+
description?: string;
|
341
|
+
|
326
342
|
/**
|
327
|
-
*
|
328
|
-
*
|
329
|
-
* If mixins are applied in the class definition, then the true superclass
|
330
|
-
* of this class is the result of applying mixins in order to the superclass.
|
331
|
-
*
|
332
|
-
* Mixins must be listed in order of their application to the superclass or
|
333
|
-
* previous mixin application. This means that the innermost mixin is listed
|
334
|
-
* first. This may read backwards from the common order in JavaScript, but
|
335
|
-
* matches the order of language used to describe mixin application, like
|
336
|
-
* "S with A, B".
|
343
|
+
* The type of the event object that's fired.
|
337
344
|
*/
|
338
|
-
|
339
|
-
|
340
|
-
|
345
|
+
type: Type;
|
346
|
+
|
347
|
+
inheritedFrom?: Reference;
|
348
|
+
|
341
349
|
/**
|
342
|
-
*
|
350
|
+
* Whether the event is deprecated.
|
351
|
+
* If the value is a string, it's the reason for the deprecation.
|
343
352
|
*/
|
344
|
-
|
345
|
-
/**
|
346
|
-
* A reference to an export of a module.
|
347
|
-
*
|
348
|
-
* All references are required to be publically accessible, so the canonical
|
349
|
-
* representation of a reference is the export it's available from.
|
350
|
-
*
|
351
|
-
* `package` should generally refer to an npm package name. If `package` is
|
352
|
-
* undefined then the reference is local to this package. If `module` is
|
353
|
-
* undefined the reference is local to the containing module.
|
354
|
-
*
|
355
|
-
* References to global symbols like `Array`, `HTMLElement`, or `Event` should
|
356
|
-
* use a `package` name of `"global:"`.
|
357
|
-
*/
|
358
|
-
superclass?: {
|
359
|
-
module?: string
|
360
|
-
name: string
|
361
|
-
package?: string
|
362
|
-
}
|
353
|
+
deprecated?: boolean | string;
|
363
354
|
}
|
364
|
-
|
365
|
-
|
355
|
+
|
356
|
+
export interface Slot {
|
357
|
+
_ui5propertyName?: string
|
358
|
+
_ui5type?: Type
|
366
359
|
_ui5privacy?: Privacy
|
367
360
|
/**
|
368
361
|
* Marks when the field was introduced
|
369
362
|
*/
|
370
363
|
_ui5since?: string
|
371
364
|
/**
|
372
|
-
*
|
373
|
-
* If the value is a string, it's the reason for the deprecation.
|
374
|
-
*/
|
375
|
-
deprecated?: string | boolean
|
376
|
-
/**
|
377
|
-
* A markdown description of the class.
|
378
|
-
*/
|
379
|
-
description?: string
|
380
|
-
kind: "interface"
|
381
|
-
/**
|
382
|
-
* Any class mixins applied in the extends clause of this class.
|
383
|
-
*
|
384
|
-
* If mixins are applied in the class definition, then the true superclass
|
385
|
-
* of this class is the result of applying mixins in order to the superclass.
|
386
|
-
*
|
387
|
-
* Mixins must be listed in order of their application to the superclass or
|
388
|
-
* previous mixin application. This means that the innermost mixin is listed
|
389
|
-
* first. This may read backwards from the common order in JavaScript, but
|
390
|
-
* matches the order of language used to describe mixin application, like
|
391
|
-
* "S with A, B".
|
365
|
+
* The slot name, or the empty string for an unnamed slot.
|
392
366
|
*/
|
393
|
-
|
394
|
-
|
395
|
-
source?: SourceReference
|
367
|
+
name: string;
|
368
|
+
|
396
369
|
/**
|
397
370
|
* A markdown summary suitable for display in a listing.
|
398
371
|
*/
|
399
|
-
summary?: string
|
400
|
-
|
401
|
-
* A reference to an export of a module.
|
402
|
-
*
|
403
|
-
* All references are required to be publically accessible, so the canonical
|
404
|
-
* representation of a reference is the export it's available from.
|
405
|
-
*
|
406
|
-
* `package` should generally refer to an npm package name. If `package` is
|
407
|
-
* undefined then the reference is local to this package. If `module` is
|
408
|
-
* undefined the reference is local to the containing module.
|
409
|
-
*
|
410
|
-
* References to global symbols like `Array`, `HTMLElement`, or `Event` should
|
411
|
-
* use a `package` name of `"global:"`.
|
412
|
-
*/
|
413
|
-
superclass?: {
|
414
|
-
module?: string
|
415
|
-
name: string
|
416
|
-
package?: string
|
417
|
-
}
|
418
|
-
}
|
419
|
-
export interface FunctionDeclaration {
|
420
|
-
_ui5package?: string
|
372
|
+
summary?: string;
|
373
|
+
|
421
374
|
/**
|
422
|
-
*
|
375
|
+
* A markdown description.
|
423
376
|
*/
|
424
|
-
|
377
|
+
description?: string;
|
378
|
+
|
425
379
|
/**
|
426
|
-
* Whether the
|
380
|
+
* Whether the slot is deprecated.
|
427
381
|
* If the value is a string, it's the reason for the deprecation.
|
428
382
|
*/
|
429
|
-
deprecated?:
|
383
|
+
deprecated?: boolean | string;
|
384
|
+
}
|
385
|
+
|
386
|
+
/**
|
387
|
+
* The description of a CSS Part
|
388
|
+
*/
|
389
|
+
export interface CssPart {
|
390
|
+
name: string;
|
391
|
+
|
430
392
|
/**
|
431
|
-
* A markdown
|
393
|
+
* A markdown summary suitable for display in a listing.
|
432
394
|
*/
|
433
|
-
|
434
|
-
|
435
|
-
name: string
|
436
|
-
parameters?: Parameter[]
|
437
|
-
return?: {
|
438
|
-
/**
|
439
|
-
* A markdown description.
|
440
|
-
*/
|
441
|
-
description?: string
|
442
|
-
/**
|
443
|
-
* A markdown summary suitable for display in a listing.
|
444
|
-
*/
|
445
|
-
summary?: string
|
446
|
-
type?: Type
|
447
|
-
[k: string]: unknown
|
448
|
-
}
|
449
|
-
source?: SourceReference
|
395
|
+
summary?: string;
|
396
|
+
|
450
397
|
/**
|
451
|
-
* A markdown
|
398
|
+
* A markdown description.
|
452
399
|
*/
|
453
|
-
|
454
|
-
|
455
|
-
/**
|
456
|
-
* A description of a class mixin.
|
457
|
-
*
|
458
|
-
* Mixins are functions which generate a new subclass of a given superclass.
|
459
|
-
* This interfaces describes the class and custom element features that
|
460
|
-
* are added by the mixin. As such, it extends the CustomElement interface and
|
461
|
-
* ClassLike interface.
|
462
|
-
*
|
463
|
-
* Since mixins are functions, it also extends the FunctionLike interface. This
|
464
|
-
* means a mixin is callable, and has parameters and a return type.
|
465
|
-
*
|
466
|
-
* The return type is often hard or impossible to accurately describe in type
|
467
|
-
* systems like TypeScript. It requires generics and an `extends` operator
|
468
|
-
* that TypeScript lacks. Therefore it's recommended that the return type is
|
469
|
-
* left empty. The most common form of a mixin function takes a single
|
470
|
-
* argument, so consumers of this interface should assume that the return type
|
471
|
-
* is the single argument subclassed by this declaration.
|
472
|
-
*
|
473
|
-
* A mixin should not have a superclass. If a mixins composes other mixins,
|
474
|
-
* they should be listed in the `mixins` field.
|
475
|
-
*
|
476
|
-
* See [this article]{@link https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/}
|
477
|
-
* for more information on the classmixin pattern in JavaScript.
|
478
|
-
*/
|
479
|
-
export interface MixinDeclaration {
|
480
|
-
_ui5package?: string
|
400
|
+
description?: string;
|
401
|
+
|
481
402
|
/**
|
482
|
-
* Whether the
|
403
|
+
* Whether the CSS shadow part is deprecated.
|
483
404
|
* If the value is a string, it's the reason for the deprecation.
|
484
405
|
*/
|
485
|
-
deprecated?:
|
406
|
+
deprecated?: boolean | string;
|
407
|
+
}
|
408
|
+
|
409
|
+
export interface CssCustomProperty {
|
486
410
|
/**
|
487
|
-
*
|
411
|
+
* The name of the property, including leading `--`.
|
488
412
|
*/
|
489
|
-
|
490
|
-
|
491
|
-
members?: (ClassField | ClassMethod)[]
|
413
|
+
name: string;
|
414
|
+
|
492
415
|
/**
|
493
|
-
*
|
416
|
+
* The expected syntax of the defined property. Defaults to "*".
|
494
417
|
*
|
495
|
-
*
|
496
|
-
*
|
418
|
+
* The syntax must be a valid CSS [syntax string](https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax)
|
419
|
+
* as defined in the CSS Properties and Values API.
|
497
420
|
*
|
498
|
-
*
|
499
|
-
*
|
500
|
-
*
|
501
|
-
*
|
502
|
-
* "
|
421
|
+
* Examples:
|
422
|
+
*
|
423
|
+
* "<color>": accepts a color
|
424
|
+
* "<length> | <percentage>": accepts lengths or percentages but not calc expressions with a combination of the two
|
425
|
+
* "small | medium | large": accepts one of these values set as custom idents.
|
426
|
+
* "*": any valid token
|
503
427
|
*/
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
/**
|
509
|
-
* A markdown description.
|
510
|
-
*/
|
511
|
-
description?: string
|
512
|
-
/**
|
513
|
-
* A markdown summary suitable for display in a listing.
|
514
|
-
*/
|
515
|
-
summary?: string
|
516
|
-
type?: Type
|
517
|
-
[k: string]: unknown
|
518
|
-
}
|
519
|
-
source?: SourceReference
|
428
|
+
syntax?: string;
|
429
|
+
|
430
|
+
default?: string;
|
431
|
+
|
520
432
|
/**
|
521
433
|
* A markdown summary suitable for display in a listing.
|
522
434
|
*/
|
523
|
-
summary?: string
|
524
|
-
|
525
|
-
* A reference to an export of a module.
|
526
|
-
*
|
527
|
-
* All references are required to be publically accessible, so the canonical
|
528
|
-
* representation of a reference is the export it's available from.
|
529
|
-
*
|
530
|
-
* `package` should generally refer to an npm package name. If `package` is
|
531
|
-
* undefined then the reference is local to this package. If `module` is
|
532
|
-
* undefined the reference is local to the containing module.
|
533
|
-
*
|
534
|
-
* References to global symbols like `Array`, `HTMLElement`, or `Event` should
|
535
|
-
* use a `package` name of `"global:"`.
|
536
|
-
*/
|
537
|
-
superclass?: {
|
538
|
-
module?: string
|
539
|
-
name: string
|
540
|
-
package?: string
|
541
|
-
}
|
542
|
-
}
|
543
|
-
export interface VariableDeclaration {
|
544
|
-
_ui5package?: string
|
545
|
-
default?: string
|
435
|
+
summary?: string;
|
436
|
+
|
546
437
|
/**
|
547
|
-
*
|
548
|
-
* If the value is a string, it's the reason for the deprecation.
|
438
|
+
* A markdown description.
|
549
439
|
*/
|
550
|
-
|
440
|
+
description?: string;
|
441
|
+
|
551
442
|
/**
|
552
|
-
*
|
443
|
+
* Whether the CSS custom property is deprecated.
|
444
|
+
* If the value is a string, it's the reason for the deprecation.
|
553
445
|
*/
|
554
|
-
|
555
|
-
|
556
|
-
|
446
|
+
deprecated?: boolean | string;
|
447
|
+
}
|
448
|
+
|
449
|
+
export interface Type {
|
557
450
|
/**
|
558
|
-
*
|
451
|
+
* The full string representation of the type, in whatever type syntax is
|
452
|
+
* used, such as JSDoc, Closure, or TypeScript.
|
559
453
|
*/
|
560
|
-
|
561
|
-
|
454
|
+
text: string;
|
455
|
+
|
562
456
|
/**
|
563
|
-
*
|
457
|
+
* An array of references to the types in the type string.
|
458
|
+
*
|
459
|
+
* These references have optional indices into the type string so that tools
|
460
|
+
* can understand the references in the type string independently of the type
|
461
|
+
* system and syntax. For example, a documentation viewer could display the
|
462
|
+
* type `Array<FooElement | BarElement>` with cross-references to `FooElement`
|
463
|
+
* and `BarElement` without understanding arrays, generics, or union types.
|
564
464
|
*/
|
565
|
-
|
566
|
-
|
465
|
+
references?: TypeReference[];
|
466
|
+
|
467
|
+
source?: SourceReference;
|
567
468
|
}
|
469
|
+
|
568
470
|
/**
|
569
|
-
* A
|
570
|
-
*
|
571
|
-
* Custom elements are JavaScript classes, so this extends from
|
572
|
-
* `ClassDeclaration` and adds custom-element-specific features like
|
573
|
-
* attributes, events, and slots.
|
574
|
-
*
|
575
|
-
* Note that `tagName` in this interface is optional. Tag names are not
|
576
|
-
* neccessarily part of a custom element class, but belong to the definition
|
577
|
-
* (often called the "registration") or the `customElements.define()` call.
|
578
|
-
*
|
579
|
-
* Because classes and tag names can only be registered once, there's a
|
580
|
-
* one-to-one relationship between classes and tag names. For ease of use,
|
581
|
-
* we allow the tag name here.
|
471
|
+
* A reference that is associated with a type string and optionally a range
|
472
|
+
* within the string.
|
582
473
|
*
|
583
|
-
*
|
584
|
-
*
|
585
|
-
*
|
586
|
-
*
|
474
|
+
* Start and end must both be present or not present. If they're present, they
|
475
|
+
* are indices into the associated type string. If they are missing, the entire
|
476
|
+
* type string is the symbol referenced and the name should match the type
|
477
|
+
* string.
|
478
|
+
*/
|
479
|
+
export interface TypeReference extends Reference {
|
480
|
+
start?: number;
|
481
|
+
end?: number;
|
482
|
+
}
|
483
|
+
|
484
|
+
/**
|
485
|
+
* The common interface of classes and mixins.
|
587
486
|
*/
|
588
|
-
export interface
|
487
|
+
export interface ClassLike {
|
589
488
|
_ui5package?: string
|
590
489
|
_ui5implements?: Reference[]
|
591
|
-
_ui5abstract?: boolean
|
592
490
|
_ui5privacy?: Privacy
|
593
491
|
/**
|
594
492
|
* Marks when the field was introduced
|
595
493
|
*/
|
596
494
|
_ui5since?: string
|
495
|
+
name: string;
|
496
|
+
|
597
497
|
/**
|
598
|
-
*
|
599
|
-
*/
|
600
|
-
attributes?: Attribute[]
|
601
|
-
cssParts?: CssPart[]
|
602
|
-
cssProperties?: CssCustomProperty[]
|
603
|
-
/**
|
604
|
-
* Distinguishes a regular JavaScript class from a
|
605
|
-
* custom element class
|
606
|
-
*/
|
607
|
-
customElement: true
|
608
|
-
demos?: Demo[]
|
609
|
-
/**
|
610
|
-
* Whether the class or mixin is deprecated.
|
611
|
-
* If the value is a string, it's the reason for the deprecation.
|
498
|
+
* A markdown summary suitable for display in a listing.
|
612
499
|
*/
|
613
|
-
|
500
|
+
summary?: string;
|
501
|
+
|
614
502
|
/**
|
615
503
|
* A markdown description of the class.
|
616
504
|
*/
|
617
|
-
description?: string
|
505
|
+
description?: string;
|
506
|
+
|
618
507
|
/**
|
619
|
-
* The
|
508
|
+
* The superclass of this class.
|
509
|
+
*
|
510
|
+
* If this class is defined with mixin applications, the prototype chain
|
511
|
+
* includes the mixin applications and the true superclass is computed
|
512
|
+
* from them.
|
620
513
|
*/
|
621
|
-
|
622
|
-
|
623
|
-
members?: (ClassField | ClassMethod)[]
|
514
|
+
superclass?: Reference;
|
515
|
+
|
624
516
|
/**
|
625
517
|
* Any class mixins applied in the extends clause of this class.
|
626
518
|
*
|
@@ -632,401 +524,278 @@ export interface CustomElementDeclaration {
|
|
632
524
|
* first. This may read backwards from the common order in JavaScript, but
|
633
525
|
* matches the order of language used to describe mixin application, like
|
634
526
|
* "S with A, B".
|
635
|
-
*/
|
636
|
-
mixins?: Reference[]
|
637
|
-
name: string
|
638
|
-
/**
|
639
|
-
* The shadow dom content slots that this element accepts.
|
640
|
-
*/
|
641
|
-
slots?: Slot[]
|
642
|
-
source?: SourceReference
|
643
|
-
/**
|
644
|
-
* A markdown summary suitable for display in a listing.
|
645
|
-
*/
|
646
|
-
summary?: string
|
647
|
-
/**
|
648
|
-
* A reference to an export of a module.
|
649
|
-
*
|
650
|
-
* All references are required to be publically accessible, so the canonical
|
651
|
-
* representation of a reference is the export it's available from.
|
652
|
-
*
|
653
|
-
* `package` should generally refer to an npm package name. If `package` is
|
654
|
-
* undefined then the reference is local to this package. If `module` is
|
655
|
-
* undefined the reference is local to the containing module.
|
656
|
-
*
|
657
|
-
* References to global symbols like `Array`, `HTMLElement`, or `Event` should
|
658
|
-
* use a `package` name of `"global:"`.
|
659
|
-
*/
|
660
|
-
superclass?: {
|
661
|
-
module?: string
|
662
|
-
name: string
|
663
|
-
package?: string
|
664
|
-
}
|
665
|
-
/**
|
666
|
-
* An optional tag name that should be specified if this is a
|
667
|
-
* self-registering element.
|
668
|
-
*
|
669
|
-
* Self-registering elements must also include a CustomElementExport
|
670
|
-
* in the module's exports.
|
671
|
-
*/
|
672
|
-
tagName?: string
|
673
|
-
}
|
674
|
-
export interface Attribute {
|
675
|
-
/**
|
676
|
-
* The default value of the attribute, if any.
|
677
527
|
*
|
678
|
-
*
|
679
|
-
*
|
680
|
-
|
681
|
-
|
528
|
+
* @example
|
529
|
+
*
|
530
|
+
* ```javascript
|
531
|
+
* class T extends B(A(S)) {}
|
532
|
+
* ```
|
533
|
+
*
|
534
|
+
* is described by:
|
535
|
+
* ```json
|
536
|
+
* {
|
537
|
+
* "kind": "class",
|
538
|
+
* "superclass": {
|
539
|
+
* "name": "S"
|
540
|
+
* },
|
541
|
+
* "mixins": [
|
542
|
+
* {
|
543
|
+
* "name": "A"
|
544
|
+
* },
|
545
|
+
* {
|
546
|
+
* "name": "B"
|
547
|
+
* },
|
548
|
+
* ]
|
549
|
+
* }
|
550
|
+
* ```
|
551
|
+
*/
|
552
|
+
mixins?: Array<Reference>;
|
553
|
+
members?: Array<ClassMember>;
|
554
|
+
|
555
|
+
source?: SourceReference;
|
556
|
+
|
682
557
|
/**
|
683
|
-
* Whether the
|
558
|
+
* Whether the class or mixin is deprecated.
|
684
559
|
* If the value is a string, it's the reason for the deprecation.
|
685
560
|
*/
|
686
|
-
deprecated?:
|
687
|
-
/**
|
688
|
-
* A markdown description.
|
689
|
-
*/
|
690
|
-
description?: string
|
691
|
-
/**
|
692
|
-
* The name of the field this attribute is associated with, if any.
|
693
|
-
*/
|
694
|
-
fieldName?: string
|
695
|
-
inheritedFrom?: Reference
|
696
|
-
name: string
|
697
|
-
/**
|
698
|
-
* A markdown summary suitable for display in a listing.
|
699
|
-
*/
|
700
|
-
summary?: string
|
701
|
-
/**
|
702
|
-
* The type that the attribute will be serialized/deserialized as.
|
703
|
-
*/
|
704
|
-
type?: {
|
705
|
-
/**
|
706
|
-
* An array of references to the types in the type string.
|
707
|
-
*
|
708
|
-
* These references have optional indices into the type string so that tools
|
709
|
-
* can understand the references in the type string independently of the type
|
710
|
-
* system and syntax. For example, a documentation viewer could display the
|
711
|
-
* type `Array<FooElement | BarElement>` with cross-references to `FooElement`
|
712
|
-
* and `BarElement` without understanding arrays, generics, or union types.
|
713
|
-
*/
|
714
|
-
references?: TypeReference[]
|
715
|
-
source?: SourceReference
|
716
|
-
/**
|
717
|
-
* The full string representation of the type, in whatever type syntax is
|
718
|
-
* used, such as JSDoc, Closure, or TypeScript.
|
719
|
-
*/
|
720
|
-
text: string
|
721
|
-
}
|
561
|
+
deprecated?: boolean | string;
|
722
562
|
}
|
563
|
+
|
564
|
+
export interface ClassDeclaration extends ClassLike {
|
565
|
+
_ui5package?: string;
|
566
|
+
kind: 'class';
|
567
|
+
}
|
568
|
+
|
569
|
+
export type ClassMember = ClassField | ClassMethod;
|
570
|
+
|
723
571
|
/**
|
724
|
-
* The
|
572
|
+
* The common interface of variables, class fields, and function
|
573
|
+
* parameters.
|
725
574
|
*/
|
726
|
-
export interface
|
727
|
-
|
728
|
-
|
729
|
-
* If the value is a string, it's the reason for the deprecation.
|
730
|
-
*/
|
731
|
-
deprecated?: string | boolean
|
575
|
+
export interface PropertyLike {
|
576
|
+
name: string;
|
577
|
+
|
732
578
|
/**
|
733
|
-
* A markdown
|
579
|
+
* A markdown summary suitable for display in a listing.
|
734
580
|
*/
|
735
|
-
|
736
|
-
|
581
|
+
summary?: string;
|
582
|
+
|
737
583
|
/**
|
738
|
-
* A markdown
|
584
|
+
* A markdown description of the field.
|
739
585
|
*/
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
586
|
+
description?: string;
|
587
|
+
|
588
|
+
type?: Type;
|
589
|
+
|
590
|
+
default?: string;
|
591
|
+
|
744
592
|
/**
|
745
|
-
* Whether the
|
593
|
+
* Whether the property is deprecated.
|
746
594
|
* If the value is a string, it's the reason for the deprecation.
|
747
595
|
*/
|
748
|
-
deprecated?:
|
596
|
+
deprecated?: boolean | string;
|
597
|
+
|
749
598
|
/**
|
750
|
-
*
|
599
|
+
* Whether the property is read-only.
|
751
600
|
*/
|
752
|
-
|
601
|
+
readonly?: boolean;
|
602
|
+
}
|
603
|
+
|
604
|
+
export interface ClassField extends PropertyLike {
|
605
|
+
_ui5validator?: string
|
606
|
+
_ui5formProperty?: boolean
|
607
|
+
_ui5formEvents?: string
|
753
608
|
/**
|
754
|
-
*
|
609
|
+
* Marks when the field was introduced
|
755
610
|
*/
|
756
|
-
|
611
|
+
_ui5since?: string
|
612
|
+
kind: 'field';
|
613
|
+
static?: boolean;
|
614
|
+
privacy?: Privacy;
|
615
|
+
inheritedFrom?: Reference;
|
616
|
+
source?: SourceReference;
|
617
|
+
}
|
618
|
+
|
619
|
+
/**
|
620
|
+
* Additional metadata for fields on custom elements.
|
621
|
+
*/
|
622
|
+
export interface CustomElementField extends ClassField {
|
757
623
|
/**
|
758
|
-
*
|
624
|
+
* The corresponding attribute name if there is one.
|
625
|
+
*
|
626
|
+
* If this property is defined, the attribute must be listed in the classes'
|
627
|
+
* `attributes` array.
|
759
628
|
*/
|
760
|
-
|
629
|
+
attribute?: string;
|
630
|
+
|
761
631
|
/**
|
762
|
-
*
|
763
|
-
*
|
764
|
-
* The syntax must be a valid CSS [syntax string](https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax)
|
765
|
-
* as defined in the CSS Properties and Values API.
|
632
|
+
* If the property reflects to an attribute.
|
766
633
|
*
|
767
|
-
*
|
768
|
-
*
|
769
|
-
* "<color>": accepts a color
|
770
|
-
* "<length> | <percentage>": accepts lengths or percentages but not calc expressions with a combination of the two
|
771
|
-
* "small | medium | large": accepts one of these values set as custom idents.
|
772
|
-
* "*": any valid token
|
634
|
+
* If this is true, the `attribute` property must be defined.
|
773
635
|
*/
|
774
|
-
|
636
|
+
reflects?: boolean;
|
775
637
|
}
|
776
|
-
|
777
|
-
|
778
|
-
* A markdown description of the demo.
|
779
|
-
*/
|
780
|
-
description?: string
|
781
|
-
source?: SourceReference
|
638
|
+
|
639
|
+
export interface ClassMethod extends FunctionLike {
|
782
640
|
/**
|
783
|
-
*
|
784
|
-
* if it's hosted.
|
641
|
+
* Marks when the field was introduced
|
785
642
|
*/
|
786
|
-
|
643
|
+
_ui5since?: string
|
644
|
+
kind: 'method';
|
645
|
+
static?: boolean;
|
646
|
+
privacy?: Privacy;
|
647
|
+
inheritedFrom?: Reference;
|
648
|
+
source?: SourceReference;
|
787
649
|
}
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
650
|
+
|
651
|
+
/**
|
652
|
+
* A description of a class mixin.
|
653
|
+
*
|
654
|
+
* Mixins are functions which generate a new subclass of a given superclass.
|
655
|
+
* This interfaces describes the class and custom element features that
|
656
|
+
* are added by the mixin. As such, it extends the CustomElement interface and
|
657
|
+
* ClassLike interface.
|
658
|
+
*
|
659
|
+
* Since mixins are functions, it also extends the FunctionLike interface. This
|
660
|
+
* means a mixin is callable, and has parameters and a return type.
|
661
|
+
*
|
662
|
+
* The return type is often hard or impossible to accurately describe in type
|
663
|
+
* systems like TypeScript. It requires generics and an `extends` operator
|
664
|
+
* that TypeScript lacks. Therefore it's recommended that the return type is
|
665
|
+
* left empty. The most common form of a mixin function takes a single
|
666
|
+
* argument, so consumers of this interface should assume that the return type
|
667
|
+
* is the single argument subclassed by this declaration.
|
668
|
+
*
|
669
|
+
* A mixin should not have a superclass. If a mixins composes other mixins,
|
670
|
+
* they should be listed in the `mixins` field.
|
671
|
+
*
|
672
|
+
* See [this article]{@link https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/}
|
673
|
+
* for more information on the classmixin pattern in JavaScript.
|
674
|
+
*
|
675
|
+
* @example
|
676
|
+
*
|
677
|
+
* This JavaScript mixin declaration:
|
678
|
+
* ```javascript
|
679
|
+
* const MyMixin = (base) => class extends base {
|
680
|
+
* foo() { ... }
|
681
|
+
* }
|
682
|
+
* ```
|
683
|
+
*
|
684
|
+
* Is described by this JSON:
|
685
|
+
* ```json
|
686
|
+
* {
|
687
|
+
* "kind": "mixin",
|
688
|
+
* "name": "MyMixin",
|
689
|
+
* "parameters": [
|
690
|
+
* {
|
691
|
+
* "name": "base",
|
692
|
+
* }
|
693
|
+
* ],
|
694
|
+
* "members": [
|
695
|
+
* {
|
696
|
+
* "kind": "method",
|
697
|
+
* "name": "foo",
|
698
|
+
* }
|
699
|
+
* ]
|
700
|
+
* }
|
701
|
+
* ```
|
702
|
+
*/
|
703
|
+
export interface MixinDeclaration extends ClassLike, FunctionLike {
|
704
|
+
_ui5package?: string;
|
705
|
+
kind: 'mixin';
|
706
|
+
}
|
707
|
+
|
708
|
+
/**
|
709
|
+
* A class mixin that also adds custom element related properties.
|
710
|
+
*/
|
711
|
+
// Note: this needs to be an interface to be included in the generated JSON
|
712
|
+
// Schema output.
|
713
|
+
export interface CustomElementMixinDeclaration
|
714
|
+
extends MixinDeclaration,
|
715
|
+
CustomElement { }
|
716
|
+
|
717
|
+
export interface VariableDeclaration extends PropertyLike {
|
718
|
+
_ui5package?: string;
|
719
|
+
kind: 'variable';
|
720
|
+
source?: SourceReference;
|
721
|
+
}
|
722
|
+
|
723
|
+
export interface FunctionDeclaration extends FunctionLike {
|
724
|
+
_ui5package?: string;
|
795
725
|
/**
|
796
726
|
* Marks when the field was introduced
|
797
727
|
*/
|
798
728
|
_ui5since?: string
|
799
|
-
|
800
|
-
|
801
|
-
* If the value is a string, it's the reason for the deprecation.
|
802
|
-
*/
|
803
|
-
deprecated?: string | boolean
|
804
|
-
/**
|
805
|
-
* A markdown description.
|
806
|
-
*/
|
807
|
-
description?: string
|
808
|
-
inheritedFrom?: Reference
|
809
|
-
name: string
|
810
|
-
/**
|
811
|
-
* A markdown summary suitable for display in a listing.
|
812
|
-
*/
|
813
|
-
summary?: string
|
814
|
-
/**
|
815
|
-
* The type of the event object that's fired.
|
816
|
-
*/
|
817
|
-
type: {
|
818
|
-
/**
|
819
|
-
* An array of references to the types in the type string.
|
820
|
-
*
|
821
|
-
* These references have optional indices into the type string so that tools
|
822
|
-
* can understand the references in the type string independently of the type
|
823
|
-
* system and syntax. For example, a documentation viewer could display the
|
824
|
-
* type `Array<FooElement | BarElement>` with cross-references to `FooElement`
|
825
|
-
* and `BarElement` without understanding arrays, generics, or union types.
|
826
|
-
*/
|
827
|
-
references?: TypeReference[]
|
828
|
-
source?: SourceReference
|
829
|
-
/**
|
830
|
-
* The full string representation of the type, in whatever type syntax is
|
831
|
-
* used, such as JSDoc, Closure, or TypeScript.
|
832
|
-
*/
|
833
|
-
text: string
|
834
|
-
}
|
729
|
+
kind: 'function';
|
730
|
+
source?: SourceReference;
|
835
731
|
}
|
836
|
-
|
837
|
-
|
838
|
-
_ui5type?: Type
|
732
|
+
|
733
|
+
export interface Parameter extends PropertyLike {
|
839
734
|
_ui5privacy?: Privacy
|
840
735
|
/**
|
841
736
|
* Marks when the field was introduced
|
842
737
|
*/
|
843
738
|
_ui5since?: string
|
844
739
|
/**
|
845
|
-
* Whether the
|
846
|
-
* If the value is a string, it's the reason for the deprecation.
|
847
|
-
*/
|
848
|
-
deprecated?: string | boolean
|
849
|
-
/**
|
850
|
-
* A markdown description.
|
851
|
-
*/
|
852
|
-
description?: string
|
853
|
-
/**
|
854
|
-
* The slot name, or the empty string for an unnamed slot.
|
740
|
+
* Whether the parameter is optional. Undefined implies non-optional.
|
855
741
|
*/
|
856
|
-
|
742
|
+
optional?: boolean;
|
857
743
|
/**
|
858
|
-
*
|
744
|
+
* Whether the parameter is a rest parameter. Only the last parameter may be a rest parameter.
|
745
|
+
* Undefined implies single parameter.
|
859
746
|
*/
|
860
|
-
|
747
|
+
rest?: boolean;
|
861
748
|
}
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
_ui5package?: string
|
749
|
+
|
750
|
+
export interface FunctionLike {
|
751
|
+
name: string;
|
752
|
+
|
867
753
|
/**
|
868
|
-
*
|
754
|
+
* A markdown summary suitable for display in a listing.
|
869
755
|
*/
|
870
|
-
|
871
|
-
|
872
|
-
cssProperties?: CssCustomProperty[]
|
756
|
+
summary?: string;
|
757
|
+
|
873
758
|
/**
|
874
|
-
*
|
875
|
-
* custom element class
|
759
|
+
* A markdown description.
|
876
760
|
*/
|
877
|
-
|
878
|
-
|
761
|
+
description?: string;
|
762
|
+
|
879
763
|
/**
|
880
|
-
* Whether the
|
764
|
+
* Whether the function is deprecated.
|
881
765
|
* If the value is a string, it's the reason for the deprecation.
|
882
766
|
*/
|
883
|
-
deprecated?:
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
description?: string
|
888
|
-
/**
|
889
|
-
* The events that this element fires.
|
890
|
-
*/
|
891
|
-
events?: Event[]
|
892
|
-
kind: "mixin"
|
893
|
-
members?: (ClassField | ClassMethod)[]
|
894
|
-
/**
|
895
|
-
* Any class mixins applied in the extends clause of this class.
|
896
|
-
*
|
897
|
-
* If mixins are applied in the class definition, then the true superclass
|
898
|
-
* of this class is the result of applying mixins in order to the superclass.
|
899
|
-
*
|
900
|
-
* Mixins must be listed in order of their application to the superclass or
|
901
|
-
* previous mixin application. This means that the innermost mixin is listed
|
902
|
-
* first. This may read backwards from the common order in JavaScript, but
|
903
|
-
* matches the order of language used to describe mixin application, like
|
904
|
-
* "S with A, B".
|
905
|
-
*/
|
906
|
-
mixins?: Reference[]
|
907
|
-
name: string
|
908
|
-
parameters?: Parameter[]
|
767
|
+
deprecated?: boolean | string;
|
768
|
+
|
769
|
+
parameters?: Parameter[];
|
770
|
+
|
909
771
|
return?: {
|
772
|
+
type?: Type;
|
773
|
+
|
910
774
|
/**
|
911
|
-
* A markdown
|
775
|
+
* A markdown summary suitable for display in a listing.
|
912
776
|
*/
|
913
|
-
|
777
|
+
summary?: string;
|
778
|
+
|
914
779
|
/**
|
915
|
-
* A markdown
|
780
|
+
* A markdown description.
|
916
781
|
*/
|
917
|
-
|
918
|
-
|
919
|
-
[k: string]: unknown
|
920
|
-
}
|
921
|
-
/**
|
922
|
-
* The shadow dom content slots that this element accepts.
|
923
|
-
*/
|
924
|
-
slots?: Slot[]
|
925
|
-
source?: SourceReference
|
926
|
-
/**
|
927
|
-
* A markdown summary suitable for display in a listing.
|
928
|
-
*/
|
929
|
-
summary?: string
|
930
|
-
/**
|
931
|
-
* A reference to an export of a module.
|
932
|
-
*
|
933
|
-
* All references are required to be publically accessible, so the canonical
|
934
|
-
* representation of a reference is the export it's available from.
|
935
|
-
*
|
936
|
-
* `package` should generally refer to an npm package name. If `package` is
|
937
|
-
* undefined then the reference is local to this package. If `module` is
|
938
|
-
* undefined the reference is local to the containing module.
|
939
|
-
*
|
940
|
-
* References to global symbols like `Array`, `HTMLElement`, or `Event` should
|
941
|
-
* use a `package` name of `"global:"`.
|
942
|
-
*/
|
943
|
-
superclass?: {
|
944
|
-
module?: string
|
945
|
-
name: string
|
946
|
-
package?: string
|
947
|
-
}
|
948
|
-
/**
|
949
|
-
* An optional tag name that should be specified if this is a
|
950
|
-
* self-registering element.
|
951
|
-
*
|
952
|
-
* Self-registering elements must also include a CustomElementExport
|
953
|
-
* in the module's exports.
|
954
|
-
*/
|
955
|
-
tagName?: string
|
956
|
-
}
|
957
|
-
export interface JavaScriptExport {
|
958
|
-
/**
|
959
|
-
* A reference to an export of a module.
|
960
|
-
*
|
961
|
-
* All references are required to be publically accessible, so the canonical
|
962
|
-
* representation of a reference is the export it's available from.
|
963
|
-
*
|
964
|
-
* `package` should generally refer to an npm package name. If `package` is
|
965
|
-
* undefined then the reference is local to this package. If `module` is
|
966
|
-
* undefined the reference is local to the containing module.
|
967
|
-
*
|
968
|
-
* References to global symbols like `Array`, `HTMLElement`, or `Event` should
|
969
|
-
* use a `package` name of `"global:"`.
|
970
|
-
*/
|
971
|
-
declaration: {
|
972
|
-
module?: string
|
973
|
-
name: string
|
974
|
-
package?: string
|
975
|
-
}
|
976
|
-
/**
|
977
|
-
* Whether the export is deprecated. For example, the name of the export was changed.
|
978
|
-
* If the value is a string, it's the reason for the deprecation.
|
979
|
-
*/
|
980
|
-
deprecated?: string | boolean
|
981
|
-
kind: "js"
|
982
|
-
/**
|
983
|
-
* The name of the exported symbol.
|
984
|
-
*
|
985
|
-
* JavaScript has a number of ways to export objects which determine the
|
986
|
-
* correct name to use.
|
987
|
-
*
|
988
|
-
* - Default exports must use the name "default".
|
989
|
-
* - Named exports use the name that is exported. If the export is renamed
|
990
|
-
* with the "as" clause, use the exported name.
|
991
|
-
* - Aggregating exports (`* from`) should use the name `*`
|
992
|
-
*/
|
993
|
-
name: string
|
782
|
+
description?: string;
|
783
|
+
};
|
994
784
|
}
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
* This is represented as an export because a definition makes the element
|
1000
|
-
* available outside of the module it's defined it.
|
1001
|
-
*/
|
1002
|
-
export interface CustomElementExport {
|
1003
|
-
/**
|
1004
|
-
* A reference to an export of a module.
|
1005
|
-
*
|
1006
|
-
* All references are required to be publically accessible, so the canonical
|
1007
|
-
* representation of a reference is the export it's available from.
|
1008
|
-
*
|
1009
|
-
* `package` should generally refer to an npm package name. If `package` is
|
1010
|
-
* undefined then the reference is local to this package. If `module` is
|
1011
|
-
* undefined the reference is local to the containing module.
|
1012
|
-
*
|
1013
|
-
* References to global symbols like `Array`, `HTMLElement`, or `Event` should
|
1014
|
-
* use a `package` name of `"global:"`.
|
1015
|
-
*/
|
1016
|
-
declaration: {
|
1017
|
-
module?: string
|
1018
|
-
name: string
|
1019
|
-
package?: string
|
1020
|
-
}
|
785
|
+
|
786
|
+
export type Privacy = 'public' | 'private' | 'protected';
|
787
|
+
|
788
|
+
export interface Demo {
|
1021
789
|
/**
|
1022
|
-
*
|
1023
|
-
* For example, a future version will not register the custom element in this file.
|
1024
|
-
* If the value is a string, it's the reason for the deprecation.
|
790
|
+
* A markdown description of the demo.
|
1025
791
|
*/
|
1026
|
-
|
1027
|
-
|
792
|
+
description?: string;
|
793
|
+
|
1028
794
|
/**
|
1029
|
-
*
|
795
|
+
* Relative URL of the demo if it's published with the package. Absolute URL
|
796
|
+
* if it's hosted.
|
1030
797
|
*/
|
1031
|
-
|
1032
|
-
|
798
|
+
url: string;
|
799
|
+
|
800
|
+
source?: SourceReference;
|
801
|
+
}
|