@ui5/webcomponents-tools 0.0.0-0a35d6b3d → 0.0.0-0dd36ca4b
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 +514 -0
- package/assets-meta.js +2 -6
- package/components-package/nps.js +12 -18
- package/components-package/wdio.js +404 -405
- package/icons-collection/nps.js +2 -2
- package/lib/amd-to-es6/index.js +102 -0
- package/lib/amd-to-es6/no-remaining-require.js +33 -0
- package/lib/cem/custom-elements-manifest.config.mjs +83 -45
- package/lib/cem/event.mjs +20 -3
- package/lib/cem/schema-internal.json +3 -0
- package/lib/cem/types-internal.d.ts +550 -786
- package/lib/cem/types.d.ts +520 -655
- package/lib/cem/utils.mjs +49 -20
- package/lib/cem/validate.js +20 -13
- package/lib/create-icons/index.js +8 -6
- package/lib/create-illustrations/index.js +40 -33
- package/lib/create-new-component/index.js +4 -11
- package/lib/create-new-component/tsFileContentTemplate.js +3 -12
- package/lib/css-processors/css-processor-component-styles.mjs +47 -0
- package/lib/css-processors/scope-variables.mjs +3 -0
- package/lib/dev-server/ssr-dom-shim-loader.js +26 -0
- package/lib/generate-js-imports/illustrations.js +9 -9
- package/lib/generate-json-imports/i18n.js +3 -35
- package/lib/generate-json-imports/themes.js +2 -29
- package/lib/i18n/defaults.js +1 -1
- package/lib/scoping/lint-src.js +8 -7
- package/package.json +3 -2
- package/components-package/wdio.sync.js +0 -368
- package/lib/create-new-component/jsFileContentTemplate.js +0 -73
- package/lib/esm-abs-to-rel/index.js +0 -61
- package/lib/generate-custom-elements-manifest/index.js +0 -327
- package/lib/jsdoc/config.json +0 -29
- package/lib/jsdoc/configTypescript.json +0 -29
- package/lib/jsdoc/plugin.js +0 -2468
- package/lib/jsdoc/preprocess.js +0 -146
- package/lib/jsdoc/template/publish.js +0 -4120
- 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,326 @@ 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 ClassLike {
|
311
|
+
kind: "enum"
|
312
|
+
}
|
313
|
+
|
314
|
+
export interface InterfaceDeclaration extends ClassLike {
|
315
|
+
kind: "interface"
|
316
|
+
}
|
317
|
+
|
318
|
+
export interface Event {
|
319
|
+
_ui5parameters?: Parameter[]
|
310
320
|
_ui5privacy?: Privacy
|
321
|
+
/**
|
322
|
+
* Whether the parameter is optional. Undefined implies non-optional.
|
323
|
+
*/
|
324
|
+
_ui5allowPreventDefault?: boolean
|
311
325
|
/**
|
312
326
|
* Marks when the field was introduced
|
313
327
|
*/
|
314
328
|
_ui5since?: string
|
329
|
+
name: string;
|
330
|
+
|
315
331
|
/**
|
316
|
-
*
|
317
|
-
* If the value is a string, it's the reason for the deprecation.
|
332
|
+
* A markdown summary suitable for display in a listing.
|
318
333
|
*/
|
319
|
-
|
334
|
+
summary?: string;
|
335
|
+
|
320
336
|
/**
|
321
|
-
* A markdown description
|
337
|
+
* A markdown description.
|
322
338
|
*/
|
323
|
-
description?: string
|
324
|
-
|
325
|
-
members?: ClassField[]
|
339
|
+
description?: string;
|
340
|
+
|
326
341
|
/**
|
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".
|
342
|
+
* The type of the event object that's fired.
|
337
343
|
*/
|
338
|
-
|
339
|
-
|
340
|
-
|
344
|
+
type: Type;
|
345
|
+
|
346
|
+
inheritedFrom?: Reference;
|
347
|
+
|
341
348
|
/**
|
342
|
-
*
|
349
|
+
* Whether the event is deprecated.
|
350
|
+
* If the value is a string, it's the reason for the deprecation.
|
343
351
|
*/
|
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
|
-
}
|
352
|
+
deprecated?: boolean | string;
|
363
353
|
}
|
364
|
-
|
365
|
-
|
354
|
+
|
355
|
+
export interface Slot {
|
356
|
+
_ui5propertyName?: string
|
357
|
+
_ui5type?: Type
|
366
358
|
_ui5privacy?: Privacy
|
367
359
|
/**
|
368
360
|
* Marks when the field was introduced
|
369
361
|
*/
|
370
362
|
_ui5since?: string
|
371
363
|
/**
|
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".
|
364
|
+
* The slot name, or the empty string for an unnamed slot.
|
392
365
|
*/
|
393
|
-
|
394
|
-
|
395
|
-
source?: SourceReference
|
366
|
+
name: string;
|
367
|
+
|
396
368
|
/**
|
397
369
|
* A markdown summary suitable for display in a listing.
|
398
370
|
*/
|
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
|
371
|
+
summary?: string;
|
372
|
+
|
421
373
|
/**
|
422
|
-
*
|
374
|
+
* A markdown description.
|
423
375
|
*/
|
424
|
-
|
376
|
+
description?: string;
|
377
|
+
|
425
378
|
/**
|
426
|
-
* Whether the
|
379
|
+
* Whether the slot is deprecated.
|
427
380
|
* If the value is a string, it's the reason for the deprecation.
|
428
381
|
*/
|
429
|
-
deprecated?:
|
382
|
+
deprecated?: boolean | string;
|
383
|
+
}
|
384
|
+
|
385
|
+
/**
|
386
|
+
* The description of a CSS Part
|
387
|
+
*/
|
388
|
+
export interface CssPart {
|
389
|
+
name: string;
|
390
|
+
|
430
391
|
/**
|
431
|
-
* A markdown
|
392
|
+
* A markdown summary suitable for display in a listing.
|
432
393
|
*/
|
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
|
394
|
+
summary?: string;
|
395
|
+
|
450
396
|
/**
|
451
|
-
* A markdown
|
397
|
+
* A markdown description.
|
452
398
|
*/
|
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
|
399
|
+
description?: string;
|
400
|
+
|
481
401
|
/**
|
482
|
-
* Whether the
|
402
|
+
* Whether the CSS shadow part is deprecated.
|
483
403
|
* If the value is a string, it's the reason for the deprecation.
|
484
404
|
*/
|
485
|
-
deprecated?:
|
405
|
+
deprecated?: boolean | string;
|
406
|
+
}
|
407
|
+
|
408
|
+
export interface CssCustomProperty {
|
486
409
|
/**
|
487
|
-
*
|
410
|
+
* The name of the property, including leading `--`.
|
488
411
|
*/
|
489
|
-
|
490
|
-
|
491
|
-
members?: (ClassField | ClassMethod)[]
|
412
|
+
name: string;
|
413
|
+
|
492
414
|
/**
|
493
|
-
*
|
415
|
+
* The expected syntax of the defined property. Defaults to "*".
|
494
416
|
*
|
495
|
-
*
|
496
|
-
*
|
417
|
+
* The syntax must be a valid CSS [syntax string](https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax)
|
418
|
+
* as defined in the CSS Properties and Values API.
|
497
419
|
*
|
498
|
-
*
|
499
|
-
*
|
500
|
-
*
|
501
|
-
*
|
502
|
-
* "
|
420
|
+
* Examples:
|
421
|
+
*
|
422
|
+
* "<color>": accepts a color
|
423
|
+
* "<length> | <percentage>": accepts lengths or percentages but not calc expressions with a combination of the two
|
424
|
+
* "small | medium | large": accepts one of these values set as custom idents.
|
425
|
+
* "*": any valid token
|
503
426
|
*/
|
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
|
427
|
+
syntax?: string;
|
428
|
+
|
429
|
+
default?: string;
|
430
|
+
|
520
431
|
/**
|
521
432
|
* A markdown summary suitable for display in a listing.
|
522
433
|
*/
|
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
|
434
|
+
summary?: string;
|
435
|
+
|
546
436
|
/**
|
547
|
-
*
|
548
|
-
* If the value is a string, it's the reason for the deprecation.
|
437
|
+
* A markdown description.
|
549
438
|
*/
|
550
|
-
|
439
|
+
description?: string;
|
440
|
+
|
551
441
|
/**
|
552
|
-
*
|
442
|
+
* Whether the CSS custom property is deprecated.
|
443
|
+
* If the value is a string, it's the reason for the deprecation.
|
553
444
|
*/
|
554
|
-
|
555
|
-
|
556
|
-
|
445
|
+
deprecated?: boolean | string;
|
446
|
+
}
|
447
|
+
|
448
|
+
export interface Type {
|
557
449
|
/**
|
558
|
-
*
|
450
|
+
* The full string representation of the type, in whatever type syntax is
|
451
|
+
* used, such as JSDoc, Closure, or TypeScript.
|
559
452
|
*/
|
560
|
-
|
561
|
-
|
453
|
+
text: string;
|
454
|
+
|
562
455
|
/**
|
563
|
-
*
|
456
|
+
* An array of references to the types in the type string.
|
457
|
+
*
|
458
|
+
* These references have optional indices into the type string so that tools
|
459
|
+
* can understand the references in the type string independently of the type
|
460
|
+
* system and syntax. For example, a documentation viewer could display the
|
461
|
+
* type `Array<FooElement | BarElement>` with cross-references to `FooElement`
|
462
|
+
* and `BarElement` without understanding arrays, generics, or union types.
|
564
463
|
*/
|
565
|
-
|
566
|
-
|
464
|
+
references?: TypeReference[];
|
465
|
+
|
466
|
+
source?: SourceReference;
|
567
467
|
}
|
468
|
+
|
568
469
|
/**
|
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.
|
470
|
+
* A reference that is associated with a type string and optionally a range
|
471
|
+
* within the string.
|
582
472
|
*
|
583
|
-
*
|
584
|
-
*
|
585
|
-
*
|
586
|
-
*
|
473
|
+
* Start and end must both be present or not present. If they're present, they
|
474
|
+
* are indices into the associated type string. If they are missing, the entire
|
475
|
+
* type string is the symbol referenced and the name should match the type
|
476
|
+
* string.
|
587
477
|
*/
|
588
|
-
export interface
|
589
|
-
|
478
|
+
export interface TypeReference extends Reference {
|
479
|
+
start?: number;
|
480
|
+
end?: number;
|
481
|
+
}
|
482
|
+
|
483
|
+
/**
|
484
|
+
* The common interface of classes and mixins.
|
485
|
+
*/
|
486
|
+
export interface ClassLike {
|
590
487
|
_ui5implements?: Reference[]
|
591
|
-
_ui5abstract?: boolean
|
592
488
|
_ui5privacy?: Privacy
|
593
489
|
/**
|
594
490
|
* Marks when the field was introduced
|
595
491
|
*/
|
596
492
|
_ui5since?: string
|
493
|
+
name: string;
|
494
|
+
|
597
495
|
/**
|
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.
|
496
|
+
* A markdown summary suitable for display in a listing.
|
612
497
|
*/
|
613
|
-
|
498
|
+
summary?: string;
|
499
|
+
|
614
500
|
/**
|
615
501
|
* A markdown description of the class.
|
616
502
|
*/
|
617
|
-
description?: string
|
503
|
+
description?: string;
|
504
|
+
|
618
505
|
/**
|
619
|
-
* The
|
506
|
+
* The superclass of this class.
|
507
|
+
*
|
508
|
+
* If this class is defined with mixin applications, the prototype chain
|
509
|
+
* includes the mixin applications and the true superclass is computed
|
510
|
+
* from them.
|
620
511
|
*/
|
621
|
-
|
622
|
-
|
623
|
-
members?: (ClassField | ClassMethod)[]
|
512
|
+
superclass?: Reference;
|
513
|
+
|
624
514
|
/**
|
625
515
|
* Any class mixins applied in the extends clause of this class.
|
626
516
|
*
|
@@ -632,401 +522,275 @@ export interface CustomElementDeclaration {
|
|
632
522
|
* first. This may read backwards from the common order in JavaScript, but
|
633
523
|
* matches the order of language used to describe mixin application, like
|
634
524
|
* "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
525
|
*
|
657
|
-
*
|
658
|
-
*
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
*
|
667
|
-
*
|
668
|
-
*
|
669
|
-
*
|
670
|
-
*
|
671
|
-
|
672
|
-
|
673
|
-
}
|
674
|
-
|
675
|
-
|
676
|
-
*
|
677
|
-
*
|
678
|
-
*
|
679
|
-
*
|
680
|
-
*/
|
681
|
-
|
526
|
+
* @example
|
527
|
+
*
|
528
|
+
* ```javascript
|
529
|
+
* class T extends B(A(S)) {}
|
530
|
+
* ```
|
531
|
+
*
|
532
|
+
* is described by:
|
533
|
+
* ```json
|
534
|
+
* {
|
535
|
+
* "kind": "class",
|
536
|
+
* "superclass": {
|
537
|
+
* "name": "S"
|
538
|
+
* },
|
539
|
+
* "mixins": [
|
540
|
+
* {
|
541
|
+
* "name": "A"
|
542
|
+
* },
|
543
|
+
* {
|
544
|
+
* "name": "B"
|
545
|
+
* },
|
546
|
+
* ]
|
547
|
+
* }
|
548
|
+
* ```
|
549
|
+
*/
|
550
|
+
mixins?: Array<Reference>;
|
551
|
+
members?: Array<ClassMember>;
|
552
|
+
|
553
|
+
source?: SourceReference;
|
554
|
+
|
682
555
|
/**
|
683
|
-
* Whether the
|
556
|
+
* Whether the class or mixin is deprecated.
|
684
557
|
* If the value is a string, it's the reason for the deprecation.
|
685
558
|
*/
|
686
|
-
deprecated?:
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
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
|
-
}
|
559
|
+
deprecated?: boolean | string;
|
560
|
+
}
|
561
|
+
|
562
|
+
export interface ClassDeclaration extends ClassLike {
|
563
|
+
kind: 'class';
|
722
564
|
}
|
565
|
+
|
566
|
+
export type ClassMember = ClassField | ClassMethod;
|
567
|
+
|
723
568
|
/**
|
724
|
-
* The
|
569
|
+
* The common interface of variables, class fields, and function
|
570
|
+
* parameters.
|
725
571
|
*/
|
726
|
-
export interface
|
727
|
-
|
728
|
-
|
729
|
-
* If the value is a string, it's the reason for the deprecation.
|
730
|
-
*/
|
731
|
-
deprecated?: string | boolean
|
572
|
+
export interface PropertyLike {
|
573
|
+
name: string;
|
574
|
+
|
732
575
|
/**
|
733
|
-
* A markdown
|
576
|
+
* A markdown summary suitable for display in a listing.
|
734
577
|
*/
|
735
|
-
|
736
|
-
|
578
|
+
summary?: string;
|
579
|
+
|
737
580
|
/**
|
738
|
-
* A markdown
|
581
|
+
* A markdown description of the field.
|
739
582
|
*/
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
583
|
+
description?: string;
|
584
|
+
|
585
|
+
type?: Type;
|
586
|
+
|
587
|
+
default?: string;
|
588
|
+
|
744
589
|
/**
|
745
|
-
* Whether the
|
590
|
+
* Whether the property is deprecated.
|
746
591
|
* If the value is a string, it's the reason for the deprecation.
|
747
592
|
*/
|
748
|
-
deprecated?:
|
593
|
+
deprecated?: boolean | string;
|
594
|
+
|
749
595
|
/**
|
750
|
-
*
|
596
|
+
* Whether the property is read-only.
|
751
597
|
*/
|
752
|
-
|
598
|
+
readonly?: boolean;
|
599
|
+
}
|
600
|
+
|
601
|
+
export interface ClassField extends PropertyLike {
|
602
|
+
_ui5noAttribute?: boolean;
|
603
|
+
_ui5validator?: string
|
604
|
+
_ui5formProperty?: boolean
|
605
|
+
_ui5formEvents?: string
|
753
606
|
/**
|
754
|
-
*
|
607
|
+
* Marks when the field was introduced
|
755
608
|
*/
|
756
|
-
|
609
|
+
_ui5since?: string
|
610
|
+
kind: 'field';
|
611
|
+
static?: boolean;
|
612
|
+
privacy?: Privacy;
|
613
|
+
inheritedFrom?: Reference;
|
614
|
+
source?: SourceReference;
|
615
|
+
}
|
616
|
+
|
617
|
+
/**
|
618
|
+
* Additional metadata for fields on custom elements.
|
619
|
+
*/
|
620
|
+
export interface CustomElementField extends ClassField {
|
757
621
|
/**
|
758
|
-
*
|
622
|
+
* The corresponding attribute name if there is one.
|
623
|
+
*
|
624
|
+
* If this property is defined, the attribute must be listed in the classes'
|
625
|
+
* `attributes` array.
|
759
626
|
*/
|
760
|
-
|
627
|
+
attribute?: string;
|
628
|
+
|
761
629
|
/**
|
762
|
-
*
|
630
|
+
* If the property reflects to an attribute.
|
763
631
|
*
|
764
|
-
*
|
765
|
-
* as defined in the CSS Properties and Values API.
|
766
|
-
*
|
767
|
-
* Examples:
|
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
|
632
|
+
* If this is true, the `attribute` property must be defined.
|
773
633
|
*/
|
774
|
-
|
634
|
+
reflects?: boolean;
|
775
635
|
}
|
776
|
-
|
777
|
-
|
778
|
-
* A markdown description of the demo.
|
779
|
-
*/
|
780
|
-
description?: string
|
781
|
-
source?: SourceReference
|
636
|
+
|
637
|
+
export interface ClassMethod extends FunctionLike {
|
782
638
|
/**
|
783
|
-
*
|
784
|
-
* if it's hosted.
|
639
|
+
* Marks when the field was introduced
|
785
640
|
*/
|
786
|
-
|
641
|
+
_ui5since?: string
|
642
|
+
kind: 'method';
|
643
|
+
static?: boolean;
|
644
|
+
privacy?: Privacy;
|
645
|
+
inheritedFrom?: Reference;
|
646
|
+
source?: SourceReference;
|
787
647
|
}
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
648
|
+
|
649
|
+
/**
|
650
|
+
* A description of a class mixin.
|
651
|
+
*
|
652
|
+
* Mixins are functions which generate a new subclass of a given superclass.
|
653
|
+
* This interfaces describes the class and custom element features that
|
654
|
+
* are added by the mixin. As such, it extends the CustomElement interface and
|
655
|
+
* ClassLike interface.
|
656
|
+
*
|
657
|
+
* Since mixins are functions, it also extends the FunctionLike interface. This
|
658
|
+
* means a mixin is callable, and has parameters and a return type.
|
659
|
+
*
|
660
|
+
* The return type is often hard or impossible to accurately describe in type
|
661
|
+
* systems like TypeScript. It requires generics and an `extends` operator
|
662
|
+
* that TypeScript lacks. Therefore it's recommended that the return type is
|
663
|
+
* left empty. The most common form of a mixin function takes a single
|
664
|
+
* argument, so consumers of this interface should assume that the return type
|
665
|
+
* is the single argument subclassed by this declaration.
|
666
|
+
*
|
667
|
+
* A mixin should not have a superclass. If a mixins composes other mixins,
|
668
|
+
* they should be listed in the `mixins` field.
|
669
|
+
*
|
670
|
+
* See [this article]{@link https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/}
|
671
|
+
* for more information on the classmixin pattern in JavaScript.
|
672
|
+
*
|
673
|
+
* @example
|
674
|
+
*
|
675
|
+
* This JavaScript mixin declaration:
|
676
|
+
* ```javascript
|
677
|
+
* const MyMixin = (base) => class extends base {
|
678
|
+
* foo() { ... }
|
679
|
+
* }
|
680
|
+
* ```
|
681
|
+
*
|
682
|
+
* Is described by this JSON:
|
683
|
+
* ```json
|
684
|
+
* {
|
685
|
+
* "kind": "mixin",
|
686
|
+
* "name": "MyMixin",
|
687
|
+
* "parameters": [
|
688
|
+
* {
|
689
|
+
* "name": "base",
|
690
|
+
* }
|
691
|
+
* ],
|
692
|
+
* "members": [
|
693
|
+
* {
|
694
|
+
* "kind": "method",
|
695
|
+
* "name": "foo",
|
696
|
+
* }
|
697
|
+
* ]
|
698
|
+
* }
|
699
|
+
* ```
|
700
|
+
*/
|
701
|
+
export interface MixinDeclaration extends ClassLike, FunctionLike {
|
702
|
+
kind: 'mixin';
|
703
|
+
}
|
704
|
+
|
705
|
+
/**
|
706
|
+
* A class mixin that also adds custom element related properties.
|
707
|
+
*/
|
708
|
+
// Note: this needs to be an interface to be included in the generated JSON
|
709
|
+
// Schema output.
|
710
|
+
export interface CustomElementMixinDeclaration
|
711
|
+
extends MixinDeclaration,
|
712
|
+
CustomElement { }
|
713
|
+
|
714
|
+
export interface VariableDeclaration extends PropertyLike {
|
715
|
+
kind: 'variable';
|
716
|
+
source?: SourceReference;
|
717
|
+
}
|
718
|
+
|
719
|
+
export interface FunctionDeclaration extends FunctionLike {
|
795
720
|
/**
|
796
721
|
* Marks when the field was introduced
|
797
722
|
*/
|
798
723
|
_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
|
-
}
|
724
|
+
kind: 'function';
|
725
|
+
source?: SourceReference;
|
835
726
|
}
|
836
|
-
|
837
|
-
|
838
|
-
_ui5type?: Type
|
727
|
+
|
728
|
+
export interface Parameter extends PropertyLike {
|
839
729
|
_ui5privacy?: Privacy
|
840
730
|
/**
|
841
731
|
* Marks when the field was introduced
|
842
732
|
*/
|
843
733
|
_ui5since?: string
|
844
734
|
/**
|
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.
|
735
|
+
* Whether the parameter is optional. Undefined implies non-optional.
|
855
736
|
*/
|
856
|
-
|
737
|
+
optional?: boolean;
|
857
738
|
/**
|
858
|
-
*
|
739
|
+
* Whether the parameter is a rest parameter. Only the last parameter may be a rest parameter.
|
740
|
+
* Undefined implies single parameter.
|
859
741
|
*/
|
860
|
-
|
742
|
+
rest?: boolean;
|
861
743
|
}
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
_ui5package?: string
|
744
|
+
|
745
|
+
export interface FunctionLike {
|
746
|
+
name: string;
|
747
|
+
|
867
748
|
/**
|
868
|
-
*
|
749
|
+
* A markdown summary suitable for display in a listing.
|
869
750
|
*/
|
870
|
-
|
871
|
-
|
872
|
-
cssProperties?: CssCustomProperty[]
|
751
|
+
summary?: string;
|
752
|
+
|
873
753
|
/**
|
874
|
-
*
|
875
|
-
* custom element class
|
754
|
+
* A markdown description.
|
876
755
|
*/
|
877
|
-
|
878
|
-
|
756
|
+
description?: string;
|
757
|
+
|
879
758
|
/**
|
880
|
-
* Whether the
|
759
|
+
* Whether the function is deprecated.
|
881
760
|
* If the value is a string, it's the reason for the deprecation.
|
882
761
|
*/
|
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[]
|
762
|
+
deprecated?: boolean | string;
|
763
|
+
|
764
|
+
parameters?: Parameter[];
|
765
|
+
|
909
766
|
return?: {
|
767
|
+
type?: Type;
|
768
|
+
|
910
769
|
/**
|
911
|
-
* A markdown
|
770
|
+
* A markdown summary suitable for display in a listing.
|
912
771
|
*/
|
913
|
-
|
772
|
+
summary?: string;
|
773
|
+
|
914
774
|
/**
|
915
|
-
* A markdown
|
775
|
+
* A markdown description.
|
916
776
|
*/
|
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
|
777
|
+
description?: string;
|
778
|
+
};
|
956
779
|
}
|
957
|
-
|
958
|
-
|
959
|
-
|
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
|
994
|
-
}
|
995
|
-
/**
|
996
|
-
* A global custom element defintion, ie the result of a
|
997
|
-
* `customElements.define()` call.
|
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
|
-
}
|
780
|
+
|
781
|
+
export type Privacy = 'public' | 'private' | 'protected';
|
782
|
+
|
783
|
+
export interface Demo {
|
1021
784
|
/**
|
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.
|
785
|
+
* A markdown description of the demo.
|
1025
786
|
*/
|
1026
|
-
|
1027
|
-
|
787
|
+
description?: string;
|
788
|
+
|
1028
789
|
/**
|
1029
|
-
*
|
790
|
+
* Relative URL of the demo if it's published with the package. Absolute URL
|
791
|
+
* if it's hosted.
|
1030
792
|
*/
|
1031
|
-
|
1032
|
-
|
793
|
+
url: string;
|
794
|
+
|
795
|
+
source?: SourceReference;
|
796
|
+
}
|