@arcgis/api-extractor 4.32.0-next.100

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 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,1051 @@
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
+ * A URL to see user-friendly documentation for the type.
211
+ *
212
+ * @example "https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html"
213
+ */
214
+ viewUrl?: string;
215
+ };
216
+ /**
217
+ * A reference to the source of a declaration or member.
218
+ *
219
+ * @remarks
220
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
221
+ * with custom-elements-manifest.
222
+ */
223
+ export type ApiSourceReference = {
224
+ /**
225
+ * An absolute URL to the source (ie. a GitHub URL).
226
+ */
227
+ href: string;
228
+ };
229
+ /**
230
+ * A description of a custom element class.
231
+ *
232
+ * Custom elements are JavaScript classes, so this extends from
233
+ * `ClassDeclaration` and adds custom-element-specific features like attributes,
234
+ * events, and slots.
235
+ *
236
+ * Note that `tagName` in this interface is optional. Tag names are not
237
+ * necessarily part of a custom element class, but belong to the definition
238
+ * (often called the "registration") or the `customElements.define()` call.
239
+ *
240
+ * Because classes and tag names can only be registered once, there's a
241
+ * one-to-one relationship between classes and tag names. For ease of use, we
242
+ * allow the tag name here.
243
+ *
244
+ * Some packages define and register custom elements in separate modules. In
245
+ * these cases one `Module` should contain the `CustomElement` without a
246
+ * tagName, and another `Module` should contain the `CustomElementExport`.
247
+ */
248
+ export type ApiCustomElementDeclaration = ApiClassDeclaration & {
249
+ /**
250
+ * An optional tag name that should be specified if this is a
251
+ * self-registering element.
252
+ *
253
+ * Self-registering elements must also include a CustomElementExport in the
254
+ * module's exports.
255
+ *
256
+ * @example "arcgis-counter"
257
+ */
258
+ tagName: string;
259
+ /**
260
+ * Tag name converted to PascalCase.
261
+ * The interfaces for the custom element are based on this name.
262
+ *
263
+ * @example "ArcgisCounter" (even if class name is `Counter`)
264
+ *
265
+ * @remarks
266
+ * Not present in vanilla custom-elements-manifest.
267
+ */
268
+ pascalCaseName: string;
269
+ members: ApiCustomElementMember[];
270
+ superclass: ApiReference;
271
+ /**
272
+ * The attributes that this element is known to understand.
273
+ *
274
+ * For most use cases, the "members" array includes properties will all the
275
+ * information included in the "attributes" array. Thus directly accessing
276
+ * "attributes" is not necessary.
277
+ */
278
+ attributes?: ApiAttribute[];
279
+ /**
280
+ * The events that this element fires.
281
+ */
282
+ events?: ApiEvent[];
283
+ /**
284
+ * The shadow dom content slots that this element accepts.
285
+ */
286
+ slots?: ApiSlot[];
287
+ cssParts?: ApiCssPart[];
288
+ cssProperties?: ApiCssCustomProperty[];
289
+ cssStates?: ApiCssCustomState[];
290
+ demos?: ApiDemo[];
291
+ /**
292
+ * Distinguishes a regular JavaScript class from a custom element class
293
+ */
294
+ customElement: true;
295
+ /**
296
+ * @remarks
297
+ * Not present in vanilla custom-elements-manifest.
298
+ */
299
+ docsTags?: ApiDocsTag[];
300
+ /**
301
+ * The path from which the component can be imported.
302
+ *
303
+ * @example "components/arcgis-area-measurement-2d"
304
+ *
305
+ * @remarks
306
+ * Not present in vanilla custom-elements-manifest.
307
+ */
308
+ importPath: string;
309
+ /**
310
+ * @default "shadow"
311
+ *
312
+ * @remarks
313
+ * Not present in vanilla custom-elements-manifest.
314
+ */
315
+ encapsulation?: "none" | "shadow";
316
+ };
317
+ /**
318
+ * A descriptor for a single JSDoc tag found in a block comment.
319
+ *
320
+ * @remarks
321
+ * Some tags have dedicated fields. Those will be excluded from array of
322
+ * "docsTags".
323
+ */
324
+ export type ApiDocsTag = {
325
+ /**
326
+ * The tag name (immediately following the '@').
327
+ *
328
+ * @example "since"
329
+ */
330
+ name: string;
331
+ /**
332
+ * The description that immediately follows the tag name.
333
+ *
334
+ * @example "4.31"
335
+ */
336
+ text?: string;
337
+ };
338
+ /**
339
+ * For most use cases, the "members" array includes properties will all the
340
+ * information included in the "attributes" array. Thus directly accessing
341
+ * "attributes" is not necessary.
342
+ */
343
+ export type ApiAttribute = {
344
+ /**
345
+ * @example "initial-count"
346
+ */
347
+ name: string;
348
+ /**
349
+ * A markdown summary suitable for display in a listing.
350
+ */
351
+ summary?: string;
352
+ /**
353
+ * A markdown description.
354
+ */
355
+ description?: string;
356
+ inheritedFrom?: ApiReference;
357
+ /**
358
+ * The type that the attribute will be serialized/deserialized as.
359
+ */
360
+ type: ApiType;
361
+ /**
362
+ * The default value of the attribute, if any.
363
+ *
364
+ * As attributes are always strings, this is the actual value, not a human
365
+ * readable description.
366
+ *
367
+ * @example "10"
368
+ */
369
+ default?: string;
370
+ /**
371
+ * The name of the field this attribute is associated with.
372
+ *
373
+ * @example "initialCount"
374
+ */
375
+ fieldName?: string;
376
+ /**
377
+ * Whether the attribute is deprecated.
378
+ * If the value is a string, it's the reason for the deprecation.
379
+ *
380
+ * @default false
381
+ */
382
+ deprecated?: boolean | string;
383
+ };
384
+ export type ApiEvent = {
385
+ /**
386
+ * @example "arcgisClick"
387
+ */
388
+ name: string;
389
+ /**
390
+ * A markdown summary suitable for display in a listing.
391
+ */
392
+ summary?: string;
393
+ /**
394
+ * A markdown description.
395
+ */
396
+ description?: string;
397
+ /**
398
+ * The type of the event object that's fired.
399
+ */
400
+ type: ApiType;
401
+ inheritedFrom?: ApiReference;
402
+ /**
403
+ * Whether the event is deprecated.
404
+ * If the value is a string, it's the reason for the deprecation.
405
+ *
406
+ * @default false
407
+ */
408
+ deprecated?: boolean | string;
409
+ /**
410
+ * @remarks
411
+ * Not present in vanilla custom-elements-manifest.
412
+ */
413
+ docsTags?: ApiDocsTag[];
414
+ /**
415
+ * @default true
416
+ *
417
+ * @remarks
418
+ * Not present in vanilla custom-elements-manifest.
419
+ */
420
+ bubbles?: boolean;
421
+ /**
422
+ * @default true
423
+ *
424
+ * @remarks
425
+ * Not present in vanilla custom-elements-manifest.
426
+ */
427
+ cancelable?: boolean;
428
+ /**
429
+ * @default true
430
+ *
431
+ * @remarks
432
+ * Not present in vanilla custom-elements-manifest.
433
+ */
434
+ composed?: boolean;
435
+ /**
436
+ * @default "public"
437
+ *
438
+ * @remarks
439
+ * Not used by `@arcgis/api-extractor`. Present for completeness.
440
+ */
441
+ privacy?: ApiPrivacy;
442
+ };
443
+ /**
444
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot
445
+ */
446
+ export type ApiSlot = {
447
+ /**
448
+ * The slot name, or the empty string for an unnamed slot.
449
+ *
450
+ * @example "header"
451
+ */
452
+ name: string;
453
+ /**
454
+ * A markdown summary suitable for display in a listing.
455
+ */
456
+ summary?: string;
457
+ /**
458
+ * A markdown description.
459
+ */
460
+ description?: string;
461
+ /**
462
+ * Whether the slot is deprecated.
463
+ * If the value is a string, it's the reason for the deprecation.
464
+ *
465
+ * @default false
466
+ *
467
+ * @remarks
468
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
469
+ * with custom-elements-manifest.
470
+ */
471
+ deprecated?: boolean | string;
472
+ };
473
+ /**
474
+ * The description of exposed CSS Parts
475
+ *
476
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_shadow_parts
477
+ */
478
+ export type ApiCssPart = {
479
+ /**
480
+ * @example "tab"
481
+ */
482
+ name: string;
483
+ /**
484
+ * A markdown summary suitable for display in a listing.
485
+ */
486
+ summary?: string;
487
+ /**
488
+ * A markdown description.
489
+ */
490
+ description?: string;
491
+ /**
492
+ * Whether the CSS shadow part is deprecated.
493
+ * If the value is a string, it's the reason for the deprecation.
494
+ *
495
+ * @default false
496
+ *
497
+ * @remarks
498
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
499
+ * with custom-elements-manifest.
500
+ */
501
+ deprecated?: boolean | string;
502
+ };
503
+ /**
504
+ * The description of a CSS Custom State.
505
+ *
506
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet
507
+ */
508
+ export type ApiCssCustomState = {
509
+ /**
510
+ * The name of the state. Note: Unlike CSS custom properties, custom states
511
+ * do not have a leading `--`.
512
+ *
513
+ * @example "active"
514
+ */
515
+ name: string;
516
+ /**
517
+ * A markdown summary suitable for display in a listing.
518
+ */
519
+ summary?: string;
520
+ /**
521
+ * A markdown description.
522
+ */
523
+ description?: string;
524
+ /**
525
+ * Whether the CSS custom state is deprecated.
526
+ * If the value is a string, it's the reason for the deprecation.
527
+ *
528
+ * @default false
529
+ *
530
+ * @remarks
531
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
532
+ * with custom-elements-manifest.
533
+ */
534
+ deprecated?: boolean | string;
535
+ };
536
+ export type ApiCssCustomProperty = {
537
+ /**
538
+ * The name of the property, including leading `--`.
539
+ *
540
+ * @example "--calcite-text-color"
541
+ */
542
+ name: string;
543
+ /**
544
+ * The expected syntax of the defined property. Defaults to "*".
545
+ *
546
+ * The syntax must be a valid CSS
547
+ * [syntax string](https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax)
548
+ * as defined in the CSS Properties and Values API.
549
+ *
550
+ * Examples:
551
+ *
552
+ * "<color>": accepts a color
553
+ * "<length> | <percentage>": accepts lengths or percentages but not calc expressions with a combination of the two
554
+ * "small | medium | large": accepts one of these values set as custom indents.
555
+ * "*": any valid token
556
+ */
557
+ syntax?: string;
558
+ default?: string;
559
+ /**
560
+ * A markdown summary suitable for display in a listing.
561
+ */
562
+ summary?: string;
563
+ /**
564
+ * A markdown description.
565
+ */
566
+ description?: string;
567
+ /**
568
+ * Whether the CSS custom property is deprecated.
569
+ * If the value is a string, it's the reason for the deprecation.
570
+ *
571
+ * @default false
572
+ *
573
+ * @remarks
574
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
575
+ * with custom-elements-manifest.
576
+ */
577
+ deprecated?: boolean | string;
578
+ };
579
+ export type ApiType = {
580
+ /**
581
+ * The full string representation of the type, in whatever type syntax is
582
+ * used, such as JSDoc, Closure, or TypeScript.
583
+ *
584
+ * This represents a 'resolved' type, where e.g. imported types have been
585
+ * resolved and inlined.
586
+ *
587
+ * @example Array<"active" | "inactive">
588
+ */
589
+ text: string;
590
+ /**
591
+ * An array of references to the types in the type string.
592
+ *
593
+ * These references have optional indices into the type string so that tools
594
+ * can understand the references in the type string independently of the type
595
+ * system and syntax. For example, a documentation viewer could display the
596
+ * type `Array<FooElement | BarElement>` with cross-references to `FooElement`
597
+ * and `BarElement` without understanding arrays, generics, or union types.
598
+ */
599
+ references?: ApiTypeReference[];
600
+ /**
601
+ * @remarks
602
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
603
+ * with custom-elements-manifest.
604
+ */
605
+ source?: ApiSourceReference;
606
+ /**
607
+ * An enum of possible values for this type.
608
+ *
609
+ * @remarks
610
+ * Not present in vanilla custom-elements-manifest.
611
+ */
612
+ values?: ApiValue[];
613
+ };
614
+ export type ApiValue = {
615
+ /**
616
+ * @example "string"
617
+ */
618
+ type: string;
619
+ /**
620
+ * @example "active"
621
+ */
622
+ value?: string;
623
+ };
624
+ /**
625
+ * A reference that is associated with a type string and optionally a range
626
+ * within the string.
627
+ *
628
+ * Start and end must both be present or not present. If they're present, they
629
+ * are indices into the associated type string. If they are missing, the entire
630
+ * type string is the symbol referenced and the name should match the type
631
+ * string.
632
+ */
633
+ export type ApiTypeReference = ApiReference & {
634
+ start?: number;
635
+ end?: number;
636
+ };
637
+ /**
638
+ * The common interface of classes and mixins.
639
+ */
640
+ export type ApiClassDeclaration = {
641
+ kind: "class";
642
+ /**
643
+ * @example "ArcgisCounter"
644
+ */
645
+ name: string;
646
+ /**
647
+ * A markdown summary suitable for display in a listing.
648
+ */
649
+ summary?: string;
650
+ /**
651
+ * A markdown description of the class.
652
+ */
653
+ description?: string;
654
+ /**
655
+ * The superclass of this class.
656
+ *
657
+ * If this class is defined with mixin applications, the prototype chain
658
+ * includes the mixin applications and the true superclass is computed
659
+ * from them.
660
+ */
661
+ superclass?: ApiReference;
662
+ /**
663
+ * Any class mixins applied in the extends clause of this class.
664
+ *
665
+ * If mixins are applied in the class definition, then the true superclass
666
+ * of this class is the result of applying mixins in order to the superclass.
667
+ *
668
+ * Mixins must be listed in order of their application to the superclass or
669
+ * previous mixin application. This means that the innermost mixin is listed
670
+ * first. This may read backwards from the common order in JavaScript, but
671
+ * matches the order of language used to describe mixin application, like
672
+ * "S with A, B".
673
+ *
674
+ * @example
675
+ *
676
+ * ```javascript
677
+ * class T extends B(A(S)) {}
678
+ * ```
679
+ *
680
+ * is described by:
681
+ * ```json
682
+ * {
683
+ * "kind": "class",
684
+ * "superclass": {
685
+ * "name": "S"
686
+ * },
687
+ * "mixins": [
688
+ * {
689
+ * "name": "A"
690
+ * },
691
+ * {
692
+ * "name": "B"
693
+ * },
694
+ * ]
695
+ * }
696
+ * ```
697
+ *
698
+ * @remarks
699
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
700
+ * with custom-elements-manifest.
701
+ */
702
+ mixins?: ApiReference[];
703
+ members?: ApiClassMember[];
704
+ /**
705
+ * @remarks
706
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
707
+ * with custom-elements-manifest.
708
+ */
709
+ source?: ApiSourceReference;
710
+ /**
711
+ * Whether the class or mixin is deprecated.
712
+ * If the value is a string, it's the reason for the deprecation.
713
+ *
714
+ * @default false
715
+ */
716
+ deprecated?: boolean | string;
717
+ /**
718
+ * @default "public"
719
+ *
720
+ * @remarks
721
+ * Not used by `@arcgis/api-extractor`. Present for completeness.
722
+ */
723
+ privacy?: ApiPrivacy;
724
+ };
725
+ export type ApiClassMember = ApiClassField | ApiClassMethod;
726
+ export type ApiCustomElementMember = ApiClassMethod | ApiCustomElementField;
727
+ /**
728
+ * The common interface of variables, class fields, and function
729
+ * parameters.
730
+ */
731
+ export type ApiPropertyLike = {
732
+ /**
733
+ * @example "initialCount"
734
+ */
735
+ name: string;
736
+ /**
737
+ * A markdown summary suitable for display in a listing.
738
+ */
739
+ summary?: string;
740
+ /**
741
+ * A markdown description of the field.
742
+ */
743
+ description?: string;
744
+ type: ApiType;
745
+ /**
746
+ * @example 10
747
+ */
748
+ default?: string;
749
+ /**
750
+ * Whether the property is deprecated.
751
+ * If the value is a string, it's the reason for the deprecation.
752
+ *
753
+ * @default false
754
+ */
755
+ deprecated?: boolean | string;
756
+ /**
757
+ * Whether the property is read-only.
758
+ *
759
+ * @default false
760
+ */
761
+ readonly?: boolean;
762
+ };
763
+ export type ApiClassField = ApiPropertyLike & {
764
+ kind: "field";
765
+ /**
766
+ * @default false
767
+ *
768
+ * @remarks
769
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
770
+ * with custom-elements-manifest.
771
+ *
772
+ * All static members are excluded from the api.json.
773
+ */
774
+ static?: boolean;
775
+ /**
776
+ * @default "public"
777
+ *
778
+ * @remarks
779
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
780
+ * with custom-elements-manifest.
781
+ *
782
+ * All private and protected fields are excluded from the api.json.
783
+ */
784
+ privacy?: ApiPrivacy;
785
+ inheritedFrom?: ApiReference;
786
+ /**
787
+ * @remarks
788
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
789
+ * with custom-elements-manifest.
790
+ */
791
+ source?: ApiSourceReference;
792
+ };
793
+ /**
794
+ * Additional metadata for fields on custom elements.
795
+ */
796
+ export type ApiCustomElementField = ApiClassField & {
797
+ /**
798
+ * The corresponding attribute name if there is one.
799
+ *
800
+ * If this property is defined, the attribute must be listed in the classes'
801
+ * `attributes` array.
802
+ *
803
+ * @example "initial-counter"
804
+ */
805
+ attribute?: string;
806
+ /**
807
+ * If the property reflects to an attribute.
808
+ *
809
+ * If this is true, the `attribute` property must be defined.
810
+ *
811
+ * @default false
812
+ */
813
+ reflects?: boolean;
814
+ /**
815
+ * @remarks
816
+ * Not present in vanilla custom-elements-manifest.
817
+ */
818
+ docsTags?: ApiDocsTag[];
819
+ /**
820
+ * Whether field has both getter and setter, and their types are different.
821
+ * The actual getter type is not included in the api.json at the moment, but
822
+ * can be added if that information is needed.
823
+ *
824
+ * @default false
825
+ *
826
+ * @remarks
827
+ * Not present in vanilla custom-elements-manifest.
828
+ */
829
+ getterTypeDiffers?: boolean;
830
+ /**
831
+ * For some properties, we show them as read-only in the docs and in the
832
+ * typings but don't actually enforce read-only at runtime.
833
+ *
834
+ * Such properties are represented in the manifest with both `readonly` and
835
+ * `docsOnlyReadonly` set to true.
836
+ *
837
+ * Runtime read-only properties are represented with only `readonly` true.
838
+ *
839
+ * @default false
840
+ *
841
+ * @remarks
842
+ * Not present in vanilla custom-elements-manifest.
843
+ */
844
+ docsOnlyReadonly?: boolean;
845
+ };
846
+ export type ApiClassMethod = ApiFunctionLike & {
847
+ kind: "method";
848
+ /**
849
+ * @default false
850
+ *
851
+ * @remarks
852
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
853
+ * with custom-elements-manifest.
854
+ *
855
+ * All static members are excluded from the api.json.
856
+ */
857
+ static?: boolean;
858
+ /**
859
+ * @default "public"
860
+ *
861
+ * @remarks
862
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
863
+ * with custom-elements-manifest.
864
+ *
865
+ * All private and protected fields are excluded from the api.json.
866
+ */
867
+ privacy?: ApiPrivacy;
868
+ inheritedFrom?: ApiReference;
869
+ /**
870
+ * @remarks
871
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
872
+ * with custom-elements-manifest.
873
+ */
874
+ source?: ApiSourceReference;
875
+ /**
876
+ * @remarks
877
+ * Not present in vanilla custom-elements-manifest.
878
+ */
879
+ docsTags?: ApiDocsTag[];
880
+ /**
881
+ * @remarks
882
+ * Not present in vanilla custom-elements-manifest.
883
+ */
884
+ signature: string;
885
+ /**
886
+ * @default false
887
+ *
888
+ * @remarks
889
+ * Not present in vanilla custom-elements-manifest.
890
+ */
891
+ async?: boolean;
892
+ };
893
+ /**
894
+ * A description of a class mixin.
895
+ *
896
+ * Mixins are functions which generate a new subclass of a given superclass.
897
+ * This interfaces describes the class and custom element features that
898
+ * are added by the mixin. As such, it extends the CustomElement interface and
899
+ * ClassLike interface.
900
+ *
901
+ * Since mixins are functions, it also extends the FunctionLike interface. This
902
+ * means a mixin is callable, and has parameters and a return type.
903
+ *
904
+ * The return type is often hard or impossible to accurately describe in type
905
+ * systems like TypeScript. It requires generics and an `extends` operator
906
+ * that TypeScript lacks. Therefore it's recommended that the return type is
907
+ * left empty. The most common form of a mixin function takes a single
908
+ * argument, so consumers of this interface should assume that the return type
909
+ * is the single argument subclassed by this declaration.
910
+ *
911
+ * A mixin should not have a superclass. If a mixins composes other mixins,
912
+ * they should be listed in the `mixins` field.
913
+ *
914
+ * See more information on the class mixin pattern in JavaScript:
915
+ * https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/
916
+ *
917
+ * @example
918
+ *
919
+ * This JavaScript mixin declaration:
920
+ * ```javascript
921
+ * const MyMixin = (base) => class extends base {
922
+ * foo() { ... }
923
+ * }
924
+ * ```
925
+ *
926
+ * Is described by this JSON:
927
+ * ```json
928
+ * {
929
+ * "kind": "mixin",
930
+ * "name": "MyMixin",
931
+ * "parameters": [
932
+ * {
933
+ * "name": "base",
934
+ * }
935
+ * ],
936
+ * "members": [
937
+ * {
938
+ * "kind": "method",
939
+ * "name": "foo",
940
+ * }
941
+ * ]
942
+ * }
943
+ * ```
944
+ *
945
+ * @remarks
946
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
947
+ * with custom-elements-manifest.
948
+ */
949
+ export type ApiMixinDeclaration = ApiClassDeclaration & ApiFunctionLike & {
950
+ kind: "mixin";
951
+ };
952
+ /**
953
+ * A class mixin that also adds custom element related properties.
954
+ *
955
+ * @remarks
956
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
957
+ * with custom-elements-manifest.
958
+ */
959
+ export type ApiCustomElementMixinDeclaration = ApiCustomElementDeclaration & ApiMixinDeclaration;
960
+ /**
961
+ * @remarks
962
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
963
+ * with custom-elements-manifest.
964
+ */
965
+ export type ApiVariableDeclaration = ApiPropertyLike & {
966
+ kind: "variable";
967
+ source?: ApiSourceReference;
968
+ };
969
+ /**
970
+ * @remarks
971
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
972
+ * with custom-elements-manifest.
973
+ */
974
+ export type ApiFunctionDeclaration = ApiFunctionLike & {
975
+ kind: "function";
976
+ source?: ApiSourceReference;
977
+ };
978
+ export type ApiParameter = ApiPropertyLike & {
979
+ /**
980
+ * Whether the parameter is optional.
981
+ *
982
+ * @default false
983
+ */
984
+ optional?: boolean;
985
+ /**
986
+ * @default false
987
+ *
988
+ * Whether the parameter is a rest parameter. Only the last parameter may be a rest parameter.
989
+ * Undefined implies single parameter.
990
+ */
991
+ rest?: boolean;
992
+ };
993
+ export type ApiFunctionLike = {
994
+ /**
995
+ * @example "increment"
996
+ */
997
+ name: string;
998
+ /**
999
+ * A markdown summary suitable for display in a listing.
1000
+ */
1001
+ summary?: string;
1002
+ /**
1003
+ * A markdown description.
1004
+ */
1005
+ description?: string;
1006
+ /**
1007
+ * Whether the function is deprecated.
1008
+ * If the value is a string, it's the reason for the deprecation.
1009
+ *
1010
+ * @default false
1011
+ */
1012
+ deprecated?: boolean | string;
1013
+ /**
1014
+ * @default []
1015
+ */
1016
+ parameters?: ApiParameter[];
1017
+ return?: {
1018
+ type?: ApiType;
1019
+ /**
1020
+ * A markdown summary suitable for display in a listing.
1021
+ */
1022
+ summary?: string;
1023
+ /**
1024
+ * A markdown description.
1025
+ */
1026
+ description?: string;
1027
+ };
1028
+ };
1029
+ /**
1030
+ * @remarks
1031
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
1032
+ * with custom-elements-manifest.
1033
+ */
1034
+ export type ApiPrivacy = "private" | "protected" | "public";
1035
+ /**
1036
+ * @remarks
1037
+ * Not used by `@arcgis/api-extractor`. Preserved in typings for compatibility
1038
+ * with custom-elements-manifest.
1039
+ */
1040
+ export type ApiDemo = {
1041
+ /**
1042
+ * A markdown description of the demo.
1043
+ */
1044
+ description: string;
1045
+ /**
1046
+ * Relative URL of the demo if it's published with the package. Absolute URL
1047
+ * if it's hosted.
1048
+ */
1049
+ url: string;
1050
+ source?: ApiSourceReference;
1051
+ };
@@ -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
+ }
@@ -0,0 +1,4 @@
1
+ export { ApiExtractor, type ApiExtractorOptions } from "./extractor";
2
+ export type * 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.100";
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.100",
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.100",
18
+ "@arcgis/components-utils": "4.32.0-next.100",
19
+ "tslib": "^2.7.0",
20
+ "typescript": "~5.6.3"
21
+ }
22
+ }