@ui5/webcomponents-tools 0.0.0-38861c872 → 0.0.0-38f83ffef
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 +1121 -0
- package/README.md +2 -5
- package/assets-meta.js +3 -11
- package/components-package/eslint.js +59 -31
- package/components-package/nps.js +48 -26
- package/components-package/vite.config.js +7 -11
- package/components-package/wdio.js +415 -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 +129 -55
- package/lib/cem/event.mjs +75 -21
- package/lib/cem/schema-internal.json +71 -0
- package/lib/cem/types-internal.d.ts +564 -785
- package/lib/cem/types.d.ts +520 -655
- package/lib/cem/utils.mjs +115 -47
- package/lib/cem/validate.js +41 -37
- package/lib/create-icons/index.js +13 -10
- package/lib/create-illustrations/index.js +44 -9
- package/lib/create-new-component/{tsFileContentTemplate.js → Component.js} +13 -10
- package/lib/create-new-component/ComponentTemplate.js +12 -0
- package/lib/create-new-component/index.js +14 -22
- package/lib/css-processors/css-processor-components.mjs +3 -2
- package/lib/css-processors/css-processor-themes.mjs +2 -7
- package/lib/css-processors/scope-variables.mjs +3 -0
- package/lib/css-processors/shared.mjs +2 -22
- package/lib/dev-server/{dev-server.js → dev-server.mjs} +4 -4
- package/lib/dev-server/virtual-index-html-plugin.js +24 -20
- package/lib/generate-json-imports/i18n.js +46 -62
- package/lib/generate-json-imports/themes.js +13 -32
- package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +12 -7
- package/lib/hbs2ui5/index.js +3 -3
- package/lib/i18n/defaults.js +3 -2
- package/lib/remove-dev-mode/remove-dev-mode.mjs +37 -0
- package/lib/scoping/get-all-tags.js +9 -2
- package/lib/scoping/lint-src.js +8 -7
- package/package.json +11 -8
- package/tsconfig.json +18 -0
- 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,12 @@ 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;
|
185
|
+
inheritedFrom?: Reference;
|
190
186
|
}
|
187
|
+
|
191
188
|
/**
|
192
189
|
* A reference to the source of a declaration or member.
|
193
190
|
*/
|
@@ -195,432 +192,340 @@ export interface SourceReference {
|
|
195
192
|
/**
|
196
193
|
* An absolute URL to the source (ie. a GitHub URL).
|
197
194
|
*/
|
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
|
195
|
+
href: string;
|
217
196
|
}
|
197
|
+
|
218
198
|
/**
|
219
|
-
* A
|
220
|
-
* within the string.
|
199
|
+
* A description of a custom element class.
|
221
200
|
*
|
222
|
-
*
|
223
|
-
*
|
224
|
-
*
|
225
|
-
*
|
201
|
+
* Custom elements are JavaScript classes, so this extends from
|
202
|
+
* `ClassDeclaration` and adds custom-element-specific features like
|
203
|
+
* attributes, events, and slots.
|
204
|
+
*
|
205
|
+
* Note that `tagName` in this interface is optional. Tag names are not
|
206
|
+
* neccessarily part of a custom element class, but belong to the definition
|
207
|
+
* (often called the "registration") or the `customElements.define()` call.
|
208
|
+
*
|
209
|
+
* Because classes and tag names can only be registered once, there's a
|
210
|
+
* one-to-one relationship between classes and tag names. For ease of use,
|
211
|
+
* we allow the tag name here.
|
212
|
+
*
|
213
|
+
* Some packages define and register custom elements in separate modules. In
|
214
|
+
* these cases one `Module` should contain the `CustomElement` without a
|
215
|
+
* tagName, and another `Module` should contain the
|
216
|
+
* `CustomElementExport`.
|
226
217
|
*/
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
}
|
234
|
-
export interface ClassMethod {
|
218
|
+
// Note: this needs to be an interface to be included in the generated JSON
|
219
|
+
// Schema output.
|
220
|
+
export interface CustomElementDeclaration
|
221
|
+
extends ClassDeclaration,
|
222
|
+
CustomElement {
|
223
|
+
_ui5abstract?: boolean
|
235
224
|
/**
|
236
225
|
* Marks when the field was introduced
|
237
226
|
*/
|
238
227
|
_ui5since?: string
|
228
|
+
}
|
229
|
+
|
230
|
+
/**
|
231
|
+
* The additional fields that a custom element adds to classes and mixins.
|
232
|
+
*/
|
233
|
+
export interface CustomElement extends ClassLike {
|
239
234
|
/**
|
240
|
-
*
|
241
|
-
*
|
235
|
+
* An optional tag name that should be specified if this is a
|
236
|
+
* self-registering element.
|
237
|
+
*
|
238
|
+
* Self-registering elements must also include a CustomElementExport
|
239
|
+
* in the module's exports.
|
242
240
|
*/
|
243
|
-
|
241
|
+
tagName?: string;
|
242
|
+
|
244
243
|
/**
|
245
|
-
*
|
244
|
+
* The attributes that this element is known to understand.
|
246
245
|
*/
|
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
|
246
|
+
attributes?: Attribute[];
|
247
|
+
|
267
248
|
/**
|
268
|
-
*
|
249
|
+
* The events that this element fires.
|
269
250
|
*/
|
270
|
-
|
271
|
-
|
272
|
-
export interface Parameter {
|
273
|
-
_ui5privacy?: Privacy
|
251
|
+
events?: Event[];
|
252
|
+
|
274
253
|
/**
|
275
|
-
*
|
254
|
+
* The shadow dom content slots that this element accepts.
|
276
255
|
*/
|
277
|
-
|
278
|
-
|
256
|
+
slots?: Slot[];
|
257
|
+
|
258
|
+
cssParts?: CssPart[];
|
259
|
+
|
260
|
+
cssProperties?: CssCustomProperty[];
|
261
|
+
|
262
|
+
demos?: Demo[];
|
263
|
+
|
279
264
|
/**
|
280
|
-
*
|
281
|
-
*
|
265
|
+
* Distinguishes a regular JavaScript class from a
|
266
|
+
* custom element class
|
282
267
|
*/
|
283
|
-
|
268
|
+
customElement: true;
|
269
|
+
}
|
270
|
+
|
271
|
+
export interface Attribute {
|
272
|
+
name: string;
|
273
|
+
|
284
274
|
/**
|
285
|
-
* A markdown
|
275
|
+
* A markdown summary suitable for display in a listing.
|
286
276
|
*/
|
287
|
-
|
288
|
-
|
277
|
+
summary?: string;
|
278
|
+
|
289
279
|
/**
|
290
|
-
*
|
280
|
+
* A markdown description.
|
291
281
|
*/
|
292
|
-
|
282
|
+
description?: string;
|
283
|
+
|
284
|
+
inheritedFrom?: Reference;
|
285
|
+
|
293
286
|
/**
|
294
|
-
*
|
287
|
+
* The type that the attribute will be serialized/deserialized as.
|
295
288
|
*/
|
296
|
-
|
289
|
+
type?: Type;
|
290
|
+
|
297
291
|
/**
|
298
|
-
*
|
299
|
-
*
|
292
|
+
* The default value of the attribute, if any.
|
293
|
+
*
|
294
|
+
* As attributes are always strings, this is the actual value, not a human
|
295
|
+
* readable description.
|
300
296
|
*/
|
301
|
-
|
297
|
+
default?: string;
|
298
|
+
|
302
299
|
/**
|
303
|
-
*
|
300
|
+
* The name of the field this attribute is associated with, if any.
|
301
|
+
*/
|
302
|
+
fieldName?: string;
|
303
|
+
|
304
|
+
/**
|
305
|
+
* Whether the attribute is deprecated.
|
306
|
+
* If the value is a string, it's the reason for the deprecation.
|
304
307
|
*/
|
305
|
-
|
306
|
-
type?: Type
|
308
|
+
deprecated?: boolean | string;
|
307
309
|
}
|
308
|
-
|
309
|
-
|
310
|
+
|
311
|
+
export interface EnumDeclaration extends ClassLike {
|
312
|
+
kind: "enum"
|
313
|
+
}
|
314
|
+
|
315
|
+
export interface InterfaceDeclaration extends ClassLike {
|
316
|
+
kind: "interface"
|
317
|
+
}
|
318
|
+
|
319
|
+
export interface Event {
|
320
|
+
_ui5parameters?: Parameter[]
|
310
321
|
_ui5privacy?: Privacy
|
311
322
|
/**
|
312
|
-
*
|
323
|
+
* Whether the event is preventable.
|
313
324
|
*/
|
314
|
-
|
325
|
+
_ui5allowPreventDefault?: boolean;
|
326
|
+
|
315
327
|
/**
|
316
|
-
* Whether the
|
317
|
-
* If the value is a string, it's the reason for the deprecation.
|
328
|
+
* Whether the event is cancelable.
|
318
329
|
*/
|
319
|
-
|
330
|
+
_ui5Cancelable?: boolean;
|
331
|
+
|
320
332
|
/**
|
321
|
-
*
|
333
|
+
* Whether the event is bubbles.
|
322
334
|
*/
|
323
|
-
|
324
|
-
|
325
|
-
members?: ClassField[]
|
326
|
-
/**
|
327
|
-
* Any class mixins applied in the extends clause of this class.
|
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".
|
337
|
-
*/
|
338
|
-
mixins?: Reference[]
|
339
|
-
name: string
|
340
|
-
source?: SourceReference
|
341
|
-
/**
|
342
|
-
* A markdown summary suitable for display in a listing.
|
343
|
-
*/
|
344
|
-
summary?: string
|
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
|
-
}
|
363
|
-
}
|
364
|
-
export interface InterfaceDeclaration {
|
365
|
-
_ui5package?: string
|
366
|
-
_ui5privacy?: Privacy
|
335
|
+
_ui5Bubbles?: boolean;
|
336
|
+
|
367
337
|
/**
|
368
338
|
* Marks when the field was introduced
|
369
339
|
*/
|
370
340
|
_ui5since?: string
|
341
|
+
name: string;
|
342
|
+
|
371
343
|
/**
|
372
|
-
*
|
373
|
-
* If the value is a string, it's the reason for the deprecation.
|
344
|
+
* A markdown summary suitable for display in a listing.
|
374
345
|
*/
|
375
|
-
|
346
|
+
summary?: string;
|
347
|
+
|
376
348
|
/**
|
377
|
-
* A markdown description
|
349
|
+
* A markdown description.
|
378
350
|
*/
|
379
|
-
description?: string
|
380
|
-
|
351
|
+
description?: string;
|
352
|
+
|
381
353
|
/**
|
382
|
-
*
|
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".
|
354
|
+
* The type of the event object that's fired.
|
392
355
|
*/
|
393
|
-
|
394
|
-
|
395
|
-
|
356
|
+
type: Type;
|
357
|
+
|
358
|
+
inheritedFrom?: Reference;
|
359
|
+
|
396
360
|
/**
|
397
|
-
*
|
361
|
+
* Whether the event is deprecated.
|
362
|
+
* If the value is a string, it's the reason for the deprecation.
|
398
363
|
*/
|
399
|
-
|
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
|
-
}
|
364
|
+
deprecated?: boolean | string;
|
418
365
|
}
|
419
|
-
|
420
|
-
|
366
|
+
|
367
|
+
export interface Slot {
|
368
|
+
_ui5propertyName?: string
|
369
|
+
_ui5type?: Type
|
370
|
+
_ui5privacy?: Privacy
|
421
371
|
/**
|
422
372
|
* Marks when the field was introduced
|
423
373
|
*/
|
424
374
|
_ui5since?: string
|
425
375
|
/**
|
426
|
-
*
|
427
|
-
* If the value is a string, it's the reason for the deprecation.
|
376
|
+
* The slot name, or the empty string for an unnamed slot.
|
428
377
|
*/
|
429
|
-
|
378
|
+
name: string;
|
379
|
+
|
380
|
+
/**
|
381
|
+
* A markdown summary suitable for display in a listing.
|
382
|
+
*/
|
383
|
+
summary?: string;
|
384
|
+
|
430
385
|
/**
|
431
386
|
* A markdown description.
|
432
387
|
*/
|
433
|
-
description?: string
|
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
|
388
|
+
description?: string;
|
389
|
+
|
450
390
|
/**
|
451
|
-
*
|
391
|
+
* Whether the slot is deprecated.
|
392
|
+
* If the value is a string, it's the reason for the deprecation.
|
452
393
|
*/
|
453
|
-
|
394
|
+
deprecated?: boolean | string;
|
454
395
|
}
|
396
|
+
|
455
397
|
/**
|
456
|
-
*
|
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.
|
398
|
+
* The description of a CSS Part
|
478
399
|
*/
|
479
|
-
export interface
|
480
|
-
|
400
|
+
export interface CssPart {
|
401
|
+
name: string;
|
402
|
+
|
481
403
|
/**
|
482
|
-
*
|
483
|
-
* If the value is a string, it's the reason for the deprecation.
|
404
|
+
* A markdown summary suitable for display in a listing.
|
484
405
|
*/
|
485
|
-
|
406
|
+
summary?: string;
|
407
|
+
|
486
408
|
/**
|
487
|
-
* A markdown description
|
409
|
+
* A markdown description.
|
488
410
|
*/
|
489
|
-
description?: string
|
490
|
-
|
491
|
-
members?: (ClassField | ClassMethod)[]
|
411
|
+
description?: string;
|
412
|
+
|
492
413
|
/**
|
493
|
-
*
|
494
|
-
*
|
495
|
-
* If mixins are applied in the class definition, then the true superclass
|
496
|
-
* of this class is the result of applying mixins in order to the superclass.
|
497
|
-
*
|
498
|
-
* Mixins must be listed in order of their application to the superclass or
|
499
|
-
* previous mixin application. This means that the innermost mixin is listed
|
500
|
-
* first. This may read backwards from the common order in JavaScript, but
|
501
|
-
* matches the order of language used to describe mixin application, like
|
502
|
-
* "S with A, B".
|
414
|
+
* Whether the CSS shadow part is deprecated.
|
415
|
+
* If the value is a string, it's the reason for the deprecation.
|
503
416
|
*/
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
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
|
417
|
+
deprecated?: boolean | string;
|
418
|
+
|
419
|
+
inheritedFrom?: Reference;
|
420
|
+
}
|
421
|
+
|
422
|
+
export interface CssCustomProperty {
|
520
423
|
/**
|
521
|
-
*
|
424
|
+
* The name of the property, including leading `--`.
|
522
425
|
*/
|
523
|
-
|
426
|
+
name: string;
|
427
|
+
|
524
428
|
/**
|
525
|
-
*
|
429
|
+
* The expected syntax of the defined property. Defaults to "*".
|
526
430
|
*
|
527
|
-
*
|
528
|
-
*
|
431
|
+
* The syntax must be a valid CSS [syntax string](https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax)
|
432
|
+
* as defined in the CSS Properties and Values API.
|
529
433
|
*
|
530
|
-
*
|
531
|
-
* undefined then the reference is local to this package. If `module` is
|
532
|
-
* undefined the reference is local to the containing module.
|
434
|
+
* Examples:
|
533
435
|
*
|
534
|
-
*
|
535
|
-
*
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
export interface VariableDeclaration {
|
544
|
-
_ui5package?: string
|
545
|
-
default?: string
|
436
|
+
* "<color>": accepts a color
|
437
|
+
* "<length> | <percentage>": accepts lengths or percentages but not calc expressions with a combination of the two
|
438
|
+
* "small | medium | large": accepts one of these values set as custom idents.
|
439
|
+
* "*": any valid token
|
440
|
+
*/
|
441
|
+
syntax?: string;
|
442
|
+
|
443
|
+
default?: string;
|
444
|
+
|
546
445
|
/**
|
547
|
-
*
|
548
|
-
* If the value is a string, it's the reason for the deprecation.
|
446
|
+
* A markdown summary suitable for display in a listing.
|
549
447
|
*/
|
550
|
-
|
448
|
+
summary?: string;
|
449
|
+
|
551
450
|
/**
|
552
|
-
* A markdown description
|
451
|
+
* A markdown description.
|
553
452
|
*/
|
554
|
-
description?: string
|
555
|
-
|
556
|
-
name: string
|
453
|
+
description?: string;
|
454
|
+
|
557
455
|
/**
|
558
|
-
* Whether the property is
|
456
|
+
* Whether the CSS custom property is deprecated.
|
457
|
+
* If the value is a string, it's the reason for the deprecation.
|
559
458
|
*/
|
560
|
-
|
561
|
-
|
459
|
+
deprecated?: boolean | string;
|
460
|
+
}
|
461
|
+
|
462
|
+
export interface Type {
|
562
463
|
/**
|
563
|
-
*
|
464
|
+
* The full string representation of the type, in whatever type syntax is
|
465
|
+
* used, such as JSDoc, Closure, or TypeScript.
|
466
|
+
*/
|
467
|
+
text: string;
|
468
|
+
|
469
|
+
/**
|
470
|
+
* An array of references to the types in the type string.
|
471
|
+
*
|
472
|
+
* These references have optional indices into the type string so that tools
|
473
|
+
* can understand the references in the type string independently of the type
|
474
|
+
* system and syntax. For example, a documentation viewer could display the
|
475
|
+
* type `Array<FooElement | BarElement>` with cross-references to `FooElement`
|
476
|
+
* and `BarElement` without understanding arrays, generics, or union types.
|
564
477
|
*/
|
565
|
-
|
566
|
-
|
478
|
+
references?: TypeReference[];
|
479
|
+
|
480
|
+
source?: SourceReference;
|
567
481
|
}
|
482
|
+
|
568
483
|
/**
|
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.
|
484
|
+
* A reference that is associated with a type string and optionally a range
|
485
|
+
* within the string.
|
582
486
|
*
|
583
|
-
*
|
584
|
-
*
|
585
|
-
*
|
586
|
-
*
|
487
|
+
* Start and end must both be present or not present. If they're present, they
|
488
|
+
* are indices into the associated type string. If they are missing, the entire
|
489
|
+
* type string is the symbol referenced and the name should match the type
|
490
|
+
* string.
|
491
|
+
*/
|
492
|
+
export interface TypeReference extends Reference {
|
493
|
+
start?: number;
|
494
|
+
end?: number;
|
495
|
+
}
|
496
|
+
|
497
|
+
/**
|
498
|
+
* The common interface of classes and mixins.
|
587
499
|
*/
|
588
|
-
export interface
|
589
|
-
|
500
|
+
export interface ClassLike {
|
501
|
+
_ui5experimental?: boolean | string
|
590
502
|
_ui5implements?: Reference[]
|
591
|
-
_ui5abstract?: boolean
|
592
503
|
_ui5privacy?: Privacy
|
593
504
|
/**
|
594
505
|
* Marks when the field was introduced
|
595
506
|
*/
|
596
507
|
_ui5since?: string
|
508
|
+
name: string;
|
509
|
+
|
597
510
|
/**
|
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.
|
511
|
+
* A markdown summary suitable for display in a listing.
|
612
512
|
*/
|
613
|
-
|
513
|
+
summary?: string;
|
514
|
+
|
614
515
|
/**
|
615
516
|
* A markdown description of the class.
|
616
517
|
*/
|
617
|
-
description?: string
|
518
|
+
description?: string;
|
519
|
+
|
618
520
|
/**
|
619
|
-
* The
|
521
|
+
* The superclass of this class.
|
522
|
+
*
|
523
|
+
* If this class is defined with mixin applications, the prototype chain
|
524
|
+
* includes the mixin applications and the true superclass is computed
|
525
|
+
* from them.
|
620
526
|
*/
|
621
|
-
|
622
|
-
|
623
|
-
members?: (ClassField | ClassMethod)[]
|
527
|
+
superclass?: Reference;
|
528
|
+
|
624
529
|
/**
|
625
530
|
* Any class mixins applied in the extends clause of this class.
|
626
531
|
*
|
@@ -632,401 +537,275 @@ export interface CustomElementDeclaration {
|
|
632
537
|
* first. This may read backwards from the common order in JavaScript, but
|
633
538
|
* matches the order of language used to describe mixin application, like
|
634
539
|
* "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
540
|
*
|
678
|
-
*
|
679
|
-
*
|
680
|
-
|
681
|
-
|
541
|
+
* @example
|
542
|
+
*
|
543
|
+
* ```javascript
|
544
|
+
* class T extends B(A(S)) {}
|
545
|
+
* ```
|
546
|
+
*
|
547
|
+
* is described by:
|
548
|
+
* ```json
|
549
|
+
* {
|
550
|
+
* "kind": "class",
|
551
|
+
* "superclass": {
|
552
|
+
* "name": "S"
|
553
|
+
* },
|
554
|
+
* "mixins": [
|
555
|
+
* {
|
556
|
+
* "name": "A"
|
557
|
+
* },
|
558
|
+
* {
|
559
|
+
* "name": "B"
|
560
|
+
* },
|
561
|
+
* ]
|
562
|
+
* }
|
563
|
+
* ```
|
564
|
+
*/
|
565
|
+
mixins?: Array<Reference>;
|
566
|
+
members?: Array<ClassMember>;
|
567
|
+
|
568
|
+
source?: SourceReference;
|
569
|
+
|
682
570
|
/**
|
683
|
-
* Whether the
|
571
|
+
* Whether the class or mixin is deprecated.
|
684
572
|
* If the value is a string, it's the reason for the deprecation.
|
685
573
|
*/
|
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
|
-
}
|
574
|
+
deprecated?: boolean | string;
|
722
575
|
}
|
576
|
+
|
577
|
+
export interface ClassDeclaration extends ClassLike {
|
578
|
+
kind: 'class';
|
579
|
+
}
|
580
|
+
|
581
|
+
export type ClassMember = ClassField | ClassMethod;
|
582
|
+
|
723
583
|
/**
|
724
|
-
* The
|
584
|
+
* The common interface of variables, class fields, and function
|
585
|
+
* parameters.
|
725
586
|
*/
|
726
|
-
export interface
|
727
|
-
|
728
|
-
|
729
|
-
* If the value is a string, it's the reason for the deprecation.
|
730
|
-
*/
|
731
|
-
deprecated?: string | boolean
|
587
|
+
export interface PropertyLike {
|
588
|
+
name: string;
|
589
|
+
|
732
590
|
/**
|
733
|
-
* A markdown
|
591
|
+
* A markdown summary suitable for display in a listing.
|
734
592
|
*/
|
735
|
-
|
736
|
-
|
593
|
+
summary?: string;
|
594
|
+
|
737
595
|
/**
|
738
|
-
* A markdown
|
596
|
+
* A markdown description of the field.
|
739
597
|
*/
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
598
|
+
description?: string;
|
599
|
+
|
600
|
+
type?: Type;
|
601
|
+
|
602
|
+
default?: string;
|
603
|
+
|
744
604
|
/**
|
745
|
-
* Whether the
|
605
|
+
* Whether the property is deprecated.
|
746
606
|
* If the value is a string, it's the reason for the deprecation.
|
747
607
|
*/
|
748
|
-
deprecated?:
|
608
|
+
deprecated?: boolean | string;
|
609
|
+
|
749
610
|
/**
|
750
|
-
*
|
611
|
+
* Whether the property is read-only.
|
751
612
|
*/
|
752
|
-
|
613
|
+
readonly?: boolean;
|
614
|
+
}
|
615
|
+
|
616
|
+
export interface ClassField extends PropertyLike {
|
617
|
+
_ui5noAttribute?: boolean;
|
618
|
+
_ui5validator?: string
|
619
|
+
_ui5formProperty?: boolean
|
620
|
+
_ui5formEvents?: string
|
753
621
|
/**
|
754
|
-
*
|
622
|
+
* Marks when the field was introduced
|
755
623
|
*/
|
756
|
-
|
624
|
+
_ui5since?: string
|
625
|
+
kind: 'field';
|
626
|
+
static?: boolean;
|
627
|
+
privacy?: Privacy;
|
628
|
+
inheritedFrom?: Reference;
|
629
|
+
source?: SourceReference;
|
630
|
+
}
|
631
|
+
|
632
|
+
/**
|
633
|
+
* Additional metadata for fields on custom elements.
|
634
|
+
*/
|
635
|
+
export interface CustomElementField extends ClassField {
|
757
636
|
/**
|
758
|
-
*
|
637
|
+
* The corresponding attribute name if there is one.
|
638
|
+
*
|
639
|
+
* If this property is defined, the attribute must be listed in the classes'
|
640
|
+
* `attributes` array.
|
759
641
|
*/
|
760
|
-
|
642
|
+
attribute?: string;
|
643
|
+
|
761
644
|
/**
|
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.
|
766
|
-
*
|
767
|
-
* Examples:
|
645
|
+
* If the property reflects to an attribute.
|
768
646
|
*
|
769
|
-
*
|
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
|
647
|
+
* If this is true, the `attribute` property must be defined.
|
773
648
|
*/
|
774
|
-
|
649
|
+
reflects?: boolean;
|
775
650
|
}
|
776
|
-
|
777
|
-
|
778
|
-
* A markdown description of the demo.
|
779
|
-
*/
|
780
|
-
description?: string
|
781
|
-
source?: SourceReference
|
651
|
+
|
652
|
+
export interface ClassMethod extends FunctionLike {
|
782
653
|
/**
|
783
|
-
*
|
784
|
-
* if it's hosted.
|
654
|
+
* Marks when the field was introduced
|
785
655
|
*/
|
786
|
-
|
656
|
+
_ui5since?: string
|
657
|
+
kind: 'method';
|
658
|
+
static?: boolean;
|
659
|
+
privacy?: Privacy;
|
660
|
+
inheritedFrom?: Reference;
|
661
|
+
source?: SourceReference;
|
787
662
|
}
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
663
|
+
|
664
|
+
/**
|
665
|
+
* A description of a class mixin.
|
666
|
+
*
|
667
|
+
* Mixins are functions which generate a new subclass of a given superclass.
|
668
|
+
* This interfaces describes the class and custom element features that
|
669
|
+
* are added by the mixin. As such, it extends the CustomElement interface and
|
670
|
+
* ClassLike interface.
|
671
|
+
*
|
672
|
+
* Since mixins are functions, it also extends the FunctionLike interface. This
|
673
|
+
* means a mixin is callable, and has parameters and a return type.
|
674
|
+
*
|
675
|
+
* The return type is often hard or impossible to accurately describe in type
|
676
|
+
* systems like TypeScript. It requires generics and an `extends` operator
|
677
|
+
* that TypeScript lacks. Therefore it's recommended that the return type is
|
678
|
+
* left empty. The most common form of a mixin function takes a single
|
679
|
+
* argument, so consumers of this interface should assume that the return type
|
680
|
+
* is the single argument subclassed by this declaration.
|
681
|
+
*
|
682
|
+
* A mixin should not have a superclass. If a mixins composes other mixins,
|
683
|
+
* they should be listed in the `mixins` field.
|
684
|
+
*
|
685
|
+
* See [this article]{@link https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/}
|
686
|
+
* for more information on the classmixin pattern in JavaScript.
|
687
|
+
*
|
688
|
+
* @example
|
689
|
+
*
|
690
|
+
* This JavaScript mixin declaration:
|
691
|
+
* ```javascript
|
692
|
+
* const MyMixin = (base) => class extends base {
|
693
|
+
* foo() { ... }
|
694
|
+
* }
|
695
|
+
* ```
|
696
|
+
*
|
697
|
+
* Is described by this JSON:
|
698
|
+
* ```json
|
699
|
+
* {
|
700
|
+
* "kind": "mixin",
|
701
|
+
* "name": "MyMixin",
|
702
|
+
* "parameters": [
|
703
|
+
* {
|
704
|
+
* "name": "base",
|
705
|
+
* }
|
706
|
+
* ],
|
707
|
+
* "members": [
|
708
|
+
* {
|
709
|
+
* "kind": "method",
|
710
|
+
* "name": "foo",
|
711
|
+
* }
|
712
|
+
* ]
|
713
|
+
* }
|
714
|
+
* ```
|
715
|
+
*/
|
716
|
+
export interface MixinDeclaration extends ClassLike, FunctionLike {
|
717
|
+
kind: 'mixin';
|
718
|
+
}
|
719
|
+
|
720
|
+
/**
|
721
|
+
* A class mixin that also adds custom element related properties.
|
722
|
+
*/
|
723
|
+
// Note: this needs to be an interface to be included in the generated JSON
|
724
|
+
// Schema output.
|
725
|
+
export interface CustomElementMixinDeclaration
|
726
|
+
extends MixinDeclaration,
|
727
|
+
CustomElement { }
|
728
|
+
|
729
|
+
export interface VariableDeclaration extends PropertyLike {
|
730
|
+
kind: 'variable';
|
731
|
+
source?: SourceReference;
|
732
|
+
}
|
733
|
+
|
734
|
+
export interface FunctionDeclaration extends FunctionLike {
|
795
735
|
/**
|
796
736
|
* Marks when the field was introduced
|
797
737
|
*/
|
798
738
|
_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
|
-
}
|
739
|
+
kind: 'function';
|
740
|
+
source?: SourceReference;
|
835
741
|
}
|
836
|
-
|
837
|
-
|
838
|
-
_ui5type?: Type
|
742
|
+
|
743
|
+
export interface Parameter extends PropertyLike {
|
839
744
|
_ui5privacy?: Privacy
|
840
745
|
/**
|
841
746
|
* Marks when the field was introduced
|
842
747
|
*/
|
843
748
|
_ui5since?: string
|
844
749
|
/**
|
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.
|
750
|
+
* Whether the parameter is optional. Undefined implies non-optional.
|
855
751
|
*/
|
856
|
-
|
752
|
+
optional?: boolean;
|
857
753
|
/**
|
858
|
-
*
|
754
|
+
* Whether the parameter is a rest parameter. Only the last parameter may be a rest parameter.
|
755
|
+
* Undefined implies single parameter.
|
859
756
|
*/
|
860
|
-
|
757
|
+
rest?: boolean;
|
861
758
|
}
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
_ui5package?: string
|
759
|
+
|
760
|
+
export interface FunctionLike {
|
761
|
+
name: string;
|
762
|
+
|
867
763
|
/**
|
868
|
-
*
|
764
|
+
* A markdown summary suitable for display in a listing.
|
869
765
|
*/
|
870
|
-
|
871
|
-
|
872
|
-
cssProperties?: CssCustomProperty[]
|
766
|
+
summary?: string;
|
767
|
+
|
873
768
|
/**
|
874
|
-
*
|
875
|
-
* custom element class
|
769
|
+
* A markdown description.
|
876
770
|
*/
|
877
|
-
|
878
|
-
|
771
|
+
description?: string;
|
772
|
+
|
879
773
|
/**
|
880
|
-
* Whether the
|
774
|
+
* Whether the function is deprecated.
|
881
775
|
* If the value is a string, it's the reason for the deprecation.
|
882
776
|
*/
|
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[]
|
777
|
+
deprecated?: boolean | string;
|
778
|
+
|
779
|
+
parameters?: Parameter[];
|
780
|
+
|
909
781
|
return?: {
|
782
|
+
type?: Type;
|
783
|
+
|
910
784
|
/**
|
911
|
-
* A markdown
|
785
|
+
* A markdown summary suitable for display in a listing.
|
912
786
|
*/
|
913
|
-
|
787
|
+
summary?: string;
|
788
|
+
|
914
789
|
/**
|
915
|
-
* A markdown
|
790
|
+
* A markdown description.
|
916
791
|
*/
|
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
|
792
|
+
description?: string;
|
793
|
+
};
|
994
794
|
}
|
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
|
-
}
|
795
|
+
|
796
|
+
export type Privacy = 'public' | 'private' | 'protected';
|
797
|
+
|
798
|
+
export interface Demo {
|
1021
799
|
/**
|
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.
|
800
|
+
* A markdown description of the demo.
|
1025
801
|
*/
|
1026
|
-
|
1027
|
-
|
802
|
+
description?: string;
|
803
|
+
|
1028
804
|
/**
|
1029
|
-
*
|
805
|
+
* Relative URL of the demo if it's published with the package. Absolute URL
|
806
|
+
* if it's hosted.
|
1030
807
|
*/
|
1031
|
-
|
1032
|
-
|
808
|
+
url: string;
|
809
|
+
|
810
|
+
source?: SourceReference;
|
811
|
+
}
|