@arcgis/api-extractor 5.0.0-next.14 → 5.0.0-next.140

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.
Files changed (56) hide show
  1. package/dist/ApiExtractor-4OnVCVTb.js +2644 -0
  2. package/dist/apiJson.d.ts +783 -1011
  3. package/dist/cli.js +38 -0
  4. package/dist/compilerHints.d.ts +62 -0
  5. package/dist/diff/diffApiJson.d.ts +26 -3
  6. package/dist/diff/diffApiJson.js +142 -0
  7. package/dist/diff/fetchApiJsonFromNpm.d.ts +5 -2
  8. package/dist/diff/fetchApiJsonFromNpm.js +9 -0
  9. package/dist/diff/types.d.ts +80 -49
  10. package/dist/diffTypes/index.d.ts +21 -0
  11. package/dist/diffTypes/index.js +71 -0
  12. package/dist/extractor/ApiExtractor.d.ts +74 -0
  13. package/dist/extractor/ApiExtractor.js +9 -0
  14. package/dist/extractor/config.d.ts +452 -0
  15. package/dist/extractor/config.js +17 -0
  16. package/dist/extractor/extractors/copyDoc.d.ts +25 -0
  17. package/dist/extractor/privateContext.d.ts +19 -0
  18. package/dist/extractor/privateContext.js +84 -0
  19. package/dist/extractor/processing/links.d.ts +12 -0
  20. package/dist/extractor/processing/links.js +177 -0
  21. package/dist/extractor/types.d.ts +40 -0
  22. package/dist/extractor/webComponent/findComponents.d.ts +19 -0
  23. package/dist/extractor/webComponent/findComponents.js +36 -0
  24. package/dist/extractor/webComponent/pathMapping.d.ts +11 -0
  25. package/dist/extractor/webComponent/pathMapping.js +44 -0
  26. package/dist/index.d.ts +164 -8
  27. package/dist/index.js +3 -283
  28. package/dist/typeScript-DRxRvn_W.js +64 -0
  29. package/dist/uiUtils/index.d.ts +12 -0
  30. package/dist/uiUtils/index.js +5 -0
  31. package/dist/utils/apiHelpers.d.ts +43 -17
  32. package/dist/utils/apiHelpers.js +80 -0
  33. package/dist/utils/astHelpers.d.ts +24 -11
  34. package/dist/utils/astHelpers.js +67 -0
  35. package/dist/utils/hydrateApiType.d.ts +26 -0
  36. package/dist/utils/hydrateApiType.js +62 -0
  37. package/dist/utils/inferEntrypoints.d.ts +17 -0
  38. package/dist/utils/inferEntrypoints.js +26 -0
  39. package/dist/utils/internalTypeScriptApis.d.ts +92 -0
  40. package/dist/utils/internalTypeScriptApis.js +58 -0
  41. package/dist/utils/partPrinter.d.ts +29 -0
  42. package/dist/utils/partPrinter.js +82 -0
  43. package/dist/vite/plugin.d.ts +53 -0
  44. package/dist/vite/plugin.js +107 -0
  45. package/dist/vite/typeScript.d.ts +16 -0
  46. package/dist/vite/typeScript.js +6 -0
  47. package/dist/worker-2MTaHG3k.js +3599 -0
  48. package/package.json +46 -5
  49. package/dist/diff/index.d.ts +0 -3
  50. package/dist/diff.js +0 -147
  51. package/dist/ensureValidType.d.ts +0 -1
  52. package/dist/extractor/index.d.ts +0 -46
  53. package/dist/types.d.ts +0 -25
  54. package/dist/utils/docHelpers.d.ts +0 -9
  55. package/dist/utils/error.d.ts +0 -12
  56. package/dist/utils/print.d.ts +0 -7
package/dist/apiJson.d.ts CHANGED
@@ -5,161 +5,221 @@
5
5
  *
6
6
  * @see https://custom-elements-manifest.open-wc.org/analyzer/getting-started/
7
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
- };
8
+ export interface ApiJson {
9
+ /**
10
+ * The timestamp at which the api.json was generated, in the format
11
+ * `YYYY-MM-DDThh:mm:ss`.
12
+ *
13
+ * > Not present in vanilla custom-elements-manifest.
14
+ *
15
+ * @example "2000-00-00T00:00:00"
16
+ */
17
+ timestamp: string;
18
+ /** > Not present in vanilla custom-elements-manifest. */
19
+ compiler: ApiJsonCompiler;
20
+ /**
21
+ * The version of the schema used in this file.
22
+ *
23
+ * @example "1.0.0"
24
+ */
25
+ schemaVersion: string;
26
+ /**
27
+ * The Markdown to use for the main readme of this package.
28
+ *
29
+ * This can be used to override the readme used by Github or npm if that file
30
+ * contains information irrelevant to custom element catalogs and
31
+ * documentation viewers.
32
+ *
33
+ * @deprecated
34
+ * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility
35
+ * with custom-elements-manifest.
36
+ */
37
+ readme?: string;
38
+ /**
39
+ * An array of the modules this package contains.
40
+ *
41
+ * The modules should be public entrypoints that other packages may import
42
+ * from.
43
+ */
44
+ modules: ApiModule[];
45
+ /**
46
+ * Whether the package is deprecated.
47
+ * If the value is a string, it's the reason for the deprecation.
48
+ *
49
+ * @deprecated
50
+ * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility
51
+ * with custom-elements-manifest.
52
+ * @default false
53
+ */
54
+ deprecated?: string | true;
55
+ }
56
+
57
+ export interface ApiJsonCompiler {
58
+ /**
59
+ * The name of the compiler that generated the metadata.
60
+ *
61
+ * @example "@arcgis/api-extractor"
62
+ */
63
+ name: string;
64
+ /**
65
+ * The version of the compiler that generated the metadata.
66
+ *
67
+ * @example "4.32.0"
68
+ */
69
+ version: string;
70
+ /**
71
+ * The version of TypeScript that was used to generate the metadata.
72
+ *
73
+ * @example "5.4.5"
74
+ */
75
+ typescriptVersion: string;
76
+ }
77
+
80
78
  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
- * @remarks
93
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
94
- * with custom-elements-manifest.
95
- */
96
- summary?: string;
97
- /**
98
- * A markdown description of the module.
99
- */
100
- description?: string;
101
- /**
102
- * The declarations of a module.
103
- *
104
- * For documentation purposes, all declarations that are reachable from
105
- * exports should be described here. Ie, functions and objects that may be
106
- * properties of exported objects, or passed as arguments to functions.
107
- */
108
- declarations: ApiDeclaration[];
109
- /**
110
- * The exports of a module. This includes JavaScript exports and
111
- * custom element definitions.
112
- */
113
- exports?: ApiExport[];
114
- /**
115
- * Whether the module is deprecated.
116
- * If the value is a string, it's the reason for the deprecation.
117
- *
118
- * @remarks
119
- * If module is marked as deprecated, all its declarations should also be
120
- * marked as deprecated. This is because in TypeScript, a usage of a
121
- * declaration will only be marked as deprecated if the declaration itself
122
- * is marked as deprecated, rather than its module.
123
- *
124
- * @default false
125
- */
126
- deprecated?: boolean | string;
127
- };
128
- export type ApiExport = ApiCustomElementExport | ApiJavaScriptExport;
79
+
80
+ export interface ApiJavaScriptModule extends ApiWithDescription, ApiWithDocsTags, ApiWithUnusedSummary {
81
+ kind: "javascript-module";
82
+ /**
83
+ * Public import path for the module. If package.json "exports" was used, this
84
+ * is the import path, not the .d.ts file path.
85
+ *
86
+ * @example "components/arcgis-map"
87
+ */
88
+ path: string;
89
+ /**
90
+ * The original source file path, relative to extraction root (most commonly
91
+ * src/ folder).
92
+ *
93
+ * > Not present in vanilla custom-elements-manifest.
94
+ *
95
+ * @example "components/map/map.tsx"
96
+ */
97
+ sourcePath: string;
98
+ /**
99
+ * Whether the module is deprecated.
100
+ * If the value is a string, it's the reason for the deprecation.
101
+ *
102
+ * If module is marked as deprecated, all its declarations should also be
103
+ * marked as deprecated. This is because in TypeScript, a usage of a
104
+ * declaration will only be marked as deprecated if the declaration itself
105
+ * is marked as deprecated, rather than its module.
106
+ *
107
+ * @default false
108
+ */
109
+ deprecated?: string | true;
110
+ /**
111
+ * The declarations of a module.
112
+ *
113
+ * For documentation purposes, all declarations that are reachable from
114
+ * exports should be described here. Ie, functions and objects that may be
115
+ * properties of exported objects, or passed as arguments to functions.
116
+ */
117
+ declarations: ApiDeclaration[];
118
+ /**
119
+ * The exports of a module. This includes JavaScript exports and
120
+ * custom element definitions.
121
+ */
122
+ exports?: ApiExport[];
123
+ }
124
+
125
+ export interface ApiWithDescription {
126
+ /** A markdown description of an api node */
127
+ description?: string;
128
+ }
129
+
130
+ export interface ApiWithDocsTags {
131
+ docsTags?: ApiDocsTag[];
132
+ }
133
+
134
+ export interface ApiWithDeprecated {
135
+ /**
136
+ * Whether the node is deprecated.
137
+ * If the value is a string, it's the reason for the deprecation.
138
+ *
139
+ * @default false
140
+ */
141
+ deprecated?: string | true;
142
+ }
143
+
144
+ export interface ApiWithUnusedSummary {
145
+ /**
146
+ * A markdown summary suitable for display in a listing.
147
+ *
148
+ * @deprecated
149
+ * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility
150
+ * with custom-elements-manifest.
151
+ */
152
+ summary?: string;
153
+ }
154
+
129
155
  /**
156
+ * A descriptor for a single JSDoc tag found in a block comment.
157
+ *
130
158
  * @remarks
131
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
132
- * with custom-elements-manifest.
159
+ * Some tags have dedicated fields. Those will be excluded from array of
160
+ * "docsTags".
133
161
  */
134
- export type ApiJavaScriptExport = {
135
- kind: "js";
136
- /**
137
- * The name of the exported symbol.
138
- *
139
- * JavaScript has a number of ways to export objects which determine the
140
- * correct name to use.
141
- *
142
- * - Default exports must use the name "default".
143
- * - Named exports use the name that is exported. If the export is renamed
144
- * with the "as" clause, use the exported name.
145
- * - Aggregating exports (`* from`) should use the name `*`
146
- */
147
- name: string;
148
- /**
149
- * A reference to the exported declaration.
150
- *
151
- * In the case of aggregating exports, the reference's `module` field must be
152
- * defined and the `name` field must be `"*"`.
153
- */
154
- declaration: ApiReference;
155
- /**
156
- * Whether the export is deprecated. For example, the name of the export was changed.
157
- * If the value is a string, it's the reason for the deprecation.
158
- *
159
- * @default false
160
- */
161
- deprecated?: boolean | string;
162
- };
162
+ export interface ApiDocsTag {
163
+ /**
164
+ * The tag name (immediately following the '@').
165
+ *
166
+ * @example "since"
167
+ */
168
+ name: string;
169
+ /**
170
+ * The description that immediately follows the tag name.
171
+ *
172
+ * @example "4.31"
173
+ */
174
+ text?: string;
175
+ }
176
+
177
+ export type ApiExport = ApiCustomElementExport | ApiJavaScriptExport | ApiTypeScriptExport;
178
+
179
+ export interface ApiJavaScriptExport {
180
+ kind: "js";
181
+ /**
182
+ * The name of the exported symbol.
183
+ *
184
+ * JavaScript has a number of ways to export objects which determine the
185
+ * correct name to use.
186
+ *
187
+ * - Default exports must use the name "default".
188
+ * - Named exports use the name that is exported. If the export is renamed
189
+ * with the "as" clause, use the exported name.
190
+ * - Aggregating exports (`* from`) should use the name `*`
191
+ */
192
+ name: string;
193
+ /**
194
+ * A reference to the exported declaration.
195
+ *
196
+ * In the case of aggregating exports, the reference's `module` field must be
197
+ * defined and the `name` field must be `"*"`.
198
+ */
199
+ declaration: ApiReference;
200
+ /**
201
+ * Whether the export is deprecated. For example, the name of the export was changed.
202
+ * If the value is a string, it's the reason for the deprecation.
203
+ *
204
+ * @deprecated
205
+ * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility
206
+ * with custom-elements-manifest. Read the deprecated status from the declaration.
207
+ * @default false
208
+ */
209
+ deprecated?: string | true;
210
+ }
211
+
212
+ /**
213
+ * Indicates that the export is type-only and has no runtime impact (is a type alias
214
+ * or an interface).
215
+ *
216
+ * > Not present in vanilla custom-elements-manifest, but may be added in the future.
217
+ * > See https://github.com/webcomponents/custom-elements-manifest/pull/77#issuecomment-873552677
218
+ */
219
+ export interface ApiTypeScriptExport extends Omit<ApiJavaScriptExport, "kind"> {
220
+ kind: "ts";
221
+ }
222
+
163
223
  /**
164
224
  * A global custom element definition, ie the result of a
165
225
  * `customElements.define()` call.
@@ -167,32 +227,34 @@ export type ApiJavaScriptExport = {
167
227
  * This is represented as an export because a definition makes the element
168
228
  * available outside of the module it's defined it.
169
229
  */
170
- export type ApiCustomElementExport = {
171
- kind: "custom-element-definition";
172
- /**
173
- * The tag name of the custom element.
174
- *
175
- * @example "arcgis-counter"
176
- */
177
- name: string;
178
- /**
179
- * A reference to the class or other declaration that implements the
180
- * custom element.
181
- */
182
- declaration: ApiReference;
183
- /**
184
- * Whether the custom-element export is deprecated.
185
- * For example, a future version will not register the custom element in this file.
186
- * If the value is a string, it's the reason for the deprecation.
187
- *
188
- * @default false
189
- * @remarks
190
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
191
- * with custom-elements-manifest.
192
- */
193
- deprecated?: boolean | string;
194
- };
195
- export type ApiDeclaration = ApiClassDeclaration | ApiCustomElementDeclaration | ApiCustomElementMixinDeclaration | ApiFunctionDeclaration | ApiMixinDeclaration | ApiVariableDeclaration;
230
+ export interface ApiCustomElementExport {
231
+ kind: "custom-element-definition";
232
+ /**
233
+ * The tag name of the custom element.
234
+ *
235
+ * @example "arcgis-counter"
236
+ */
237
+ name: string;
238
+ /**
239
+ * A reference to the class or other declaration that implements the
240
+ * custom element.
241
+ */
242
+ declaration: ApiReference;
243
+ /**
244
+ * Whether the custom-element export is deprecated.
245
+ * For example, a future version will not register the custom element in this file.
246
+ * If the value is a string, it's the reason for the deprecation.
247
+ *
248
+ * @deprecated
249
+ * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility
250
+ * with custom-elements-manifest. Read the deprecated status from the declaration.
251
+ * @default false
252
+ */
253
+ deprecated?: string | true;
254
+ }
255
+
256
+ export type ApiDeclaration = ApiClassDeclaration | ApiCustomElementDeclaration | ApiCustomElementMixinDeclaration | ApiFunctionDeclaration | ApiInterfaceDeclaration | ApiMixinDeclaration | ApiVariableDeclaration;
257
+
196
258
  /**
197
259
  * A reference to an export of a module.
198
260
  *
@@ -206,42 +268,27 @@ export type ApiDeclaration = ApiClassDeclaration | ApiCustomElementDeclaration |
206
268
  * References to global symbols like `Array`, `HTMLElement`, or `Event` should
207
269
  * use a `package` name of `"global:"`.
208
270
  */
209
- export type ApiReference = {
210
- /**
211
- * @example "AreaMeasurementAnalysis"
212
- */
213
- name: string;
214
- /**
215
- * @example "@arcgis/core"
216
- */
217
- package?: string;
218
- /**
219
- * @example "interfaces.d.ts"
220
- */
221
- module?: string;
222
- /**
223
- * A URL to see user-friendly documentation for the type.
224
- *
225
- * @example "https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html"
226
- */
227
- viewUrl?: string;
228
- };
229
- /**
230
- * A reference to the source of a declaration or member.
231
- *
232
- * @remarks
233
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
234
- * with custom-elements-manifest.
235
- */
236
- export type ApiSourceReference = {
237
- /**
238
- * An absolute URL to the source (ie. a GitHub URL).
239
- */
240
- href: string;
241
- };
271
+ export interface ApiReference {
272
+ /** @example "AreaMeasurementAnalysis" */
273
+ name: string;
274
+ /** @example "interfaces.d.ts" */
275
+ module?: string;
276
+ /** @example "@arcgis/core" */
277
+ package?: string;
278
+ /**
279
+ * A URL to see user-friendly documentation for the type.
280
+ *
281
+ * @example "https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html"
282
+ */
283
+ viewUrl?: string;
284
+ }
285
+
286
+ /** > Not present in vanilla custom-elements-manifest. */
287
+ export interface ApiReferenceWithTypeArguments extends ApiReference {
288
+ typeArguments?: ApiType[];
289
+ }
290
+
242
291
  /**
243
- * A description of a custom element class.
244
- *
245
292
  * Custom elements are JavaScript classes, so this extends from
246
293
  * `ClassDeclaration` and adds custom-element-specific features like attributes,
247
294
  * events, and slots.
@@ -258,402 +305,289 @@ export type ApiSourceReference = {
258
305
  * these cases one `Module` should contain the `CustomElement` without a
259
306
  * tagName, and another `Module` should contain the `CustomElementExport`.
260
307
  */
261
- export type ApiCustomElementDeclaration = Omit<ApiClassDeclaration, "members"> & {
262
- /**
263
- * An optional tag name that should be specified if this is a
264
- * self-registering element.
265
- *
266
- * Self-registering elements must also include a CustomElementExport in the
267
- * module's exports.
268
- *
269
- * @example "arcgis-counter"
270
- */
271
- tagName: string;
272
- /**
273
- * Tag name converted to PascalCase.
274
- * The interfaces for the custom element are based on this name.
275
- *
276
- * @example "ArcgisCounter" (even if class name is `Counter`)
277
- *
278
- * @remarks
279
- * Not present in vanilla custom-elements-manifest.
280
- */
281
- pascalCaseName: string;
282
- members: ApiCustomElementMember[];
283
- superclass: ApiReference;
284
- /**
285
- * The attributes that this element is known to understand.
286
- *
287
- * For most use cases, the "members" array includes properties will all the
288
- * information included in the "attributes" array. Thus directly accessing
289
- * "attributes" is not necessary.
290
- */
291
- attributes?: ApiAttribute[];
292
- /**
293
- * The shadow dom content slots that this element accepts.
294
- */
295
- slots?: ApiSlot[];
296
- cssParts?: ApiCssPart[];
297
- cssProperties?: ApiCssCustomProperty[];
298
- cssStates?: ApiCssCustomState[];
299
- demos?: ApiDemo[];
300
- /**
301
- * Distinguishes a regular JavaScript class from a custom element class
302
- */
303
- customElement: true;
304
- /**
305
- * @remarks
306
- * Not present in vanilla custom-elements-manifest.
307
- */
308
- docsTags?: ApiDocsTag[];
309
- /**
310
- * The path from which the component can be imported.
311
- *
312
- * @example "components/arcgis-area-measurement-2d"
313
- *
314
- * @remarks
315
- * Not present in vanilla custom-elements-manifest.
316
- */
317
- importPath: string;
318
- /**
319
- * @default "shadow"
320
- *
321
- * @remarks
322
- * Not present in vanilla custom-elements-manifest.
323
- */
324
- encapsulation?: "none" | "shadow";
325
- };
326
- /**
327
- * A descriptor for a single JSDoc tag found in a block comment.
328
- *
329
- * @remarks
330
- * Some tags have dedicated fields. Those will be excluded from array of
331
- * "docsTags".
332
- */
333
- export type ApiDocsTag = {
334
- /**
335
- * The tag name (immediately following the '@').
336
- *
337
- * @example "since"
338
- */
339
- name: string;
340
- /**
341
- * The description that immediately follows the tag name.
342
- *
343
- * @example "4.31"
344
- */
345
- text?: string;
346
- };
308
+ export interface ApiCustomElementDeclaration extends ApiClassDeclaration, ApiWithPrivacy {
309
+ /**
310
+ * An optional tag name that should be specified if this is a
311
+ * self-registering element.
312
+ *
313
+ * Self-registering elements must also include a CustomElementExport in the
314
+ * module's exports.
315
+ *
316
+ * @example "arcgis-counter"
317
+ */
318
+ tagName: string;
319
+ /**
320
+ * Tag name converted to PascalCase.
321
+ * The interfaces for the custom element are based on this name.
322
+ *
323
+ * > Not present in vanilla custom-elements-manifest.
324
+ *
325
+ * @deprecated
326
+ * Use `import { kebabToPascal } from "@arcgis/toolkit/string";`
327
+ * utility to convert tag name to pascal case.
328
+ * @example "ArcgisCounter" (even if class name is `Counter`)
329
+ */
330
+ pascalCaseName: string;
331
+ members: ApiCustomElementMember[];
332
+ /**
333
+ * The attributes that this element is known to understand.
334
+ *
335
+ * For most use cases, the "members" array includes properties will all the
336
+ * information included in the "attributes" array. Thus directly accessing
337
+ * "attributes" is not necessary.
338
+ */
339
+ attributes?: ApiAttribute[];
340
+ /** The shadow dom content slots that this element accepts. */
341
+ slots?: ApiSlot[];
342
+ cssParts?: ApiCssPart[];
343
+ cssProperties?: ApiCssCustomProperty[];
344
+ cssStates?: ApiCssCustomState[];
345
+ demos?: ApiDemo[];
346
+ /** Distinguishes a regular JavaScript class from a custom element class */
347
+ customElement: true;
348
+ /**
349
+ * > Not present in vanilla custom-elements-manifest.
350
+ *
351
+ * @default "shadow"
352
+ */
353
+ encapsulation?: "none" | "shadow";
354
+ /**
355
+ * The path from which the component can be imported.
356
+ *
357
+ * > Not present in vanilla custom-elements-manifest.
358
+ *
359
+ * @deprecated Use ApiModule.path instead.
360
+ * @example "components/arcgis-area-measurement-2d"
361
+ */
362
+ importPath: string;
363
+ }
364
+
365
+ export interface ApiWithPrivacy {
366
+ /**
367
+ * If this field is absent, default value is assumed.
368
+ * All private fields are excluded from the api.json.
369
+ * So in practice, this value will be either "protected" or undefined.
370
+ *
371
+ * \@arcgis/api-extractor may only ever set this field on class members, even
372
+ * though the original spec also allows it on classes and events.
373
+ *
374
+ * @default "public"
375
+ */
376
+ privacy?: "private" | "protected" | "public";
377
+ }
378
+
347
379
  /**
348
- * For most use cases, the "members" array includes properties will all the
380
+ * For most use cases, the "members" array includes properties with all the
349
381
  * information included in the "attributes" array. Thus directly accessing
350
382
  * "attributes" is not necessary.
351
383
  */
352
- export type ApiAttribute = {
353
- /**
354
- * @example "initial-count"
355
- */
356
- name: string;
357
- /**
358
- * A markdown summary suitable for display in a listing.
359
- *
360
- * @remarks
361
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
362
- * with custom-elements-manifest.
363
- */
364
- summary?: string;
365
- /**
366
- * A markdown description.
367
- */
368
- description?: string;
369
- inheritedFrom?: ApiReference;
370
- /**
371
- * The type that the attribute will be serialized/deserialized as.
372
- */
373
- type: ApiType;
374
- /**
375
- * The default value of the attribute, if any.
376
- *
377
- * As attributes are always strings, this is the actual value, not a human
378
- * readable description.
379
- *
380
- * @example "10"
381
- */
382
- default?: string;
383
- /**
384
- * The name of the field this attribute is associated with.
385
- *
386
- * @example "initialCount"
387
- */
388
- fieldName?: string;
389
- /**
390
- * Whether the attribute is deprecated.
391
- * If the value is a string, it's the reason for the deprecation.
392
- *
393
- * @default false
394
- */
395
- deprecated?: boolean | string;
396
- };
397
- export type ApiEvent = {
398
- /**
399
- * @example "arcgisClick"
400
- */
401
- name: string;
402
- /**
403
- * A markdown summary suitable for display in a listing.
404
- *
405
- * @remarks
406
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
407
- * with custom-elements-manifest.
408
- */
409
- summary?: string;
410
- /**
411
- * A markdown description.
412
- */
413
- description?: string;
414
- /**
415
- * The type of the event object that's fired.
416
- */
417
- type: ApiType;
418
- inheritedFrom?: ApiReference;
419
- /**
420
- * Whether the event is deprecated.
421
- * If the value is a string, it's the reason for the deprecation.
422
- *
423
- * @default false
424
- */
425
- deprecated?: boolean | string;
426
- /**
427
- * @remarks
428
- * Not present in vanilla custom-elements-manifest.
429
- */
430
- docsTags?: ApiDocsTag[];
431
- /**
432
- * @default true
433
- *
434
- * @remarks
435
- * Not present in vanilla custom-elements-manifest.
436
- */
437
- bubbles?: boolean;
438
- /**
439
- * @default true
440
- *
441
- * @remarks
442
- * Not present in vanilla custom-elements-manifest.
443
- */
444
- cancelable?: boolean;
445
- /**
446
- * @default true
447
- *
448
- * @remarks
449
- * Not present in vanilla custom-elements-manifest.
450
- */
451
- composed?: boolean;
452
- /**
453
- * @default "public"
454
- *
455
- * @remarks
456
- * Not used by `@arcgis/api-extractor`. Present for completeness.
457
- */
458
- privacy?: ApiPrivacy;
459
- };
460
- /**
461
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot
462
- */
463
- export type ApiSlot = {
464
- /**
465
- * The slot name, or the empty string for an unnamed slot.
466
- *
467
- * @example "header"
468
- */
469
- name: string;
470
- /**
471
- * A markdown summary suitable for display in a listing.
472
- *
473
- * @remarks
474
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
475
- * with custom-elements-manifest.
476
- */
477
- summary?: string;
478
- /**
479
- * A markdown description.
480
- */
481
- description?: string;
482
- /**
483
- * Whether the slot 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
- };
384
+ export interface ApiAttribute extends ApiWithDeprecated, ApiWithDescription, ApiWithInheritance, ApiWithUnusedSummary {
385
+ /** @example "initial-count" */
386
+ name: string;
387
+ /** The type that the attribute will be serialized/deserialized as. */
388
+ type: ApiType;
389
+ /**
390
+ * The default value of the attribute, if any.
391
+ *
392
+ * As attributes are always strings, this is the actual value, not a human
393
+ * readable description.
394
+ *
395
+ * @example "10"
396
+ */
397
+ default?: string;
398
+ /**
399
+ * The name of the field this attribute is associated with.
400
+ *
401
+ * @example "initialCount"
402
+ */
403
+ fieldName?: string;
404
+ }
405
+
406
+ export interface ApiEvent extends ApiWithDescription, ApiWithDocsTags, ApiWithDeprecated, ApiWithInheritance, ApiWithPrivacy, ApiWithUnusedSummary {
407
+ /** @example "arcgisClick" */
408
+ name: string;
409
+ /** The type of the event object that's fired. */
410
+ type: ApiType;
411
+ /**
412
+ * > Not present in vanilla custom-elements-manifest.
413
+ *
414
+ * @default true
415
+ */
416
+ bubbles?: false;
417
+ /**
418
+ * > Not present in vanilla custom-elements-manifest.
419
+ *
420
+ * @default true
421
+ */
422
+ cancelable?: false;
423
+ /**
424
+ * > Not present in vanilla custom-elements-manifest.
425
+ *
426
+ * @default true
427
+ */
428
+ composed?: false;
429
+ }
430
+
431
+ export interface ApiWithInheritance {
432
+ /**
433
+ * To keep api.json size in check, `inheritedFrom` object does not include
434
+ * `viewUrl`.
435
+ */
436
+ inheritedFrom?: ApiReference;
437
+ }
438
+
439
+ /** @see [MDN Slot](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) */
440
+ export interface ApiSlot extends ApiWithDescription, ApiWithUnusedSummary {
441
+ /**
442
+ * The slot name, or the empty string for an unnamed slot.
443
+ *
444
+ * @example "header"
445
+ */
446
+ name: string;
447
+ /**
448
+ * Whether the slot is deprecated.
449
+ * If the value is a string, it's the reason for the deprecation.
450
+ *
451
+ * @deprecated
452
+ * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility
453
+ * with custom-elements-manifest.
454
+ * @default false
455
+ */
456
+ deprecated?: string | true;
457
+ }
458
+
494
459
  /**
495
460
  * The description of exposed CSS Parts
496
461
  *
497
462
  * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_shadow_parts
498
463
  */
499
- export type ApiCssPart = {
500
- /**
501
- * @example "tab"
502
- */
503
- name: string;
504
- /**
505
- * A markdown summary suitable for display in a listing.
506
- *
507
- * @remarks
508
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
509
- * with custom-elements-manifest.
510
- */
511
- summary?: string;
512
- /**
513
- * A markdown description.
514
- */
515
- description?: string;
516
- /**
517
- * Whether the CSS shadow part is deprecated.
518
- * If the value is a string, it's the reason for the deprecation.
519
- *
520
- * @default false
521
- *
522
- * @remarks
523
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
524
- * with custom-elements-manifest.
525
- */
526
- deprecated?: boolean | string;
527
- };
464
+ export interface ApiCssPart extends ApiWithDescription, ApiWithUnusedSummary {
465
+ /** @example "tab" */
466
+ name: string;
467
+ /**
468
+ * Whether the CSS shadow part is deprecated.
469
+ * If the value is a string, it's the reason for the deprecation.
470
+ *
471
+ * @deprecated
472
+ * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility
473
+ * with custom-elements-manifest.
474
+ * @default false
475
+ */
476
+ deprecated?: string | true;
477
+ }
478
+
528
479
  /**
529
480
  * The description of a CSS Custom State.
530
481
  *
531
482
  * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet
532
483
  */
533
- export type ApiCssCustomState = {
534
- /**
535
- * The name of the state. Note: Unlike CSS custom properties, custom states
536
- * do not have a leading `--`.
537
- *
538
- * @example "active"
539
- */
540
- name: string;
541
- /**
542
- * A markdown summary suitable for display in a listing.
543
- *
544
- * @remarks
545
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
546
- * with custom-elements-manifest.
547
- */
548
- summary?: string;
549
- /**
550
- * A markdown description.
551
- */
552
- description?: string;
553
- /**
554
- * Whether the CSS custom state is deprecated.
555
- * If the value is a string, it's the reason for the deprecation.
556
- *
557
- * @default false
558
- *
559
- * @remarks
560
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
561
- * with custom-elements-manifest.
562
- */
563
- deprecated?: boolean | string;
564
- };
565
- export type ApiCssCustomProperty = {
566
- /**
567
- * The name of the property, including leading `--`.
568
- *
569
- * @example "--calcite-text-color"
570
- */
571
- name: string;
572
- /**
573
- * The expected syntax of the defined property. Defaults to "*".
574
- *
575
- * The syntax must be a valid CSS
576
- * [syntax string](https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax)
577
- * as defined in the CSS Properties and Values API.
578
- *
579
- * Examples:
580
- *
581
- * "<color>": accepts a color
582
- * "<length> | <percentage>": accepts lengths or percentages but not calc expressions with a combination of the two
583
- * "small | medium | large": accepts one of these values set as custom indents.
584
- * "*": any valid token
585
- */
586
- syntax?: string;
587
- default?: string;
588
- /**
589
- * A markdown summary suitable for display in a listing.
590
- *
591
- * @remarks
592
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
593
- * with custom-elements-manifest.
594
- */
595
- summary?: string;
596
- /**
597
- * A markdown description.
598
- */
599
- description?: string;
600
- /**
601
- * Whether the CSS custom property is deprecated.
602
- * If the value is a string, it's the reason for the deprecation.
603
- *
604
- * @default false
605
- *
606
- * @remarks
607
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
608
- * with custom-elements-manifest.
609
- */
610
- deprecated?: boolean | string;
611
- };
612
- export type ApiType = {
613
- /**
614
- * The full string representation of the type, in whatever type syntax is
615
- * used, such as JSDoc, Closure, or TypeScript.
616
- *
617
- * This represents a 'resolved' type, where e.g. imported types have been
618
- * resolved and inlined.
619
- *
620
- * @example Array<"active" | "inactive">
621
- */
622
- text: string;
623
- /**
624
- * An array of references to the types in the type string.
625
- *
626
- * These references have optional indices into the type string so that tools
627
- * can understand the references in the type string independently of the type
628
- * system and syntax. For example, a documentation viewer could display the
629
- * type `Array<FooElement | BarElement>` with cross-references to `FooElement`
630
- * and `BarElement` without understanding arrays, generics, or union types.
631
- */
632
- references?: ApiTypeReference[];
633
- /**
634
- * @remarks
635
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
636
- * with custom-elements-manifest.
637
- */
638
- source?: ApiSourceReference;
639
- /**
640
- * An enum of possible values for this type.
641
- *
642
- * @remarks
643
- * Not present in vanilla custom-elements-manifest.
644
- */
645
- values?: ApiValue[];
646
- };
647
- export type ApiValue = {
648
- /**
649
- * @example "string"
650
- */
651
- type: string;
652
- /**
653
- * @example "active"
654
- */
655
- value?: string;
656
- };
484
+ export interface ApiCssCustomState extends ApiWithDescription, ApiWithUnusedSummary {
485
+ /**
486
+ * The name of the state. Note: Unlike CSS custom properties, custom states
487
+ * do not have a leading `--`.
488
+ *
489
+ * @example "active"
490
+ */
491
+ name: string;
492
+ /**
493
+ * Whether the CSS custom state is deprecated.
494
+ * If the value is a string, it's the reason for the deprecation.
495
+ *
496
+ * @deprecated
497
+ * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility
498
+ * with custom-elements-manifest.
499
+ * @default false
500
+ */
501
+ deprecated?: string | true;
502
+ }
503
+
504
+ export interface ApiCssCustomProperty extends ApiWithDescription, ApiWithUnusedSummary {
505
+ /**
506
+ * The name of the property, including leading `--`.
507
+ *
508
+ * @example "--calcite-text-color"
509
+ */
510
+ name: string;
511
+ /**
512
+ * The expected syntax of the defined property. Defaults to "*".
513
+ *
514
+ * The syntax must be a valid CSS
515
+ * [syntax string](https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax)
516
+ * as defined in the CSS Properties and Values API.
517
+ *
518
+ * Examples:
519
+ *
520
+ * "<color>": accepts a color
521
+ * "<length> | <percentage>": accepts lengths or percentages but not calc expressions with a combination of the two
522
+ * "small | medium | large": accepts one of these values set as custom indents.
523
+ * "*": any valid token
524
+ *
525
+ * @deprecated
526
+ * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility
527
+ * with custom-elements-manifest.
528
+ */
529
+ syntax?: string;
530
+ default?: string;
531
+ /**
532
+ * Whether the CSS custom property is deprecated.
533
+ * If the value is a string, it's the reason for the deprecation.
534
+ *
535
+ * @deprecated
536
+ * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility
537
+ * with custom-elements-manifest.
538
+ * @default false
539
+ */
540
+ deprecated?: string | true;
541
+ }
542
+
543
+ export interface ApiType extends ApiWithUnusedSource {
544
+ /**
545
+ * The full string representation of the type, in whatever type syntax is
546
+ * used, such as JSDoc, Closure, or TypeScript.
547
+ *
548
+ * This represents a 'resolved' type, where e.g. imported types have been
549
+ * resolved and inlined.
550
+ *
551
+ * @example Array<"active" | "inactive">
552
+ */
553
+ text: string;
554
+ /**
555
+ * An array of references to the types in the type string.
556
+ *
557
+ * These references have optional indices into the type string so that tools
558
+ * can understand the references in the type string independently of the type
559
+ * system and syntax. For example, a documentation viewer could display the
560
+ * type `Array<FooElement | BarElement>` with cross-references to `FooElement`
561
+ * and `BarElement` without understanding arrays, generics, or union types.
562
+ */
563
+ references?: ApiTypeReference[];
564
+ /**
565
+ * An enum of possible values for this type.
566
+ *
567
+ * > Not present in vanilla custom-elements-manifest.
568
+ */
569
+ values?: ApiValue[];
570
+ }
571
+
572
+ export interface ApiWithUnusedSource {
573
+ /**
574
+ * A reference to the source of a declaration or member.
575
+ * An absolute URL to the source (ie. a GitHub URL).
576
+ *
577
+ * @deprecated
578
+ * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility
579
+ * with custom-elements-manifest.
580
+ */
581
+ source?: { href: string; };
582
+ }
583
+
584
+ export interface ApiValue {
585
+ /** @example "string" */
586
+ type: string;
587
+ /** @example "active" */
588
+ value?: string;
589
+ }
590
+
657
591
  /**
658
592
  * A reference that is associated with a type string and optionally a range
659
593
  * within the string.
@@ -663,436 +597,274 @@ export type ApiValue = {
663
597
  * type string is the symbol referenced and the name should match the type
664
598
  * string.
665
599
  */
666
- export type ApiTypeReference = ApiReference & {
667
- start?: number;
668
- end?: number;
669
- };
600
+ export interface ApiTypeReference extends ApiReference {
601
+ start?: number;
602
+ end?: number;
603
+ }
604
+
605
+ export interface ApiObjectLikeDeclaration extends ApiWithDescription, ApiWithDocsTags, ApiWithDeprecated, ApiWithUnusedSource, ApiWithUnusedSummary, ApiWithTypeParameters {
606
+ /** @example "ArcgisCounter" */
607
+ name: string;
608
+ members?: ApiClassMember[];
609
+ }
610
+
611
+ export interface ApiWithTypeParameters {
612
+ typeParameters?: ApiTypeParameter[];
613
+ }
614
+
615
+ /** > Not present in vanilla custom-elements-manifest. */
616
+ export interface ApiTypeParameter {
617
+ name: string;
618
+ constraint?: ApiType;
619
+ default?: ApiType;
620
+ /** @default false */
621
+ const?: true;
622
+ /**
623
+ * @default false
624
+ * @see [Type Parameter variance annotations](https://www.typescriptlang.org/docs/handbook/2/generics.html#variance-annotations)
625
+ */
626
+ in?: true;
627
+ /** @default false */
628
+ out?: true;
629
+ }
630
+
631
+ /** The common interface of classes and mixins. */
632
+ export interface ApiClassDeclaration extends ApiObjectLikeDeclaration, ApiWithEvents {
633
+ kind: "class";
634
+ /**
635
+ * The superclass of this class.
636
+ *
637
+ * If this class is defined with mixin applications, the prototype chain
638
+ * includes the mixin applications and the true superclass is computed
639
+ * from them.
640
+ */
641
+ superclass?: ApiReferenceWithTypeArguments;
642
+ /**
643
+ * Any class mixins applied in the extends clause of this class.
644
+ *
645
+ * If mixins are applied in the class definition, then the true superclass
646
+ * of this class is the result of applying mixins in order to the superclass.
647
+ *
648
+ * Mixins must be listed in order of their application to the superclass or
649
+ * previous mixin application. This means that the innermost mixin is listed
650
+ * first. This may read backwards from the common order in JavaScript, but
651
+ * matches the order of language used to describe mixin application, like
652
+ * "S with A, B".
653
+ *
654
+ * @see https://webgis.esri.com/webgis/core/core/mixins
655
+ */
656
+ mixins?: ApiReferenceWithTypeArguments[];
657
+ }
658
+
659
+ export interface ApiWithEvents {
660
+ /** The events that this object fires. */
661
+ events?: ApiEvent[];
662
+ }
663
+
670
664
  /**
671
- * The common interface of classes and mixins.
665
+ * An interface that describes the properties and methods of an object.
666
+ *
667
+ * > Not yet part of vanilla custom-elements-manifest, but may be added in the
668
+ * > future. See https://github.com/webcomponents/custom-elements-manifest/pull/77
672
669
  */
673
- export type ApiClassDeclaration = {
674
- kind: "class";
675
- /**
676
- * @example "ArcgisCounter"
677
- */
678
- name: string;
679
- /**
680
- * A markdown summary suitable for display in a listing.
681
- *
682
- * @remarks
683
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
684
- * with custom-elements-manifest.
685
- */
686
- summary?: string;
687
- /**
688
- * A markdown description of the class.
689
- */
690
- description?: string;
691
- /**
692
- * The superclass of this class.
693
- *
694
- * If this class is defined with mixin applications, the prototype chain
695
- * includes the mixin applications and the true superclass is computed
696
- * from them.
697
- */
698
- superclass?: ApiReference;
699
- /**
700
- * Any class mixins applied in the extends clause of this class.
701
- *
702
- * If mixins are applied in the class definition, then the true superclass
703
- * of this class is the result of applying mixins in order to the superclass.
704
- *
705
- * Mixins must be listed in order of their application to the superclass or
706
- * previous mixin application. This means that the innermost mixin is listed
707
- * first. This may read backwards from the common order in JavaScript, but
708
- * matches the order of language used to describe mixin application, like
709
- * "S with A, B".
710
- *
711
- * @example
712
- *
713
- * ```javascript
714
- * class T extends B(A(S)) {}
715
- * ```
716
- *
717
- * is described by:
718
- * ```json
719
- * {
720
- * "kind": "class",
721
- * "superclass": {
722
- * "name": "S"
723
- * },
724
- * "mixins": [
725
- * {
726
- * "name": "A"
727
- * },
728
- * {
729
- * "name": "B"
730
- * },
731
- * ]
732
- * }
733
- * ```
734
- *
735
- * @remarks
736
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
737
- * with custom-elements-manifest.
738
- */
739
- mixins?: ApiReference[];
740
- members?: ApiClassMember[];
741
- /**
742
- * The events that this element fires.
743
- */
744
- events?: ApiEvent[];
745
- /**
746
- * @remarks
747
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
748
- * with custom-elements-manifest.
749
- */
750
- source?: ApiSourceReference;
751
- /**
752
- * Whether the class or mixin is deprecated.
753
- * If the value is a string, it's the reason for the deprecation.
754
- *
755
- * @default false
756
- */
757
- deprecated?: boolean | string;
758
- /**
759
- * @default "public"
760
- *
761
- * @remarks
762
- * Not used by `@arcgis/api-extractor`. Present for completeness.
763
- */
764
- privacy?: ApiPrivacy;
765
- };
766
- export type ApiClassMember = ApiClassField | ApiClassMethod;
670
+ export interface ApiInterfaceDeclaration extends ApiObjectLikeDeclaration {
671
+ kind: "interface";
672
+ /** The interfaces that this interface extends. */
673
+ supertypes?: ApiReferenceWithTypeArguments[];
674
+ /**
675
+ * Present in type aliases only. If type alias is an intersection, then type
676
+ * reference members will be represented in the `supertypes` field. If type
677
+ * alias is an object literal, then object members will be represented in
678
+ * the `members` field. Thus, the `type` field will only be used for unions,
679
+ * mapped types, conditional types, and other types that cannot be represented
680
+ * as supertypes/members.
681
+ */
682
+ type?: ApiType;
683
+ }
684
+
685
+ export type ApiClassMember = ApiClassCallSignature | ApiClassConstructor | ApiClassField | ApiClassMethod;
686
+
767
687
  export type ApiCustomElementMember = ApiClassMethod | ApiCustomElementField;
688
+
768
689
  /**
769
690
  * The common interface of variables, class fields, and function
770
691
  * parameters.
771
692
  */
772
- export type ApiPropertyLike = {
773
- /**
774
- * @example "initialCount"
775
- */
776
- name: string;
777
- /**
778
- * A markdown summary suitable for display in a listing.
779
- *
780
- * @remarks
781
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
782
- * with custom-elements-manifest.
783
- */
784
- summary?: string;
785
- /**
786
- * A markdown description of the field.
787
- */
788
- description?: string;
789
- type: ApiType;
790
- /**
791
- * @example 10
792
- */
793
- default?: string;
794
- /**
795
- * Whether the property is deprecated.
796
- * If the value is a string, it's the reason for the deprecation.
797
- *
798
- * @default false
799
- */
800
- deprecated?: boolean | string;
801
- /**
802
- * Whether the property is read-only.
803
- *
804
- * @default false
805
- */
806
- readonly?: boolean;
807
- };
808
- export type ApiClassField = ApiPropertyLike & {
809
- kind: "field";
810
- /**
811
- * @default false
812
- *
813
- * @remarks
814
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
815
- * with custom-elements-manifest.
816
- *
817
- * All static members are excluded from the api.json.
818
- */
819
- static?: boolean;
820
- /**
821
- * @default "public"
822
- *
823
- * @remarks
824
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
825
- * with custom-elements-manifest.
826
- *
827
- * All private and protected fields are excluded from the api.json.
828
- */
829
- privacy?: ApiPrivacy;
830
- inheritedFrom?: ApiReference;
831
- /**
832
- * @remarks
833
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
834
- * with custom-elements-manifest.
835
- */
836
- source?: ApiSourceReference;
837
- };
838
- /**
839
- * Additional metadata for fields on custom elements.
840
- */
841
- export type ApiCustomElementField = ApiClassField & {
842
- /**
843
- * The corresponding attribute name if there is one.
844
- *
845
- * If this property is defined, the attribute must be listed in the classes'
846
- * `attributes` array.
847
- *
848
- * @example "initial-counter"
849
- */
850
- attribute?: string;
851
- /**
852
- * If the property reflects to an attribute.
853
- *
854
- * If this is true, the `attribute` property must be defined.
855
- *
856
- * @default false
857
- */
858
- reflects?: boolean;
859
- /**
860
- * @remarks
861
- * Not present in vanilla custom-elements-manifest.
862
- */
863
- docsTags?: ApiDocsTag[];
864
- /**
865
- * If getter type differs from setter type, this property will
866
- * contain the getter type.
867
- *
868
- * @default undefined
869
- *
870
- * @remarks
871
- * Not present in vanilla custom-elements-manifest.
872
- */
873
- getterType?: Pick<ApiType, "text">;
874
- /**
875
- * For some properties, we show them as read-only in the docs and in the
876
- * typings but don't actually enforce read-only at runtime.
877
- *
878
- * Such properties are represented in the manifest with both `readonly` and
879
- * `docsOnlyReadonly` set to true.
880
- *
881
- * Runtime read-only properties are represented with only `readonly` true.
882
- *
883
- * @default false
884
- *
885
- * @remarks
886
- * Not present in vanilla custom-elements-manifest.
887
- */
888
- docsOnlyReadonly?: boolean;
889
- };
890
- export type ApiClassMethod = ApiFunctionLike & {
891
- kind: "method";
892
- /**
893
- * @default false
894
- *
895
- * @remarks
896
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
897
- * with custom-elements-manifest.
898
- *
899
- * All static members are excluded from the api.json.
900
- */
901
- static?: boolean;
902
- /**
903
- * @default "public"
904
- *
905
- * @remarks
906
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
907
- * with custom-elements-manifest.
908
- *
909
- * All private and protected fields are excluded from the api.json.
910
- */
911
- privacy?: ApiPrivacy;
912
- inheritedFrom?: ApiReference;
913
- /**
914
- * @remarks
915
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
916
- * with custom-elements-manifest.
917
- */
918
- source?: ApiSourceReference;
919
- /**
920
- * @remarks
921
- * Not present in vanilla custom-elements-manifest.
922
- */
923
- docsTags?: ApiDocsTag[];
924
- /**
925
- * @remarks
926
- * Not present in vanilla custom-elements-manifest.
927
- */
928
- signature: string;
929
- /**
930
- * @default false
931
- *
932
- * @remarks
933
- * Not present in vanilla custom-elements-manifest.
934
- */
935
- async?: boolean;
936
- };
693
+ export interface ApiPropertyLike extends ApiWithDescription, ApiWithDocsTags, ApiWithDeprecated, ApiWithUnusedSummary {
694
+ /**
695
+ * @example "initialCount"
696
+ * @example // Special names appear unquoted and unescaped: "@eventTypes"
697
+ * @example // Computed Symbol properties appear as "[Symbol.iterator]"
698
+ */
699
+ name: string;
700
+ type: ApiType;
701
+ /** @example 10 */
702
+ default?: string;
703
+ }
704
+
705
+ export interface ApiClassField extends ApiPropertyLike, ApiWithInheritance, ApiWithStatic, ApiWithPrivacy, ApiWithUnusedSource {
706
+ kind: "field";
707
+ /**
708
+ * Whether the property is read-only.
709
+ *
710
+ * @default false
711
+ */
712
+ readonly?: true;
713
+ /**
714
+ * Getter type if any.
715
+ *
716
+ * This property will only be set if it differs from `type` property in order
717
+ * to keep documentation UI cleaner, and api.json smaller.
718
+ *
719
+ * If the property is read-only, only the `type` property will be set.
720
+ *
721
+ * > Not present in vanilla custom-elements-manifest.
722
+ *
723
+ * @default undefined
724
+ */
725
+ getterType?: ApiType;
726
+ }
727
+
728
+ export interface ApiWithStatic {
729
+ /** @default false */
730
+ static?: true;
731
+ }
732
+
733
+ /** Additional metadata for fields on custom elements. */
734
+ export interface ApiCustomElementField extends ApiClassField {
735
+ /**
736
+ * The corresponding attribute name if there is one.
737
+ *
738
+ * If this property is defined, the attribute must be listed in the classes'
739
+ * `attributes` array.
740
+ *
741
+ * @example "initial-counter"
742
+ */
743
+ attribute?: string;
744
+ /**
745
+ * If the property reflects to an attribute.
746
+ *
747
+ * If this is true, the `attribute` property must be defined.
748
+ *
749
+ * @default false
750
+ */
751
+ reflects?: true;
752
+ /**
753
+ * For some properties, we show them as read-only in the docs and in the
754
+ * types but don't actually enforce read-only at runtime.
755
+ *
756
+ * Such properties are represented in the manifest with both `readonly` and
757
+ * `docsOnlyReadonly` set to true.
758
+ *
759
+ * Runtime read-only properties are represented with only `readonly` true.
760
+ *
761
+ * > Not present in vanilla custom-elements-manifest.
762
+ *
763
+ * @deprecated fuse regular .readonly field instead
764
+ * @default false
765
+ */
766
+ docsOnlyReadonly?: true;
767
+ }
768
+
769
+ export interface ApiClassMethod extends ApiFunctionLike, ApiWithInheritance, ApiWithStatic, ApiWithPrivacy, ApiWithUnusedSource {
770
+ kind: "method";
771
+ /** @default false */
772
+ static?: true;
773
+ /**
774
+ * > Not present in vanilla custom-elements-manifest.
775
+ *
776
+ * @deprecated
777
+ * If documentation UI shows a table with parameters and the return type, then
778
+ * displaying the signature is redundant.
779
+ * Still, if needed, you can use printSignature() util from
780
+ * `@arcgis/api-extractor`.
781
+ * @example "(options?: __esri.PopupViewOpenPopupOptions): Promise<void>"
782
+ */
783
+ signature: string;
784
+ }
785
+
786
+ /** > Not present in vanilla custom-elements-manifest. */
787
+ export interface ApiClassConstructor extends Omit<ApiFunctionLike, "name" | "return">, ApiWithInheritance, ApiWithPrivacy {
788
+ kind: "constructor";
789
+ }
790
+
791
+ /** > Not present in vanilla custom-elements-manifest. */
792
+ export interface ApiClassCallSignature extends Omit<ApiFunctionLike, "name">, ApiWithInheritance, ApiWithPrivacy {
793
+ kind: "call-signature";
794
+ }
795
+
937
796
  /**
938
797
  * A description of a class mixin.
939
798
  *
940
- * Mixins are functions which generate a new subclass of a given superclass.
941
- * This interfaces describes the class and custom element features that
942
- * are added by the mixin. As such, it extends the CustomElement interface and
943
- * ClassLike interface.
944
- *
945
- * Since mixins are functions, it also extends the FunctionLike interface. This
946
- * means a mixin is callable, and has parameters and a return type.
947
- *
948
- * The return type is often hard or impossible to accurately describe in type
949
- * systems like TypeScript. It requires generics and an `extends` operator
950
- * that TypeScript lacks. Therefore it's recommended that the return type is
951
- * left empty. The most common form of a mixin function takes a single
952
- * argument, so consumers of this interface should assume that the return type
953
- * is the single argument subclassed by this declaration.
954
- *
955
- * A mixin should not have a superclass. If a mixins composes other mixins,
956
- * they should be listed in the `mixins` field.
957
- *
958
- * See more information on the class mixin pattern in JavaScript:
959
- * https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/
960
- *
961
- * @example
962
- *
963
- * This JavaScript mixin declaration:
964
- * ```javascript
965
- * const MyMixin = (base) => class extends base {
966
- * foo() { ... }
967
- * }
968
- * ```
969
- *
970
- * Is described by this JSON:
971
- * ```json
972
- * {
973
- * "kind": "mixin",
974
- * "name": "MyMixin",
975
- * "parameters": [
976
- * {
977
- * "name": "base",
978
- * }
979
- * ],
980
- * "members": [
981
- * {
982
- * "kind": "method",
983
- * "name": "foo",
984
- * }
985
- * ]
986
- * }
987
- * ```
988
- *
989
- * @remarks
990
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
991
- * with custom-elements-manifest.
799
+ * @see [WebGIS - Mixins](https://webgis.esri.com/webgis/core/core/mixins)
992
800
  */
993
- export type ApiMixinDeclaration = ApiClassDeclaration & ApiFunctionLike & {
994
- kind: "mixin";
995
- };
801
+ export interface ApiMixinDeclaration extends Omit<ApiFunctionLike, "return">, ApiObjectLikeDeclaration, ApiWithEvents {
802
+ kind: "mixin";
803
+ /** The mixins that this mixin uses, if any. */
804
+ mixins?: ApiReferenceWithTypeArguments[];
805
+ /**
806
+ * @deprecated
807
+ * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility
808
+ * with custom-elements-manifest.
809
+ */
810
+ return?: ApiFunctionLikeReturn;
811
+ }
812
+
996
813
  /**
997
814
  * A class mixin that also adds custom element related properties.
998
815
  *
999
- * @remarks
1000
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
1001
- * with custom-elements-manifest.
1002
- */
1003
- export type ApiCustomElementMixinDeclaration = ApiCustomElementDeclaration & ApiMixinDeclaration;
1004
- /**
1005
- * @remarks
1006
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
1007
- * with custom-elements-manifest.
1008
- */
1009
- export type ApiVariableDeclaration = ApiPropertyLike & {
1010
- kind: "variable";
1011
- source?: ApiSourceReference;
1012
- };
1013
- /**
1014
- * @remarks
1015
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
1016
- * with custom-elements-manifest.
1017
- */
1018
- export type ApiFunctionDeclaration = ApiFunctionLike & {
1019
- kind: "function";
1020
- source?: ApiSourceReference;
1021
- };
1022
- export type ApiParameter = ApiPropertyLike & {
1023
- /**
1024
- * Whether the parameter is optional.
1025
- *
1026
- * @default false
1027
- */
1028
- optional?: boolean;
1029
- /**
1030
- * @default false
1031
- *
1032
- * Whether the parameter is a rest parameter. Only the last parameter may be a rest parameter.
1033
- * Undefined implies single parameter.
1034
- */
1035
- rest?: boolean;
1036
- };
1037
- export type ApiFunctionLike = {
1038
- /**
1039
- * @example "increment"
1040
- */
1041
- name: string;
1042
- /**
1043
- * A markdown summary suitable for display in a listing.
1044
- *
1045
- * @remarks
1046
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
1047
- * with custom-elements-manifest.
1048
- */
1049
- summary?: string;
1050
- /**
1051
- * A markdown description.
1052
- */
1053
- description?: string;
1054
- /**
1055
- * Whether the function is deprecated.
1056
- * If the value is a string, it's the reason for the deprecation.
1057
- *
1058
- * @default false
1059
- */
1060
- deprecated?: boolean | string;
1061
- /**
1062
- * @default []
1063
- */
1064
- parameters?: ApiParameter[];
1065
- return?: {
1066
- type?: ApiType;
1067
- /**
1068
- * A markdown summary suitable for display in a listing.
1069
- *
1070
- * @remarks
1071
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
1072
- * with custom-elements-manifest.
1073
- */
1074
- summary?: string;
1075
- /**
1076
- * A markdown description.
1077
- */
1078
- description?: string;
1079
- };
1080
- };
1081
- /**
1082
- * @remarks
1083
- * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
816
+ * @deprecated
817
+ * Not used by `@arcgis/api-extractor`. Preserved in types for compatibility
1084
818
  * with custom-elements-manifest.
1085
819
  */
1086
- export type ApiPrivacy = "private" | "protected" | "public";
1087
- export type ApiDemo = {
1088
- /**
1089
- * A markdown description of the demo.
1090
- */
1091
- description: string;
1092
- /**
1093
- * Relative URL of the demo if it's published with the package. Absolute URL
1094
- * if it's hosted.
1095
- */
1096
- url: string;
1097
- source?: ApiSourceReference;
1098
- };
820
+ export interface ApiCustomElementMixinDeclaration extends Omit<ApiCustomElementDeclaration, "kind">, Omit<ApiMixinDeclaration, "members"> {}
821
+
822
+ export interface ApiVariableDeclaration extends ApiPropertyLike, ApiWithUnusedSource {
823
+ kind: "variable";
824
+ }
825
+
826
+ export interface ApiFunctionDeclaration extends ApiFunctionLike, ApiWithUnusedSource {
827
+ kind: "function";
828
+ }
829
+
830
+ export interface ApiParameter extends ApiPropertyLike {
831
+ /**
832
+ * Whether the parameter had `?`. If there is a default value, that takes
833
+ * precedence over `optional` flag.
834
+ *
835
+ * @default false
836
+ */
837
+ optional?: true;
838
+ /**
839
+ * Whether the parameter is a rest parameter. Only the last parameter may be a rest parameter.
840
+ * Undefined implies single parameter.
841
+ *
842
+ * @default false
843
+ */
844
+ rest?: true;
845
+ }
846
+
847
+ export interface ApiFunctionLike extends ApiWithDescription, ApiWithDocsTags, ApiWithDeprecated, ApiWithUnusedSummary, ApiWithTypeParameters {
848
+ /**
849
+ * @example "increment"
850
+ * @example // Special names appear unquoted and unescaped: "@eventTypes"
851
+ * @example // Computed Symbol properties appear as "[Symbol.iterator]"
852
+ */
853
+ name: string;
854
+ /** @default [] */
855
+ parameters?: ApiParameter[];
856
+ return: ApiFunctionLikeReturn;
857
+ }
858
+
859
+ export interface ApiFunctionLikeReturn extends ApiWithDescription, ApiWithUnusedSummary {
860
+ type: ApiType;
861
+ }
862
+
863
+ export interface ApiDemo extends ApiWithUnusedSource {
864
+ /**
865
+ * Relative URL of the demo if it's published with the package. Absolute URL
866
+ * if it's hosted.
867
+ */
868
+ url: string;
869
+ description: NonNullable<ApiWithDescription["description"]>;
870
+ }