@arcgis/api-extractor 4.32.0-next.11
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/README.md +21 -0
- package/dist/apiJson.d.ts +1042 -0
- package/dist/ensureValidType.d.ts +1 -0
- package/dist/extractor/index.d.ts +42 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +141 -0
- package/dist/utils/apiHelpers.d.ts +22 -0
- package/dist/utils/astHelpers.d.ts +9 -0
- package/package.json +22 -0
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# ArcGIS Maps SDK for JavaScript - API Extractor
|
|
2
|
+
|
|
3
|
+
**No Esri Technical Support included.**
|
|
4
|
+
|
|
5
|
+
Package that is part of the [ArcGIS Maps SDK for JavaScript](https://developers.arcgis.com/javascript).
|
|
6
|
+
|
|
7
|
+
It is not intended to be used directly, but rather used as a dependency by other packages in the SDK.
|
|
8
|
+
|
|
9
|
+
## License
|
|
10
|
+
|
|
11
|
+
COPYRIGHT © 2024 Esri
|
|
12
|
+
|
|
13
|
+
All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
|
|
14
|
+
|
|
15
|
+
This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement. You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
|
|
16
|
+
|
|
17
|
+
See use restrictions at <http://www.esri.com/legal/pdfs/mla_e204_e300/english>
|
|
18
|
+
|
|
19
|
+
For additional information, contact: Environmental Systems Research Institute, Inc. Attn: Contracts and Legal Services Department 380 New York Street Redlands, California, USA 92373 USA
|
|
20
|
+
|
|
21
|
+
email: contracts@esri.com
|
|
@@ -0,0 +1,1042 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The top-level type of an `api.json` file.
|
|
3
|
+
*
|
|
4
|
+
* `api.json` is a superset of custom-elements-manifest.
|
|
5
|
+
*
|
|
6
|
+
* @see https://custom-elements-manifest.open-wc.org/analyzer/getting-started/
|
|
7
|
+
*/
|
|
8
|
+
export type ApiJson = {
|
|
9
|
+
/**
|
|
10
|
+
* The timestamp at which the metadata was generated, in the format
|
|
11
|
+
* `YYYY-MM-DDThh:mm:ss`.
|
|
12
|
+
*
|
|
13
|
+
* @example "2000-00-00T00:00:00"
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Not present in vanilla custom-elements-manifest.
|
|
17
|
+
*/
|
|
18
|
+
timestamp: string;
|
|
19
|
+
/**
|
|
20
|
+
* @remarks
|
|
21
|
+
* Not present in vanilla custom-elements-manifest.
|
|
22
|
+
*/
|
|
23
|
+
compiler: {
|
|
24
|
+
/**
|
|
25
|
+
* The name of the compiler that generated the metadata.
|
|
26
|
+
*
|
|
27
|
+
* @example "@arcgis/api-extractor"
|
|
28
|
+
*/
|
|
29
|
+
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* The version of the compiler that generated the metadata.
|
|
32
|
+
*
|
|
33
|
+
* @example "4.32.0"
|
|
34
|
+
*/
|
|
35
|
+
version: string;
|
|
36
|
+
/**
|
|
37
|
+
* The version of TypeScript that was used to generate the metadata.
|
|
38
|
+
*
|
|
39
|
+
* @example "5.4.5"
|
|
40
|
+
*/
|
|
41
|
+
typescriptVersion: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The version of the schema used in this file.
|
|
45
|
+
*
|
|
46
|
+
* @example "1.0.0"
|
|
47
|
+
*/
|
|
48
|
+
schemaVersion: string;
|
|
49
|
+
/**
|
|
50
|
+
* The Markdown to use for the main readme of this package.
|
|
51
|
+
*
|
|
52
|
+
* This can be used to override the readme used by Github or npm if that file
|
|
53
|
+
* contains information irrelevant to custom element catalogs and
|
|
54
|
+
* documentation viewers.
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
58
|
+
* with custom-elements-manifest.
|
|
59
|
+
*/
|
|
60
|
+
readme?: string;
|
|
61
|
+
/**
|
|
62
|
+
* An array of the modules this package contains.
|
|
63
|
+
*
|
|
64
|
+
* The modules should be public entrypoints that other packages may import
|
|
65
|
+
* from.
|
|
66
|
+
*/
|
|
67
|
+
modules: ApiModule[];
|
|
68
|
+
/**
|
|
69
|
+
* Whether the package is deprecated.
|
|
70
|
+
* If the value is a string, it's the reason for the deprecation.
|
|
71
|
+
*
|
|
72
|
+
* @default false
|
|
73
|
+
*
|
|
74
|
+
* @remarks
|
|
75
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
76
|
+
* with custom-elements-manifest.
|
|
77
|
+
*/
|
|
78
|
+
deprecated?: boolean | string;
|
|
79
|
+
};
|
|
80
|
+
export type ApiModule = ApiJavaScriptModule;
|
|
81
|
+
export type ApiJavaScriptModule = {
|
|
82
|
+
kind: "javascript-module";
|
|
83
|
+
/**
|
|
84
|
+
* Path to the javascript file needed to be imported.
|
|
85
|
+
*
|
|
86
|
+
* @example "src/components/property-types/property-types.tsx"
|
|
87
|
+
*/
|
|
88
|
+
path: string;
|
|
89
|
+
/**
|
|
90
|
+
* A markdown summary suitable for display in a listing.
|
|
91
|
+
*/
|
|
92
|
+
summary?: string;
|
|
93
|
+
/**
|
|
94
|
+
* A markdown description of the module.
|
|
95
|
+
*/
|
|
96
|
+
description?: string;
|
|
97
|
+
/**
|
|
98
|
+
* The declarations of a module.
|
|
99
|
+
*
|
|
100
|
+
* For documentation purposes, all declarations that are reachable from
|
|
101
|
+
* exports should be described here. Ie, functions and objects that may be
|
|
102
|
+
* properties of exported objects, or passed as arguments to functions.
|
|
103
|
+
*/
|
|
104
|
+
declarations: ApiDeclaration[];
|
|
105
|
+
/**
|
|
106
|
+
* The exports of a module. This includes JavaScript exports and
|
|
107
|
+
* custom element definitions.
|
|
108
|
+
*/
|
|
109
|
+
exports?: ApiExport[];
|
|
110
|
+
/**
|
|
111
|
+
* Whether the module is deprecated.
|
|
112
|
+
* If the value is a string, it's the reason for the deprecation.
|
|
113
|
+
*
|
|
114
|
+
* @default false
|
|
115
|
+
*/
|
|
116
|
+
deprecated?: boolean | string;
|
|
117
|
+
};
|
|
118
|
+
export type ApiExport = ApiCustomElementExport | ApiJavaScriptExport;
|
|
119
|
+
/**
|
|
120
|
+
* @remarks
|
|
121
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
122
|
+
* with custom-elements-manifest.
|
|
123
|
+
*/
|
|
124
|
+
export type ApiJavaScriptExport = {
|
|
125
|
+
kind: "js";
|
|
126
|
+
/**
|
|
127
|
+
* The name of the exported symbol.
|
|
128
|
+
*
|
|
129
|
+
* JavaScript has a number of ways to export objects which determine the
|
|
130
|
+
* correct name to use.
|
|
131
|
+
*
|
|
132
|
+
* - Default exports must use the name "default".
|
|
133
|
+
* - Named exports use the name that is exported. If the export is renamed
|
|
134
|
+
* with the "as" clause, use the exported name.
|
|
135
|
+
* - Aggregating exports (`* from`) should use the name `*`
|
|
136
|
+
*/
|
|
137
|
+
name: string;
|
|
138
|
+
/**
|
|
139
|
+
* A reference to the exported declaration.
|
|
140
|
+
*
|
|
141
|
+
* In the case of aggregating exports, the reference's `module` field must be
|
|
142
|
+
* defined and the `name` field must be `"*"`.
|
|
143
|
+
*/
|
|
144
|
+
declaration: ApiReference;
|
|
145
|
+
/**
|
|
146
|
+
* Whether the export is deprecated. For example, the name of the export was changed.
|
|
147
|
+
* If the value is a string, it's the reason for the deprecation.
|
|
148
|
+
*
|
|
149
|
+
* @default false
|
|
150
|
+
*/
|
|
151
|
+
deprecated?: boolean | string;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* A global custom element definition, ie the result of a
|
|
155
|
+
* `customElements.define()` call.
|
|
156
|
+
*
|
|
157
|
+
* This is represented as an export because a definition makes the element
|
|
158
|
+
* available outside of the module it's defined it.
|
|
159
|
+
*/
|
|
160
|
+
export type ApiCustomElementExport = {
|
|
161
|
+
kind: "custom-element-definition";
|
|
162
|
+
/**
|
|
163
|
+
* The tag name of the custom element.
|
|
164
|
+
*
|
|
165
|
+
* @example "arcgis-counter"
|
|
166
|
+
*/
|
|
167
|
+
name: string;
|
|
168
|
+
/**
|
|
169
|
+
* A reference to the class or other declaration that implements the
|
|
170
|
+
* custom element.
|
|
171
|
+
*/
|
|
172
|
+
declaration: ApiReference;
|
|
173
|
+
/**
|
|
174
|
+
* Whether the custom-element export is deprecated.
|
|
175
|
+
* For example, a future version will not register the custom element in this file.
|
|
176
|
+
* If the value is a string, it's the reason for the deprecation.
|
|
177
|
+
*
|
|
178
|
+
* @default false
|
|
179
|
+
*/
|
|
180
|
+
deprecated?: boolean | string;
|
|
181
|
+
};
|
|
182
|
+
export type ApiDeclaration = ApiClassDeclaration | ApiCustomElementDeclaration | ApiCustomElementMixinDeclaration | ApiFunctionDeclaration | ApiMixinDeclaration | ApiVariableDeclaration;
|
|
183
|
+
/**
|
|
184
|
+
* A reference to an export of a module.
|
|
185
|
+
*
|
|
186
|
+
* All references are required to be publicly accessible, so the canonical
|
|
187
|
+
* representation of a reference is the export it's available from.
|
|
188
|
+
*
|
|
189
|
+
* `package` should generally refer to an npm package name. If `package` is
|
|
190
|
+
* undefined then the reference is local to this package. If `module` is
|
|
191
|
+
* undefined the reference is local to the containing module.
|
|
192
|
+
*
|
|
193
|
+
* References to global symbols like `Array`, `HTMLElement`, or `Event` should
|
|
194
|
+
* use a `package` name of `"global:"`.
|
|
195
|
+
*/
|
|
196
|
+
export type ApiReference = {
|
|
197
|
+
/**
|
|
198
|
+
* @example "AreaMeasurementAnalysis"
|
|
199
|
+
*/
|
|
200
|
+
name: string;
|
|
201
|
+
/**
|
|
202
|
+
* @example "@arcgis/core"
|
|
203
|
+
*/
|
|
204
|
+
package?: string;
|
|
205
|
+
/**
|
|
206
|
+
* @example "interfaces.d.ts"
|
|
207
|
+
*/
|
|
208
|
+
module?: string;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* A reference to the source of a declaration or member.
|
|
212
|
+
*
|
|
213
|
+
* @remarks
|
|
214
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
215
|
+
* with custom-elements-manifest.
|
|
216
|
+
*/
|
|
217
|
+
export type ApiSourceReference = {
|
|
218
|
+
/**
|
|
219
|
+
* An absolute URL to the source (ie. a GitHub URL).
|
|
220
|
+
*/
|
|
221
|
+
href: string;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* A description of a custom element class.
|
|
225
|
+
*
|
|
226
|
+
* Custom elements are JavaScript classes, so this extends from
|
|
227
|
+
* `ClassDeclaration` and adds custom-element-specific features like attributes,
|
|
228
|
+
* events, and slots.
|
|
229
|
+
*
|
|
230
|
+
* Note that `tagName` in this interface is optional. Tag names are not
|
|
231
|
+
* necessarily part of a custom element class, but belong to the definition
|
|
232
|
+
* (often called the "registration") or the `customElements.define()` call.
|
|
233
|
+
*
|
|
234
|
+
* Because classes and tag names can only be registered once, there's a
|
|
235
|
+
* one-to-one relationship between classes and tag names. For ease of use, we
|
|
236
|
+
* allow the tag name here.
|
|
237
|
+
*
|
|
238
|
+
* Some packages define and register custom elements in separate modules. In
|
|
239
|
+
* these cases one `Module` should contain the `CustomElement` without a
|
|
240
|
+
* tagName, and another `Module` should contain the `CustomElementExport`.
|
|
241
|
+
*/
|
|
242
|
+
export type ApiCustomElementDeclaration = ApiClassDeclaration & {
|
|
243
|
+
/**
|
|
244
|
+
* An optional tag name that should be specified if this is a
|
|
245
|
+
* self-registering element.
|
|
246
|
+
*
|
|
247
|
+
* Self-registering elements must also include a CustomElementExport in the
|
|
248
|
+
* module's exports.
|
|
249
|
+
*
|
|
250
|
+
* @example "arcgis-counter"
|
|
251
|
+
*/
|
|
252
|
+
tagName: string;
|
|
253
|
+
members: ApiCustomElementMember[];
|
|
254
|
+
superclass: ApiReference;
|
|
255
|
+
/**
|
|
256
|
+
* The attributes that this element is known to understand.
|
|
257
|
+
*
|
|
258
|
+
* For most use cases, the "members" array includes properties will all the
|
|
259
|
+
* information included in the "attributes" array. Thus directly accessing
|
|
260
|
+
* "attributes" is not necessary.
|
|
261
|
+
*/
|
|
262
|
+
attributes?: ApiAttribute[];
|
|
263
|
+
/**
|
|
264
|
+
* The events that this element fires.
|
|
265
|
+
*/
|
|
266
|
+
events?: ApiEvent[];
|
|
267
|
+
/**
|
|
268
|
+
* The shadow dom content slots that this element accepts.
|
|
269
|
+
*/
|
|
270
|
+
slots?: ApiSlot[];
|
|
271
|
+
cssParts?: ApiCssPart[];
|
|
272
|
+
cssProperties?: ApiCssCustomProperty[];
|
|
273
|
+
cssStates?: ApiCssCustomState[];
|
|
274
|
+
demos?: ApiDemo[];
|
|
275
|
+
/**
|
|
276
|
+
* Distinguishes a regular JavaScript class from a custom element class
|
|
277
|
+
*/
|
|
278
|
+
customElement: true;
|
|
279
|
+
/**
|
|
280
|
+
* @remarks
|
|
281
|
+
* Not present in vanilla custom-elements-manifest.
|
|
282
|
+
*/
|
|
283
|
+
docsTags?: ApiDocsTag[];
|
|
284
|
+
/**
|
|
285
|
+
* The path from which the component can be imported.
|
|
286
|
+
*
|
|
287
|
+
* @example "components/arcgis-area-measurement-2d"
|
|
288
|
+
*
|
|
289
|
+
* @remarks
|
|
290
|
+
* Not present in vanilla custom-elements-manifest.
|
|
291
|
+
*/
|
|
292
|
+
importPath: string;
|
|
293
|
+
/**
|
|
294
|
+
* @default "shadow"
|
|
295
|
+
*
|
|
296
|
+
* @remarks
|
|
297
|
+
* Not present in vanilla custom-elements-manifest.
|
|
298
|
+
*/
|
|
299
|
+
encapsulation?: "none" | "shadow";
|
|
300
|
+
/**
|
|
301
|
+
* @example "HTMLArcgisCounterElement"
|
|
302
|
+
*
|
|
303
|
+
* @remarks
|
|
304
|
+
* Not present in vanilla custom-elements-manifest.
|
|
305
|
+
*/
|
|
306
|
+
typeName: string;
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* A descriptor for a single JSDoc tag found in a block comment.
|
|
310
|
+
*
|
|
311
|
+
* @remarks
|
|
312
|
+
* Some tags have dedicated fields. Those will be excluded from array of
|
|
313
|
+
* "docsTags".
|
|
314
|
+
*/
|
|
315
|
+
export type ApiDocsTag = {
|
|
316
|
+
/**
|
|
317
|
+
* The tag name (immediately following the '@').
|
|
318
|
+
*
|
|
319
|
+
* @example "since"
|
|
320
|
+
*/
|
|
321
|
+
name: string;
|
|
322
|
+
/**
|
|
323
|
+
* The description that immediately follows the tag name.
|
|
324
|
+
*
|
|
325
|
+
* @example "4.31"
|
|
326
|
+
*/
|
|
327
|
+
text?: string;
|
|
328
|
+
};
|
|
329
|
+
/**
|
|
330
|
+
* For most use cases, the "members" array includes properties will all the
|
|
331
|
+
* information included in the "attributes" array. Thus directly accessing
|
|
332
|
+
* "attributes" is not necessary.
|
|
333
|
+
*/
|
|
334
|
+
export type ApiAttribute = {
|
|
335
|
+
/**
|
|
336
|
+
* @example "initial-count"
|
|
337
|
+
*/
|
|
338
|
+
name: string;
|
|
339
|
+
/**
|
|
340
|
+
* A markdown summary suitable for display in a listing.
|
|
341
|
+
*/
|
|
342
|
+
summary?: string;
|
|
343
|
+
/**
|
|
344
|
+
* A markdown description.
|
|
345
|
+
*/
|
|
346
|
+
description?: string;
|
|
347
|
+
inheritedFrom?: ApiReference;
|
|
348
|
+
/**
|
|
349
|
+
* The type that the attribute will be serialized/deserialized as.
|
|
350
|
+
*/
|
|
351
|
+
type: ApiType;
|
|
352
|
+
/**
|
|
353
|
+
* The default value of the attribute, if any.
|
|
354
|
+
*
|
|
355
|
+
* As attributes are always strings, this is the actual value, not a human
|
|
356
|
+
* readable description.
|
|
357
|
+
*
|
|
358
|
+
* @example "10"
|
|
359
|
+
*/
|
|
360
|
+
default?: string;
|
|
361
|
+
/**
|
|
362
|
+
* The name of the field this attribute is associated with.
|
|
363
|
+
*
|
|
364
|
+
* @example "initialCount"
|
|
365
|
+
*/
|
|
366
|
+
fieldName?: string;
|
|
367
|
+
/**
|
|
368
|
+
* Whether the attribute is deprecated.
|
|
369
|
+
* If the value is a string, it's the reason for the deprecation.
|
|
370
|
+
*
|
|
371
|
+
* @default false
|
|
372
|
+
*/
|
|
373
|
+
deprecated?: boolean | string;
|
|
374
|
+
};
|
|
375
|
+
export type ApiEvent = {
|
|
376
|
+
/**
|
|
377
|
+
* @example "arcgisClick"
|
|
378
|
+
*/
|
|
379
|
+
name: string;
|
|
380
|
+
/**
|
|
381
|
+
* A markdown summary suitable for display in a listing.
|
|
382
|
+
*/
|
|
383
|
+
summary?: string;
|
|
384
|
+
/**
|
|
385
|
+
* A markdown description.
|
|
386
|
+
*/
|
|
387
|
+
description?: string;
|
|
388
|
+
/**
|
|
389
|
+
* The type of the event object that's fired.
|
|
390
|
+
*/
|
|
391
|
+
type: Omit<ApiType, "values">;
|
|
392
|
+
inheritedFrom?: ApiReference;
|
|
393
|
+
/**
|
|
394
|
+
* Whether the event is deprecated.
|
|
395
|
+
* If the value is a string, it's the reason for the deprecation.
|
|
396
|
+
*
|
|
397
|
+
* @default false
|
|
398
|
+
*/
|
|
399
|
+
deprecated?: boolean | string;
|
|
400
|
+
/**
|
|
401
|
+
* @remarks
|
|
402
|
+
* Not present in vanilla custom-elements-manifest.
|
|
403
|
+
*/
|
|
404
|
+
docsTags?: ApiDocsTag[];
|
|
405
|
+
/**
|
|
406
|
+
* @default true
|
|
407
|
+
*
|
|
408
|
+
* @remarks
|
|
409
|
+
* Not present in vanilla custom-elements-manifest.
|
|
410
|
+
*/
|
|
411
|
+
bubbles?: boolean;
|
|
412
|
+
/**
|
|
413
|
+
* @default true
|
|
414
|
+
*
|
|
415
|
+
* @remarks
|
|
416
|
+
* Not present in vanilla custom-elements-manifest.
|
|
417
|
+
*/
|
|
418
|
+
cancelable?: boolean;
|
|
419
|
+
/**
|
|
420
|
+
* @default true
|
|
421
|
+
*
|
|
422
|
+
* @remarks
|
|
423
|
+
* Not present in vanilla custom-elements-manifest.
|
|
424
|
+
*/
|
|
425
|
+
composed?: boolean;
|
|
426
|
+
/**
|
|
427
|
+
* @default "public"
|
|
428
|
+
*
|
|
429
|
+
* @remarks
|
|
430
|
+
* Not used by `@arcgis/api-extractor`. Present for completeness.
|
|
431
|
+
*/
|
|
432
|
+
privacy?: ApiPrivacy;
|
|
433
|
+
};
|
|
434
|
+
/**
|
|
435
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot
|
|
436
|
+
*/
|
|
437
|
+
export type ApiSlot = {
|
|
438
|
+
/**
|
|
439
|
+
* The slot name, or the empty string for an unnamed slot.
|
|
440
|
+
*
|
|
441
|
+
* @example "header"
|
|
442
|
+
*/
|
|
443
|
+
name: string;
|
|
444
|
+
/**
|
|
445
|
+
* A markdown summary suitable for display in a listing.
|
|
446
|
+
*/
|
|
447
|
+
summary?: string;
|
|
448
|
+
/**
|
|
449
|
+
* A markdown description.
|
|
450
|
+
*/
|
|
451
|
+
description?: string;
|
|
452
|
+
/**
|
|
453
|
+
* Whether the slot is deprecated.
|
|
454
|
+
* If the value is a string, it's the reason for the deprecation.
|
|
455
|
+
*
|
|
456
|
+
* @default false
|
|
457
|
+
*
|
|
458
|
+
* @remarks
|
|
459
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
460
|
+
* with custom-elements-manifest.
|
|
461
|
+
*/
|
|
462
|
+
deprecated?: boolean | string;
|
|
463
|
+
};
|
|
464
|
+
/**
|
|
465
|
+
* The description of exposed CSS Parts
|
|
466
|
+
*
|
|
467
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_shadow_parts
|
|
468
|
+
*/
|
|
469
|
+
export type ApiCssPart = {
|
|
470
|
+
/**
|
|
471
|
+
* @example "tab"
|
|
472
|
+
*/
|
|
473
|
+
name: string;
|
|
474
|
+
/**
|
|
475
|
+
* A markdown summary suitable for display in a listing.
|
|
476
|
+
*/
|
|
477
|
+
summary?: string;
|
|
478
|
+
/**
|
|
479
|
+
* A markdown description.
|
|
480
|
+
*/
|
|
481
|
+
description?: string;
|
|
482
|
+
/**
|
|
483
|
+
* Whether the CSS shadow part is deprecated.
|
|
484
|
+
* If the value is a string, it's the reason for the deprecation.
|
|
485
|
+
*
|
|
486
|
+
* @default false
|
|
487
|
+
*
|
|
488
|
+
* @remarks
|
|
489
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
490
|
+
* with custom-elements-manifest.
|
|
491
|
+
*/
|
|
492
|
+
deprecated?: boolean | string;
|
|
493
|
+
};
|
|
494
|
+
/**
|
|
495
|
+
* The description of a CSS Custom State.
|
|
496
|
+
*
|
|
497
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet
|
|
498
|
+
*/
|
|
499
|
+
export type ApiCssCustomState = {
|
|
500
|
+
/**
|
|
501
|
+
* The name of the state. Note: Unlike CSS custom properties, custom states
|
|
502
|
+
* do not have a leading `--`.
|
|
503
|
+
*
|
|
504
|
+
* @example "active"
|
|
505
|
+
*/
|
|
506
|
+
name: string;
|
|
507
|
+
/**
|
|
508
|
+
* A markdown summary suitable for display in a listing.
|
|
509
|
+
*/
|
|
510
|
+
summary?: string;
|
|
511
|
+
/**
|
|
512
|
+
* A markdown description.
|
|
513
|
+
*/
|
|
514
|
+
description?: string;
|
|
515
|
+
/**
|
|
516
|
+
* Whether the CSS custom state is deprecated.
|
|
517
|
+
* If the value is a string, it's the reason for the deprecation.
|
|
518
|
+
*
|
|
519
|
+
* @default false
|
|
520
|
+
*
|
|
521
|
+
* @remarks
|
|
522
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
523
|
+
* with custom-elements-manifest.
|
|
524
|
+
*/
|
|
525
|
+
deprecated?: boolean | string;
|
|
526
|
+
};
|
|
527
|
+
export type ApiCssCustomProperty = {
|
|
528
|
+
/**
|
|
529
|
+
* The name of the property, including leading `--`.
|
|
530
|
+
*
|
|
531
|
+
* @example "--calcite-text-color"
|
|
532
|
+
*/
|
|
533
|
+
name: string;
|
|
534
|
+
/**
|
|
535
|
+
* The expected syntax of the defined property. Defaults to "*".
|
|
536
|
+
*
|
|
537
|
+
* The syntax must be a valid CSS
|
|
538
|
+
* [syntax string](https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax)
|
|
539
|
+
* as defined in the CSS Properties and Values API.
|
|
540
|
+
*
|
|
541
|
+
* Examples:
|
|
542
|
+
*
|
|
543
|
+
* "<color>": accepts a color
|
|
544
|
+
* "<length> | <percentage>": accepts lengths or percentages but not calc expressions with a combination of the two
|
|
545
|
+
* "small | medium | large": accepts one of these values set as custom indents.
|
|
546
|
+
* "*": any valid token
|
|
547
|
+
*/
|
|
548
|
+
syntax?: string;
|
|
549
|
+
default?: string;
|
|
550
|
+
/**
|
|
551
|
+
* A markdown summary suitable for display in a listing.
|
|
552
|
+
*/
|
|
553
|
+
summary?: string;
|
|
554
|
+
/**
|
|
555
|
+
* A markdown description.
|
|
556
|
+
*/
|
|
557
|
+
description?: string;
|
|
558
|
+
/**
|
|
559
|
+
* Whether the CSS custom property is deprecated.
|
|
560
|
+
* If the value is a string, it's the reason for the deprecation.
|
|
561
|
+
*
|
|
562
|
+
* @default false
|
|
563
|
+
*
|
|
564
|
+
* @remarks
|
|
565
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
566
|
+
* with custom-elements-manifest.
|
|
567
|
+
*/
|
|
568
|
+
deprecated?: boolean | string;
|
|
569
|
+
};
|
|
570
|
+
export type ApiType = {
|
|
571
|
+
/**
|
|
572
|
+
* The full string representation of the type, in whatever type syntax is
|
|
573
|
+
* used, such as JSDoc, Closure, or TypeScript.
|
|
574
|
+
*
|
|
575
|
+
* This represents a 'resolved' type, where e.g. imported types have been
|
|
576
|
+
* resolved and inlined.
|
|
577
|
+
*
|
|
578
|
+
* @example Array<"active" | "inactive">
|
|
579
|
+
*/
|
|
580
|
+
text: string;
|
|
581
|
+
/**
|
|
582
|
+
* An array of references to the types in the type string.
|
|
583
|
+
*
|
|
584
|
+
* These references have optional indices into the type string so that tools
|
|
585
|
+
* can understand the references in the type string independently of the type
|
|
586
|
+
* system and syntax. For example, a documentation viewer could display the
|
|
587
|
+
* type `Array<FooElement | BarElement>` with cross-references to `FooElement`
|
|
588
|
+
* and `BarElement` without understanding arrays, generics, or union types.
|
|
589
|
+
*/
|
|
590
|
+
references?: ApiTypeReference[];
|
|
591
|
+
/**
|
|
592
|
+
* @remarks
|
|
593
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
594
|
+
* with custom-elements-manifest.
|
|
595
|
+
*/
|
|
596
|
+
source?: ApiSourceReference;
|
|
597
|
+
/**
|
|
598
|
+
* An enum of possible values for this type.
|
|
599
|
+
*
|
|
600
|
+
* @remarks
|
|
601
|
+
* Not present in vanilla custom-elements-manifest.
|
|
602
|
+
*/
|
|
603
|
+
values?: ApiValue[];
|
|
604
|
+
};
|
|
605
|
+
export type ApiValue = {
|
|
606
|
+
/**
|
|
607
|
+
* @example "string"
|
|
608
|
+
*/
|
|
609
|
+
type: string;
|
|
610
|
+
/**
|
|
611
|
+
* @example "active"
|
|
612
|
+
*/
|
|
613
|
+
value?: string;
|
|
614
|
+
};
|
|
615
|
+
/**
|
|
616
|
+
* A reference that is associated with a type string and optionally a range
|
|
617
|
+
* within the string.
|
|
618
|
+
*
|
|
619
|
+
* Start and end must both be present or not present. If they're present, they
|
|
620
|
+
* are indices into the associated type string. If they are missing, the entire
|
|
621
|
+
* type string is the symbol referenced and the name should match the type
|
|
622
|
+
* string.
|
|
623
|
+
*/
|
|
624
|
+
export type ApiTypeReference = ApiReference & {
|
|
625
|
+
start?: number;
|
|
626
|
+
end?: number;
|
|
627
|
+
};
|
|
628
|
+
/**
|
|
629
|
+
* The common interface of classes and mixins.
|
|
630
|
+
*/
|
|
631
|
+
export type ApiClassDeclaration = {
|
|
632
|
+
kind: "class";
|
|
633
|
+
/**
|
|
634
|
+
* @example "ArcgisCounter"
|
|
635
|
+
*/
|
|
636
|
+
name: string;
|
|
637
|
+
/**
|
|
638
|
+
* A markdown summary suitable for display in a listing.
|
|
639
|
+
*/
|
|
640
|
+
summary?: string;
|
|
641
|
+
/**
|
|
642
|
+
* A markdown description of the class.
|
|
643
|
+
*/
|
|
644
|
+
description?: string;
|
|
645
|
+
/**
|
|
646
|
+
* The superclass of this class.
|
|
647
|
+
*
|
|
648
|
+
* If this class is defined with mixin applications, the prototype chain
|
|
649
|
+
* includes the mixin applications and the true superclass is computed
|
|
650
|
+
* from them.
|
|
651
|
+
*/
|
|
652
|
+
superclass?: ApiReference;
|
|
653
|
+
/**
|
|
654
|
+
* Any class mixins applied in the extends clause of this class.
|
|
655
|
+
*
|
|
656
|
+
* If mixins are applied in the class definition, then the true superclass
|
|
657
|
+
* of this class is the result of applying mixins in order to the superclass.
|
|
658
|
+
*
|
|
659
|
+
* Mixins must be listed in order of their application to the superclass or
|
|
660
|
+
* previous mixin application. This means that the innermost mixin is listed
|
|
661
|
+
* first. This may read backwards from the common order in JavaScript, but
|
|
662
|
+
* matches the order of language used to describe mixin application, like
|
|
663
|
+
* "S with A, B".
|
|
664
|
+
*
|
|
665
|
+
* @example
|
|
666
|
+
*
|
|
667
|
+
* ```javascript
|
|
668
|
+
* class T extends B(A(S)) {}
|
|
669
|
+
* ```
|
|
670
|
+
*
|
|
671
|
+
* is described by:
|
|
672
|
+
* ```json
|
|
673
|
+
* {
|
|
674
|
+
* "kind": "class",
|
|
675
|
+
* "superclass": {
|
|
676
|
+
* "name": "S"
|
|
677
|
+
* },
|
|
678
|
+
* "mixins": [
|
|
679
|
+
* {
|
|
680
|
+
* "name": "A"
|
|
681
|
+
* },
|
|
682
|
+
* {
|
|
683
|
+
* "name": "B"
|
|
684
|
+
* },
|
|
685
|
+
* ]
|
|
686
|
+
* }
|
|
687
|
+
* ```
|
|
688
|
+
*
|
|
689
|
+
* @remarks
|
|
690
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
691
|
+
* with custom-elements-manifest.
|
|
692
|
+
*/
|
|
693
|
+
mixins?: ApiReference[];
|
|
694
|
+
members?: ApiClassMember[];
|
|
695
|
+
/**
|
|
696
|
+
* @remarks
|
|
697
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
698
|
+
* with custom-elements-manifest.
|
|
699
|
+
*/
|
|
700
|
+
source?: ApiSourceReference;
|
|
701
|
+
/**
|
|
702
|
+
* Whether the class or mixin is deprecated.
|
|
703
|
+
* If the value is a string, it's the reason for the deprecation.
|
|
704
|
+
*
|
|
705
|
+
* @default false
|
|
706
|
+
*/
|
|
707
|
+
deprecated?: boolean | string;
|
|
708
|
+
/**
|
|
709
|
+
* @default "public"
|
|
710
|
+
*
|
|
711
|
+
* @remarks
|
|
712
|
+
* Not used by `@arcgis/api-extractor`. Present for completeness.
|
|
713
|
+
*/
|
|
714
|
+
privacy?: ApiPrivacy;
|
|
715
|
+
};
|
|
716
|
+
export type ApiClassMember = ApiClassField | ApiClassMethod;
|
|
717
|
+
export type ApiCustomElementMember = ApiClassMethod | ApiCustomElementField;
|
|
718
|
+
/**
|
|
719
|
+
* The common interface of variables, class fields, and function
|
|
720
|
+
* parameters.
|
|
721
|
+
*/
|
|
722
|
+
export type ApiPropertyLike = {
|
|
723
|
+
/**
|
|
724
|
+
* @example "initialCount"
|
|
725
|
+
*/
|
|
726
|
+
name: string;
|
|
727
|
+
/**
|
|
728
|
+
* A markdown summary suitable for display in a listing.
|
|
729
|
+
*/
|
|
730
|
+
summary?: string;
|
|
731
|
+
/**
|
|
732
|
+
* A markdown description of the field.
|
|
733
|
+
*/
|
|
734
|
+
description?: string;
|
|
735
|
+
type: ApiType;
|
|
736
|
+
/**
|
|
737
|
+
* @example 10
|
|
738
|
+
*/
|
|
739
|
+
default?: string;
|
|
740
|
+
/**
|
|
741
|
+
* Whether the property is deprecated.
|
|
742
|
+
* If the value is a string, it's the reason for the deprecation.
|
|
743
|
+
*
|
|
744
|
+
* @default false
|
|
745
|
+
*/
|
|
746
|
+
deprecated?: boolean | string;
|
|
747
|
+
/**
|
|
748
|
+
* Whether the property is read-only.
|
|
749
|
+
*
|
|
750
|
+
* @default false
|
|
751
|
+
*/
|
|
752
|
+
readonly?: boolean;
|
|
753
|
+
};
|
|
754
|
+
export type ApiClassField = ApiPropertyLike & {
|
|
755
|
+
kind: "field";
|
|
756
|
+
/**
|
|
757
|
+
* @default false
|
|
758
|
+
*
|
|
759
|
+
* @remarks
|
|
760
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
761
|
+
* with custom-elements-manifest.
|
|
762
|
+
*
|
|
763
|
+
* All static members are excluded from the api.json.
|
|
764
|
+
*/
|
|
765
|
+
static?: boolean;
|
|
766
|
+
/**
|
|
767
|
+
* @default "public"
|
|
768
|
+
*
|
|
769
|
+
* @remarks
|
|
770
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
771
|
+
* with custom-elements-manifest.
|
|
772
|
+
*
|
|
773
|
+
* All private and protected fields are excluded from the api.json.
|
|
774
|
+
*/
|
|
775
|
+
privacy?: ApiPrivacy;
|
|
776
|
+
inheritedFrom?: ApiReference;
|
|
777
|
+
/**
|
|
778
|
+
* @remarks
|
|
779
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
780
|
+
* with custom-elements-manifest.
|
|
781
|
+
*/
|
|
782
|
+
source?: ApiSourceReference;
|
|
783
|
+
};
|
|
784
|
+
/**
|
|
785
|
+
* Additional metadata for fields on custom elements.
|
|
786
|
+
*/
|
|
787
|
+
export type ApiCustomElementField = ApiClassField & {
|
|
788
|
+
/**
|
|
789
|
+
* The corresponding attribute name if there is one.
|
|
790
|
+
*
|
|
791
|
+
* If this property is defined, the attribute must be listed in the classes'
|
|
792
|
+
* `attributes` array.
|
|
793
|
+
*
|
|
794
|
+
* @example "initial-counter"
|
|
795
|
+
*/
|
|
796
|
+
attribute?: string;
|
|
797
|
+
/**
|
|
798
|
+
* If the property reflects to an attribute.
|
|
799
|
+
*
|
|
800
|
+
* If this is true, the `attribute` property must be defined.
|
|
801
|
+
*
|
|
802
|
+
* @default false
|
|
803
|
+
*/
|
|
804
|
+
reflects?: boolean;
|
|
805
|
+
/**
|
|
806
|
+
* @remarks
|
|
807
|
+
* Not present in vanilla custom-elements-manifest.
|
|
808
|
+
*/
|
|
809
|
+
docsTags?: ApiDocsTag[];
|
|
810
|
+
/**
|
|
811
|
+
* Whether field has both getter and setter, and their types are different.
|
|
812
|
+
* The actual getter type is not included in the api.json at the moment, but
|
|
813
|
+
* can be added if that information is needed.
|
|
814
|
+
*
|
|
815
|
+
* @default false
|
|
816
|
+
*
|
|
817
|
+
* @remarks
|
|
818
|
+
* Not present in vanilla custom-elements-manifest.
|
|
819
|
+
*/
|
|
820
|
+
getterTypeDiffers?: boolean;
|
|
821
|
+
/**
|
|
822
|
+
* For some properties, we show them as read-only in the docs and in the
|
|
823
|
+
* typings but don't actually enforce read-only at runtime.
|
|
824
|
+
*
|
|
825
|
+
* Such properties are represented in the manifest with both `readonly` and
|
|
826
|
+
* `docsOnlyReadonly` set to true.
|
|
827
|
+
*
|
|
828
|
+
* Runtime read-only properties are represented with only `readonly` true.
|
|
829
|
+
*
|
|
830
|
+
* @default false
|
|
831
|
+
*
|
|
832
|
+
* @remarks
|
|
833
|
+
* Not present in vanilla custom-elements-manifest.
|
|
834
|
+
*/
|
|
835
|
+
docsOnlyReadonly?: boolean;
|
|
836
|
+
};
|
|
837
|
+
export type ApiClassMethod = ApiFunctionLike & {
|
|
838
|
+
kind: "method";
|
|
839
|
+
/**
|
|
840
|
+
* @default false
|
|
841
|
+
*
|
|
842
|
+
* @remarks
|
|
843
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
844
|
+
* with custom-elements-manifest.
|
|
845
|
+
*
|
|
846
|
+
* All static members are excluded from the api.json.
|
|
847
|
+
*/
|
|
848
|
+
static?: boolean;
|
|
849
|
+
/**
|
|
850
|
+
* @default "public"
|
|
851
|
+
*
|
|
852
|
+
* @remarks
|
|
853
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
854
|
+
* with custom-elements-manifest.
|
|
855
|
+
*
|
|
856
|
+
* All private and protected fields are excluded from the api.json.
|
|
857
|
+
*/
|
|
858
|
+
privacy?: ApiPrivacy;
|
|
859
|
+
inheritedFrom?: ApiReference;
|
|
860
|
+
/**
|
|
861
|
+
* @remarks
|
|
862
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
863
|
+
* with custom-elements-manifest.
|
|
864
|
+
*/
|
|
865
|
+
source?: ApiSourceReference;
|
|
866
|
+
/**
|
|
867
|
+
* @remarks
|
|
868
|
+
* Not present in vanilla custom-elements-manifest.
|
|
869
|
+
*/
|
|
870
|
+
docsTags?: ApiDocsTag[];
|
|
871
|
+
/**
|
|
872
|
+
* @remarks
|
|
873
|
+
* Not present in vanilla custom-elements-manifest.
|
|
874
|
+
*/
|
|
875
|
+
signature: string;
|
|
876
|
+
/**
|
|
877
|
+
* @default false
|
|
878
|
+
*
|
|
879
|
+
* @remarks
|
|
880
|
+
* Not present in vanilla custom-elements-manifest.
|
|
881
|
+
*/
|
|
882
|
+
async?: boolean;
|
|
883
|
+
};
|
|
884
|
+
/**
|
|
885
|
+
* A description of a class mixin.
|
|
886
|
+
*
|
|
887
|
+
* Mixins are functions which generate a new subclass of a given superclass.
|
|
888
|
+
* This interfaces describes the class and custom element features that
|
|
889
|
+
* are added by the mixin. As such, it extends the CustomElement interface and
|
|
890
|
+
* ClassLike interface.
|
|
891
|
+
*
|
|
892
|
+
* Since mixins are functions, it also extends the FunctionLike interface. This
|
|
893
|
+
* means a mixin is callable, and has parameters and a return type.
|
|
894
|
+
*
|
|
895
|
+
* The return type is often hard or impossible to accurately describe in type
|
|
896
|
+
* systems like TypeScript. It requires generics and an `extends` operator
|
|
897
|
+
* that TypeScript lacks. Therefore it's recommended that the return type is
|
|
898
|
+
* left empty. The most common form of a mixin function takes a single
|
|
899
|
+
* argument, so consumers of this interface should assume that the return type
|
|
900
|
+
* is the single argument subclassed by this declaration.
|
|
901
|
+
*
|
|
902
|
+
* A mixin should not have a superclass. If a mixins composes other mixins,
|
|
903
|
+
* they should be listed in the `mixins` field.
|
|
904
|
+
*
|
|
905
|
+
* See more information on the class mixin pattern in JavaScript:
|
|
906
|
+
* https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/
|
|
907
|
+
*
|
|
908
|
+
* @example
|
|
909
|
+
*
|
|
910
|
+
* This JavaScript mixin declaration:
|
|
911
|
+
* ```javascript
|
|
912
|
+
* const MyMixin = (base) => class extends base {
|
|
913
|
+
* foo() { ... }
|
|
914
|
+
* }
|
|
915
|
+
* ```
|
|
916
|
+
*
|
|
917
|
+
* Is described by this JSON:
|
|
918
|
+
* ```json
|
|
919
|
+
* {
|
|
920
|
+
* "kind": "mixin",
|
|
921
|
+
* "name": "MyMixin",
|
|
922
|
+
* "parameters": [
|
|
923
|
+
* {
|
|
924
|
+
* "name": "base",
|
|
925
|
+
* }
|
|
926
|
+
* ],
|
|
927
|
+
* "members": [
|
|
928
|
+
* {
|
|
929
|
+
* "kind": "method",
|
|
930
|
+
* "name": "foo",
|
|
931
|
+
* }
|
|
932
|
+
* ]
|
|
933
|
+
* }
|
|
934
|
+
* ```
|
|
935
|
+
*
|
|
936
|
+
* @remarks
|
|
937
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
938
|
+
* with custom-elements-manifest.
|
|
939
|
+
*/
|
|
940
|
+
export type ApiMixinDeclaration = ApiClassDeclaration & ApiFunctionLike & {
|
|
941
|
+
kind: "mixin";
|
|
942
|
+
};
|
|
943
|
+
/**
|
|
944
|
+
* A class mixin that also adds custom element related properties.
|
|
945
|
+
*
|
|
946
|
+
* @remarks
|
|
947
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
948
|
+
* with custom-elements-manifest.
|
|
949
|
+
*/
|
|
950
|
+
export type ApiCustomElementMixinDeclaration = ApiCustomElementDeclaration & ApiMixinDeclaration;
|
|
951
|
+
/**
|
|
952
|
+
* @remarks
|
|
953
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
954
|
+
* with custom-elements-manifest.
|
|
955
|
+
*/
|
|
956
|
+
export type ApiVariableDeclaration = ApiPropertyLike & {
|
|
957
|
+
kind: "variable";
|
|
958
|
+
source?: ApiSourceReference;
|
|
959
|
+
};
|
|
960
|
+
/**
|
|
961
|
+
* @remarks
|
|
962
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
963
|
+
* with custom-elements-manifest.
|
|
964
|
+
*/
|
|
965
|
+
export type ApiFunctionDeclaration = ApiFunctionLike & {
|
|
966
|
+
kind: "function";
|
|
967
|
+
source?: ApiSourceReference;
|
|
968
|
+
};
|
|
969
|
+
export type ApiParameter = ApiPropertyLike & {
|
|
970
|
+
/**
|
|
971
|
+
* Whether the parameter is optional.
|
|
972
|
+
*
|
|
973
|
+
* @default false
|
|
974
|
+
*/
|
|
975
|
+
optional?: boolean;
|
|
976
|
+
/**
|
|
977
|
+
* @default false
|
|
978
|
+
*
|
|
979
|
+
* Whether the parameter is a rest parameter. Only the last parameter may be a rest parameter.
|
|
980
|
+
* Undefined implies single parameter.
|
|
981
|
+
*/
|
|
982
|
+
rest?: boolean;
|
|
983
|
+
};
|
|
984
|
+
export type ApiFunctionLike = {
|
|
985
|
+
/**
|
|
986
|
+
* @example "increment"
|
|
987
|
+
*/
|
|
988
|
+
name: string;
|
|
989
|
+
/**
|
|
990
|
+
* A markdown summary suitable for display in a listing.
|
|
991
|
+
*/
|
|
992
|
+
summary?: string;
|
|
993
|
+
/**
|
|
994
|
+
* A markdown description.
|
|
995
|
+
*/
|
|
996
|
+
description?: string;
|
|
997
|
+
/**
|
|
998
|
+
* Whether the function is deprecated.
|
|
999
|
+
* If the value is a string, it's the reason for the deprecation.
|
|
1000
|
+
*
|
|
1001
|
+
* @default false
|
|
1002
|
+
*/
|
|
1003
|
+
deprecated?: boolean | string;
|
|
1004
|
+
/**
|
|
1005
|
+
* @default []
|
|
1006
|
+
*/
|
|
1007
|
+
parameters?: ApiParameter[];
|
|
1008
|
+
return?: {
|
|
1009
|
+
type?: ApiType;
|
|
1010
|
+
/**
|
|
1011
|
+
* A markdown summary suitable for display in a listing.
|
|
1012
|
+
*/
|
|
1013
|
+
summary?: string;
|
|
1014
|
+
/**
|
|
1015
|
+
* A markdown description.
|
|
1016
|
+
*/
|
|
1017
|
+
description?: string;
|
|
1018
|
+
};
|
|
1019
|
+
};
|
|
1020
|
+
/**
|
|
1021
|
+
* @remarks
|
|
1022
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
1023
|
+
* with custom-elements-manifest.
|
|
1024
|
+
*/
|
|
1025
|
+
export type ApiPrivacy = "private" | "protected" | "public";
|
|
1026
|
+
/**
|
|
1027
|
+
* @remarks
|
|
1028
|
+
* Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
|
|
1029
|
+
* with custom-elements-manifest.
|
|
1030
|
+
*/
|
|
1031
|
+
export type ApiDemo = {
|
|
1032
|
+
/**
|
|
1033
|
+
* A markdown description of the demo.
|
|
1034
|
+
*/
|
|
1035
|
+
description: string;
|
|
1036
|
+
/**
|
|
1037
|
+
* Relative URL of the demo if it's published with the package. Absolute URL
|
|
1038
|
+
* if it's hosted.
|
|
1039
|
+
*/
|
|
1040
|
+
url: string;
|
|
1041
|
+
source?: ApiSourceReference;
|
|
1042
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ApiDeclaration, ApiExport, ApiJson, ApiModule } from "../apiJson";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
export type ApiExtractorOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* Whether to extract full API information, with type-checking. This should be
|
|
6
|
+
* the case during build or when running under Storybook. Otherwise, the dev
|
|
7
|
+
* server should keep API extraction to bare minimum to reduce needless
|
|
8
|
+
* overhead. Only the information necessary for the dev server is extracted.
|
|
9
|
+
*/
|
|
10
|
+
isFullApiExtraction: boolean;
|
|
11
|
+
cwd: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* This is a base abstract class. It should be subclassed to implement the
|
|
15
|
+
* specific extraction logic.
|
|
16
|
+
*/
|
|
17
|
+
export declare abstract class ApiExtractor {
|
|
18
|
+
options: ApiExtractorOptions;
|
|
19
|
+
constructor(options: ApiExtractorOptions);
|
|
20
|
+
protected file: ts.SourceFile;
|
|
21
|
+
protected apiModule: ApiModule;
|
|
22
|
+
/** Given an array of TypeScript source files, generate an api.json file */
|
|
23
|
+
extract(files: readonly ts.SourceFile[]): ApiJson;
|
|
24
|
+
protected extractModules(files: readonly ts.SourceFile[]): ApiModule[];
|
|
25
|
+
protected extractModule(module: ts.SourceFile): ApiModule;
|
|
26
|
+
/**
|
|
27
|
+
* For a given module, extract all public declarations.
|
|
28
|
+
*/
|
|
29
|
+
protected extractDeclarations(module: ts.SourceFile): ApiDeclaration[];
|
|
30
|
+
/**
|
|
31
|
+
* For each statement in a module, extract a declaration if it is a public API
|
|
32
|
+
*/
|
|
33
|
+
protected abstract extractDeclaration(statement: ts.Statement): ApiDeclaration | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Infer ApiModule.exports based on ApiModule.declarations.
|
|
36
|
+
*/
|
|
37
|
+
protected inferExports(declarations: ApiDeclaration[]): ApiExport[];
|
|
38
|
+
/**
|
|
39
|
+
* Infer ApiExport based on ApiDeclaration
|
|
40
|
+
*/
|
|
41
|
+
protected abstract inferExport(declaration: ApiDeclaration): ApiExport | undefined;
|
|
42
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ApiExtractor, type ApiExtractorOptions } from "./extractor";
|
|
2
|
+
export * from "./apiJson";
|
|
3
|
+
export { hasIgnoredModifier, setDefaultFromInitializer, getMemberName } from "./utils/astHelpers";
|
|
4
|
+
export { isApiMethod, isApiProperty, globalPackageIdentifier } from "./utils/apiHelpers";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// package.json
|
|
2
|
+
var name = "@arcgis/api-extractor";
|
|
3
|
+
var version = "4.32.0-next.11";
|
|
4
|
+
|
|
5
|
+
// src/extractor/index.ts
|
|
6
|
+
import ts from "typescript";
|
|
7
|
+
|
|
8
|
+
// src/utils/apiHelpers.ts
|
|
9
|
+
var isApiMethod = (member) => member.kind === "method";
|
|
10
|
+
var isApiProperty = (member) => member.kind === "field";
|
|
11
|
+
function naturalSortModules(left, right) {
|
|
12
|
+
const leftSplit = left.path.split("/");
|
|
13
|
+
const leftName = leftSplit.pop();
|
|
14
|
+
const leftDirectories = leftSplit.join("/");
|
|
15
|
+
const rightSplit = right.path.split("/");
|
|
16
|
+
const rightName = rightSplit.pop();
|
|
17
|
+
const rightDirectories = rightSplit.join("/");
|
|
18
|
+
if (leftDirectories === rightDirectories) {
|
|
19
|
+
return leftName < rightName ? -1 : 1;
|
|
20
|
+
} else if (leftDirectories.startsWith(rightDirectories)) {
|
|
21
|
+
return 1;
|
|
22
|
+
} else if (rightDirectories.startsWith(leftDirectories)) {
|
|
23
|
+
return -1;
|
|
24
|
+
} else {
|
|
25
|
+
return leftDirectories < rightDirectories ? -1 : 1;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
var globalPackageIdentifier = "global:";
|
|
29
|
+
|
|
30
|
+
// src/extractor/index.ts
|
|
31
|
+
import { path } from "@arcgis/components-build-utils";
|
|
32
|
+
var ApiExtractor = class {
|
|
33
|
+
constructor(options) {
|
|
34
|
+
this.options = options;
|
|
35
|
+
}
|
|
36
|
+
/** Given an array of TypeScript source files, generate an api.json file */
|
|
37
|
+
extract(files) {
|
|
38
|
+
return {
|
|
39
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString().split(".")[0],
|
|
40
|
+
compiler: {
|
|
41
|
+
name,
|
|
42
|
+
version,
|
|
43
|
+
typescriptVersion: ts.version
|
|
44
|
+
},
|
|
45
|
+
schemaVersion: "1.0.0",
|
|
46
|
+
modules: this.extractModules(files)
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
extractModules(files) {
|
|
50
|
+
const modules = [];
|
|
51
|
+
for (const file of files) {
|
|
52
|
+
this.file = file;
|
|
53
|
+
modules.push(this.extractModule(file));
|
|
54
|
+
}
|
|
55
|
+
if (this.options.isFullApiExtraction) {
|
|
56
|
+
modules.sort(naturalSortModules);
|
|
57
|
+
}
|
|
58
|
+
return modules;
|
|
59
|
+
}
|
|
60
|
+
extractModule(module) {
|
|
61
|
+
const apiModule = {
|
|
62
|
+
kind: "javascript-module",
|
|
63
|
+
path: path.relative(this.options.cwd, module.fileName),
|
|
64
|
+
declarations: void 0,
|
|
65
|
+
exports: void 0
|
|
66
|
+
};
|
|
67
|
+
this.apiModule = apiModule;
|
|
68
|
+
const declarations = this.extractDeclarations(module);
|
|
69
|
+
apiModule.declarations = declarations;
|
|
70
|
+
if (this.options.isFullApiExtraction) {
|
|
71
|
+
const exports = this.inferExports(declarations);
|
|
72
|
+
if (exports.length > 0) {
|
|
73
|
+
apiModule.exports = exports;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return apiModule;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* For a given module, extract all public declarations.
|
|
80
|
+
*/
|
|
81
|
+
extractDeclarations(module) {
|
|
82
|
+
const declarations = [];
|
|
83
|
+
for (const statement of module.statements) {
|
|
84
|
+
const declaration = this.extractDeclaration(statement);
|
|
85
|
+
if (declaration !== void 0) {
|
|
86
|
+
declarations.push(declaration);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return declarations;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Infer ApiModule.exports based on ApiModule.declarations.
|
|
93
|
+
*/
|
|
94
|
+
inferExports(declarations) {
|
|
95
|
+
const exports = [];
|
|
96
|
+
for (const declaration of declarations) {
|
|
97
|
+
const exported = this.inferExport(declaration);
|
|
98
|
+
if (exported !== void 0) {
|
|
99
|
+
exports.push(exported);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return exports;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// src/utils/astHelpers.ts
|
|
107
|
+
import ts2 from "typescript";
|
|
108
|
+
var hasIgnoredModifier = (member) => member.modifiers?.some?.(
|
|
109
|
+
(modifier) => modifier.kind === ts2.SyntaxKind.StaticKeyword || modifier.kind === ts2.SyntaxKind.PrivateKeyword || modifier.kind === ts2.SyntaxKind.ProtectedKeyword
|
|
110
|
+
) ?? false;
|
|
111
|
+
function setDefaultFromInitializer(node, property, sourceFile) {
|
|
112
|
+
if (!property.default && "initializer" in node && node.initializer) {
|
|
113
|
+
const unpacked = unpackInitializer(node.initializer);
|
|
114
|
+
if (isDefaultValueDocumentationEligible(unpacked)) {
|
|
115
|
+
property.default = unpacked.getText(sourceFile);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
var isDefaultValueDocumentationEligible = (initializer) => ts2.isLiteralExpression(initializer) || initializer.kind === ts2.SyntaxKind.TrueKeyword || initializer.kind === ts2.SyntaxKind.FalseKeyword || ts2.isPrefixUnaryExpression(initializer) && ts2.isLiteralExpression(initializer.operand);
|
|
120
|
+
function unpackInitializer(expression) {
|
|
121
|
+
if (ts2.isSatisfiesExpression(expression) || ts2.isParenthesizedExpression(expression)) {
|
|
122
|
+
return unpackInitializer(expression.expression);
|
|
123
|
+
} else {
|
|
124
|
+
return expression;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function getMemberName(name2) {
|
|
128
|
+
if (ts2.isIdentifier(name2) || ts2.isStringLiteralLike(name2)) {
|
|
129
|
+
return name2.text;
|
|
130
|
+
}
|
|
131
|
+
return void 0;
|
|
132
|
+
}
|
|
133
|
+
export {
|
|
134
|
+
ApiExtractor,
|
|
135
|
+
getMemberName,
|
|
136
|
+
globalPackageIdentifier,
|
|
137
|
+
hasIgnoredModifier,
|
|
138
|
+
isApiMethod,
|
|
139
|
+
isApiProperty,
|
|
140
|
+
setDefaultFromInitializer
|
|
141
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ApiClassMember, ApiClassMethod, ApiCustomElementField, ApiModule } from "../apiJson";
|
|
2
|
+
export declare const isApiMethod: (member: ApiClassMember) => member is ApiClassMethod;
|
|
3
|
+
export declare const isApiProperty: (member: ApiClassMember) => member is ApiCustomElementField;
|
|
4
|
+
/**
|
|
5
|
+
* Being a bit smarter than simply sorting paths alphabetically. The goal
|
|
6
|
+
* is that nested components appear after their parent component. Otherwise,
|
|
7
|
+
* simple alphabetical.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* [
|
|
12
|
+
* "src/components/z/z.js",
|
|
13
|
+
* "src/components/z/components/sub-a.js",
|
|
14
|
+
* "src/components/z/components/sub-z.js",
|
|
15
|
+
* ]
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function naturalSortModules(left: ApiModule, right: ApiModule): number;
|
|
19
|
+
/**
|
|
20
|
+
* This is not made up by us - defined in the custom-elements-manifest spec
|
|
21
|
+
*/
|
|
22
|
+
export declare const globalPackageIdentifier = "global:";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import type { ApiPropertyLike } from "../apiJson";
|
|
3
|
+
export declare const hasIgnoredModifier: (member: ts.ClassElement) => boolean;
|
|
4
|
+
export declare function setDefaultFromInitializer(node: ts.AccessorDeclaration | ts.PropertyDeclaration, property: ApiPropertyLike, sourceFile: ts.SourceFile): void;
|
|
5
|
+
/**
|
|
6
|
+
* Convert property name node into a string. Converts Identifier and
|
|
7
|
+
* StringLiteralLike nodes. The rest return undefined.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getMemberName(name: ts.PropertyName): string | undefined;
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@arcgis/api-extractor",
|
|
3
|
+
"version": "4.32.0-next.11",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./dist/index.js",
|
|
10
|
+
"./package.json": "./package.json"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist/"
|
|
14
|
+
],
|
|
15
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@arcgis/components-build-utils": "4.32.0-next.11",
|
|
18
|
+
"@arcgis/components-utils": "4.32.0-next.11",
|
|
19
|
+
"tslib": "^2.7.0",
|
|
20
|
+
"typescript": "~5.6.3"
|
|
21
|
+
}
|
|
22
|
+
}
|