@arcgis/api-extractor 5.0.0-next.99 → 5.0.0

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 (68) hide show
  1. package/README.md +2 -3
  2. package/dist/ApiExtractor-DIxlsiLk.js +2664 -0
  3. package/dist/apiHelpers-BYzO767m.js +161 -0
  4. package/dist/apiJson.d.ts +706 -760
  5. package/dist/cli-7PX_wNxb.js +34 -0
  6. package/dist/cli.js +50 -7
  7. package/dist/compilerHints.d.ts +62 -0
  8. package/dist/diff/apiDiffToMarkdown.d.ts +9 -0
  9. package/dist/diff/apiDiffToMarkdown.js +140 -0
  10. package/dist/diff/diffApiJson.d.ts +8 -5
  11. package/dist/diff/diffApiJson.js +260 -0
  12. package/dist/diff/fetchApiJsonFromNpm.d.ts +5 -2
  13. package/dist/diff/fetchApiJsonFromNpm.js +9 -0
  14. package/dist/diff/types.d.ts +71 -56
  15. package/dist/diffTypes/index.d.ts +20 -23
  16. package/dist/diffTypes/index.js +4 -2
  17. package/dist/extractor/ApiExtractor.d.ts +64 -137
  18. package/dist/extractor/ApiExtractor.js +9 -0
  19. package/dist/extractor/config.d.ts +459 -39
  20. package/dist/extractor/config.js +18 -0
  21. package/dist/extractor/extractors/copyDoc.d.ts +25 -0
  22. package/dist/extractor/processing/links.d.ts +15 -0
  23. package/dist/extractor/processing/links.js +172 -0
  24. package/dist/extractor/types.d.ts +19 -0
  25. package/dist/extractor/webComponent/findComponents.d.ts +19 -0
  26. package/dist/extractor/webComponent/findComponents.js +36 -0
  27. package/dist/extractor/webComponent/pathMapping.d.ts +11 -0
  28. package/dist/extractor/webComponent/pathMapping.js +44 -0
  29. package/dist/index.d.ts +164 -12
  30. package/dist/index.js +3 -837
  31. package/dist/typeScript-Dsim-EQC.js +64 -0
  32. package/dist/uiUtils/index.d.ts +10 -19
  33. package/dist/uiUtils/index.js +3 -55
  34. package/dist/utils/apiHelpers.d.ts +28 -61
  35. package/dist/utils/apiHelpers.js +17 -0
  36. package/dist/utils/astHelpers.d.ts +22 -21
  37. package/dist/utils/astHelpers.js +67 -0
  38. package/dist/utils/createIndex.d.ts +30 -0
  39. package/dist/utils/createIndex.js +81 -0
  40. package/dist/utils/hydrateApiType.d.ts +26 -0
  41. package/dist/utils/hydrateApiType.js +62 -0
  42. package/dist/utils/inferEntrypoints.d.ts +17 -0
  43. package/dist/utils/inferEntrypoints.js +26 -0
  44. package/dist/utils/internalTypeScriptApis.d.ts +92 -0
  45. package/dist/utils/internalTypeScriptApis.js +58 -0
  46. package/dist/utils/partPrinter.d.ts +25 -19
  47. package/dist/utils/partPrinter.js +82 -0
  48. package/dist/vite/plugin.d.ts +53 -0
  49. package/dist/vite/plugin.js +107 -0
  50. package/dist/vite/typeScript.d.ts +16 -0
  51. package/dist/vite/typeScript.js +6 -0
  52. package/dist/worker-1ouniZM0.js +3680 -0
  53. package/package.json +43 -9
  54. package/dist/cli.d.ts +0 -2
  55. package/dist/config/typeReferences/docLinkAdditions.d.ts +0 -51
  56. package/dist/config/typeReferences/globals.d.ts +0 -11
  57. package/dist/config/typeReferences/stringDocLinkAdditions.d.ts +0 -17
  58. package/dist/config/typeReferences/typeScriptGlobals.json.d.ts +0 -3
  59. package/dist/diff/index.d.ts +0 -3
  60. package/dist/diff/index.js +0 -149
  61. package/dist/ensureCemCompatibility.d.ts +0 -1
  62. package/dist/internalTypeScriptApis.d.ts +0 -31
  63. package/dist/types.d.ts +0 -22
  64. package/dist/utils/error.d.ts +0 -17
  65. package/dist/utils/jsDocHelpers.d.ts +0 -2
  66. package/dist/utils/jsDocParser.d.ts +0 -46
  67. package/dist/utils/jsDocPrinter.d.ts +0 -13
  68. package/dist/utils/print.d.ts +0 -6
@@ -0,0 +1,2664 @@
1
+ import { l as H, a as se, e as Re, p as fe } from "./typeScript-Dsim-EQC.js";
2
+ import { a as be, o as Me, t as Ge, b as De, c as Le, e as Oe, d as _, p as Ne, f as Be, i as me, g as We, h as Ue, j as ze, k as je, n as He, r as Je } from "./worker-1ouniZM0.js";
3
+ import { getViewUrl as Ve, postProcessDeprecated as ee, postProcessDescription as G, postProcessDocsTags as V, resolveJsDocLink as Xe } from "./extractor/processing/links.js";
4
+ import E from "typescript";
5
+ import { path as N, toPosixPathSeparators as Ye } from "@arcgis/components-build-utils";
6
+ import { mkdir as ae, writeFile as xe } from "fs/promises";
7
+ import x from "chalk";
8
+ import { styleText as qe } from "util";
9
+ import { kebabToPascal as Ze } from "@arcgis/toolkit/string";
10
+ import { g as h, a as Q, b as _e, c as Ke, d as le, e as Pe, f as oe, p as Qe, h as et, i as ce, m as Ie, n as tt, j as it, k as nt } from "./apiHelpers-BYzO767m.js";
11
+ import { printTypeParameters as ie, printTypeAlias as ot } from "./utils/partPrinter.js";
12
+ import { identity as Se, debounce as rt } from "@arcgis/toolkit/function";
13
+ import { opendirSync as st, watch as at, readFileSync as lt, statSync as ct } from "node:fs";
14
+ const k = "/** @deprecated since 5.0. Refactor using \\@arcgis/codemod */", dt = `${k}
15
+ type HashMap<T> = Record<string, T | undefined>;
16
+ ${k}
17
+ type nullish = null | undefined;
18
+
19
+ ${k}
20
+ type IHandle = import("./core/Handles.js").ResourceHandle;
21
+
22
+ ${k}
23
+ type GroupKey<T> = import("./core/Accessor.js").GroupKey<T>;
24
+
25
+ ${k}
26
+ declare namespace __esri {
27
+ ${k}
28
+ type Constructor<T> = new (...params: any[]) => T;
29
+
30
+ ${k}
31
+ export type AnonymousAccessor = Accessor;
32
+
33
+ ${k}
34
+ export type ReadonlyAccessor = Omit<Accessor, "set" | "_set" | "destroy" | "notifyChange" | "_get">;
35
+
36
+ `, ft = `
37
+
38
+ ${k}
39
+ export namespace CIM {
40
+ export enum ExpressionReturnType {
41
+ Default = "Default",
42
+ String = "String",
43
+ Numeric = "Numeric"
44
+ }
45
+
46
+ export enum AngleAlignment {
47
+ Display = "Display",
48
+ Map = "Map"
49
+ }
50
+
51
+ export enum BalloonCalloutStyle {
52
+ Rectangle = "Rectangle",
53
+ RoundedRectangle = "RoundedRectangle",
54
+ Oval = "Oval"
55
+ }
56
+
57
+ export enum BlendingMode {
58
+ None = "None",
59
+ Alpha = "Alpha",
60
+ Screen = "Screen",
61
+ Multiply = "Multiply",
62
+ Add = "Add"
63
+ }
64
+
65
+ export enum BlockProgression {
66
+ TTB = "TTB",
67
+ RTL = "RTL",
68
+ BTT = "BTT"
69
+ }
70
+
71
+ export enum CGAAttributeType {
72
+ Float = "Float",
73
+ String = "String",
74
+ Boolean = "Boolean"
75
+ }
76
+
77
+ export enum ClippingType {
78
+ Intersect = "Intersect",
79
+ Subtract = "Subtract"
80
+ }
81
+
82
+ export enum ExternalColorMixMode {
83
+ Tint = "Tint",
84
+ Ignore = "Ignore",
85
+ Multiply = "Multiply"
86
+ }
87
+
88
+ export enum ExtremityPlacement {
89
+ Both = "Both",
90
+ JustBegin = "JustBegin",
91
+ JustEnd = "JustEnd",
92
+ None = "None"
93
+ }
94
+
95
+ export enum FillMode {
96
+ Mosaic = "Mosaic",
97
+ Centered = "Centered"
98
+ }
99
+
100
+ export enum FontEffects {
101
+ Normal = "Normal",
102
+ Superscript = "Superscript",
103
+ Subscript = "Subscript"
104
+ }
105
+
106
+ export enum FontEncoding {
107
+ MSSymbol = "MSSymbol",
108
+ Unicode = "Unicode"
109
+ }
110
+
111
+ export enum FontType {
112
+ Unspecified = "Unspecified",
113
+ TrueType = "TrueType",
114
+ PSOpenType = "PSOpenType",
115
+ TTOpenType = "TTOpenType",
116
+ Type1 = "Type1"
117
+ }
118
+
119
+ export enum GeometricEffectArrowType {
120
+ OpenEnded = "OpenEnded",
121
+ Block = "Block",
122
+ Crossed = "Crossed"
123
+ }
124
+
125
+ export enum GeometricEffectDonutMethod {
126
+ Mitered = "Mitered",
127
+ Bevelled = "Bevelled",
128
+ Rounded = "Rounded",
129
+ Square = "Square",
130
+ TrueBuffer = "TrueBuffer"
131
+ }
132
+
133
+ export enum GeometricEffectEnclosingPolygonMethod {
134
+ ClosePath = "ClosePath",
135
+ ConvexHull = "ConvexHull",
136
+ RectangularBox = "RectangularBox"
137
+ }
138
+
139
+ export enum GeometricEffectExtensionOrigin {
140
+ BeginningOfLine = "BeginningOfLine",
141
+ EndOfLine = "EndOfLine"
142
+ }
143
+
144
+ export enum GeometricEffectLocalizerFeatherStyle {
145
+ Complete = "Complete",
146
+ Left = "Left",
147
+ Right = "Right"
148
+ }
149
+
150
+ export enum GeometricEffectOffsetMethod {
151
+ Mitered = "Mitered",
152
+ Bevelled = "Bevelled",
153
+ Rounded = "Rounded",
154
+ Square = "Square"
155
+ }
156
+
157
+ export enum GeometricEffectOffsetOption {
158
+ Fast = "Fast",
159
+ Accurate = "Accurate"
160
+ }
161
+
162
+ export enum GeometricEffectOffsetTangentMethod {
163
+ BeginningOfLine = "BeginningOfLine",
164
+ EndOfLine = "EndOfLine"
165
+ }
166
+
167
+ export enum GeometricEffectWaveform {
168
+ Sinus = "Sinus",
169
+ Square = "Square",
170
+ Triangle = "Triangle",
171
+ Random = "Random"
172
+ }
173
+
174
+ export enum GlyphHinting {
175
+ None = "None",
176
+ Default = "Default",
177
+ Force = "Force"
178
+ }
179
+
180
+ export enum GradientAlignment {
181
+ Buffered = "Buffered",
182
+ Left = "Left",
183
+ Right = "Right",
184
+ AlongLine = "AlongLine"
185
+ }
186
+
187
+ export enum GradientFillMethod {
188
+ Linear = "Linear",
189
+ Rectangular = "Rectangular",
190
+ Circular = "Circular",
191
+ Buffered = "Buffered"
192
+ }
193
+
194
+ export enum GradientStrokeType {
195
+ Discrete = "Discrete",
196
+ Continuous = "Continuous"
197
+ }
198
+
199
+ export enum HorizontalAlignment {
200
+ Left = "Left",
201
+ Right = "Right",
202
+ Center = "Center",
203
+ Justify = "Justify"
204
+ }
205
+
206
+ export enum LeaderLineStyle {
207
+ Base = "Base",
208
+ MidPoint = "MidPoint",
209
+ ThreePoint = "ThreePoint",
210
+ FourPoint = "FourPoint",
211
+ Underline = "Underline",
212
+ CircularCW = "CircularCW",
213
+ CircularCCW = "CircularCCW"
214
+ }
215
+
216
+ export enum LineCapStyle {
217
+ Butt = "Butt",
218
+ Round = "Round",
219
+ Square = "Square"
220
+ }
221
+
222
+ export enum LineDashEnding {
223
+ NoConstraint = "NoConstraint",
224
+ HalfPattern = "HalfPattern",
225
+ HalfGap = "HalfGap",
226
+ FullPattern = "FullPattern",
227
+ FullGap = "FullGap",
228
+ Custom = "Custom"
229
+ }
230
+
231
+ export enum LineDecorationStyle {
232
+ None = "None",
233
+ Custom = "Custom",
234
+ Circle = "Circle",
235
+ OpenArrow = "OpenArrow",
236
+ ClosedArrow = "ClosedArrow",
237
+ Diamond = "Diamond"
238
+ }
239
+
240
+ export enum LineGapType {
241
+ ExtraLeading = "ExtraLeading",
242
+ Multiple = "Multiple",
243
+ Exact = "Exact"
244
+ }
245
+
246
+ export enum LineJoinStyle {
247
+ Bevel = "Bevel",
248
+ Round = "Round",
249
+ Miter = "Miter"
250
+ }
251
+
252
+ export enum MarkerPlacementType {
253
+ InsidePolygon = "InsidePolygon",
254
+ PolygonCenter = "PolygonCenter",
255
+ RandomlyInsidePolygon = "RandomlyInsidePolygon"
256
+ }
257
+
258
+ export enum MaterialMode {
259
+ Tint = "Tint",
260
+ Replace = "Replace",
261
+ Multiply = "Multiply"
262
+ }
263
+
264
+ export enum PlacementClip {
265
+ ClipAtBoundary = "ClipAtBoundary",
266
+ RemoveIfCenterOutsideBoundary = "RemoveIfCenterOutsideBoundary",
267
+ DoNotTouchBoundary = "DoNotTouchBoundary",
268
+ DoNotClip = "DoNotClip"
269
+ }
270
+
271
+ export enum PlacementEndings {
272
+ NoConstraint = "NoConstraint",
273
+ WithMarkers = "WithMarkers",
274
+ WithFullGap = "WithFullGap",
275
+ WithHalfGap = "WithHalfGap",
276
+ Custom = "Custom"
277
+ }
278
+
279
+ export enum PlacementGridType {
280
+ Fixed = "Fixed",
281
+ Random = "Random",
282
+ RandomFixedQuantity = "RandomFixedQuantity"
283
+ }
284
+
285
+ export enum PlacementOnLineRelativeTo {
286
+ LineMiddle = "LineMiddle",
287
+ LineBeginning = "LineBeginning",
288
+ LineEnd = "LineEnd",
289
+ SegmentMidpoint = "SegmentMidpoint"
290
+ }
291
+
292
+ export enum PlacementPolygonCenterMethod {
293
+ OnPolygon = "OnPolygon",
294
+ CenterOfMass = "CenterOfMass",
295
+ BoundingBoxCenter = "BoundingBoxCenter"
296
+ }
297
+
298
+ export enum PlacementRandomlyAlongLineRandomization {
299
+ Low = "Low",
300
+ Medium = "Medium",
301
+ High = "High"
302
+ }
303
+
304
+ export enum PlacementStepPosition {
305
+ MarkerCenter = "MarkerCenter",
306
+ MarkerBounds = "MarkerBounds"
307
+ }
308
+
309
+ export enum PointSymbolCalloutScale {
310
+ None = "None",
311
+ PropUniform = "PropUniform",
312
+ PropNonuniform = "PropNonuniform",
313
+ DifUniform = "DifUniform",
314
+ DifNonuniform = "DifNonuniform"
315
+ }
316
+
317
+ export enum Simple3DLineStyle {
318
+ Tube = "Tube",
319
+ Strip = "Strip",
320
+ Wall = "Wall"
321
+ }
322
+
323
+ export enum SizeVariationMethod {
324
+ Random = "Random",
325
+ Increasing = "Increasing",
326
+ Decreasing = "Decreasing",
327
+ IncreasingThenDecreasing = "IncreasingThenDecreasing"
328
+ }
329
+
330
+ export enum SymbolUnits {
331
+ Relative = "Relative",
332
+ Absolute = "Absolute"
333
+ }
334
+
335
+ export enum TextCase {
336
+ Normal = "Normal",
337
+ LowerCase = "LowerCase",
338
+ Allcaps = "Allcaps"
339
+ }
340
+
341
+ export enum TextReadingDirection {
342
+ LTR = "LTR",
343
+ RTL = "RTL"
344
+ }
345
+
346
+ export enum TextureFilter {
347
+ Draft = "Draft",
348
+ Picture = "Picture",
349
+ Text = "Text"
350
+ }
351
+
352
+ export enum VerticalAlignment {
353
+ Top = "Top",
354
+ Center = "Center",
355
+ Baseline = "Baseline",
356
+ Bottom = "Bottom"
357
+ }
358
+
359
+ export enum VerticalGlyphOrientation {
360
+ Right = "Right",
361
+ Upright = "Upright"
362
+ }
363
+
364
+ export enum WaterbodySize {
365
+ Small = "Small",
366
+ Medium = "Medium",
367
+ Large = "Large"
368
+ }
369
+
370
+ export enum WaveStrength {
371
+ Calm = "Calm",
372
+ Rippled = "Rippled",
373
+ Slight = "Slight",
374
+ Moderate = "Moderate"
375
+ }
376
+
377
+ export enum BillboardMode {
378
+ None = "None",
379
+ SignPost = "SignPost",
380
+ FaceNearPlane = "FaceNearPlane"
381
+ }
382
+
383
+ export enum DominantSizeAxis {
384
+ Z = "Z",
385
+ X = "X",
386
+ Y = "Y"
387
+ }
388
+
389
+ export enum GradientStrokeMethod {
390
+ AcrossLine = "AcrossLine",
391
+ AlongLine = "AlongLine"
392
+ }
393
+
394
+ export enum RotationOrder {
395
+ XYZ = "XYZ",
396
+ ZXY = "ZXY",
397
+ YXZ = "YXZ"
398
+ }
399
+
400
+ export interface CIMExpressionInfo {
401
+ type: "CIMExpressionInfo";
402
+ title?: string;
403
+ expression?: string;
404
+ name?: string;
405
+ returnType?: keyof typeof ExpressionReturnType;
406
+ }
407
+
408
+ export interface CIMPrimitiveOverride {
409
+ type: "CIMPrimitiveOverride";
410
+ primitiveName?: string;
411
+ propertyName?: string;
412
+ expression?: string;
413
+ valueExpressionInfo?: CIMExpressionInfo;
414
+ }
415
+
416
+ export interface CIMScaleDependentSizeVariation {
417
+ type: "CIMScaleDependentSizeVariation";
418
+ scale?: number;
419
+ size?: number;
420
+ }
421
+
422
+ export interface CIMSymbolReference {
423
+ type: "CIMSymbolReference";
424
+ primitiveOverrides?: CIMPrimitiveOverride[];
425
+ stylePath?: string;
426
+ symbol?: CIMSymbolType;
427
+ symbolName?: string;
428
+ minScale?: number;
429
+ maxScale?: number;
430
+ scaleDependentSizeVariation?: CIMScaleDependentSizeVariation[];
431
+ minDistance?: number;
432
+ maxDistance?: number;
433
+ }
434
+
435
+ export interface CIM3DSymbolProperties {
436
+ type: "CIM3DSymbolProperties";
437
+ dominantSizeAxis3D?: keyof typeof DominantSizeAxis;
438
+ rotationOrder3D?: keyof typeof RotationOrder;
439
+ scaleZ?: number;
440
+ scaleY?: number;
441
+ }
442
+
443
+ export interface CIMCalloutBase {
444
+ type: string;
445
+ leaderTolerance?: number;
446
+ leaderOffset?: number;
447
+ }
448
+
449
+ export interface CIMLineCallout extends CIMCalloutBase {
450
+ leaderLineSymbol?: CIMLineSymbol;
451
+ gap?: number;
452
+ lineStyle?: keyof typeof LeaderLineStyle;
453
+ }
454
+
455
+ export interface CIMSymbolLayerBase {
456
+ type: string;
457
+ effects?: CIMGeometricEffectType[];
458
+ enable?: boolean;
459
+ name?: string;
460
+ colorLocked?: boolean;
461
+ primitiveName?: string;
462
+ overprint?: boolean;
463
+ }
464
+
465
+ export interface CIMMarker extends CIMSymbolLayerBase {
466
+ anchorPoint?: ExternalReferencePoint;
467
+ anchorPointUnits?: keyof typeof SymbolUnits;
468
+ angleX?: number;
469
+ angleY?: number;
470
+ dominantSizeAxis3D?: keyof typeof DominantSizeAxis;
471
+ offsetX?: number;
472
+ offsetY?: number;
473
+ offsetZ?: number;
474
+ rotateClockwise?: boolean;
475
+ rotation?: number;
476
+ size?: number;
477
+ billboardMode3D?: keyof typeof BillboardMode;
478
+ markerPlacement?: CIMMarkerPlacementType;
479
+ }
480
+
481
+ export interface CIMCGAAttribute {
482
+ type: "CIMCGAAttribute";
483
+ name?: string;
484
+ CGAAttributeType?: keyof typeof CGAAttributeType;
485
+ value?: any;
486
+ }
487
+
488
+ export interface CIMCharacterMarker extends CIMMarker {
489
+ type: "CIMCharacterMarker";
490
+ characterIndex?: number;
491
+ depth3D?: number;
492
+ fontFamilyName?: string;
493
+ fontStyleName?: string;
494
+ fontType?: keyof typeof FontType;
495
+ scaleX?: number;
496
+ symbol?: CIMPolygonSymbol;
497
+ verticalOrientation3D?: boolean;
498
+ scaleSymbolsProportionally?: boolean;
499
+ respectFrame?: boolean;
500
+ }
501
+
502
+ export interface CIMClippingPath {
503
+ type: "CIMClippingPath";
504
+ clippingType?: keyof typeof ClippingType;
505
+ path?: ExternalReferencePolygon;
506
+ }
507
+
508
+ export interface CIMColorSubstitution {
509
+ type: "CIMColorSubstitution";
510
+ oldColor?: number[];
511
+ newColor?: number[];
512
+ }
513
+
514
+ export interface CIMGeometricEffectBase {
515
+ type: string;
516
+ primitiveName?: string;
517
+ }
518
+
519
+ export interface CIMGeometricEffectAddControlPoints extends CIMGeometricEffectBase {
520
+ type: "CIMGeometricEffectAddControlPoints";
521
+ angleTolerance?: number;
522
+ }
523
+
524
+ export interface CIMGeometricEffectArrow extends CIMGeometricEffectBase {
525
+ type: "CIMGeometricEffectArrow";
526
+ geometricEffectArrowType?: keyof typeof GeometricEffectArrowType;
527
+ width?: number;
528
+ }
529
+
530
+ export interface CIMGeometricEffectBuffer extends CIMGeometricEffectBase {
531
+ type: "CIMGeometricEffectBuffer";
532
+ size?: number;
533
+ }
534
+
535
+ export interface CIMGeometricEffectCut extends CIMGeometricEffectBase {
536
+ type: "CIMGeometricEffectCut";
537
+ beginCut?: number;
538
+ endCut?: number;
539
+ middleCut?: number;
540
+ invert?: boolean;
541
+ }
542
+
543
+ export interface CIMGeometricEffectDashes extends CIMGeometricEffectBase {
544
+ type: "CIMGeometricEffectDashes";
545
+ customEndingOffset?: number;
546
+ dashTemplate?: number[];
547
+ lineDashEnding?: keyof typeof LineDashEnding;
548
+ offsetAlongLine?: number;
549
+ controlPointEnding?: keyof typeof LineDashEnding;
550
+ }
551
+
552
+ export interface CIMGeometricEffectDonut extends CIMGeometricEffectBase {
553
+ type: "CIMGeometricEffectDonut";
554
+ method?: keyof typeof GeometricEffectDonutMethod;
555
+ option?: keyof typeof GeometricEffectOffsetOption;
556
+ width?: number;
557
+ }
558
+
559
+ export interface CIMGeometricEffectEnclosingPolygon extends CIMGeometricEffectBase {
560
+ type: "CIMGeometricEffectEnclosingPolygon";
561
+ method?: keyof typeof GeometricEffectEnclosingPolygonMethod;
562
+ }
563
+
564
+ export interface CIMGeometricEffectExtension extends CIMGeometricEffectBase {
565
+ type: "CIMGeometricEffectExtension";
566
+ deflection?: number;
567
+ origin?: keyof typeof GeometricEffectExtensionOrigin;
568
+ length?: number;
569
+ }
570
+
571
+ export interface CIMGeometricEffectJog extends CIMGeometricEffectBase {
572
+ type: "CIMGeometricEffectJog";
573
+ angle?: number;
574
+ length?: number;
575
+ position?: number;
576
+ }
577
+
578
+ export interface CIMGeometricEffectLocalizerFeather extends CIMGeometricEffectBase {
579
+ type: "CIMGeometricEffectLocalizerFeather";
580
+ style?: keyof typeof GeometricEffectLocalizerFeatherStyle;
581
+ length?: number;
582
+ width?: number;
583
+ angle?: number;
584
+ }
585
+
586
+ export interface CIMGeometricEffectMove extends CIMGeometricEffectBase {
587
+ type: "CIMGeometricEffectMove";
588
+ offsetX?: number;
589
+ offsetY?: number;
590
+ }
591
+
592
+ export interface CIMGeometricEffectOffset extends CIMGeometricEffectBase {
593
+ type: "CIMGeometricEffectOffset";
594
+ method?: keyof typeof GeometricEffectOffsetMethod;
595
+ offset?: number;
596
+ option?: keyof typeof GeometricEffectOffsetOption;
597
+ }
598
+
599
+ export interface CIMGeometricEffectOffsetHatch extends CIMGeometricEffectBase {
600
+ type: "CIMGeometricEffectOffsetHatch";
601
+ length?: number;
602
+ spacing?: number;
603
+ }
604
+
605
+ export interface CIMGeometricEffectOffsetTangent extends CIMGeometricEffectBase {
606
+ type: "CIMGeometricEffectOffsetTangent";
607
+ method?: keyof typeof GeometricEffectOffsetTangentMethod;
608
+ offset?: number;
609
+ }
610
+
611
+ export interface CIMGeometricEffectRadial extends CIMGeometricEffectBase {
612
+ type: "CIMGeometricEffectRadial";
613
+ angle?: number;
614
+ length?: number;
615
+ }
616
+
617
+ export interface CIMGeometricEffectRegularPolygon extends CIMGeometricEffectBase {
618
+ type: "CIMGeometricEffectRegularPolygon";
619
+ angle?: number;
620
+ edges?: number;
621
+ radius?: number;
622
+ }
623
+
624
+ export interface CIMGeometricEffectReverse extends CIMGeometricEffectBase {
625
+ type: "CIMGeometricEffectReverse";
626
+ reverse?: boolean;
627
+ }
628
+
629
+ export interface CIMGeometricEffectRotate extends CIMGeometricEffectBase {
630
+ type: "CIMGeometricEffectRotate";
631
+ angle?: number;
632
+ }
633
+
634
+ export interface CIMGeometricEffectScale extends CIMGeometricEffectBase {
635
+ type: "CIMGeometricEffectScale";
636
+ XScaleFactor?: number;
637
+ YScaleFactor?: number;
638
+ }
639
+
640
+ export interface CIMGeometricEffectSuppress extends CIMGeometricEffectBase {
641
+ type: "CIMGeometricEffectSuppress";
642
+ suppress?: boolean;
643
+ invert?: boolean;
644
+ }
645
+
646
+ export interface CIMGeometricEffectTaperedPolygon extends CIMGeometricEffectBase {
647
+ type: "CIMGeometricEffectTaperedPolygon";
648
+ fromWidth?: number;
649
+ length?: number;
650
+ toWidth?: number;
651
+ }
652
+
653
+ export interface CIMGeometricEffectWave extends CIMGeometricEffectBase {
654
+ type: "CIMGeometricEffectWave";
655
+ amplitude?: number;
656
+ period?: number;
657
+ seed?: number;
658
+ waveform?: keyof typeof GeometricEffectWaveform;
659
+ }
660
+
661
+ export interface CIMFill extends CIMSymbolLayerBase {}
662
+
663
+ export interface CIMGradientFill extends CIMFill {
664
+ type: "CIMGradientFill";
665
+ angle?: number;
666
+ colorRamp?: any;
667
+ gradientMethod?: keyof typeof GradientFillMethod;
668
+ gradientSize?: number;
669
+ gradientSizeUnits?: keyof typeof SymbolUnits;
670
+ gradientType?: keyof typeof GradientStrokeType;
671
+ interval?: number;
672
+ }
673
+
674
+ export interface CIMStroke extends CIMSymbolLayerBase {
675
+ capStyle?: keyof typeof LineCapStyle;
676
+ joinStyle?: keyof typeof LineJoinStyle;
677
+ lineStyle3D?: keyof typeof Simple3DLineStyle;
678
+ miterLimit?: number;
679
+ width?: number;
680
+ closeCaps3D?: boolean;
681
+ }
682
+
683
+ export interface CIMGradientStroke extends CIMStroke {
684
+ type: "CIMGradientStroke";
685
+ colorRamp?: any;
686
+ gradientMethod?: keyof typeof GradientStrokeMethod;
687
+ gradientSize?: number;
688
+ gradientSizeUnits?: keyof typeof SymbolUnits;
689
+ gradientType?: keyof typeof GradientStrokeType;
690
+ interval?: number;
691
+ }
692
+
693
+ export interface CIMHatchFill extends CIMFill {
694
+ type: "CIMHatchFill";
695
+ lineSymbol?: CIMLineSymbol;
696
+ offsetX?: number;
697
+ rotation?: number;
698
+ separation?: number;
699
+ offsetY?: number;
700
+ }
701
+
702
+ export interface CIMSymbolBase {
703
+ type: string;
704
+ }
705
+
706
+ export interface CIMMultiLayerSymbol extends CIMSymbolBase {
707
+ effects?: CIMGeometricEffectType[];
708
+ symbolLayers?: CIMSymbolLayerType[];
709
+ thumbnailURI?: string;
710
+ useRealWorldSymbolSizes?: boolean;
711
+ }
712
+
713
+ export interface CIMLineSymbol extends CIMMultiLayerSymbol {
714
+ type: "CIMLineSymbol";
715
+ }
716
+
717
+ export interface CIMMarkerGraphic {
718
+ type: "CIMMarkerGraphic";
719
+ geometry?: ExternalReferenceGeometry;
720
+ symbol?: CIMSymbolType;
721
+ textString?: string;
722
+ primitiveName?: string;
723
+ }
724
+
725
+ export interface CIMMarkerPlacementBase {
726
+ type: string;
727
+ primitiveName?: string;
728
+ }
729
+
730
+ export interface CIMMarkerStrokePlacement extends CIMMarkerPlacementBase {
731
+ angleToLine?: boolean;
732
+ offset?: number;
733
+ }
734
+
735
+ export interface CIMMarkerPlacementAlongLine extends CIMMarkerStrokePlacement {
736
+ controlPointPlacement?: keyof typeof PlacementEndings;
737
+ customEndingOffset?: number;
738
+ endings?: keyof typeof PlacementEndings;
739
+ offsetAlongLine?: number;
740
+ placementTemplate?: number[];
741
+ }
742
+
743
+ export interface CIMMarkerPlacementAlongLineRandomSize extends CIMMarkerPlacementAlongLine {
744
+ type: "CIMMarkerPlacementAlongLineRandomSize";
745
+ randomization?: keyof typeof PlacementRandomlyAlongLineRandomization;
746
+ seed?: number;
747
+ }
748
+
749
+ export interface CIMMarkerPlacementAlongLineSameSize extends CIMMarkerPlacementAlongLine {
750
+ type: "CIMMarkerPlacementAlongLineSameSize";
751
+ }
752
+
753
+ export interface CIMMarkerPlacementAlongLineVariableSize extends CIMMarkerPlacementAlongLine {
754
+ type: "CIMMarkerPlacementAlongLineVariableSize";
755
+ maxRandomOffset?: number;
756
+ maxZoom?: number;
757
+ minZoom?: number;
758
+ numberOfSizes?: number;
759
+ seed?: number;
760
+ variationMethod?: keyof typeof SizeVariationMethod;
761
+ }
762
+
763
+ export interface CIMMarkerPlacementAtExtremities extends CIMMarkerStrokePlacement {
764
+ type: "CIMMarkerPlacementAtExtremities";
765
+ extremityPlacement?: keyof typeof ExtremityPlacement;
766
+ offsetAlongLine?: number;
767
+ }
768
+
769
+ export interface CIMMarkerPlacementAtMeasuredUnits extends CIMMarkerStrokePlacement {
770
+ type: "CIMMarkerPlacementAtMeasuredUnits";
771
+ interval?: number;
772
+ skipMarkerRate?: number;
773
+ placeAtExtremities?: boolean;
774
+ }
775
+
776
+ export interface CIMMarkerPlacementAtRatioPositions extends CIMMarkerStrokePlacement {
777
+ type: "CIMMarkerPlacementAtRatioPositions";
778
+ beginPosition?: number;
779
+ endPosition?: number;
780
+ flipFirst?: boolean;
781
+ positionArray?: number[];
782
+ }
783
+
784
+ export interface CIMMarkerFillPlacement extends CIMMarkerPlacementBase {}
785
+
786
+ export interface CIMMarkerPlacementInsidePolygon extends CIMMarkerFillPlacement {
787
+ type: "CIMMarkerPlacementInsidePolygon";
788
+ gridAngle?: number;
789
+ gridType?: keyof typeof PlacementGridType;
790
+ offsetX?: number;
791
+ randomness?: number;
792
+ seed?: number;
793
+ shiftOddRows?: boolean;
794
+ stepX?: number;
795
+ stepY?: number;
796
+ offsetY?: number;
797
+ clipping?: keyof typeof PlacementClip;
798
+ }
799
+
800
+ export interface CIMMarkerPlacementOnLine extends CIMMarkerStrokePlacement {
801
+ type: "CIMMarkerPlacementOnLine";
802
+ relativeTo?: keyof typeof PlacementOnLineRelativeTo;
803
+ startPointOffset?: number;
804
+ }
805
+
806
+ export interface CIMMarkerPlacementOnVertices extends CIMMarkerStrokePlacement {
807
+ type: "CIMMarkerPlacementOnVertices";
808
+ placeOnControlPoints?: boolean;
809
+ placeOnEndPoints?: boolean;
810
+ placeOnRegularVertices?: boolean;
811
+ }
812
+
813
+ export interface CIMMarkerPlacementPolygonCenter extends CIMMarkerFillPlacement {
814
+ type: "CIMMarkerPlacementPolygonCenter";
815
+ method?: keyof typeof PlacementPolygonCenterMethod;
816
+ offsetX?: number;
817
+ offsetY?: number;
818
+ clipAtBoundary?: boolean;
819
+ }
820
+
821
+ export interface CIMMaterialProperties {
822
+ type: "CIMMaterialProperties";
823
+ specularColor?: number[];
824
+ shininess?: number;
825
+ externalColorMixMode?: keyof typeof ExternalColorMixMode;
826
+ }
827
+
828
+ export interface CIMMaterialSymbolLayer extends CIMSymbolLayerBase {
829
+ type: "CIMMaterialSymbolLayer";
830
+ color?: number[];
831
+ materialMode?: keyof typeof MaterialMode;
832
+ }
833
+
834
+ export interface CIMObjectMarker3D extends CIMMarker {
835
+ type: "CIMObjectMarker3D";
836
+ modelURI?: string;
837
+ width?: number;
838
+ depth?: number;
839
+ tintColor?: number[];
840
+ isRestricted?: boolean;
841
+ thumbnail?: string;
842
+ useAnchorPoint?: boolean;
843
+ LODs?: CIMObjectMarker3DLOD[];
844
+ }
845
+
846
+ export interface CIMObjectMarker3DLOD {
847
+ type: "CIMObjectMarker3DLOD";
848
+ faceCount?: number;
849
+ modelURI?: string;
850
+ }
851
+
852
+ export interface CIMPictureFill extends CIMFill {
853
+ type: "CIMPictureFill";
854
+ url?: string;
855
+ offsetX?: number;
856
+ offsetY?: number;
857
+ rotation?: number;
858
+ scaleX?: number;
859
+ height?: number;
860
+ textureFilter?: keyof typeof TextureFilter;
861
+ colorSubstitutions?: CIMColorSubstitution[];
862
+ tintColor?: number[];
863
+ }
864
+
865
+ export interface CIMPictureMarker extends CIMMarker {
866
+ type: "CIMPictureMarker";
867
+ colorSubstitutions?: CIMColorSubstitution[];
868
+ depth3D?: number;
869
+ invertBackfaceTexture?: boolean;
870
+ scaleX?: number;
871
+ textureFilter?: keyof typeof TextureFilter;
872
+ tintColor?: number[];
873
+ url?: string;
874
+ verticalOrientation3D?: boolean;
875
+ }
876
+
877
+ export interface CIMPictureStroke extends CIMStroke {
878
+ type: "CIMPictureStroke";
879
+ colorSubstitutions?: CIMColorSubstitution[];
880
+ textureFilter?: keyof typeof TextureFilter;
881
+ url?: string;
882
+ tintColor?: number[];
883
+ }
884
+
885
+ export interface CIMPointSymbol extends CIMMultiLayerSymbol {
886
+ type: "CIMPointSymbol";
887
+ callout?: CIMCalloutType;
888
+ haloSize?: number;
889
+ haloSymbol?: CIMPolygonSymbol;
890
+ primitiveName?: string;
891
+ scaleX?: number;
892
+ symbol3DProperties?: CIM3DSymbolProperties;
893
+ angle?: number;
894
+ angleAlignment?: keyof typeof AngleAlignment;
895
+ }
896
+
897
+ export interface CIMPolygonSymbol extends CIMMultiLayerSymbol {
898
+ type: "CIMPolygonSymbol";
899
+ }
900
+
901
+ export interface CIMShapeVertices {
902
+ type: "CIMShapeVertices";
903
+ indices?: number;
904
+ shapes?: string;
905
+ }
906
+
907
+ export interface CIMSolidFill extends CIMFill {
908
+ type: "CIMSolidFill";
909
+ color?: number[];
910
+ }
911
+
912
+ export interface CIMSolidStroke extends CIMStroke {
913
+ type: "CIMSolidStroke";
914
+ color?: number[];
915
+ }
916
+
917
+ export interface CIMTextMargin {
918
+ type: "CIMTextMargin";
919
+ left?: number;
920
+ right?: number;
921
+ top?: number;
922
+ bottom?: number;
923
+ }
924
+
925
+ export interface CIMTextSymbol extends CIMSymbolBase {
926
+ type: "CIMTextSymbol";
927
+ angle?: number;
928
+ angleX?: number;
929
+ angleY?: number;
930
+ blockProgression?: keyof typeof BlockProgression;
931
+ callout?: CIMCalloutType;
932
+ compatibilityMode?: boolean;
933
+ countryISO?: string;
934
+ depth3D?: number;
935
+ drawGlyphsAsGeometry?: boolean;
936
+ drawSoftHyphen?: boolean;
937
+ extrapolateBaselines?: boolean;
938
+ flipAngle?: number;
939
+ fontEffects?: keyof typeof FontEffects;
940
+ fontEncoding?: keyof typeof FontEncoding;
941
+ fontFamilyName?: string;
942
+ fontStyleName?: string;
943
+ fontType?: keyof typeof FontType;
944
+ glyphRotation?: number;
945
+ haloSize?: number;
946
+ haloSymbol?: CIMPolygonSymbol;
947
+ height?: number;
948
+ hinting?: keyof typeof GlyphHinting;
949
+ horizontalAlignment?: keyof typeof HorizontalAlignment;
950
+ indentAfter?: number;
951
+ indentBefore?: number;
952
+ indentFirstLine?: number;
953
+ kerning?: boolean;
954
+ languageISO?: string;
955
+ letterSpacing?: number;
956
+ letterWidth?: number;
957
+ ligatures?: boolean;
958
+ lineGap?: number;
959
+ lineGapType?: keyof typeof LineGapType;
960
+ offsetX?: number;
961
+ offsetY?: number;
962
+ offsetZ?: number;
963
+ shadowColor?: number[];
964
+ shadowOffsetX?: number;
965
+ shadowOffsetY?: number;
966
+ smallCaps?: boolean;
967
+ strikethrough?: boolean;
968
+ symbol?: CIMPolygonSymbol;
969
+ symbol3DProperties?: CIM3DSymbolProperties;
970
+ textCase?: keyof typeof TextCase;
971
+ textDirection?: keyof typeof TextReadingDirection;
972
+ underline?: boolean;
973
+ verticalAlignment?: keyof typeof VerticalAlignment;
974
+ verticalGlyphOrientation?: keyof typeof VerticalGlyphOrientation;
975
+ wordSpacing?: number;
976
+ billboardMode3D?: keyof typeof BillboardMode;
977
+ overprint?: boolean;
978
+ }
979
+
980
+ export interface CIMVectorMarker extends CIMMarker {
981
+ type: "CIMVectorMarker";
982
+ depth3D?: number;
983
+ frame?: ExternalReferenceEnvelope;
984
+ markerGraphics?: CIMMarkerGraphic[];
985
+ verticalOrientation3D?: boolean;
986
+ scaleSymbolsProportionally?: boolean;
987
+ respectFrame?: boolean;
988
+ clippingPath?: CIMClippingPath;
989
+ }
990
+
991
+ export type CIMMarkerPlacementType =
992
+ | CIMMarkerPlacementAlongLineRandomSize
993
+ | CIMMarkerPlacementAlongLineSameSize
994
+ | CIMMarkerPlacementAlongLineVariableSize
995
+ | CIMMarkerPlacementAtExtremities
996
+ | CIMMarkerPlacementAtMeasuredUnits
997
+ | CIMMarkerPlacementAtRatioPositions
998
+ | CIMMarkerPlacementOnLine
999
+ | CIMMarkerPlacementOnVertices
1000
+ | CIMMarkerPlacementInsidePolygon
1001
+ | CIMMarkerPlacementPolygonCenter;
1002
+ export type CIMSymbolType = CIMLineSymbol | CIMPointSymbol | CIMPolygonSymbol | CIMTextSymbol;
1003
+ export type CIMGeometricEffectType =
1004
+ | CIMGeometricEffectAddControlPoints
1005
+ | CIMGeometricEffectArrow
1006
+ | CIMGeometricEffectBuffer
1007
+ | CIMGeometricEffectCut
1008
+ | CIMGeometricEffectDashes
1009
+ | CIMGeometricEffectDonut
1010
+ | CIMGeometricEffectEnclosingPolygon
1011
+ | CIMGeometricEffectExtension
1012
+ | CIMGeometricEffectJog
1013
+ | CIMGeometricEffectLocalizerFeather
1014
+ | CIMGeometricEffectMove
1015
+ | CIMGeometricEffectOffset
1016
+ | CIMGeometricEffectOffsetHatch
1017
+ | CIMGeometricEffectOffsetTangent
1018
+ | CIMGeometricEffectRadial
1019
+ | CIMGeometricEffectRegularPolygon
1020
+ | CIMGeometricEffectReverse
1021
+ | CIMGeometricEffectRotate
1022
+ | CIMGeometricEffectScale
1023
+ | CIMGeometricEffectSuppress
1024
+ | CIMGeometricEffectTaperedPolygon
1025
+ | CIMGeometricEffectWave;
1026
+ export type CIMSymbolLayerType =
1027
+ | CIMCharacterMarker
1028
+ | CIMObjectMarker3D
1029
+ | CIMPictureMarker
1030
+ | CIMVectorMarker
1031
+ | CIMGradientFill
1032
+ | CIMHatchFill
1033
+ | CIMPictureFill
1034
+ | CIMSolidFill
1035
+ | CIMGradientStroke
1036
+ | CIMPictureStroke
1037
+ | CIMSolidStroke
1038
+ | CIMMaterialSymbolLayer;
1039
+ export type CIMCalloutType = CIMLineCallout;
1040
+
1041
+ export interface ExternalReferencePoint {
1042
+ x?: number;
1043
+ y?: number;
1044
+ z?: number;
1045
+ m?: number;
1046
+ spatialReference?: ExternalReferenceSpatialReference;
1047
+ }
1048
+
1049
+ export interface ExternalReferencePolyline {
1050
+ hasM?: boolean;
1051
+ hasZ?: boolean;
1052
+ paths?: number[][][];
1053
+ curvePath?: number[][][];
1054
+ spatialReference?: ExternalReferenceSpatialReference;
1055
+ }
1056
+
1057
+ export interface ExternalReferencePolygon {
1058
+ hasM?: boolean;
1059
+ hasZ?: boolean;
1060
+ rings?: number[][][];
1061
+ curveRings?: number[][][];
1062
+ spatialReference?: ExternalReferenceSpatialReference;
1063
+ }
1064
+
1065
+ export interface ExternalReferenceEnvelope {
1066
+ mmax?: number;
1067
+ mmin?: number;
1068
+ xmax?: number;
1069
+ xmin?: number;
1070
+ ymax?: number;
1071
+ ymin?: number;
1072
+ zmax?: number;
1073
+ zmin?: number;
1074
+ spatialReference?: ExternalReferenceSpatialReference;
1075
+ }
1076
+
1077
+ export interface ExternalReferenceSpatialReference {
1078
+ wkid?: number;
1079
+ latestWkid?: number;
1080
+ vcsWkid?: number;
1081
+ latestVcsWkid?: number;
1082
+ }
1083
+
1084
+ export type ExternalReferenceGeometry =
1085
+ | ExternalReferencePoint
1086
+ | ExternalReferencePolyline
1087
+ | ExternalReferencePolygon
1088
+ | ExternalReferenceEnvelope;
1089
+ }
1090
+
1091
+ ${k}
1092
+ export type EventHandlerCallback = (selectionResult: SelectionResultType) => void;
1093
+ ${k}
1094
+ export type On = (eventName: string, eventHandler: EventHandlerCallback) => IHandle;
1095
+ }`;
1096
+ let B, D, z, W, O = "", U = "", q = "", te = "";
1097
+ function mt(e, t) {
1098
+ z = void 0, W = void 0, U = e.path, q = "", te = "";
1099
+ const i = `import("./${U}.js")`;
1100
+ let n = "";
1101
+ const s = e.exports?.[0]?.declaration.name, a = h(e);
1102
+ if (a.constructorPropertiesInterface !== void 0) {
1103
+ const o = a.constructorPropertiesInterface;
1104
+ ue(o), w.length !== 0 && (n += pe(o, U, o.name, t));
1105
+ }
1106
+ let r;
1107
+ for (let o = 0; o < e.declarations.length; ++o) {
1108
+ const l = e.declarations[o];
1109
+ if (ue(l), w.length === 0)
1110
+ continue;
1111
+ const c = l.name === s, d = c ? "default" : l.name, m = l.kind === "function", f = l.kind === "variable";
1112
+ if (m || f) {
1113
+ if (m) {
1114
+ if (l.name === r)
1115
+ continue;
1116
+ if (r = l.name, c) {
1117
+ w.length !== 1 && t.emitError("Expected only a single @esriCompatibilityName tag on a default export function.", {
1118
+ file: h(e).file,
1119
+ node: void 0
1120
+ }), Z(w[0], t), D === void 0 && t.emitError("Expected default export @esriCompatibilityName tag to include a #", {
1121
+ file: h(e).file,
1122
+ node: void 0
1123
+ }), n += ` ${k}
1124
+ interface ${D} {
1125
+ ${l.name}: typeof ${i}.${d};
1126
+ }
1127
+
1128
+ const __${D}Mapped: ${D};
1129
+ export const ${D}: typeof __${D}Mapped.${l.name};
1130
+
1131
+ `;
1132
+ continue;
1133
+ }
1134
+ } else if (f && c) {
1135
+ w.length !== 1 && t.emitError("Expected only a single @esriCompatibilityName tag on a default export variable.", {
1136
+ file: h(e).file,
1137
+ node: void 0
1138
+ }), Z(w[0], t), (D !== void 0 || B !== void 0) && t.emitError("Expected default export @esriCompatibilityName tag to not include a # or .", {
1139
+ file: h(e).file,
1140
+ node: void 0
1141
+ }), n += ` export const ${O}: typeof ${i}.default;
1142
+
1143
+ `;
1144
+ continue;
1145
+ }
1146
+ for (let p = 0; p < w.length; ++p)
1147
+ Z(w[p], t), f && z !== void 0 ? q += ` export const ${O}: ${i}.${d};
1148
+ ` : te += ` ${O}: typeof ${i}.${d};
1149
+ `;
1150
+ } else if (l.kind === "class" || l.kind === "mixin" || l.kind === "interface" && Q(l).isMixinBaseClass === !0) {
1151
+ const p = ie(K(l.typeParameters, !1, U)), g = ie(K(l.typeParameters, !1, void 0)), u = ie(K(l.typeParameters, !0, void 0)), v = ` ${i}.${d}`;
1152
+ for (let C = 0; C < w.length; ++C) {
1153
+ if (Z(w[C], t), O.startsWith("$")) {
1154
+ const M = O.slice(1);
1155
+ n += pt(M, l, d, U);
1156
+ continue;
1157
+ }
1158
+ const y = B === void 0 ? " " : " ";
1159
+ n += `${y}${k}
1160
+ ${y}export type ${O}${p} =${v}${g};
1161
+ ${y}export const ${O}: typeof${v}${u};
1162
+
1163
+ `;
1164
+ }
1165
+ } else l.kind === "interface" && (n += pe(l, U, d, t));
1166
+ }
1167
+ return q.length > 0 && (z === void 0 && t.emitError("Invalid @esriCompatibilityName usage: Namespace name was not set correctly.", {
1168
+ file: h(e).file,
1169
+ node: void 0
1170
+ }), n += ` ${k}
1171
+ namespace ${z} {
1172
+ ${q.slice(0, -1)} }
1173
+
1174
+ `), te.length > 0 && (W === void 0 && t.emitError(
1175
+ "Invalid @esriCompatibilityName usage: Classdec module interface name was not set correctly.",
1176
+ {
1177
+ file: h(e).file,
1178
+ node: void 0
1179
+ }
1180
+ ), n += ` ${k}
1181
+ interface ${W} {
1182
+ ${te} }
1183
+
1184
+ export const ${W}: ${W};
1185
+
1186
+ `), n;
1187
+ }
1188
+ function pe(e, t, i, n) {
1189
+ const s = ie(K(e.typeParameters, !1, void 0)), a = K(e.typeParameters, !1, t), r = `import("./${t}.js").${i}${s}`;
1190
+ let o = "";
1191
+ for (let l = 0; l < w.length; ++l) {
1192
+ Z(w[l], n);
1193
+ const c = ot(O, a, void 0, r);
1194
+ B === void 0 ? o += ` ${k}
1195
+ ${c}
1196
+ ` : q += ` ${k}
1197
+ ${c}
1198
+
1199
+ `;
1200
+ }
1201
+ return o += `
1202
+ `, o;
1203
+ }
1204
+ function K(e, t, i) {
1205
+ if (e === void 0)
1206
+ return;
1207
+ const n = [];
1208
+ for (let s = 0; s < e.length; ++s) {
1209
+ const a = e[s];
1210
+ if (i !== void 0) {
1211
+ const r = a.constraint === void 0 ? void 0 : le(a.constraint, i), o = a.default === void 0 ? r ?? {
1212
+ text: "any",
1213
+ references: void 0,
1214
+ values: void 0,
1215
+ source: void 0
1216
+ } : le(a.default, i);
1217
+ n.push({
1218
+ ...a,
1219
+ default: o,
1220
+ constraint: r
1221
+ });
1222
+ } else if (t) {
1223
+ if (a.default !== void 0)
1224
+ break;
1225
+ n.push({
1226
+ name: "any",
1227
+ constraint: void 0,
1228
+ default: void 0,
1229
+ const: void 0,
1230
+ in: void 0,
1231
+ out: void 0
1232
+ });
1233
+ } else
1234
+ n.push({
1235
+ name: a.name,
1236
+ constraint: void 0,
1237
+ default: void 0,
1238
+ const: void 0,
1239
+ in: void 0,
1240
+ out: void 0
1241
+ });
1242
+ }
1243
+ return n.length === 0 ? void 0 : n;
1244
+ }
1245
+ const ne = [];
1246
+ let w = ne;
1247
+ function ue(e) {
1248
+ e.kind === "variable" ? w = _e(e).esriCompatibilityNames ?? ne : e.kind === "function" ? w = Ke(e).esriCompatibilityNames ?? ne : w = Q(e).esriCompatibilityNames ?? ne;
1249
+ }
1250
+ function Z(e, t) {
1251
+ const i = e.indexOf(".");
1252
+ if (i !== -1) {
1253
+ B = e.slice(0, i), D = void 0, O = e.slice(i + 1), z === void 0 ? z = B : z !== B && t.emitError(
1254
+ `Invalid @esriCompatibilityName usage: Multiple different namespaces in a single file are not supported. Found ${z} and ${B}`,
1255
+ {
1256
+ file: void 0,
1257
+ scope: U,
1258
+ node: void 0
1259
+ }
1260
+ );
1261
+ return;
1262
+ }
1263
+ const n = e.indexOf("#");
1264
+ if (n !== -1) {
1265
+ B = void 0, D = e.slice(0, n), O = e.slice(n + 1), W === void 0 ? W = D : W !== D && t.emitError(
1266
+ `Invalid @esriCompatibilityName usage: Multiple different __esri interfaces in a single file are not supported. Found ${W} and ${D}`,
1267
+ {
1268
+ file: void 0,
1269
+ scope: U,
1270
+ node: void 0
1271
+ }
1272
+ );
1273
+ return;
1274
+ }
1275
+ B = void 0, D = void 0, O = e;
1276
+ }
1277
+ function pt(e, t, i, n) {
1278
+ const s = ut(e, t.events), r = `${// IdentityManager fake class got renamed to IdentityManagerBase real class
1279
+ t.name.startsWith(w[0]) ? w[0] : t.name}${Ze(e)}Event`, o = yt(s, n) ?? ` = import("./${n}.js").${i}["@eventTypes"]["${e}"]`, l = o.startsWith("<") ? o.indexOf(">") + 1 : -1, c = l !== -1 ? o.slice(0, l) : "";
1280
+ return ` ${k}
1281
+ export type ${r}${o};
1282
+ ${k}
1283
+ export type ${r}Handler${c} = (event: ${r}${c}) => void;
1284
+
1285
+ `;
1286
+ }
1287
+ function ut(e, t) {
1288
+ if (t !== void 0)
1289
+ for (let i = 0; i < t.length; ++i) {
1290
+ const n = t[i];
1291
+ if (n.name === e)
1292
+ return n;
1293
+ }
1294
+ }
1295
+ function yt(e, t) {
1296
+ const i = e?.type;
1297
+ if (t = e?.inheritedFrom?.module ?? t, i?.references?.length === 1) {
1298
+ const a = i.references[0];
1299
+ if (a.package === void 0 && a.viewUrl !== void 0 && i.text === a.name)
1300
+ return ` = import("./${a.module ?? t}.js").${a.name}`;
1301
+ }
1302
+ if (i?.references?.length !== 2)
1303
+ return;
1304
+ const n = i.references[0], s = i.references[1];
1305
+ if (!(n.package !== void 0 || s.package !== void 0 || s.module !== void 0 || s.viewUrl !== void 0) && i.text === `${n.name}<${s.name}>`)
1306
+ return t = n.module ?? t, `<${s.name}> = import("./${t}.js").${n.name}<${s.name}>`;
1307
+ }
1308
+ function ht(e, t) {
1309
+ let i = dt;
1310
+ for (let n = 0; n < e.length; ++n) {
1311
+ const s = e[n];
1312
+ i += mt(s, t);
1313
+ }
1314
+ return i + ft;
1315
+ }
1316
+ function gt(e, t, i) {
1317
+ let n = "";
1318
+ const s = t.importsMap, a = /* @__PURE__ */ Object.create(null);
1319
+ for (const r in s) {
1320
+ const o = s[r];
1321
+ if (!o.wasUsed)
1322
+ continue;
1323
+ let l = o.specifier;
1324
+ if (o.replacementName !== void 0) {
1325
+ const d = s[o.replacementName];
1326
+ if (d?.wasUsed === !0) {
1327
+ d.specifier !== o.specifier && i.emitError(
1328
+ `Failed to perform type replacement of ${r} with ${o.replacementName} because ${o.replacementName} is already imported from ${d.modulePath}, where as type replacement was going to import it from ${o.modulePath}. Either manually replace ${o.replacementName} usage with ${r} or alias ${r} to another name.`,
1329
+ {
1330
+ file: t.file,
1331
+ node: void 0
1332
+ }
1333
+ );
1334
+ continue;
1335
+ }
1336
+ }
1337
+ const c = o.replacementName ?? r;
1338
+ if (o.type === "named") {
1339
+ if (o.modulePath !== void 0) {
1340
+ const f = o.actualName ?? c, p = i.moduleMap.get(o.modulePath), g = p === void 0 ? void 0 : h(p);
1341
+ if (g?.index.named[f] === void 0) {
1342
+ if (i.privateMixinModuleNames.has(o.modulePath))
1343
+ continue;
1344
+ i.emitError(
1345
+ `The ${x.red(f)} imported from ${x.red(p?.sourcePath ?? o.modulePath)} is not @public but used in the type of a @public declaration. Add /** @public */ JSDoc, refactor out the usage, or ensure ${x.red(f)} is not a re-export, not a namespace, and not an enum.`,
1346
+ {
1347
+ file: t.file,
1348
+ node: void 0
1349
+ }
1350
+ );
1351
+ } else
1352
+ l = re(g, t);
1353
+ }
1354
+ const d = a[l], m = o.actualName === void 0 ? c : `${o.actualName} as ${c}`;
1355
+ a[l] = d === void 0 ? m : `${d}, ${m}`;
1356
+ } else if (o.type === "default") {
1357
+ if (o.modulePath !== void 0) {
1358
+ const d = i.moduleMap.get(o.modulePath), m = d === void 0 ? void 0 : h(d);
1359
+ m?.index.default === void 0 ? i.emitError(
1360
+ `The default exported declaration in ${x.red(d?.sourcePath ?? o.modulePath)} is not @public but used in the type of a @public declaration. Add /** @public */ JSDoc or refactor out the usage.`,
1361
+ {
1362
+ file: t.file,
1363
+ node: void 0
1364
+ }
1365
+ ) : l = re(m, t);
1366
+ }
1367
+ n += `import type ${c} from "${l}";
1368
+ `;
1369
+ } else {
1370
+ if (o.modulePath !== void 0) {
1371
+ const d = i.moduleMap.get(o.modulePath);
1372
+ d === void 0 ? i.emitError(
1373
+ `Non-public module was imported: ${x.red(o.modulePath)} and used in the type of a public declaration. Ensure the imported module has at least one /** @public */ declaration or refactor out the usage.`,
1374
+ {
1375
+ file: t.file,
1376
+ node: void 0
1377
+ }
1378
+ ) : l = re(h(d), t);
1379
+ }
1380
+ c === "__esri" ? n = `/// <reference types="@arcgis/core/interfaces.d.ts" />
1381
+ ${n}` : n += `import type * as ${c} from "${l}";
1382
+ `;
1383
+ }
1384
+ if (o.modulePath !== void 0 && i.watchFiles !== void 0) {
1385
+ const d = i.moduleMap.get(o.modulePath), f = (d === void 0 ? void 0 : h(d))?.file.fileName.slice(i.config.context.cwd.length);
1386
+ f !== void 0 && (i.watchFiles.get(e.sourcePath).dependencies.add(f), i.watchFiles.get(f).dependents.set(e.sourcePath, !0));
1387
+ }
1388
+ }
1389
+ if (i.produceDts) {
1390
+ for (const r in a) {
1391
+ const o = a[r];
1392
+ n += `import type { ${o} } from "${r}";
1393
+ `;
1394
+ }
1395
+ t.importsText = n;
1396
+ }
1397
+ }
1398
+ function re(e, t) {
1399
+ return `${be(t.dtsPath, e.dtsPath)}.js`;
1400
+ }
1401
+ function vt(e, t, i, n) {
1402
+ const s = e.references;
1403
+ if (s !== void 0) {
1404
+ if (t.autoCastingRequiresType === void 0 && s.length > 1 && s[0].module === "core/Collection")
1405
+ if (s.length > 2)
1406
+ t.autoCastingRequiresType = !0;
1407
+ else {
1408
+ const a = s[1], r = a.module === void 0 ? i : n.moduleMap.get(a.module), o = r === void 0 ? void 0 : h(r), l = a.name === "default" ? o?.index.default : o?.index.named[a.name];
1409
+ $e(l) && (t.autoCastingRequiresType = !0);
1410
+ }
1411
+ return ke(e, t, n, i, s);
1412
+ }
1413
+ }
1414
+ function ke(e, t, i, n, s) {
1415
+ for (let a = s.length - 1; a >= 0; a--) {
1416
+ const r = s[a];
1417
+ if (r.package !== void 0) {
1418
+ r.package === Pe && r.name === "Date" && ye(
1419
+ e,
1420
+ s,
1421
+ a,
1422
+ { type: Mt, inheritedFrom: void 0 },
1423
+ i,
1424
+ n,
1425
+ t
1426
+ );
1427
+ continue;
1428
+ }
1429
+ const o = r.module === void 0 ? n : i.moduleMap.get(r.module), l = o === void 0 ? void 0 : h(o), c = r.name === "default" ? l?.index.default : l?.index.named[r.name];
1430
+ if ($e(c)) {
1431
+ const m = `(${c.type.text})`, f = e.text;
1432
+ e.text = `${e.text.slice(0, r.start)}${m}${e.text.slice(r.end)}`;
1433
+ const p = e.text, g = r.start + 1, u = [];
1434
+ for (let C = 0; C < c.type.references.length; ++C) {
1435
+ const y = c.type.references[C], M = y.module ?? o?.path, b = M === n.path;
1436
+ u.push({
1437
+ ...y,
1438
+ module: b ? void 0 : M,
1439
+ start: y.start + g,
1440
+ end: y.end + g
1441
+ });
1442
+ }
1443
+ if (ke(e, t, i, n, u), e.text === p) {
1444
+ e.text = f;
1445
+ continue;
1446
+ }
1447
+ s.splice(a, 1, ...u);
1448
+ const v = e.text.length - f.length;
1449
+ Me(s, v, a + u.length);
1450
+ continue;
1451
+ }
1452
+ if (c?.kind !== "class")
1453
+ continue;
1454
+ const d = Ee(c, o, void 0, i);
1455
+ if (d === void 0) {
1456
+ i.emitError(
1457
+ `Failed to resolve auto-castable type for ${x.red(c.name)} from ${x.red(o.sourcePath)}. Ensure the class either has a public constructor or a public ${x.green(c.name)}Properties interface. Auto-casting resolution was attempted because this class is used in an autocastable property in ${x.blue(
1458
+ n.sourcePath
1459
+ )} in type ${x.blue(e.text)}.`,
1460
+ {
1461
+ file: h(o).file,
1462
+ node: void 0
1463
+ }
1464
+ );
1465
+ continue;
1466
+ }
1467
+ ye(
1468
+ e,
1469
+ s,
1470
+ a,
1471
+ d,
1472
+ i,
1473
+ n,
1474
+ t
1475
+ );
1476
+ }
1477
+ }
1478
+ function Ee(e, t, i, n) {
1479
+ const s = h(t), a = s.constructorAutoCastType;
1480
+ if (a !== void 0)
1481
+ return a;
1482
+ const r = Ct(e, t, i, n);
1483
+ return r !== void 0 && (s.constructorAutoCastType = r), r;
1484
+ }
1485
+ function Ct(e, t, i, n) {
1486
+ if (e.members !== void 0)
1487
+ for (let r = 0; r < e.members.length; ++r) {
1488
+ const o = e.members[r];
1489
+ if (o.kind === "constructor" && // Use the last constructor for auto-casting signature
1490
+ // Examples: Point, MeshTexture
1491
+ e.members[r + 1]?.kind !== "constructor" && // Only consider the single-parameter signature
1492
+ o.parameters?.length === 1 && // To avoid false positives, constructors without type references are not
1493
+ // considered autocastable. This excludes core/Accessor#constructor's any[].
1494
+ o.parameters[0].type?.references !== void 0)
1495
+ return {
1496
+ type: o.parameters[0].type,
1497
+ inheritedFrom: i?.path
1498
+ };
1499
+ }
1500
+ const a = h(t).constructorPropertiesInterface;
1501
+ if (a !== void 0)
1502
+ return { type: {
1503
+ text: a.name,
1504
+ references: [
1505
+ {
1506
+ name: a.name,
1507
+ module: t.path,
1508
+ package: void 0,
1509
+ viewUrl: Ve(t.path, a.name, void 0, n),
1510
+ start: 0,
1511
+ end: a.name.length
1512
+ }
1513
+ ],
1514
+ values: void 0,
1515
+ source: void 0
1516
+ }, inheritedFrom: i?.path };
1517
+ if (e.superclass !== void 0) {
1518
+ const r = e.superclass.module === void 0 ? t : n.moduleMap.get(e.superclass.module), c = (r === void 0 ? void 0 : h(r))?.index?.class;
1519
+ if (c !== void 0)
1520
+ return Ee(c, r, r, n);
1521
+ }
1522
+ }
1523
+ function ye(e, t, i, { type: n, inheritedFrom: s }, a, r, o) {
1524
+ let l = n.references;
1525
+ l.length === 2 && l[0].name === "ReadonlyArrayOrCollection" && l[1].name === "T" && (l = [l[0]], n = {
1526
+ ...n,
1527
+ text: "ReadonlyArrayOrCollection",
1528
+ references: l
1529
+ });
1530
+ let c = n.text;
1531
+ const d = t[i], m = n.text.length - (d.end - d.start);
1532
+ let f = 0;
1533
+ t.splice(i, 1);
1534
+ for (let p = l.length - 1; p >= 0; p--) {
1535
+ const g = l[p], u = n.text.slice(g.start, g.end);
1536
+ if (u !== g.name && g.name !== "default") {
1537
+ a.emitError(
1538
+ `Unsupported case: cannot yet handle auto-adding imports for renamed references. Tried to add ${g.name} as ${u} from ${g.module} when resolving auto-casting type.`,
1539
+ {
1540
+ file: h(r).file,
1541
+ node: void 0
1542
+ }
1543
+ );
1544
+ continue;
1545
+ }
1546
+ const v = g.module ?? s ?? d.module, C = (v === void 0 ? void 0 : a.moduleMap.get(v)) ?? r, y = h(C);
1547
+ if (g.module === void 0 && g.package === void 0 && g.viewUrl === void 0) {
1548
+ a.emitError(
1549
+ `Unsupported case: auto-casting type for ${C.sourcePath} uses a type parameter. Failed to automatically turn \`${e.text}\` into an auto-castable type. Refactor out the type parameter, or submit API Extractor feature request to support this case.`,
1550
+ {
1551
+ file: h(r).file,
1552
+ node: void 0
1553
+ }
1554
+ );
1555
+ continue;
1556
+ }
1557
+ Te(g, C, a, r);
1558
+ const b = d.start, I = {
1559
+ ...g,
1560
+ start: g.start + b + f,
1561
+ end: g.end + b + f
1562
+ }, P = y.typeName;
1563
+ if (l.length === 1 && o.autoCastingRequiresType === !0 && P !== void 0) {
1564
+ const L = o.autoCastingDefaultType === P, S = `(${u} & { type${L ? "?" : ""}: "${P}" })`, F = S.length - u.length;
1565
+ f += F, I.end += F, c = c.slice(0, g.start) + S + c.slice(g.end);
1566
+ }
1567
+ t.splice(i, 0, I);
1568
+ }
1569
+ return e.text = e.text.slice(0, d.start) + c + e.text.slice(d.end), Me(
1570
+ t,
1571
+ m + f,
1572
+ i + (l?.length ?? 0)
1573
+ ), !0;
1574
+ }
1575
+ function Te(e, t, i, n) {
1576
+ const s = h(n);
1577
+ if (e.package !== void 0) {
1578
+ if (e.package === Pe)
1579
+ return;
1580
+ i.emitError(
1581
+ `Unsupported case: cannot yet handle auto-adding imports for external packages. Tried to add ${e.name} from ${e.package} when resolving auto-casting type.`,
1582
+ {
1583
+ file: s.file,
1584
+ node: void 0
1585
+ }
1586
+ );
1587
+ }
1588
+ if (t === n)
1589
+ return;
1590
+ const a = h(t), r = e.name === "default" ? a.index.default?.name : e.name;
1591
+ if (r === void 0) {
1592
+ i.emitError(
1593
+ `Failed to resolve the name of the default import from module ${t.sourcePath} when adding auto-casting import for ${e.name}.`,
1594
+ {
1595
+ file: s.file,
1596
+ node: void 0
1597
+ }
1598
+ );
1599
+ return;
1600
+ }
1601
+ let o = r, l;
1602
+ const c = e;
1603
+ c.printableText !== void 0 && (o = c.printableText, l = r);
1604
+ const d = s.importsMap[o];
1605
+ d === void 0 ? s.importsMap[o] = {
1606
+ type: e.name === "default" ? "default" : "named",
1607
+ modulePath: t.path,
1608
+ specifier: be(s.dtsPath, a.dtsPath),
1609
+ replacementName: void 0,
1610
+ actualName: l,
1611
+ wasUsed: !0
1612
+ } : d.modulePath !== t.path ? i.emitError(
1613
+ `API Extractor tried to add an import for ${e.name} from ${t.sourcePath}, but current module already imports ${e.name} from ${d.modulePath}. Please rename one of the types or use import alias to avoid the conflict`,
1614
+ {
1615
+ file: s.file,
1616
+ node: void 0
1617
+ }
1618
+ ) : d.wasUsed = !0;
1619
+ }
1620
+ function $e(e) {
1621
+ return e?.kind === "interface" && e.members === void 0 && e.supertypes === void 0 && e.type?.references !== void 0 && e.type.references.length > 1 && e.typeParameters === void 0 && bt(e.type);
1622
+ }
1623
+ function bt(e) {
1624
+ let t = 0;
1625
+ for (let i = 0; i < e.references.length; ++i) {
1626
+ const n = e.references[i], s = e.text.slice(t, n.start).trim();
1627
+ if (s !== "" && s !== "|")
1628
+ return !1;
1629
+ t = n.end;
1630
+ }
1631
+ return t === e.text.length;
1632
+ }
1633
+ const Mt = {
1634
+ // Wrap in parents to correctly substitute Date[] in TimeInfo.stops
1635
+ text: "(Date | number | string)",
1636
+ references: [
1637
+ {
1638
+ name: "Date",
1639
+ module: void 0,
1640
+ package: "global:",
1641
+ viewUrl: "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date",
1642
+ start: 1,
1643
+ end: 5
1644
+ }
1645
+ ],
1646
+ values: void 0,
1647
+ source: void 0
1648
+ };
1649
+ function xt(e, t) {
1650
+ const i = e.constructorPropertiesInterface;
1651
+ i.type = void 0;
1652
+ const n = Q(i), s = h(t.apiModule).index.class;
1653
+ if (i.typeParameters = s.typeParameters, s.superclass !== void 0) {
1654
+ const r = he(
1655
+ s.superclass,
1656
+ t,
1657
+ Q(s).superClassText
1658
+ );
1659
+ r !== void 0 && (n.superTypesText = [r.printableText ?? r.name]);
1660
+ }
1661
+ if (s.mixins !== void 0)
1662
+ for (let r = 0; r < s.mixins.length; ++r) {
1663
+ const o = s.mixins[r], l = he(
1664
+ o,
1665
+ t,
1666
+ o.printableText
1667
+ );
1668
+ l !== void 0 && (n.superTypesText ??= [], n.superTypesText.push(l.printableText ?? l.name));
1669
+ }
1670
+ let a = "";
1671
+ if (s.members !== void 0)
1672
+ for (let r = 0; r < s.members.length; ++r) {
1673
+ const o = s.members[r];
1674
+ if (o.kind !== "field" || o.inheritedFrom !== void 0 || o.static !== void 0)
1675
+ continue;
1676
+ const l = oe(o);
1677
+ if (l.isAbstract)
1678
+ continue;
1679
+ let c = e.constructorOnlySetters?.[o.name];
1680
+ if (c === void 0) {
1681
+ if (o.readonly !== void 0)
1682
+ continue;
1683
+ if (o.getterType === void 0 && l.isOverride === void 0) {
1684
+ a += `${a.length === 0 ? "" : " | "}"${o.name}"`;
1685
+ continue;
1686
+ } else
1687
+ c = o.type, c.text.includes(" | undefined") || (c = { ...c, text: `${c.text} | undefined` });
1688
+ } else c.text.includes(" | undefined") || (c.text += " | undefined");
1689
+ const d = {
1690
+ isAbstract: void 0,
1691
+ isAccessor: void 0,
1692
+ hasAutoCasting: void 0,
1693
+ autoCastingRequiresType: void 0,
1694
+ autoCastingDefaultType: void 0,
1695
+ isConstructorOnly: void 0,
1696
+ isOverride: void 0,
1697
+ dtsTypeOverride: void 0
1698
+ }, m = o, f = {
1699
+ [Qe]: d,
1700
+ kind: "field",
1701
+ name: m.name,
1702
+ static: void 0,
1703
+ deprecated: m.deprecated,
1704
+ summary: void 0,
1705
+ description: m.description,
1706
+ docsTags: m.docsTags,
1707
+ type: c,
1708
+ getterType: void 0,
1709
+ default: m.default,
1710
+ readonly: void 0,
1711
+ inheritedFrom: void 0,
1712
+ privacy: m.privacy,
1713
+ source: void 0,
1714
+ attribute: void 0,
1715
+ reflects: void 0,
1716
+ docsOnlyReadonly: void 0
1717
+ };
1718
+ i.members ??= [], i.members.push(f);
1719
+ }
1720
+ if (a.length > 0) {
1721
+ n.superTypesText ??= [];
1722
+ let r = `Partial<Pick<${s.name}`;
1723
+ if (i.typeParameters !== void 0) {
1724
+ r += "<";
1725
+ for (let o = 0; o < i.typeParameters.length; ++o) {
1726
+ const l = i.typeParameters[o];
1727
+ r += l.name, o < i.typeParameters.length - 1 && (r += ", ");
1728
+ }
1729
+ r += ">";
1730
+ }
1731
+ r += `, ${a}>>`, n.superTypesText.push(r);
1732
+ }
1733
+ }
1734
+ function he(e, t, i) {
1735
+ if (e.package !== void 0)
1736
+ return;
1737
+ const n = t.moduleMap.get(e.module);
1738
+ if (n === void 0)
1739
+ return;
1740
+ const s = h(n), a = s.constructorPropertiesInterface;
1741
+ if (a === void 0) {
1742
+ const o = s.inheritance;
1743
+ if (typeof o == "object" && o.hasSettableField) {
1744
+ const l = e.name === "default" ? s.index.class?.name ?? e.name : e.name;
1745
+ t.emitError(
1746
+ `This file must have a @public ${x.green(`${l}Properties`)} interface because it contains a public class that has non-readonly public properties and it is being extended by ${t.apiModule.sourcePath}.`,
1747
+ { file: h(t.apiModule).file, node: void 0 }
1748
+ ), o.hasSettableField = !1;
1749
+ }
1750
+ return;
1751
+ }
1752
+ const r = {
1753
+ name: a.name,
1754
+ module: e.module,
1755
+ package: e.package,
1756
+ viewUrl: e.viewUrl,
1757
+ typeArguments: void 0,
1758
+ /**
1759
+ * If class was renamed when imported, also rename the created Properties
1760
+ * interface. This avoids name collision inside of
1761
+ * views/3d/environment/SunLighting as it imports webscene/SunLighting.
1762
+ * apiReference.name !== class.name for references to mixin base classes.
1763
+ */
1764
+ printableText: i === e.name ? void 0 : Pt(i, s.index.class.name)
1765
+ };
1766
+ return Te(r, n, t, t.apiModule), r;
1767
+ }
1768
+ function Pt(e, t) {
1769
+ if (e === void 0 || e === t)
1770
+ return;
1771
+ const i = e.indexOf("<");
1772
+ if (e = i === -1 ? e : e.slice(0, i), e !== t)
1773
+ return `${e}Properties`;
1774
+ }
1775
+ function It(e) {
1776
+ if (e.customElement === void 0)
1777
+ return;
1778
+ const t = e, i = [];
1779
+ for (let n = 0; n < t.members.length; ++n) {
1780
+ const s = t.members[n];
1781
+ if (s.kind !== "field" || s.attribute === void 0 || s.privacy !== void 0)
1782
+ continue;
1783
+ const a = s.type.values?.filter(
1784
+ (r) => r.type === "number" || r.type === "string" || r.type === "boolean"
1785
+ );
1786
+ i.push({
1787
+ name: s.attribute,
1788
+ summary: s.summary,
1789
+ description: s.description,
1790
+ inheritedFrom: s.inheritedFrom,
1791
+ type: a === void 0 || a.length === 0 ? s.type : {
1792
+ text: Ge(a),
1793
+ references: void 0,
1794
+ values: a,
1795
+ source: void 0
1796
+ },
1797
+ default: s.default,
1798
+ fieldName: s.name,
1799
+ deprecated: s.deprecated
1800
+ });
1801
+ }
1802
+ i.length > 0 && (t.attributes = i);
1803
+ }
1804
+ const de = {
1805
+ /**
1806
+ * Don't inherit or inheritance resolution failed.
1807
+ */
1808
+ skip: 0,
1809
+ /**
1810
+ * We already inherited the members, but have not yet computed the inheritance
1811
+ * data for this module. Almost every class inherits some class, but only a
1812
+ * few are inherited by other classes, so we compute inheritance data lazily.
1813
+ */
1814
+ deferred: 1
1815
+ };
1816
+ function St(e, t, i, n) {
1817
+ const s = e;
1818
+ n.produceDts && (Q(t).eventTypesProperty = s);
1819
+ const a = h(i), r = `${t.name}Events`;
1820
+ if (s.type.text !== r && !s.type.text.startsWith(`${r}<`)) {
1821
+ if (s.type.text === "unknown")
1822
+ return;
1823
+ n.emitError(
1824
+ `The "@eventTypes" property must be of type named "${t.name}Events". Found ${x.red(s.type.text)}.`,
1825
+ {
1826
+ file: a.file,
1827
+ node: void 0
1828
+ }
1829
+ );
1830
+ return;
1831
+ }
1832
+ const o = a.index.named[r];
1833
+ if (o?.kind !== "interface") {
1834
+ n.emitError(
1835
+ `The "${r}" referenced by the "@eventTypes" property must be a @public interface and defined in the same file as the ${t.name} class.`,
1836
+ {
1837
+ file: a.file,
1838
+ node: void 0
1839
+ }
1840
+ );
1841
+ return;
1842
+ }
1843
+ t.events ??= [], Fe(o, t, i, void 0, n);
1844
+ }
1845
+ function Fe(e, t, i, n, s) {
1846
+ const a = n !== void 0;
1847
+ if (n ??= /* @__PURE__ */ new Set(), e.type !== void 0) {
1848
+ s.emitError(
1849
+ `For documentation purposes, event interface types need to be statically analyzable - include only properties & extends clauses. Found complex type in ${e.name}: ${e.type.text}`,
1850
+ {
1851
+ file: h(i).file,
1852
+ node: void 0
1853
+ }
1854
+ );
1855
+ return;
1856
+ }
1857
+ if (e.members !== void 0)
1858
+ for (let r = 0; r < e.members.length; ++r) {
1859
+ const o = e.members[r];
1860
+ if (o.kind !== "field") {
1861
+ s.emitError(
1862
+ `Event interfaces should only contain properties. Found ${et(o)} of kind ${x.red(o.kind)} in ${e.name}.`,
1863
+ {
1864
+ file: h(i).file,
1865
+ node: void 0
1866
+ }
1867
+ );
1868
+ continue;
1869
+ }
1870
+ n.has(o.name) || (n.add(o.name), t.events.push({
1871
+ name: o.name,
1872
+ deprecated: o.deprecated,
1873
+ summary: void 0,
1874
+ description: o.description,
1875
+ docsTags: o.docsTags,
1876
+ type: o.type,
1877
+ inheritedFrom: a ? {
1878
+ name: e.name,
1879
+ module: i.path,
1880
+ package: void 0,
1881
+ viewUrl: void 0
1882
+ } : void 0,
1883
+ privacy: void 0,
1884
+ bubbles: void 0,
1885
+ cancelable: void 0,
1886
+ composed: void 0
1887
+ }));
1888
+ }
1889
+ if (e.supertypes !== void 0)
1890
+ for (let r = 0; r < e.supertypes.length; ++r) {
1891
+ const o = e.supertypes[r], l = o.module === void 0 ? i : s.moduleMap.get(o.module), c = h(l).index.named[o.name];
1892
+ if (c?.kind !== "interface") {
1893
+ s.emitError(
1894
+ `Failed to find @public interface ${x.red(o.name)} (used by ${x.green(e.name)}).`,
1895
+ {
1896
+ file: h(i).file,
1897
+ node: void 0
1898
+ }
1899
+ );
1900
+ return;
1901
+ }
1902
+ Fe(c, t, l, n, s);
1903
+ }
1904
+ }
1905
+ function we(e, t, i) {
1906
+ const n = h(e);
1907
+ if (n.inheritance !== void 0)
1908
+ return;
1909
+ n.inheritance = de.deferred;
1910
+ let a = !1;
1911
+ if (t.members !== void 0)
1912
+ for (let m = 0; m < t.members.length; ++m) {
1913
+ const f = t.members[m];
1914
+ if (f.kind === "field") {
1915
+ if (f.name === "@eventTypes") {
1916
+ a = !0, St(f, t, e, i), t.members.splice(m, 1), m -= 1;
1917
+ continue;
1918
+ }
1919
+ f.inheritedFrom === void 0 && Et(f, e, i);
1920
+ }
1921
+ }
1922
+ const r = t;
1923
+ let o = t.mixins, l = r.superclass, c = l === void 0 ? void 0 : Ce(l, e, i);
1924
+ if (c?.supertypes !== void 0) {
1925
+ o = o === void 0 ? [] : [...o];
1926
+ do {
1927
+ const m = c.supertypes.length > 1, f = m ? 1 : 0;
1928
+ for (let p = c.supertypes.length - 1; p >= f; p--) {
1929
+ const g = c.supertypes[p], u = g.module === void 0 ? { ...g, module: l.module } : g;
1930
+ o.unshift(u);
1931
+ }
1932
+ l = m ? c.supertypes[0] : void 0, c = l === void 0 ? void 0 : Ce(l, e, i);
1933
+ } while (c?.supertypes !== void 0);
1934
+ }
1935
+ if (o !== void 0) {
1936
+ const m = o.length - (t.mixins?.length ?? 0);
1937
+ for (let f = o.length - 1; f >= 0; f--) {
1938
+ const p = o[f], g = ve(p.module ?? e.path, !0, i);
1939
+ typeof g == "object" ? ge(g, t, a, i) : f >= m && (t.mixins.splice(f - m, 1), t.mixins.length === 0 && (t.mixins = void 0));
1940
+ }
1941
+ }
1942
+ if (l?.package !== void 0)
1943
+ return;
1944
+ const d = l?.module;
1945
+ if (d !== void 0) {
1946
+ const m = ve(d, !1, i);
1947
+ typeof m == "object" && (m.declaration.privacy !== void 0 && t.privacy === void 0 && i.emitError(
1948
+ `Public component may only subclass a public component to avoid broken inheritance. Tried to inherit from private ${m.declaration.name}. Remove @private from it but feel free to add a jsdoc description stating the base class is abstract - not for direct consumption. Lumina does bare minimum extraction work for private components, which makes them ineligible for public docs.`,
1949
+ { file: n.file, node: void 0 }
1950
+ ), ge(m, t, a, i));
1951
+ }
1952
+ }
1953
+ function ge(e, t, i, n) {
1954
+ const s = e.declaration, a = t;
1955
+ if (e.indexedMembers !== void 0) {
1956
+ t.members ??= [];
1957
+ const r = t.members, o = n.config.documentation.noInheritMembers[e.inheritanceData.module];
1958
+ let l = o === void 0 ? void 0 : new Set(o);
1959
+ for (let d = 0; d < r.length; ++d) {
1960
+ const m = r[d], f = ce(m), p = e.indexedMembers[f];
1961
+ if (p === void 0)
1962
+ continue;
1963
+ if (l ??= /* @__PURE__ */ new Set(), l.add(f), m.kind === "field") {
1964
+ const u = oe(m);
1965
+ oe(p).isAccessor === !0 && (u.isAccessor = !0), u.isOverride = !0;
1966
+ }
1967
+ p !== void 0 && m.inheritedFrom === void 0 && Ie(p, m);
1968
+ }
1969
+ const c = s.members;
1970
+ for (let d = 0; d < c.length; ++d) {
1971
+ const m = c[d];
1972
+ // Most classes don't override any public members, so don't even check
1973
+ // for this if no members were overridden.
1974
+ (l?.has(ce(m)) ?? !1) || t.members.push(
1975
+ m.inheritedFrom === void 0 ? { ...m, inheritedFrom: e.inheritanceData } : m
1976
+ );
1977
+ }
1978
+ }
1979
+ !i && e.indexedEvents !== void 0 && (a.events = X(
1980
+ a.events,
1981
+ s.events,
1982
+ e.indexedEvents,
1983
+ e.inheritanceData
1984
+ )), e.indexedAttributes !== void 0 && (a.attributes = X(
1985
+ a.attributes,
1986
+ s.attributes,
1987
+ e.indexedAttributes,
1988
+ e.inheritanceData
1989
+ )), e.indexedSlots !== void 0 && (a.slots = X(
1990
+ a.slots,
1991
+ s.slots,
1992
+ e.indexedSlots
1993
+ )), e.indexedCssParts !== void 0 && (a.cssParts = X(
1994
+ a.cssParts,
1995
+ s.cssParts,
1996
+ e.indexedCssParts
1997
+ )), e.indexedCssProperties !== void 0 && (a.cssProperties = X(
1998
+ a.cssProperties,
1999
+ s.cssProperties,
2000
+ e.indexedCssProperties
2001
+ )), e.indexedCssStates !== void 0 && (a.cssStates = X(
2002
+ a.cssStates,
2003
+ s.cssStates,
2004
+ e.indexedCssStates
2005
+ ));
2006
+ }
2007
+ function X(e = [], t, i, n) {
2008
+ const s = /* @__PURE__ */ new Set();
2009
+ for (let a = 0; a < e.length; ++a) {
2010
+ const r = e[a], o = i[r.name];
2011
+ o !== void 0 && (s.add(r.name), r.inheritedFrom === void 0 && Ie(o, r));
2012
+ }
2013
+ for (let a = 0; a < t.length; ++a) {
2014
+ const r = t[a];
2015
+ s.has(r.name) || e.push(
2016
+ n === void 0 || r.inheritedFrom !== void 0 ? r : { ...r, inheritedFrom: n }
2017
+ );
2018
+ }
2019
+ return e;
2020
+ }
2021
+ function ve(e, t, i) {
2022
+ const n = i.moduleMap.get(e), s = kt(n, e, t, i), a = n === void 0 ? void 0 : h(n);
2023
+ if (s === !1 || n === void 0)
2024
+ return a !== void 0 ? a.inheritance = de.skip : t && i.privateMixinModuleNames.add(e), de.skip;
2025
+ const [r, o] = s, l = o;
2026
+ we(n, o, i);
2027
+ let c, d = !1;
2028
+ if (o.members !== void 0) {
2029
+ c = /* @__PURE__ */ Object.create(null);
2030
+ for (let f = 0; f < o.members.length; ++f) {
2031
+ const p = o.members[f], g = ce(p), v = c[g] !== void 0;
2032
+ c[g] = v ? void 0 : p, d ||= p.kind === "field" && p.readonly === void 0;
2033
+ }
2034
+ }
2035
+ const m = {
2036
+ inheritanceData: {
2037
+ name: o.name,
2038
+ module: r,
2039
+ package: void 0,
2040
+ viewUrl: void 0
2041
+ },
2042
+ declaration: o,
2043
+ hasSettableField: d,
2044
+ indexedMembers: c,
2045
+ indexedEvents: Y(o.events),
2046
+ indexedAttributes: Y(l.attributes),
2047
+ indexedSlots: Y(l.slots),
2048
+ indexedCssParts: Y(l.cssParts),
2049
+ indexedCssProperties: Y(l.cssProperties),
2050
+ indexedCssStates: Y(l.cssStates)
2051
+ };
2052
+ return a.inheritance = m, m;
2053
+ }
2054
+ function Y(e) {
2055
+ if (e === void 0)
2056
+ return;
2057
+ const t = /* @__PURE__ */ Object.create(null);
2058
+ for (let i = 0; i < e.length; ++i) {
2059
+ const n = e[i];
2060
+ t[n.name] = n;
2061
+ }
2062
+ return t;
2063
+ }
2064
+ function kt(e, t, i, n) {
2065
+ const s = e === void 0 ? void 0 : h(e), a = s?.index.class;
2066
+ return a === void 0 ? (i || n.emitError(
2067
+ `Failed to find @public class/custom element declaration in ${x.red(t)}. Referenced in the extends clause by ${x.blue(n.apiModule.sourcePath)}`,
2068
+ {
2069
+ file: s?.file,
2070
+ scope: s === void 0 ? t : void 0,
2071
+ node: void 0
2072
+ }
2073
+ ), !1) : [t, a];
2074
+ }
2075
+ function Ce(e, t, i) {
2076
+ if (e.package !== void 0)
2077
+ return;
2078
+ const n = e.module === void 0 ? t : i.moduleMap.get(e.module), s = n === void 0 ? void 0 : h(n), a = e.name === "default" ? s?.index.default : s?.index.named[e.name];
2079
+ if (a === void 0) {
2080
+ i.emitError(
2081
+ `Failed to find @public class/mixin/custom element declaration in ${x.red(n?.sourcePath ?? e.module ?? t.sourcePath)}. Referenced in the extends clause by ${x.blue(t.sourcePath)}.`,
2082
+ {
2083
+ file: s?.file,
2084
+ scope: n === void 0 ? t.path : void 0,
2085
+ node: void 0
2086
+ }
2087
+ );
2088
+ return;
2089
+ }
2090
+ return a.kind === "interface" ? a : void 0;
2091
+ }
2092
+ function Et(e, t, i) {
2093
+ const n = oe(e), s = h(t);
2094
+ n.hasAutoCasting === !0 && (vt(e.type, n, t, i), n.isConstructorOnly !== !0 && e.getterType?.text === e.type.text && (e.getterType = void 0)), n.isConstructorOnly === !0 && (s.constructorOnlySetters ??= {}, s.constructorOnlySetters[e.name] = e.type, e.type = e.getterType ?? e.type, e.getterType = void 0, e.readonly = !0);
2095
+ }
2096
+ function Tt(e, t, i) {
2097
+ if (!(i.watchFiles === void 0 || t.reExports === void 0))
2098
+ for (let n = 0; n < t.reExports.length; ++n) {
2099
+ const s = t.reExports[n];
2100
+ if (s.modulePath === void 0)
2101
+ continue;
2102
+ const a = i.moduleMap.get(s.modulePath), o = (a === void 0 ? void 0 : h(a))?.file.fileName.slice(i.config.context.cwd.length);
2103
+ o !== void 0 && (i.watchFiles.get(e.sourcePath).dependencies.add(o), i.watchFiles.get(o).dependents.set(e.sourcePath, !0));
2104
+ }
2105
+ }
2106
+ function $t(e, t) {
2107
+ e.sort(tt), Ft(e, t), t.isComponentProject && De(e, t);
2108
+ }
2109
+ function Ft(e, t) {
2110
+ for (let i = 0; i < e.length; ++i) {
2111
+ const n = e[i];
2112
+ if (!h(n).isStale)
2113
+ continue;
2114
+ t.apiModule = n;
2115
+ const a = n.deprecated !== void 0;
2116
+ for (let r = 0; r < n.declarations.length; ++r) {
2117
+ const o = n.declarations[r];
2118
+ a && o.deprecated === void 0 && t.emitError(
2119
+ `If module is marked as @deprecated, all its declarations must be too. Found non-deprecated ${o.name}`,
2120
+ {
2121
+ file: h(n).file,
2122
+ node: void 0
2123
+ }
2124
+ ), "members" in o && o.kind !== "interface" && (we(n, o, t), o.events?.sort(it));
2125
+ }
2126
+ }
2127
+ for (let i = 0; i < e.length; ++i) {
2128
+ const n = e[i], s = h(n);
2129
+ if (!s.isStale) {
2130
+ const a = t.watchFiles?.get(n.sourcePath);
2131
+ if (a?.hasDirtyLinks === !0) {
2132
+ t.apiModule = n;
2133
+ for (let r = 0; r < a.docLinks.length; ++r) {
2134
+ const o = a.docLinks[r];
2135
+ t.resolveJsDocLink(`{@link ${o}}`, o);
2136
+ }
2137
+ a.hasDirtyLinks = !1;
2138
+ }
2139
+ continue;
2140
+ }
2141
+ t.apiModule = n, t.inheritedModuleName = void 0, n.deprecated = ee(n.deprecated, t), n.description = G(n.description, t), V(n.docsTags, t);
2142
+ for (let a = 0; a < n.declarations.length; ++a) {
2143
+ const r = n.declarations[a];
2144
+ if (r.deprecated = ee(r.deprecated, t), r.description = G(r.description, t), V(r.docsTags, t), r.kind === "function") {
2145
+ if (r.parameters !== void 0)
2146
+ for (let l = 0; l < r.parameters.length; ++l) {
2147
+ const c = r.parameters[l];
2148
+ c.description = G(c.description, t), V(c.docsTags, t);
2149
+ }
2150
+ r.return !== void 0 && (r.return.description = G(r.return.description, t));
2151
+ }
2152
+ const o = r;
2153
+ if (o.members !== void 0) {
2154
+ for (let c = 0; c < o.members.length; ++c) {
2155
+ const d = o.members[c], m = d.inheritedFrom, f = m !== void 0;
2156
+ if (t.inheritedModuleName = m?.module, d.deprecated = ee(d.deprecated, t), d.description = G(d.description, t), V(d.docsTags, t), !f && d.kind !== "field") {
2157
+ if (d.parameters !== void 0)
2158
+ for (let g = 0; g < d.parameters.length; ++g) {
2159
+ const u = d.parameters[g];
2160
+ u.description = G(u.description, t), V(u.docsTags, t);
2161
+ }
2162
+ const p = d;
2163
+ p.return !== void 0 && (p.return.description = G(p.return.description, t));
2164
+ }
2165
+ t.inheritedModuleName = void 0;
2166
+ }
2167
+ r.kind !== "interface" && o.members.sort(nt);
2168
+ const l = r;
2169
+ if (l.events !== void 0) {
2170
+ for (let c = 0; c < l.events.length; ++c) {
2171
+ const d = l.events[c];
2172
+ t.inheritedModuleName = d.inheritedFrom?.module, d.deprecated = ee(d.deprecated, t), d.description = G(d.description, t), V(d.docsTags, t);
2173
+ }
2174
+ t.inheritedModuleName = void 0;
2175
+ }
2176
+ if (t.config.context.isLuminaMinimalExtraction || It(o), l.slots !== void 0)
2177
+ for (let c = 0; c < l.slots.length; ++c) {
2178
+ const d = l.slots[c];
2179
+ d.description = G(d.description, t);
2180
+ }
2181
+ if (l.cssProperties !== void 0)
2182
+ for (let c = 0; c < l.cssProperties.length; ++c) {
2183
+ const d = l.cssProperties[c];
2184
+ d.description = G(d.description, t);
2185
+ }
2186
+ if (l.cssParts !== void 0)
2187
+ for (let c = 0; c < l.cssParts.length; ++c) {
2188
+ const d = l.cssParts[c];
2189
+ d.description = G(d.description, t);
2190
+ }
2191
+ if (l.cssStates !== void 0)
2192
+ for (let c = 0; c < l.cssStates.length; ++c) {
2193
+ const d = l.cssStates[c];
2194
+ d.description = G(d.description, t);
2195
+ }
2196
+ if (l.demos !== void 0)
2197
+ for (let c = 0; c < l.demos.length; ++c) {
2198
+ const d = l.demos[c];
2199
+ d.description = G(d.description, t);
2200
+ }
2201
+ } else r === s.constructorPropertiesInterface && (n.declarations.splice(a, 1), a -= 1);
2202
+ }
2203
+ s.constructorPropertiesInterface !== void 0 && xt(s, t), gt(n, s, t), Tt(n, s, t);
2204
+ }
2205
+ }
2206
+ const wt = async function() {
2207
+ if (this.isRunInProgress)
2208
+ throw Error(
2209
+ "The ApiExtractor.run() is already in progress, or previous run crashed with unrecoverable error. Await the previous run first or create a new ApiExtractor"
2210
+ );
2211
+ this.isRunInProgress = !0, this.errorCount = 0, this.silencedBrokenLinkCount = 0;
2212
+ const e = this.config;
2213
+ this.watchFiles === void 0 && (this.moduleMap = /* @__PURE__ */ new Map());
2214
+ const t = e.context.dtsEmitPath !== "", i = e.context.emptyDtsEmitPath && t ? (
2215
+ // This takes 80ms for JSAPI
2216
+ Le(e.context.dtsEmitPath)
2217
+ ) : void 0;
2218
+ if (e.types.typeCheckedExtraction || e.types.fullTypeCheck) {
2219
+ const o = _(), l = e.types.typeScriptConfig;
2220
+ if (this.watchFiles === void 0) {
2221
+ const c = E.createCompilerHost(l.config.options), d = E.createProgram({
2222
+ host: c,
2223
+ rootNames: l.config.fileNames,
2224
+ options: l.config.options,
2225
+ projectReferences: l.config.projectReferences
2226
+ });
2227
+ this.program = d, e.types.typeScriptInstanceCreated(d, c);
2228
+ }
2229
+ Ae(this, o);
2230
+ }
2231
+ const n = _(), s = await Oe(this);
2232
+ $t(s, this);
2233
+ const a = this.wrapApiModules(s);
2234
+ e.context.logger.info(
2235
+ `${H}Extracted ${s.length} @public files in ${x.green(`${n()}s`)}`
2236
+ );
2237
+ const r = { apiJson: a, dtsFiles: void 0 };
2238
+ if (e.afterApiJsonCreate !== Se && e.afterApiJsonCreate(r), this.produceDts) {
2239
+ const o = _(), l = this.dtsFiles;
2240
+ if (this.dtsFiles = /* @__PURE__ */ new Map(), this.isJsApi) {
2241
+ const c = ht(s, this), d = `${e.context.dtsEmitPath}interfaces.d.ts`;
2242
+ this.dtsFiles.set(d, c);
2243
+ } else this.isComponentProject && Ne(s, this);
2244
+ for (let c = 0; c < s.length; ++c) {
2245
+ const d = s[c], m = h(d);
2246
+ let f = `${e.context.dtsEmitPath + m.dtsPath}.d.ts`, p;
2247
+ if (m.isStale) {
2248
+ if (p = Be(d, this), e.types.declarationTextTransformers.length > 0) {
2249
+ let v = { filePath: f, content: p };
2250
+ for (let C = 0; C < e.types.declarationTextTransformers.length; ++C) {
2251
+ const y = e.types.declarationTextTransformers[C];
2252
+ if (v = y(v, d, this), v === !1)
2253
+ break;
2254
+ }
2255
+ if (v === !1)
2256
+ continue;
2257
+ f = v.filePath, p = v.content;
2258
+ }
2259
+ } else
2260
+ p = l.get(f);
2261
+ if (d.exports?.[0].kind === "custom-element-definition" && p.length > 0) {
2262
+ const v = `${f.slice(0, -19)}/index.d.ts`;
2263
+ this.dtsFiles.set(v, 'export * from "./customElement.js";');
2264
+ }
2265
+ this.dtsFiles.set(f, p);
2266
+ }
2267
+ if (this.changedDtsFiles !== void 0)
2268
+ for (const [c, d] of this.dtsFiles)
2269
+ l.get(c) !== d && this.changedDtsFiles.set(c, d);
2270
+ if (t) {
2271
+ await i, await ae(e.context.dtsEmitPath, { recursive: !0 }), await At(e.context.dtsEmitPath, !0, this.changedDtsFiles ?? this.dtsFiles);
2272
+ const c = N.join(N.relative(process.cwd(), e.context.dtsEmitPath), "/");
2273
+ e.context.logger.info(
2274
+ `${H}Wrote ${c}**/*${x.blue(".d.ts")} in ${x.green(`${o()}s`)}`
2275
+ );
2276
+ }
2277
+ }
2278
+ if (e.context.apiJsonEmitPath !== "") {
2279
+ const o = N.resolve(e.context.cwd, e.context.apiJsonEmitPath), l = N.join(N.relative(process.cwd(), N.dirname(o)), "/");
2280
+ await ae(N.dirname(o), { recursive: !0 }), await xe(
2281
+ o,
2282
+ e.context.environment === "production" ? JSON.stringify(a) : JSON.stringify(a, null, 2)
2283
+ ), e.context.logger.info(
2284
+ `${H}Wrote ${l}${x.yellow(N.basename(o))}`
2285
+ );
2286
+ }
2287
+ return this.typeVerifier?.verifyTypes(s), this.errorCount > 0 && e.context.logger.error(
2288
+ `${H}${x.red(`Found ${this.errorCount} ${this.errorCount === 1 ? "error" : "errors"}`)}`
2289
+ ), this.silencedBrokenLinkCount > 0 && e.context.logger.info(`${H}Silenced ${this.silencedBrokenLinkCount} broken link errors.`), this.isRunInProgress = !1, this.produceDts && (r.dtsFiles = this.dtsFiles), r;
2290
+ };
2291
+ async function At(e, t, i) {
2292
+ const n = /* @__PURE__ */ new Set(), s = Array.from(i.entries());
2293
+ for (let l = 0; l < s.length; ++l) {
2294
+ const [c, d] = s[l];
2295
+ if (d.length === 0)
2296
+ continue;
2297
+ const m = (t ? c.slice(e.length) : c).split("/");
2298
+ for (let f = 1; f < m.length; ++f)
2299
+ n.add(m.slice(0, f).join("/"));
2300
+ }
2301
+ const a = new Array(n.size);
2302
+ for (const l of n)
2303
+ a.push(ae(e + l, { recursive: !0 }));
2304
+ await Promise.all(a);
2305
+ const r = new Array(s.length), o = t ? "" : e;
2306
+ for (let l = 0; l < s.length; ++l) {
2307
+ const [c, d] = s[l];
2308
+ if (d.length === 0)
2309
+ continue;
2310
+ const m = o + c;
2311
+ r[l] = xe(m, d);
2312
+ }
2313
+ await Promise.all(r);
2314
+ }
2315
+ function Ae(e, t) {
2316
+ if (e.config.types.fullTypeCheck)
2317
+ if ("getSemanticDiagnostics" in e.program) {
2318
+ const i = e.builderProgram === void 0 ? E.getPreEmitDiagnostics(e.program) : e.builderProgram.getSemanticDiagnostics();
2319
+ i.length > 0 && (e.config.context.logger.error(
2320
+ E.formatDiagnosticsWithColorAndContext(i, se)
2321
+ ), e.errorCount += i.length, process.exitCode = 1), e.config.types.afterDiagnostic(i), e.config.context.logger.info(`${H}Type checked in ${qe("cyan", `${t()}s`)}`);
2322
+ } else
2323
+ e.emitError("Can't do type checking as the passed ts.Program is not a ts.Program instance.", {
2324
+ file: void 0,
2325
+ node: void 0
2326
+ });
2327
+ }
2328
+ const Rt = async function() {
2329
+ if (this.watchFiles !== void 0)
2330
+ throw Error(
2331
+ "The ApiExtractor.watch() is already in progress, or previous watch crashed with unrecoverable error. Stop the previous watch first or create a new ApiExtractor"
2332
+ );
2333
+ this.watchFiles = /* @__PURE__ */ new Map(), this.moduleMap = /* @__PURE__ */ new Map();
2334
+ const e = this.config;
2335
+ let t;
2336
+ const i = /* @__PURE__ */ new Map();
2337
+ let n = [];
2338
+ const s = (u, v, C) => {
2339
+ r(u), o(v, C, u.previousModule);
2340
+ }, a = (u, v) => {
2341
+ this.watchFiles.delete(v), u.module !== void 0 && n.push(u.module), r(u);
2342
+ }, r = (u) => {
2343
+ if (u.module === void 0)
2344
+ return;
2345
+ const v = u.module;
2346
+ this.moduleMap.delete(v.path), u.previousModule = u.module, u.module = void 0, u.isEmptyModule = !1;
2347
+ for (const C of u.dependencies)
2348
+ this.watchFiles.get(C)?.dependents.delete(v.sourcePath);
2349
+ for (const [C, y] of u.dependents) {
2350
+ const M = this.watchFiles.get(C);
2351
+ M !== void 0 && (y ? (M.dependencies.delete(v.sourcePath), r(M)) : M.hasDirtyLinks = !0);
2352
+ }
2353
+ }, o = (u, v, C) => {
2354
+ if (v === void 0) {
2355
+ const y = e.context.cwd + u, M = lt(y, "utf8");
2356
+ v = je(y, M);
2357
+ }
2358
+ this.watchFiles.set(u, {
2359
+ file: v,
2360
+ module: void 0,
2361
+ previousModule: C,
2362
+ isEmptyModule: !1,
2363
+ dependencies: /* @__PURE__ */ new Set(),
2364
+ dependents: /* @__PURE__ */ new Map(),
2365
+ docLinks: [],
2366
+ hasDirtyLinks: !1,
2367
+ wasRemoved: !1
2368
+ });
2369
+ };
2370
+ let l, c = !0, d;
2371
+ m();
2372
+ function m() {
2373
+ return d === void 0 ? (d = Promise.withResolvers(), e.watch.onUpdate(d.promise), !0) : !1;
2374
+ }
2375
+ function f(u) {
2376
+ d?.resolve(u), d = void 0;
2377
+ }
2378
+ const p = async () => {
2379
+ this.changedDtsFiles = e.watch.skipWritingUnchanged && this.dtsFiles.size > 0 ? /* @__PURE__ */ new Map() : void 0;
2380
+ let u;
2381
+ try {
2382
+ u = await this.run();
2383
+ } catch (b) {
2384
+ throw f(void 0), b;
2385
+ }
2386
+ const v = [], C = [];
2387
+ for (const b of this.watchFiles.values()) {
2388
+ const I = b.module, P = b.previousModule;
2389
+ if (I === void 0)
2390
+ P !== void 0 && (b.module = b.previousModule, a(b, P.sourcePath));
2391
+ else {
2392
+ P === void 0 ? (c || C.push(I), b.previousModule = I) : I !== P && (He(I, P) ? b.module = P : (v.push({ old: P, new: I }), b.previousModule = I));
2393
+ const L = h(I);
2394
+ L.isStale && (L.isStale = !1);
2395
+ }
2396
+ }
2397
+ this.program ??= {
2398
+ getSourceFiles: () => {
2399
+ const b = [];
2400
+ for (const I of this.watchFiles.values())
2401
+ b.push(I.file);
2402
+ return b;
2403
+ },
2404
+ getSourceFile: (b) => this.watchFiles.get(b.slice(e.context.cwd.length))?.file
2405
+ };
2406
+ const y = {
2407
+ apiJson: u.apiJson,
2408
+ dtsFiles: u.dtsFiles,
2409
+ changedModules: v,
2410
+ addedModules: C,
2411
+ removedModules: n
2412
+ };
2413
+ n = [];
2414
+ const M = c || v.length > 0 || C.length > 0 || y.removedModules.length > 0;
2415
+ c = !1, f(M ? y : void 0), l?.();
2416
+ };
2417
+ if (e.types.typeCheckedExtraction || e.types.fullTypeCheck) {
2418
+ const u = e.types.fullTypeCheck ? E.createSemanticDiagnosticsBuilderProgram : E.createAbstractBuilder;
2419
+ let v;
2420
+ const C = (S, F, T, ...A) => (v = T, u(
2421
+ // If not doing full type check, don't scout test files
2422
+ // If non-tests import tests, they will be included implicitly anyway
2423
+ e.types.fullTypeCheck ? S : S?.filter(($) => !ze($)),
2424
+ F,
2425
+ T,
2426
+ ...A
2427
+ // Type cast to keep types simpler&aligned between two branches
2428
+ )), y = E.createWatchCompilerHost(
2429
+ // This parses the config file again (we already do it) and computes the
2430
+ // files include array, however avoiding this is tricky, and overhead is small.
2431
+ e.types.typeScriptConfigPath,
2432
+ void 0,
2433
+ E.sys,
2434
+ C,
2435
+ void 0,
2436
+ void 0
2437
+ ), M = y.setTimeout;
2438
+ let b;
2439
+ y.setTimeout = M === void 0 ? void 0 : (S, F, ...T) => {
2440
+ if (!(T[0] === "timerToUpdateProgram"))
2441
+ return M(S, F, ...T);
2442
+ const R = b !== void 0 ? Promise.resolve() : d === void 0 ? Promise.resolve(m()) : d.promise.finally(m);
2443
+ return b = M(
2444
+ (...J) => {
2445
+ b = void 0, R.finally(() => {
2446
+ this.program = void 0, S(...J), this.program === void 0 && f(void 0);
2447
+ });
2448
+ },
2449
+ e.watch.debounceTime,
2450
+ ...T
2451
+ ), b;
2452
+ };
2453
+ const I = y.onWatchStatusChange, P = 6031, L = 6032;
2454
+ y.onWatchStatusChange = (S, ...F) => {
2455
+ S.code === L ? e.watch.clearScreen && E.sys.clearScreen?.() : S.code !== P && I?.(S, ...F);
2456
+ }, y.afterProgramCreate = (S) => {
2457
+ this.builderProgram = S;
2458
+ const F = S.getProgram();
2459
+ this.program = F;
2460
+ const T = F.getSourceFiles();
2461
+ e.types.typeScriptInstanceCreated(F, v);
2462
+ for (const $ of this.watchFiles.values())
2463
+ $.wasRemoved = !0;
2464
+ let A = !1;
2465
+ for (let $ = 0; $ < T.length; ++$) {
2466
+ const R = T[$];
2467
+ if (!me(R.fileName, this))
2468
+ continue;
2469
+ const j = R.fileName.slice(e.context.cwd.length), J = this.watchFiles.get(j);
2470
+ J === void 0 ? (o(j, R, void 0), A = !0) : J.file !== R ? (s(J, j, R), A = !0) : J.wasRemoved = !1;
2471
+ }
2472
+ for (const [$, R] of this.watchFiles)
2473
+ R.wasRemoved && (a(R, $), A = !0);
2474
+ A ? p() : (Ae(this, _()), f(void 0));
2475
+ }, t = E.createWatchProgram(y);
2476
+ } else {
2477
+ let u = function(y) {
2478
+ return ct(y, {
2479
+ throwIfNoEntry: !1
2480
+ })?.isFile();
2481
+ };
2482
+ const v = rt(() => {
2483
+ let y = !1;
2484
+ for (const [M, b] of i)
2485
+ y = C(M, b) || y;
2486
+ i.clear(), y ? (e.watch.clearScreen && E.sys.clearScreen?.(), p()) : f(void 0);
2487
+ }, e.watch.debounceTime), C = (y, M) => {
2488
+ const b = e.context.cwd + y, I = !M, P = this.watchFiles.get(y), L = P !== void 0;
2489
+ if (I || P === void 0) {
2490
+ const S = u(b);
2491
+ if (S === !1) {
2492
+ let T, A = !1;
2493
+ try {
2494
+ T = st(b, { recursive: !0 });
2495
+ let $;
2496
+ for (; ($ = T.readSync()) !== null; ) {
2497
+ if ($.isDirectory())
2498
+ continue;
2499
+ const j = `${$.parentPath}/${$.name}`.slice(e.context.cwd.length);
2500
+ We(j) && (A = C(j, !1) || A);
2501
+ }
2502
+ } finally {
2503
+ T?.closeSync();
2504
+ }
2505
+ return A;
2506
+ }
2507
+ const F = S === !0;
2508
+ if (L) {
2509
+ if (F)
2510
+ return s(P, y, void 0), !0;
2511
+ {
2512
+ const T = P?.module !== void 0;
2513
+ return a(P, y), T;
2514
+ }
2515
+ } else {
2516
+ if (F)
2517
+ return o(y, void 0, void 0), !0;
2518
+ {
2519
+ let T = !1;
2520
+ const A = `${y}/`;
2521
+ for (const [$, R] of this.watchFiles)
2522
+ $.startsWith(A) && (a(R, $), T = !0);
2523
+ return T;
2524
+ }
2525
+ }
2526
+ } else
2527
+ return s(P, y, void 0), !0;
2528
+ };
2529
+ t = at(this.basePath, { recursive: !0 }, (y, M) => {
2530
+ const b = m(), I = M === null ? void 0 : Ye(M), P = y === "change";
2531
+ if (I !== void 0 && // If changed, check if it is an included file
2532
+ // For a rename, we don't know if it is directory or a file - only check
2533
+ // if directory is included, and the file will be checked later.
2534
+ (P ? me(this.basePath + I, this) : Ue(this.basePath + I, this))) {
2535
+ const L = e.context.basePath + I, F = (i.get(L) ?? !0) && P;
2536
+ i.set(L, F);
2537
+ }
2538
+ b && v();
2539
+ }), p(), l = () => {
2540
+ i.size > 0 && v();
2541
+ };
2542
+ }
2543
+ return {
2544
+ close: async () => {
2545
+ t.close(), i.clear(), await d?.promise, this.watchFiles = void 0;
2546
+ }
2547
+ };
2548
+ }, Gt = ".verify-typings.ts";
2549
+ class Dt {
2550
+ constructor(t, i = N.join(process.cwd(), "dist")) {
2551
+ this.extractor = t, this.virtualCwdPath = N.join(i, "/");
2552
+ }
2553
+ verifyTypes(t) {
2554
+ const i = _(), n = /* @__PURE__ */ Object.create(null);
2555
+ n[this.virtualCwdPath + Gt] = this.getVerificationFileContents(t);
2556
+ const s = this.extractor.config.context.dtsEmitPath === "" ? this.virtualCwdPath : "";
2557
+ for (const [f, p] of this.extractor.dtsFiles)
2558
+ n[s + f] = p;
2559
+ const a = {
2560
+ lib: ["lib.dom.d.ts", "lib.esnext.d.ts"],
2561
+ module: E.ModuleKind.ESNext,
2562
+ // Our dependencies' typings are not yet moduleResolution:Node16 compatible
2563
+ moduleResolution: E.ModuleResolutionKind.Bundler,
2564
+ target: E.ScriptTarget.ESNext,
2565
+ noPropertyAccessFromIndexSignature: !0,
2566
+ noUncheckedIndexedAccess: !0,
2567
+ noImplicitOverride: !0,
2568
+ skipDefaultLibCheck: !0,
2569
+ strict: !0,
2570
+ verbatimModuleSyntax: !0,
2571
+ esModuleInterop: !0,
2572
+ declaration: !0,
2573
+ // Performance optimization. Don't auto-load node_modules/@types
2574
+ types: [],
2575
+ // Performance optimization. Don't look up node_modules/@typescript/lib-...
2576
+ libReplacement: !1
2577
+ }, r = E.createCompilerHost(a), o = r.fileExists;
2578
+ r.fileExists = (f) => f.endsWith("package.json") ? f.includes("node_modules") ? o(f) : !1 : n[f] !== void 0 ? !0 : f.endsWith(".d.ts") ? o(f) : !1, r.useCaseSensitiveFileNames = () => !0;
2579
+ const l = r.readFile;
2580
+ r.readFile = (f) => {
2581
+ const p = n[f];
2582
+ return p === void 0 ? l(f) : p;
2583
+ };
2584
+ const c = r.directoryExists;
2585
+ r.directoryExists = (f) => f.includes("node_modules") ? c(f) : !0, r.getCurrentDirectory = () => this.virtualCwdPath, r.getCanonicalFileName = se.getCanonicalFileName;
2586
+ const d = E.createProgram({
2587
+ rootNames: Object.keys(n),
2588
+ host: r,
2589
+ options: a
2590
+ }), m = E.getPreEmitDiagnostics(d).filter(this.extractor.config.verify.filterTypeCheckDiagnostic);
2591
+ m.length && (this.extractor.config.context.logger.error(
2592
+ E.formatDiagnosticsWithColorAndContext(m, se)
2593
+ ), process.exitCode = 1, this.extractor.errorCount += m.length), this.extractor.config.context.logger.info(`${H}Types verified in ${x.green(`${i()}s`)}`);
2594
+ }
2595
+ printTypeParameters(t, i) {
2596
+ if (t === void 0)
2597
+ return "";
2598
+ let n = "";
2599
+ for (let s = 0; s < t.length; ++s) {
2600
+ const a = t[s];
2601
+ if (a.default !== void 0)
2602
+ break;
2603
+ n === "" ? n += "<" : n += ", ", n += a.constraint === void 0 ? "any" : le(a.constraint, i).text;
2604
+ }
2605
+ return n === "" ? "" : `${n}>`;
2606
+ }
2607
+ getVerificationFileContents(t) {
2608
+ let i = `declare const $: unknown;
2609
+
2610
+ `;
2611
+ for (let n = 0; n < t.length; ++n) {
2612
+ const s = t[n], a = h(s);
2613
+ if (a.constructorPropertiesInterface !== void 0) {
2614
+ const r = a.constructorPropertiesInterface.name, o = this.printTypeParameters(
2615
+ a.constructorPropertiesInterface.typeParameters,
2616
+ s.path
2617
+ ), l = r.slice(0, -10), c = s.exports === void 0 ? l : "default";
2618
+ i += `$ as import("./${s.path}.js").${c}${o} satisfies import("./${s.path}.js").${r}${o};
2619
+ `;
2620
+ }
2621
+ }
2622
+ return i;
2623
+ }
2624
+ }
2625
+ class qt {
2626
+ /**
2627
+ * @public
2628
+ * @param rawConfig Optional configuration for the extractor.
2629
+ */
2630
+ constructor(t = {}) {
2631
+ this.componentStories = /* @__PURE__ */ Object.create(null), this.dtsFiles = /* @__PURE__ */ new Map(), this.changedDtsFiles = void 0, this.isRunInProgress = !1, this.watchFiles = void 0, this.program = void 0, this.builderProgram = void 0, this.componentPathMapping = void 0, this.componentCssFileDocs = void 0, this.vanillaComponentTypes = void 0, this.isInLuminaMinimalExtraction = !1, this.errorCount = 0, this.silencedBrokenLinkCount = 0, this.loggedBooleanWarning = !1, this.moduleMap = void 0, this.privateMixinModuleNames = /* @__PURE__ */ new Set(), this.implicitPublicModules = void 0, this.file = void 0, this.apiModule = void 0, this.componentTagName = void 0, this.pairedSetter = void 0, this.statementJsDocs = [], this.jsDoc = void 0, this.apiObject = void 0, this.moduleContext = void 0, this.localDeclarations = /* @__PURE__ */ new Set(), this.exportDefaultName = void 0, this.objectLikeTypeParameters = void 0, this.functionLikeTypeParameters = void 0, this.apiClassLikeName = void 0, this.mixinName = void 0, this.mixinMixins = void 0, this.moduleHasAccessorLikeClass = !1, this.moduleHasClass = !1, this.inheritedModuleName = void 0, this.run = wt.bind(this), this.watch = Rt.bind(this), this.emitError = Re.bind(this);
2632
+ const i = Je(t);
2633
+ this.config = i, this.produceDts = i.types.forceProduceDts || i.context.dtsEmitPath !== "" || i.verify.typeCheckTypes, this.basePath = `${i.context.cwd}${i.context.basePath}`, this.normalizedApiReferencePrefix = `https://${this.config.documentation.host}${this.config.documentation.basePath}`, this.runtimeDependencyNames = /* @__PURE__ */ new Set([
2634
+ ...Object.keys(i.context.packageJson.dependencies ?? {}),
2635
+ ...Object.keys(i.context.packageJson.peerDependencies ?? {})
2636
+ ]), this.resolveJsDocLink = i.context.isLuminaMinimalExtraction ? Se : Xe.bind(void 0, this), this.isComponentProject = "@arcgis/lumina" in (i.context.packageJson.dependencies ?? {}), this.isJsApi = i.context.packageJson.name === "arcgis-js-api", this.typeVerifier = i.verify.typeCheckTypes ? new Dt(this, i.context.dtsEmitPath || void 0) : void 0, this.localPrivateDeclarations = i.strict ? void 0 : /* @__PURE__ */ new Map();
2637
+ }
2638
+ /**
2639
+ * Given an array of ApiModules, add top-level api.json metadata and return
2640
+ * the completed ApiJson structure.
2641
+ */
2642
+ wrapApiModules(t) {
2643
+ return {
2644
+ timestamp: (/* @__PURE__ */ new Date()).toISOString().split(".")[0],
2645
+ compiler: {
2646
+ // Preserve previous compiler.name for component projects as that is what
2647
+ // pre 5.0 Lumina versions expect.
2648
+ name: this.isComponentProject ? "@arcgis/lumina-compiler" : fe.name,
2649
+ version: fe.version,
2650
+ typescriptVersion: E.version
2651
+ },
2652
+ // https://github.com/webcomponents/custom-elements-manifest?tab=readme-ov-file#schema-versioning
2653
+ // https://github.com/webcomponents/custom-elements-manifest/releases
2654
+ schemaVersion: "2.1.0",
2655
+ readme: void 0,
2656
+ deprecated: void 0,
2657
+ modules: t
2658
+ };
2659
+ }
2660
+ }
2661
+ export {
2662
+ qt as A,
2663
+ At as w
2664
+ };