@arcgis/api-extractor 5.2.0-next.9 → 5.2.0-next.90

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