@arcgis/api-extractor 5.2.0-next.1 → 5.2.0-next.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2701 +0,0 @@
1
- import { l as H, a as se, e as De, p as me } from "./typeScript-Bi6LkUmP.js";
2
- import { a as be, o as xe, t as Le, b as Oe, c as Ne, e as Be, p as We, d as Ue, f as _, i as pe, g as je, h as ze, j as He, k as Je, n as Ve, r as Xe } from "./worker-C9agsAIe.js";
3
- import { getViewUrl as Ye, postProcessDeprecated as Q, postProcessDescription as R, postProcessDocsTags as V, resolveJsDocLink as qe } from "./extractor/processing/links.js";
4
- import E from "typescript";
5
- import { path as N, toPosixPathSeparators as Ze } 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 _e } from "@arcgis/toolkit/string";
9
- import { g as h, a as fe, b as Ke, c as Qe, d as Ie, e as oe, p as ne } from "./privateContext-CB7P40up.js";
10
- import { apiTypeToImportType as le, globalPackageIdentifier as ke, getApiMemberName as et, getMaybeStaticApiMemberName as ce, mergeApiNodes as Se, naturalSortModules as tt, compareNamedNodes as it, compareClassMembers as ot } from "./utils/apiHelpers.js";
11
- import { printTypeParameters as te, printTypeAlias as nt } from "./utils/partPrinter.js";
12
- import { identity as Ee, debounce as rt } from "@arcgis/toolkit/function";
13
- import { hasRuntimeDeclaration as st } from "./utils/inferEntrypoints.js";
14
- import { opendirSync as at, watch as lt, readFileSync as ct, statSync as dt } from "node:fs";
15
- const S = "/** @deprecated since 5.0. Refactor using \\@arcgis/codemod */", ft = `${S}
16
- type HashMap<T> = Record<string, T | undefined>;
17
- ${S}
18
- type nullish = null | undefined;
19
-
20
- ${S}
21
- type IHandle = import("./core/Handles.js").ResourceHandle;
22
-
23
- ${S}
24
- type GroupKey<T> = import("./core/Accessor.js").GroupKey<T>;
25
-
26
- ${S}
27
- declare namespace __esri {
28
- ${S}
29
- type Constructor<T> = new (...params: any[]) => T;
30
-
31
- ${S}
32
- export type AnonymousAccessor = Accessor;
33
-
34
- ${S}
35
- export type ReadonlyAccessor = Omit<Accessor, "set" | "_set" | "destroy" | "notifyChange" | "_get">;
36
-
37
- `, mt = `
38
-
39
- ${S}
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
- ${S}
1093
- export type EventHandlerCallback = (selectionResult: SelectionResultType) => void;
1094
- ${S}
1095
- export type On = (eventName: string, eventHandler: EventHandlerCallback) => IHandle;
1096
- }`;
1097
- let B, D, j, W, O = "", U = "", q = "", ee = "";
1098
- function pt(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
- ye(n), A.length !== 0 && (o += ue(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 (ye(l), A.length === 0)
1111
- continue;
1112
- const c = l.name === s, d = c ? "default" : l.name, m = l.kind === "function", f = l.kind === "variable";
1113
- if (m || f) {
1114
- if (m) {
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 += ` ${S}
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 (f && 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), f && 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" && fe(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 += ut(b, l, d, U);
1157
- continue;
1158
- }
1159
- const y = B === void 0 ? " " : " ";
1160
- o += `${y}${S}
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 += ue(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 += ` ${S}
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 += ` ${S}
1182
- interface ${W} {
1183
- ${ee} }
1184
-
1185
- export const ${W}: ${W};
1186
-
1187
- `), o;
1188
- }
1189
- function ue(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 = nt(O, a, void 0, r);
1195
- B === void 0 ? n += ` ${S}
1196
- ${c}
1197
- ` : q += ` ${S}
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 ye(e) {
1249
- e.kind === "variable" ? A = Ke(e).esriCompatibilityNames ?? ie : e.kind === "function" ? A = Qe(e).esriCompatibilityNames ?? ie : A = fe(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 ut(e, t, i, o) {
1279
- const s = yt(e, t.events), r = `${// IdentityManager fake class got renamed to IdentityManagerBase real class
1280
- t.name.startsWith(A[0]) ? A[0] : t.name}${_e(e)}Event`, n = ht(s, o) ?? ` = import("./${o}.js").${i}["@eventTypes"]["${e}"]`, l = n.startsWith("<") ? n.indexOf(">") + 1 : -1, c = l !== -1 ? n.slice(0, l) : "";
1281
- return ` ${S}
1282
- export type ${r}${n};
1283
- ${S}
1284
- export type ${r}Handler${c} = (event: ${r}${c}) => void;
1285
-
1286
- `;
1287
- }
1288
- function yt(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 ht(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 gt(e, t) {
1310
- let i = ft;
1311
- for (let o = 0; o < e.length; ++o) {
1312
- const s = e[o];
1313
- i += pt(s, t);
1314
- }
1315
- return i + mt;
1316
- }
1317
- function vt(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.specifier;
1325
- if (n.replacementName !== void 0) {
1326
- const d = s[n.replacementName];
1327
- if (d?.wasUsed === !0) {
1328
- d.specifier !== n.specifier && 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 f = n.actualName ?? c, p = i.moduleMap.get(n.modulePath), g = p === void 0 ? void 0 : h(p);
1342
- if (g?.index.named[f] === void 0) {
1343
- if (i.privateMixinModuleNames.has(n.modulePath))
1344
- continue;
1345
- i.emitError(
1346
- `The ${x("red", f)} 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", f)} 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(g, t);
1354
- }
1355
- const d = a[l], m = n.actualName === void 0 ? c : `${n.actualName} as ${c}`;
1356
- a[l] = d === void 0 ? m : `${d}, ${m}`;
1357
- } else if (n.type === "default") {
1358
- if (n.modulePath !== void 0) {
1359
- const d = i.moduleMap.get(n.modulePath), m = d === void 0 ? void 0 : h(d);
1360
- m?.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(m, t);
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(h(d), t);
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), f = (d === void 0 ? void 0 : h(d))?.file.fileName.slice(i.config.context.cwd.length);
1387
- f !== void 0 && (i.watchFiles.get(e.sourcePath).dependencies.add(f), i.watchFiles.get(f).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 re(e, t) {
1400
- return `${be(t.dtsPath, e.dtsPath)}.js`;
1401
- }
1402
- function Ct(e, t, i, o) {
1403
- const s = e.references;
1404
- if (s !== void 0) {
1405
- if (t.autoCastingRequiresType === void 0 && s.length > 1 && s[0].module === "core/Collection")
1406
- if (s.length > 2)
1407
- t.autoCastingRequiresType = !0;
1408
- else {
1409
- 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];
1410
- Ae(l) && (t.autoCastingRequiresType = !0);
1411
- }
1412
- return Te(e, t, o, i, s);
1413
- }
1414
- }
1415
- function Te(e, t, i, o, s) {
1416
- for (let a = s.length - 1; a >= 0; a--) {
1417
- const r = s[a];
1418
- if (r.package !== void 0) {
1419
- r.package === ke && r.name === "Date" && he(
1420
- e,
1421
- s,
1422
- a,
1423
- { type: xt, inheritedFrom: void 0 },
1424
- i,
1425
- o,
1426
- t
1427
- );
1428
- continue;
1429
- }
1430
- 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];
1431
- if (Ae(c)) {
1432
- const m = `(${c.type.text})`, f = e.text;
1433
- e.text = `${e.text.slice(0, r.start)}${m}${e.text.slice(r.end)}`;
1434
- const p = e.text, g = r.start + 1, u = [];
1435
- for (let C = 0; C < c.type.references.length; ++C) {
1436
- const y = c.type.references[C], b = y.module ?? n?.path, M = b === o.path;
1437
- u.push({
1438
- ...y,
1439
- module: M ? void 0 : b,
1440
- start: y.start + g,
1441
- end: y.end + g
1442
- });
1443
- }
1444
- if (Te(e, t, i, o, u), e.text === p) {
1445
- e.text = f;
1446
- continue;
1447
- }
1448
- s.splice(a, 1, ...u);
1449
- const v = e.text.length - f.length;
1450
- xe(s, v, a + u.length);
1451
- continue;
1452
- }
1453
- if (c?.kind !== "class")
1454
- continue;
1455
- const d = $e(c, n, void 0, i);
1456
- if (d === void 0) {
1457
- i.emitError(
1458
- `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)}.`,
1459
- {
1460
- file: h(n).file,
1461
- node: void 0
1462
- }
1463
- );
1464
- continue;
1465
- }
1466
- he(
1467
- e,
1468
- s,
1469
- a,
1470
- d,
1471
- i,
1472
- o,
1473
- t
1474
- );
1475
- }
1476
- }
1477
- function $e(e, t, i, o) {
1478
- const s = h(t), a = s.constructorAutoCastType;
1479
- if (a !== void 0)
1480
- return a;
1481
- const r = Mt(e, t, i, o);
1482
- return r !== void 0 && (s.constructorAutoCastType = r), r;
1483
- }
1484
- function Mt(e, t, i, o) {
1485
- if (e.members !== void 0)
1486
- for (let r = 0; r < e.members.length; ++r) {
1487
- const n = e.members[r];
1488
- if (n.kind === "constructor" && // Use the last constructor for auto-casting signature
1489
- // Examples: Point, MeshTexture
1490
- e.members[r + 1]?.kind !== "constructor" && // Only consider the single-parameter signature
1491
- n.parameters?.length === 1 && // To avoid false positives, constructors without type references are not
1492
- // considered autocastable. This excludes core/Accessor#constructor's any[].
1493
- n.parameters[0].type?.references !== void 0)
1494
- return {
1495
- type: n.parameters[0].type,
1496
- inheritedFrom: i?.path
1497
- };
1498
- }
1499
- const a = h(t).constructorPropertiesInterface;
1500
- if (a !== void 0)
1501
- return { type: {
1502
- text: a.name,
1503
- references: [
1504
- {
1505
- name: a.name,
1506
- module: t.path,
1507
- package: void 0,
1508
- viewUrl: Ye(t.path, a.name, void 0, o),
1509
- start: 0,
1510
- end: a.name.length
1511
- }
1512
- ],
1513
- values: void 0,
1514
- source: void 0
1515
- }, inheritedFrom: i?.path };
1516
- if (e.superclass !== void 0) {
1517
- const r = e.superclass.module === void 0 ? t : o.moduleMap.get(e.superclass.module), c = (r === void 0 ? void 0 : h(r))?.index?.class;
1518
- if (c !== void 0)
1519
- return $e(c, r, r, o);
1520
- }
1521
- }
1522
- function he(e, t, i, { type: o, inheritedFrom: s }, a, r, n) {
1523
- let l = o.references;
1524
- l.length === 2 && l[0].name === "ReadonlyArrayOrCollection" && l[1].name === "T" && (l = [l[0]], o = {
1525
- ...o,
1526
- text: "ReadonlyArrayOrCollection",
1527
- references: l
1528
- });
1529
- let c = o.text;
1530
- const d = t[i], m = o.text.length - (d.end - d.start);
1531
- let f = 0;
1532
- t.splice(i, 1);
1533
- for (let p = l.length - 1; p >= 0; p--) {
1534
- const g = l[p], u = o.text.slice(g.start, g.end);
1535
- if (u !== g.name && g.name !== "default") {
1536
- a.emitError(
1537
- `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.`,
1538
- {
1539
- file: h(r).file,
1540
- node: void 0
1541
- }
1542
- );
1543
- continue;
1544
- }
1545
- const v = g.module ?? s ?? d.module, C = (v === void 0 ? void 0 : a.moduleMap.get(v)) ?? r, y = h(C);
1546
- if (g.module === void 0 && g.package === void 0 && g.viewUrl === void 0) {
1547
- a.emitError(
1548
- `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.`,
1549
- {
1550
- file: h(r).file,
1551
- node: void 0
1552
- }
1553
- );
1554
- continue;
1555
- }
1556
- Fe(g, C, a, r);
1557
- const M = d.start, I = {
1558
- ...g,
1559
- start: g.start + M + f,
1560
- end: g.end + M + f
1561
- }, P = y.typeName;
1562
- if (l.length === 1 && n.autoCastingRequiresType === !0 && P !== void 0) {
1563
- const L = n.autoCastingDefaultType === P, k = `(${u} & { type${L ? "?" : ""}: "${P}" })`, F = k.length - u.length;
1564
- f += F, I.end += F, c = c.slice(0, g.start) + k + c.slice(g.end);
1565
- }
1566
- t.splice(i, 0, I);
1567
- }
1568
- return e.text = e.text.slice(0, d.start) + c + e.text.slice(d.end), xe(
1569
- t,
1570
- m + f,
1571
- i + (l?.length ?? 0)
1572
- ), !0;
1573
- }
1574
- function Fe(e, t, i, o) {
1575
- const s = h(o);
1576
- if (e.package !== void 0) {
1577
- if (e.package === ke)
1578
- return;
1579
- i.emitError(
1580
- `Unsupported case: cannot yet handle auto-adding imports for external packages. Tried to add ${e.name} from ${e.package} when resolving auto-casting type.`,
1581
- {
1582
- file: s.file,
1583
- node: void 0
1584
- }
1585
- );
1586
- }
1587
- if (t === o)
1588
- return;
1589
- const a = h(t), r = e.name === "default" ? a.index.default?.name : e.name;
1590
- if (r === void 0) {
1591
- i.emitError(
1592
- `Failed to resolve the name of the default import from module ${t.sourcePath} when adding auto-casting import for ${e.name}.`,
1593
- {
1594
- file: s.file,
1595
- node: void 0
1596
- }
1597
- );
1598
- return;
1599
- }
1600
- let n = r, l;
1601
- const c = Ie(e);
1602
- c !== void 0 && (n = c, l = r);
1603
- const d = s.importsMap[n];
1604
- d === void 0 ? s.importsMap[n] = {
1605
- type: e.name === "default" ? "default" : "named",
1606
- modulePath: t.path,
1607
- specifier: be(s.dtsPath, a.dtsPath),
1608
- replacementName: void 0,
1609
- actualName: l,
1610
- wasUsed: !0
1611
- } : d.modulePath !== t.path ? i.emitError(
1612
- `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`,
1613
- {
1614
- file: s.file,
1615
- node: void 0
1616
- }
1617
- ) : d.wasUsed = !0;
1618
- }
1619
- function Ae(e) {
1620
- return e?.kind === "interface" && e.members === void 0 && e.supertypes === void 0 && e.type?.references !== void 0 && e.type.references.length > 1 && e.typeParameters === void 0 && bt(e.type);
1621
- }
1622
- function bt(e) {
1623
- let t = 0;
1624
- for (let i = 0; i < e.references.length; ++i) {
1625
- const o = e.references[i], s = e.text.slice(t, o.start).trim();
1626
- if (s !== "" && s !== "|")
1627
- return !1;
1628
- t = o.end;
1629
- }
1630
- return t === e.text.length;
1631
- }
1632
- const xt = {
1633
- // Wrap in parents to correctly substitute Date[] in TimeInfo.stops
1634
- text: "(Date | number | string)",
1635
- references: [
1636
- {
1637
- name: "Date",
1638
- module: void 0,
1639
- package: "global:",
1640
- viewUrl: "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date",
1641
- start: 1,
1642
- end: 5
1643
- }
1644
- ],
1645
- values: void 0,
1646
- source: void 0
1647
- };
1648
- function Pt(e, t) {
1649
- const i = e.constructorPropertiesInterface;
1650
- i.type = void 0;
1651
- const o = h(t.apiModule).index.class;
1652
- i.typeParameters = o.typeParameters;
1653
- const s = o.superclass;
1654
- if (s !== void 0) {
1655
- const r = ge(s, t);
1656
- r !== void 0 && (i.supertypes ??= [], i.supertypes.push(r));
1657
- }
1658
- if (o.mixins !== void 0)
1659
- for (let r = 0; r < o.mixins.length; ++r) {
1660
- const n = o.mixins[r], l = ge(n, t);
1661
- l !== void 0 && (i.supertypes ??= [], i.supertypes.push(l));
1662
- }
1663
- let a = "";
1664
- if (o.members !== void 0)
1665
- for (let r = 0; r < o.members.length; ++r) {
1666
- const n = o.members[r];
1667
- if (n.kind !== "field" || n.inheritedFrom !== void 0 || n.static !== void 0)
1668
- continue;
1669
- const l = oe(n);
1670
- if (l.isAbstract)
1671
- continue;
1672
- let c = e.constructorOnlySetters?.[n.name];
1673
- if (c === void 0) {
1674
- if (n.readonly !== void 0)
1675
- continue;
1676
- if (n.getterType === void 0 && l.isOverride === void 0) {
1677
- a += `${a.length === 0 ? "" : " | "}"${n.name}"`;
1678
- continue;
1679
- } else
1680
- c = n.type, c.text.includes(" | undefined") || (c = { ...c, text: `${c.text} | undefined` });
1681
- } else c.text.includes(" | undefined") || (c.text += " | undefined");
1682
- const d = {
1683
- isAbstract: void 0,
1684
- isAccessor: void 0,
1685
- hasAutoCasting: void 0,
1686
- autoCastingRequiresType: void 0,
1687
- autoCastingDefaultType: void 0,
1688
- isConstructorOnly: void 0,
1689
- isOverride: void 0,
1690
- dtsTypeOverride: void 0
1691
- }, m = n, f = {
1692
- [ne]: d,
1693
- kind: "field",
1694
- name: m.name,
1695
- static: void 0,
1696
- deprecated: m.deprecated,
1697
- summary: void 0,
1698
- description: m.description,
1699
- docsTags: m.docsTags,
1700
- type: c,
1701
- getterType: void 0,
1702
- default: m.default,
1703
- readonly: void 0,
1704
- inheritedFrom: void 0,
1705
- privacy: m.privacy,
1706
- source: void 0,
1707
- attribute: void 0,
1708
- reflects: void 0,
1709
- docsOnlyReadonly: void 0
1710
- };
1711
- i.members ??= [], i.members.push(f);
1712
- }
1713
- if (a.length > 0) {
1714
- i.supertypes ??= [];
1715
- let r = `Partial<Pick<${o.name}`;
1716
- if (i.typeParameters !== void 0) {
1717
- r += "<";
1718
- for (let l = 0; l < i.typeParameters.length; ++l) {
1719
- const c = i.typeParameters[l];
1720
- r += c.name, l < i.typeParameters.length - 1 && (r += ", ");
1721
- }
1722
- r += ">";
1723
- }
1724
- r += `, ${a}>>`;
1725
- const n = {
1726
- [ne]: r,
1727
- name: "",
1728
- module: void 0,
1729
- package: void 0,
1730
- viewUrl: void 0,
1731
- typeArguments: void 0
1732
- };
1733
- i.supertypes.push(n);
1734
- }
1735
- }
1736
- function ge(e, t) {
1737
- if (e.package !== void 0)
1738
- return;
1739
- const i = t.moduleMap.get(e.module);
1740
- if (i === void 0)
1741
- return;
1742
- const o = h(i), s = o.constructorPropertiesInterface;
1743
- if (s === void 0) {
1744
- const n = o.inheritance;
1745
- if (typeof n == "object" && n.hasSettableField) {
1746
- const l = e.name === "default" ? o.index.class?.name ?? e.name : e.name;
1747
- t.emitError(
1748
- `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}.`,
1749
- { file: h(t.apiModule).file, node: void 0 }
1750
- ), n.hasSettableField = !1;
1751
- }
1752
- return;
1753
- }
1754
- const a = Ie(e), r = {
1755
- /**
1756
- * If class was renamed when imported, also rename the created Properties
1757
- * interface. This avoids name collision inside of
1758
- * views/3d/environment/SunLighting as it imports webscene/SunLighting.
1759
- * apiReference.name !== class.name for references to mixin base classes.
1760
- */
1761
- [ne]: a === e.name ? void 0 : It(a, o.index.class.name),
1762
- name: s.name,
1763
- module: e.module,
1764
- package: e.package,
1765
- viewUrl: e.viewUrl,
1766
- typeArguments: void 0
1767
- };
1768
- return Fe(r, i, t, t.apiModule), r[ne] ??= s.name, r;
1769
- }
1770
- function It(e, t) {
1771
- if (e === void 0 || e === t)
1772
- return;
1773
- const i = e.indexOf("<");
1774
- if (e = i === -1 ? e : e.slice(0, i), e !== t)
1775
- return `${e}Properties`;
1776
- }
1777
- function kt(e) {
1778
- if (e.customElement === void 0)
1779
- return;
1780
- const t = e, i = [];
1781
- for (let o = 0; o < t.members.length; ++o) {
1782
- const s = t.members[o];
1783
- if (s.kind !== "field" || s.attribute === void 0 || s.privacy !== void 0)
1784
- continue;
1785
- const a = s.type.values?.filter(
1786
- (r) => r.type === "number" || r.type === "string" || r.type === "boolean"
1787
- );
1788
- i.push({
1789
- name: s.attribute,
1790
- summary: s.summary,
1791
- description: s.description,
1792
- inheritedFrom: s.inheritedFrom,
1793
- type: a === void 0 || a.length === 0 ? s.type : {
1794
- text: Le(a),
1795
- references: void 0,
1796
- values: a,
1797
- source: void 0
1798
- },
1799
- default: s.default,
1800
- fieldName: s.name,
1801
- deprecated: s.deprecated
1802
- });
1803
- }
1804
- i.length > 0 && (t.attributes = i);
1805
- }
1806
- const de = {
1807
- /**
1808
- * Don't inherit or inheritance resolution failed.
1809
- */
1810
- skip: 0,
1811
- /**
1812
- * We already inherited the members, but have not yet computed the inheritance
1813
- * data for this module. Almost every class inherits some class, but only a
1814
- * few are inherited by other classes, so we compute inheritance data lazily.
1815
- */
1816
- deferred: 1
1817
- };
1818
- function St(e, t, i, o) {
1819
- const s = e;
1820
- o.produceDts && (fe(t).eventTypesProperty = s);
1821
- const a = h(i), r = `${t.name}Events`;
1822
- if (s.type.text !== r && !s.type.text.startsWith(`${r}<`)) {
1823
- if (s.type.text === "unknown")
1824
- return;
1825
- o.emitError(
1826
- `The "@eventTypes" property must be of type named "${t.name}Events". Found ${x("red", s.type.text)}.`,
1827
- {
1828
- file: a.file,
1829
- node: void 0
1830
- }
1831
- );
1832
- return;
1833
- }
1834
- const n = a.index.named[r];
1835
- if (n?.kind !== "interface") {
1836
- o.emitError(
1837
- `The "${r}" referenced by the "@eventTypes" property must be a @public interface and defined in the same file as the ${t.name} class.`,
1838
- {
1839
- file: a.file,
1840
- node: void 0
1841
- }
1842
- );
1843
- return;
1844
- }
1845
- t.events ??= [], we(n, t, i, void 0, o);
1846
- }
1847
- function we(e, t, i, o, s) {
1848
- const a = o !== void 0;
1849
- if (o ??= /* @__PURE__ */ new Set(), e.type !== void 0) {
1850
- s.emitError(
1851
- `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}`,
1852
- {
1853
- file: h(i).file,
1854
- node: void 0
1855
- }
1856
- );
1857
- return;
1858
- }
1859
- if (e.members !== void 0)
1860
- for (let r = 0; r < e.members.length; ++r) {
1861
- const n = e.members[r];
1862
- if (n.kind !== "field") {
1863
- s.emitError(
1864
- `Event interfaces should only contain properties. Found ${et(n)} of kind ${x("red", n.kind)} in ${e.name}.`,
1865
- {
1866
- file: h(i).file,
1867
- node: void 0
1868
- }
1869
- );
1870
- continue;
1871
- }
1872
- o.has(n.name) || (o.add(n.name), t.events.push({
1873
- name: n.name,
1874
- deprecated: n.deprecated,
1875
- summary: void 0,
1876
- description: n.description,
1877
- docsTags: n.docsTags,
1878
- type: n.type,
1879
- inheritedFrom: a ? {
1880
- name: e.name,
1881
- module: i.path,
1882
- package: void 0,
1883
- viewUrl: void 0
1884
- } : void 0,
1885
- privacy: void 0,
1886
- bubbles: void 0,
1887
- cancelable: void 0,
1888
- composed: void 0
1889
- }));
1890
- }
1891
- if (e.supertypes !== void 0)
1892
- for (let r = 0; r < e.supertypes.length; ++r) {
1893
- const n = e.supertypes[r], l = n.module === void 0 ? i : s.moduleMap.get(n.module), c = h(l).index.named[n.name];
1894
- if (c?.kind !== "interface") {
1895
- s.emitError(
1896
- `Failed to find @public interface ${x("red", n.name)} (used by ${x("green", e.name)}).`,
1897
- {
1898
- file: h(i).file,
1899
- node: void 0
1900
- }
1901
- );
1902
- return;
1903
- }
1904
- we(c, t, l, o, s);
1905
- }
1906
- }
1907
- function Ge(e, t, i) {
1908
- const o = h(e);
1909
- if (o.inheritance !== void 0)
1910
- return;
1911
- o.inheritance = de.deferred;
1912
- let a = !1;
1913
- if (t.members !== void 0)
1914
- for (let m = 0; m < t.members.length; ++m) {
1915
- const f = t.members[m];
1916
- if (f.kind === "field") {
1917
- if (f.name === "@eventTypes") {
1918
- a = !0, St(f, t, e, i), t.members.splice(m, 1), m -= 1;
1919
- continue;
1920
- }
1921
- f.inheritedFrom === void 0 && Tt(f, e, i);
1922
- }
1923
- }
1924
- const r = t;
1925
- let n = t.mixins, l = r.superclass, c = l === void 0 ? void 0 : Me(l, e, i);
1926
- if (c?.supertypes !== void 0) {
1927
- n = n === void 0 ? [] : [...n];
1928
- do {
1929
- const m = c.supertypes.length > 1, f = m ? 1 : 0;
1930
- for (let p = c.supertypes.length - 1; p >= f; p--) {
1931
- const g = c.supertypes[p], u = g.module === void 0 ? { ...g, module: l.module } : g;
1932
- n.unshift(u);
1933
- }
1934
- l = m ? c.supertypes[0] : void 0, c = l === void 0 ? void 0 : Me(l, e, i);
1935
- } while (c?.supertypes !== void 0);
1936
- }
1937
- if (n !== void 0) {
1938
- const m = n.length - (t.mixins?.length ?? 0);
1939
- for (let f = n.length - 1; f >= 0; f--) {
1940
- const p = n[f], g = Ce(p.module ?? e.path, !0, i);
1941
- typeof g == "object" ? ve(g, t, a, i) : f >= m && (t.mixins.splice(f - m, 1), t.mixins.length === 0 && (t.mixins = void 0));
1942
- }
1943
- }
1944
- if (l?.package !== void 0)
1945
- return;
1946
- const d = l?.module;
1947
- if (d !== void 0) {
1948
- const m = Ce(d, !1, i);
1949
- typeof m == "object" && (m.declaration.privacy !== void 0 && t.privacy === void 0 && i.emitError(
1950
- `Public component may only subclass a public component to avoid broken inheritance. Tried to inherit from private ${m.declaration.name}. Remove @private from it but feel free to add a jsdoc description stating the base class is abstract - not for direct consumption. Lumina does bare minimum extraction work for private components, which makes them ineligible for public docs.`,
1951
- { file: o.file, node: void 0 }
1952
- ), ve(m, t, a, i));
1953
- }
1954
- }
1955
- function ve(e, t, i, o) {
1956
- const s = e.declaration, a = t;
1957
- if (e.indexedMembers !== void 0) {
1958
- t.members ??= [];
1959
- const r = t.members, n = o.config.documentation.noInheritMembers[e.inheritanceData.module];
1960
- let l = n === void 0 ? void 0 : new Set(n);
1961
- for (let d = 0; d < r.length; ++d) {
1962
- const m = r[d], f = ce(m), p = e.indexedMembers[f];
1963
- if (p === void 0)
1964
- continue;
1965
- if (l ??= /* @__PURE__ */ new Set(), l.add(f), m.kind === "field") {
1966
- const u = oe(m);
1967
- oe(p).isAccessor === !0 && (u.isAccessor = !0), u.isOverride = !0;
1968
- }
1969
- p !== void 0 && m.inheritedFrom === void 0 && Se(p, m);
1970
- }
1971
- const c = s.members;
1972
- for (let d = 0; d < c.length; ++d) {
1973
- const m = c[d];
1974
- // Most classes don't override any public members, so don't even check
1975
- // for this if no members were overridden.
1976
- (l?.has(ce(m)) ?? !1) || t.members.push(
1977
- m.inheritedFrom === void 0 ? { ...m, inheritedFrom: e.inheritanceData } : m
1978
- );
1979
- }
1980
- }
1981
- !i && e.indexedEvents !== void 0 && (a.events = X(
1982
- a.events,
1983
- s.events,
1984
- e.indexedEvents,
1985
- e.inheritanceData
1986
- )), e.indexedAttributes !== void 0 && (a.attributes = X(
1987
- a.attributes,
1988
- s.attributes,
1989
- e.indexedAttributes,
1990
- e.inheritanceData
1991
- )), e.indexedSlots !== void 0 && (a.slots = X(
1992
- a.slots,
1993
- s.slots,
1994
- e.indexedSlots
1995
- )), e.indexedCssParts !== void 0 && (a.cssParts = X(
1996
- a.cssParts,
1997
- s.cssParts,
1998
- e.indexedCssParts
1999
- )), e.indexedCssProperties !== void 0 && (a.cssProperties = X(
2000
- a.cssProperties,
2001
- s.cssProperties,
2002
- e.indexedCssProperties
2003
- )), e.indexedCssStates !== void 0 && (a.cssStates = X(
2004
- a.cssStates,
2005
- s.cssStates,
2006
- e.indexedCssStates
2007
- )), s.formAssociated === !0 && (a.formAssociated = !0);
2008
- }
2009
- function X(e = [], t, i, o) {
2010
- const s = /* @__PURE__ */ new Set();
2011
- for (let a = 0; a < e.length; ++a) {
2012
- const r = e[a], n = i[r.name];
2013
- n !== void 0 && (s.add(r.name), r.inheritedFrom === void 0 && Se(n, r));
2014
- }
2015
- for (let a = 0; a < t.length; ++a) {
2016
- const r = t[a];
2017
- s.has(r.name) || e.push(
2018
- o === void 0 || r.inheritedFrom !== void 0 ? r : { ...r, inheritedFrom: o }
2019
- );
2020
- }
2021
- return e;
2022
- }
2023
- function Ce(e, t, i) {
2024
- const o = i.moduleMap.get(e), s = Et(o, e, t, i), a = o === void 0 ? void 0 : h(o);
2025
- if (s === !1 || o === void 0)
2026
- return a !== void 0 ? a.inheritance = de.skip : t && i.privateMixinModuleNames.add(e), de.skip;
2027
- const [r, n] = s, l = n;
2028
- Ge(o, n, i);
2029
- let c, d = !1;
2030
- if (n.members !== void 0) {
2031
- c = /* @__PURE__ */ Object.create(null);
2032
- for (let f = 0; f < n.members.length; ++f) {
2033
- const p = n.members[f], g = ce(p), v = c[g] !== void 0;
2034
- c[g] = v ? void 0 : p, d ||= p.kind === "field" && p.readonly === void 0;
2035
- }
2036
- }
2037
- const m = {
2038
- inheritanceData: {
2039
- name: n.name,
2040
- module: r,
2041
- package: void 0,
2042
- viewUrl: void 0
2043
- },
2044
- declaration: n,
2045
- hasSettableField: d,
2046
- indexedMembers: c,
2047
- indexedEvents: Y(n.events),
2048
- indexedAttributes: Y(l.attributes),
2049
- indexedSlots: Y(l.slots),
2050
- indexedCssParts: Y(l.cssParts),
2051
- indexedCssProperties: Y(l.cssProperties),
2052
- indexedCssStates: Y(l.cssStates)
2053
- };
2054
- return a.inheritance = m, m;
2055
- }
2056
- function Y(e) {
2057
- if (e === void 0)
2058
- return;
2059
- const t = /* @__PURE__ */ Object.create(null);
2060
- for (let i = 0; i < e.length; ++i) {
2061
- const o = e[i];
2062
- t[o.name] = o;
2063
- }
2064
- return t;
2065
- }
2066
- function Et(e, t, i, o) {
2067
- const s = e === void 0 ? void 0 : h(e), a = s?.index.class;
2068
- return a === void 0 ? (i || o.emitError(
2069
- `Failed to find @public class/custom element declaration in ${x("red", t)}. Referenced in the extends clause by ${x("blue", o.apiModule.sourcePath)}`,
2070
- {
2071
- file: s?.file,
2072
- scope: s === void 0 ? t : void 0,
2073
- node: void 0
2074
- }
2075
- ), !1) : [t, a];
2076
- }
2077
- function Me(e, t, i) {
2078
- if (e.package !== void 0)
2079
- return;
2080
- 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];
2081
- if (a === void 0) {
2082
- i.emitError(
2083
- `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)}.`,
2084
- {
2085
- file: s?.file,
2086
- scope: o === void 0 ? t.path : void 0,
2087
- node: void 0
2088
- }
2089
- );
2090
- return;
2091
- }
2092
- return a.kind === "interface" ? a : void 0;
2093
- }
2094
- function Tt(e, t, i) {
2095
- const o = oe(e), s = h(t);
2096
- o.hasAutoCasting === !0 && (Ct(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);
2097
- }
2098
- function $t(e, t, i) {
2099
- if (!(i.watchFiles === void 0 || t.reExports === void 0))
2100
- for (let o = 0; o < t.reExports.length; ++o) {
2101
- const s = t.reExports[o];
2102
- if (s.modulePath === void 0)
2103
- continue;
2104
- const a = i.moduleMap.get(s.modulePath), n = (a === void 0 ? void 0 : h(a))?.file.fileName.slice(i.config.context.cwd.length);
2105
- n !== void 0 && (i.watchFiles.get(e.sourcePath).dependencies.add(n), i.watchFiles.get(n).dependents.set(e.sourcePath, !0));
2106
- }
2107
- }
2108
- function Ft(e, t) {
2109
- e.sort(tt), At(e, t), t.isComponentProject && Oe(e, t);
2110
- }
2111
- function At(e, t) {
2112
- for (let i = 0; i < e.length; ++i) {
2113
- const o = e[i];
2114
- if (!h(o).isStale)
2115
- continue;
2116
- t.apiModule = o;
2117
- const a = o.deprecated !== void 0;
2118
- for (let r = 0; r < o.declarations.length; ++r) {
2119
- const n = o.declarations[r];
2120
- a && n.deprecated === void 0 && t.emitError(
2121
- `If module is marked as @deprecated, all its declarations must be too. Found non-deprecated ${n.name}`,
2122
- {
2123
- file: h(o).file,
2124
- node: void 0
2125
- }
2126
- ), "members" in n && n.kind !== "interface" && (Ge(o, n, t), n.events?.sort(it));
2127
- }
2128
- }
2129
- for (let i = 0; i < e.length; ++i) {
2130
- const o = e[i], s = h(o);
2131
- if (!s.isStale) {
2132
- const a = t.watchFiles?.get(o.sourcePath);
2133
- if (a?.hasDirtyLinks === !0) {
2134
- t.apiModule = o;
2135
- for (let r = 0; r < a.docLinks.length; ++r) {
2136
- const n = a.docLinks[r];
2137
- t.resolveJsDocLink(`{@link ${n}}`, n);
2138
- }
2139
- a.hasDirtyLinks = !1;
2140
- }
2141
- continue;
2142
- }
2143
- t.apiModule = o, t.inheritedModuleName = void 0, o.deprecated = Q(o.deprecated, t), o.description = R(o.description, t), V(o.docsTags, t);
2144
- for (let a = 0; a < o.declarations.length; ++a) {
2145
- const r = o.declarations[a];
2146
- if (r.deprecated = Q(r.deprecated, t), r.description = R(r.description, t), V(r.docsTags, t), r.kind === "function") {
2147
- if (r.parameters !== void 0)
2148
- for (let l = 0; l < r.parameters.length; ++l) {
2149
- const c = r.parameters[l];
2150
- c.description = R(c.description, t), V(c.docsTags, t);
2151
- }
2152
- r.return !== void 0 && (r.return.description = R(r.return.description, t));
2153
- }
2154
- const n = r;
2155
- if (n.members !== void 0) {
2156
- for (let c = 0; c < n.members.length; ++c) {
2157
- const d = n.members[c], m = d.inheritedFrom, f = m !== void 0;
2158
- if (t.inheritedModuleName = m?.module, d.deprecated = Q(d.deprecated, t), d.description = R(d.description, t), V(d.docsTags, t), !f && d.kind !== "field") {
2159
- if (d.parameters !== void 0)
2160
- for (let g = 0; g < d.parameters.length; ++g) {
2161
- const u = d.parameters[g];
2162
- u.description = R(u.description, t), V(u.docsTags, t);
2163
- }
2164
- const p = d;
2165
- p.return !== void 0 && (p.return.description = R(p.return.description, t));
2166
- }
2167
- t.inheritedModuleName = void 0;
2168
- }
2169
- r.kind !== "interface" && n.members.sort(ot);
2170
- const l = r;
2171
- if (l.events !== void 0) {
2172
- for (let c = 0; c < l.events.length; ++c) {
2173
- const d = l.events[c];
2174
- t.inheritedModuleName = d.inheritedFrom?.module, d.deprecated = Q(d.deprecated, t), d.description = R(d.description, t), V(d.docsTags, t);
2175
- }
2176
- t.inheritedModuleName = void 0;
2177
- }
2178
- if (t.config.context.isLuminaMinimalExtraction || kt(n), l.slots !== void 0)
2179
- for (let c = 0; c < l.slots.length; ++c) {
2180
- const d = l.slots[c];
2181
- d.description = R(d.description, t);
2182
- }
2183
- if (l.cssProperties !== void 0)
2184
- for (let c = 0; c < l.cssProperties.length; ++c) {
2185
- const d = l.cssProperties[c];
2186
- d.description = R(d.description, t);
2187
- }
2188
- if (l.cssParts !== void 0)
2189
- for (let c = 0; c < l.cssParts.length; ++c) {
2190
- const d = l.cssParts[c];
2191
- d.description = R(d.description, t);
2192
- }
2193
- if (l.cssStates !== void 0)
2194
- for (let c = 0; c < l.cssStates.length; ++c) {
2195
- const d = l.cssStates[c];
2196
- d.description = R(d.description, t);
2197
- }
2198
- if (l.demos !== void 0)
2199
- for (let c = 0; c < l.demos.length; ++c) {
2200
- const d = l.demos[c];
2201
- d.description = R(d.description, t);
2202
- }
2203
- } else r === s.constructorPropertiesInterface && (o.declarations.splice(a, 1), a -= 1);
2204
- }
2205
- s.constructorPropertiesInterface !== void 0 && Pt(s, t), vt(o, s, t), $t(o, s, t);
2206
- }
2207
- }
2208
- function wt(e) {
2209
- const t = [Gt];
2210
- for (let i = 0; i < e.length; ++i) {
2211
- const o = e[i];
2212
- st(o) && t.push(
2213
- ` "@arcgis/core/${o.path}.js": typeof import("./${o.path}.js")${o.exports === void 0 ? "" : ".default"};
2214
- `
2215
- );
2216
- }
2217
- return t.push(Rt), t.join("");
2218
- }
2219
- const Gt = `declare global {
2220
- const $arcgis: ArcgisGlobal;
2221
- }
2222
-
2223
- interface ArcgisGlobal {
2224
- import: ArcgisImport;
2225
- }
2226
-
2227
- interface ArcgisImport {
2228
- <ModuleName extends keyof ArcgisImportModules>(module: ModuleName): Promise<ArcgisImportModules[ModuleName]>;
2229
- <ModuleNames extends (keyof ArcgisImportModules)[]>(
2230
- modules: [...ModuleNames],
2231
- ): Promise<{
2232
- [ModuleName in keyof ModuleNames]: ModuleNames[ModuleName] extends keyof ArcgisImportModules
2233
- ? ArcgisImportModules[ModuleNames[ModuleName]]
2234
- : unknown;
2235
- }>;
2236
- }
2237
-
2238
- export interface ArcgisImportModules {
2239
- `, Rt = `}
2240
- `, Dt = async function() {
2241
- if (this.isRunInProgress)
2242
- throw Error(
2243
- "The ApiExtractor.run() is already in progress, or previous run crashed with unrecoverable error. Await the previous run first or create a new ApiExtractor"
2244
- );
2245
- this.isRunInProgress = !0, this.errorCount = 0, this.silencedBrokenLinkCount = 0;
2246
- const e = this.config;
2247
- this.watchFiles === void 0 && (this.moduleMap = /* @__PURE__ */ new Map());
2248
- const t = e.context.dtsEmitPath !== "", i = e.context.emptyDtsEmitPath && t ? (
2249
- // This takes 80ms for JSAPI
2250
- Ne(e.context.dtsEmitPath)
2251
- ) : void 0;
2252
- if (e.types.typeCheckedExtraction || e.types.fullTypeCheck) {
2253
- const n = _(), l = e.types.typeScriptConfig;
2254
- if (this.watchFiles === void 0) {
2255
- const c = E.createCompilerHost(l.config.options), d = E.createProgram({
2256
- host: c,
2257
- rootNames: l.config.fileNames,
2258
- options: l.config.options,
2259
- projectReferences: l.config.projectReferences
2260
- });
2261
- this.program = d, e.types.typeScriptInstanceCreated(d, c);
2262
- }
2263
- Re(this, n);
2264
- }
2265
- const o = _(), s = await Be(this);
2266
- Ft(s, this);
2267
- const a = this.wrapApiModules(s);
2268
- e.context.logger.info(
2269
- `${H}Extracted ${s.length} @public files in ${x("green", `${o()}s`)}`
2270
- );
2271
- const r = { apiJson: a, dtsFiles: void 0 };
2272
- if (e.afterApiJsonCreate !== Ee && e.afterApiJsonCreate(r), this.produceDts) {
2273
- const n = _(), l = this.dtsFiles;
2274
- if (this.dtsFiles = /* @__PURE__ */ new Map(), this.isJsApi) {
2275
- const c = gt(s, this), d = `${e.context.dtsEmitPath}interfaces.d.ts`;
2276
- this.dtsFiles.set(d, c);
2277
- const m = wt(s), f = `${e.context.dtsEmitPath}arcgisGlobal.d.ts`;
2278
- this.dtsFiles.set(f, m);
2279
- } else this.isComponentProject && We(s, this);
2280
- for (let c = 0; c < s.length; ++c) {
2281
- const d = s[c], m = h(d);
2282
- let f = `${e.context.dtsEmitPath + m.dtsPath}.d.ts`, p;
2283
- if (m.isStale) {
2284
- if (p = Ue(d, this), e.types.declarationTextTransformers.length > 0) {
2285
- let v = { filePath: f, content: p };
2286
- for (let C = 0; C < e.types.declarationTextTransformers.length; ++C) {
2287
- const y = e.types.declarationTextTransformers[C];
2288
- if (v = y(v, d, this), v === !1)
2289
- break;
2290
- }
2291
- if (v === !1)
2292
- continue;
2293
- f = v.filePath, p = v.content;
2294
- }
2295
- } else
2296
- p = l.get(f);
2297
- if (d.exports?.[0].kind === "custom-element-definition" && p.length > 0) {
2298
- const v = `${f.slice(0, -19)}/index.d.ts`;
2299
- this.dtsFiles.set(v, 'export * from "./customElement.js";');
2300
- }
2301
- this.dtsFiles.set(f, p);
2302
- }
2303
- if (this.changedDtsFiles !== void 0)
2304
- for (const [c, d] of this.dtsFiles)
2305
- l.get(c) !== d && this.changedDtsFiles.set(c, d);
2306
- if (t) {
2307
- await i, await ae(e.context.dtsEmitPath, { recursive: !0 }), await Lt(e.context.dtsEmitPath, !0, this.changedDtsFiles ?? this.dtsFiles);
2308
- const c = N.join(N.relative(process.cwd(), e.context.dtsEmitPath), "/");
2309
- e.context.logger.info(
2310
- `${H}Wrote ${c}**/*${x("blue", ".d.ts")} in ${x("green", `${n()}s`)}`
2311
- );
2312
- }
2313
- }
2314
- if (e.context.apiJsonEmitPath !== "") {
2315
- const n = N.resolve(e.context.cwd, e.context.apiJsonEmitPath), l = N.join(N.relative(process.cwd(), N.dirname(n)), "/");
2316
- await ae(N.dirname(n), { recursive: !0 }), await Pe(
2317
- n,
2318
- e.context.environment === "production" ? JSON.stringify(a) : JSON.stringify(a, null, 2)
2319
- ), e.context.logger.info(
2320
- `${H}Wrote ${l}${x("yellow", N.basename(n))}`
2321
- );
2322
- }
2323
- return this.typeVerifier?.verifyTypes(s), this.errorCount > 0 && e.context.logger.error(
2324
- `${H}${x("red", `Found ${this.errorCount} ${this.errorCount === 1 ? "error" : "errors"}`)}`
2325
- ), this.silencedBrokenLinkCount > 0 && e.context.logger.info(`${H}Silenced ${this.silencedBrokenLinkCount} broken link errors.`), this.isRunInProgress = !1, this.produceDts && (r.dtsFiles = this.dtsFiles), r;
2326
- };
2327
- async function Lt(e, t, i) {
2328
- const o = /* @__PURE__ */ new Set(), s = Array.from(i.entries());
2329
- for (let l = 0; l < s.length; ++l) {
2330
- const [c, d] = s[l];
2331
- if (d.length === 0)
2332
- continue;
2333
- const m = (t ? c.slice(e.length) : c).split("/");
2334
- for (let f = 1; f < m.length; ++f)
2335
- o.add(m.slice(0, f).join("/"));
2336
- }
2337
- const a = new Array(o.size);
2338
- for (const l of o)
2339
- a.push(ae(e + l, { recursive: !0 }));
2340
- await Promise.all(a);
2341
- const r = new Array(s.length), n = t ? "" : e;
2342
- for (let l = 0; l < s.length; ++l) {
2343
- const [c, d] = s[l];
2344
- if (d.length === 0)
2345
- continue;
2346
- const m = n + c;
2347
- r[l] = Pe(m, d);
2348
- }
2349
- await Promise.all(r);
2350
- }
2351
- function Re(e, t) {
2352
- if (e.config.types.fullTypeCheck)
2353
- if ("getSemanticDiagnostics" in e.program) {
2354
- const i = e.builderProgram === void 0 ? E.getPreEmitDiagnostics(e.program) : e.builderProgram.getSemanticDiagnostics();
2355
- i.length > 0 && (e.config.context.logger.error(
2356
- E.formatDiagnosticsWithColorAndContext(i, se)
2357
- ), 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`)}`);
2358
- } else
2359
- e.emitError("Can't do type checking as the passed ts.Program is not a ts.Program instance.", {
2360
- file: void 0,
2361
- node: void 0
2362
- });
2363
- }
2364
- const Ot = async function() {
2365
- if (this.watchFiles !== void 0)
2366
- throw Error(
2367
- "The ApiExtractor.watch() is already in progress, or previous watch crashed with unrecoverable error. Stop the previous watch first or create a new ApiExtractor"
2368
- );
2369
- this.watchFiles = /* @__PURE__ */ new Map(), this.moduleMap = /* @__PURE__ */ new Map();
2370
- const e = this.config;
2371
- let t;
2372
- const i = /* @__PURE__ */ new Map();
2373
- let o = [];
2374
- const s = (u, v, C) => {
2375
- r(u), n(v, C, u.previousModule);
2376
- }, a = (u, v) => {
2377
- this.watchFiles.delete(v), u.module !== void 0 && o.push(u.module), r(u);
2378
- }, r = (u) => {
2379
- if (u.module === void 0)
2380
- return;
2381
- const v = u.module;
2382
- this.moduleMap.delete(v.path), u.previousModule = u.module, u.module = void 0, u.isEmptyModule = !1;
2383
- for (const C of u.dependencies)
2384
- this.watchFiles.get(C)?.dependents.delete(v.sourcePath);
2385
- for (const [C, y] of u.dependents) {
2386
- const b = this.watchFiles.get(C);
2387
- b !== void 0 && (y ? (b.dependencies.delete(v.sourcePath), r(b)) : b.hasDirtyLinks = !0);
2388
- }
2389
- }, n = (u, v, C) => {
2390
- if (v === void 0) {
2391
- const y = e.context.cwd + u, b = ct(y, "utf8");
2392
- v = Je(y, b);
2393
- }
2394
- this.watchFiles.set(u, {
2395
- file: v,
2396
- module: void 0,
2397
- previousModule: C,
2398
- isEmptyModule: !1,
2399
- dependencies: /* @__PURE__ */ new Set(),
2400
- dependents: /* @__PURE__ */ new Map(),
2401
- docLinks: [],
2402
- hasDirtyLinks: !1,
2403
- wasRemoved: !1
2404
- });
2405
- };
2406
- let l, c = !0, d;
2407
- m();
2408
- function m() {
2409
- return d === void 0 ? (d = Promise.withResolvers(), e.watch.onUpdate(d.promise), !0) : !1;
2410
- }
2411
- function f(u) {
2412
- d?.resolve(u), d = void 0;
2413
- }
2414
- const p = async () => {
2415
- this.changedDtsFiles = e.watch.skipWritingUnchanged && this.dtsFiles.size > 0 ? /* @__PURE__ */ new Map() : void 0;
2416
- let u;
2417
- try {
2418
- u = await this.run();
2419
- } catch (M) {
2420
- throw f(void 0), M;
2421
- }
2422
- const v = [], C = [];
2423
- for (const M of this.watchFiles.values()) {
2424
- const I = M.module, P = M.previousModule;
2425
- if (I === void 0)
2426
- P !== void 0 && (M.module = M.previousModule, a(M, P.sourcePath));
2427
- else {
2428
- P === void 0 ? (c || C.push(I), M.previousModule = I) : I !== P && (Ve(I, P) ? M.module = P : (v.push({ old: P, new: I }), M.previousModule = I));
2429
- const L = h(I);
2430
- L.isStale && (L.isStale = !1);
2431
- }
2432
- }
2433
- this.program ??= {
2434
- getSourceFiles: () => {
2435
- const M = [];
2436
- for (const I of this.watchFiles.values())
2437
- M.push(I.file);
2438
- return M;
2439
- },
2440
- getSourceFile: (M) => this.watchFiles.get(M.slice(e.context.cwd.length))?.file
2441
- };
2442
- const y = {
2443
- apiJson: u.apiJson,
2444
- dtsFiles: u.dtsFiles,
2445
- changedModules: v,
2446
- addedModules: C,
2447
- removedModules: o
2448
- };
2449
- o = [];
2450
- const b = c || v.length > 0 || C.length > 0 || y.removedModules.length > 0;
2451
- c = !1, f(b ? y : void 0), l?.();
2452
- };
2453
- if (e.types.typeCheckedExtraction || e.types.fullTypeCheck) {
2454
- const u = e.types.fullTypeCheck ? E.createSemanticDiagnosticsBuilderProgram : E.createAbstractBuilder;
2455
- let v;
2456
- const C = (k, F, T, ...w) => (v = T, u(
2457
- // If not doing full type check, don't scout test files
2458
- // If non-tests import tests, they will be included implicitly anyway
2459
- e.types.fullTypeCheck ? k : k?.filter(($) => !He($)),
2460
- F,
2461
- T,
2462
- ...w
2463
- // Type cast to keep types simpler&aligned between two branches
2464
- )), y = E.createWatchCompilerHost(
2465
- // This parses the config file again (we already do it) and computes the
2466
- // files include array, however avoiding this is tricky, and overhead is small.
2467
- e.types.typeScriptConfigPath,
2468
- void 0,
2469
- E.sys,
2470
- C,
2471
- void 0,
2472
- void 0
2473
- ), b = y.setTimeout;
2474
- let M;
2475
- y.setTimeout = b === void 0 ? void 0 : (k, F, ...T) => {
2476
- if (!(T[0] === "timerToUpdateProgram"))
2477
- return b(k, F, ...T);
2478
- const G = M !== void 0 ? Promise.resolve() : d === void 0 ? Promise.resolve(m()) : d.promise.finally(m);
2479
- return M = b(
2480
- (...J) => {
2481
- M = void 0, G.finally(() => {
2482
- this.program = void 0, k(...J), this.program === void 0 && f(void 0);
2483
- });
2484
- },
2485
- e.watch.debounceTime,
2486
- ...T
2487
- ), M;
2488
- };
2489
- const I = y.onWatchStatusChange, P = 6031, L = 6032;
2490
- y.onWatchStatusChange = (k, ...F) => {
2491
- k.code === L ? e.watch.clearScreen && E.sys.clearScreen?.() : k.code !== P && I?.(k, ...F);
2492
- }, y.afterProgramCreate = (k) => {
2493
- this.builderProgram = k;
2494
- const F = k.getProgram();
2495
- this.program = F;
2496
- const T = F.getSourceFiles();
2497
- e.types.typeScriptInstanceCreated(F, v);
2498
- for (const $ of this.watchFiles.values())
2499
- $.wasRemoved = !0;
2500
- let w = !1;
2501
- for (let $ = 0; $ < T.length; ++$) {
2502
- const G = T[$];
2503
- if (!pe(G.fileName, this))
2504
- continue;
2505
- const z = G.fileName.slice(e.context.cwd.length), J = this.watchFiles.get(z);
2506
- J === void 0 ? (n(z, G, void 0), w = !0) : J.file !== G ? (s(J, z, G), w = !0) : J.wasRemoved = !1;
2507
- }
2508
- for (const [$, G] of this.watchFiles)
2509
- G.wasRemoved && (a(G, $), w = !0);
2510
- w ? p() : (Re(this, _()), f(void 0));
2511
- }, t = E.createWatchProgram(y);
2512
- } else {
2513
- let u = function(y) {
2514
- return dt(y, {
2515
- throwIfNoEntry: !1
2516
- })?.isFile();
2517
- };
2518
- const v = rt(() => {
2519
- let y = !1;
2520
- for (const [b, M] of i)
2521
- y = C(b, M) || y;
2522
- i.clear(), y ? (e.watch.clearScreen && E.sys.clearScreen?.(), p()) : f(void 0);
2523
- }, e.watch.debounceTime), C = (y, b) => {
2524
- const M = e.context.cwd + y, I = !b, P = this.watchFiles.get(y), L = P !== void 0;
2525
- if (I || P === void 0) {
2526
- const k = u(M);
2527
- if (k === !1) {
2528
- let T, w = !1;
2529
- try {
2530
- T = at(M, { recursive: !0 });
2531
- let $;
2532
- for (; ($ = T.readSync()) !== null; ) {
2533
- if ($.isDirectory())
2534
- continue;
2535
- const z = `${$.parentPath}/${$.name}`.slice(e.context.cwd.length);
2536
- je(z) && (w = C(z, !1) || w);
2537
- }
2538
- } finally {
2539
- T?.closeSync();
2540
- }
2541
- return w;
2542
- }
2543
- const F = k === !0;
2544
- if (L) {
2545
- if (F)
2546
- return s(P, y, void 0), !0;
2547
- {
2548
- const T = P?.module !== void 0;
2549
- return a(P, y), T;
2550
- }
2551
- } else {
2552
- if (F)
2553
- return n(y, void 0, void 0), !0;
2554
- {
2555
- let T = !1;
2556
- const w = `${y}/`;
2557
- for (const [$, G] of this.watchFiles)
2558
- $.startsWith(w) && (a(G, $), T = !0);
2559
- return T;
2560
- }
2561
- }
2562
- } else
2563
- return s(P, y, void 0), !0;
2564
- };
2565
- t = lt(this.basePath, { recursive: !0 }, (y, b) => {
2566
- const M = m(), I = b === null ? void 0 : Ze(b), P = y === "change";
2567
- if (I !== void 0 && // If changed, check if it is an included file
2568
- // For a rename, we don't know if it is directory or a file - only check
2569
- // if directory is included, and the file will be checked later.
2570
- (P ? pe(this.basePath + I, this) : ze(this.basePath + I, this))) {
2571
- const L = e.context.basePath + I, F = (i.get(L) ?? !0) && P;
2572
- i.set(L, F);
2573
- }
2574
- M && v();
2575
- }), p(), l = () => {
2576
- i.size > 0 && v();
2577
- };
2578
- }
2579
- return {
2580
- close: async () => {
2581
- t.close(), i.clear(), await d?.promise, this.watchFiles = void 0;
2582
- }
2583
- };
2584
- }, Nt = ".verify-typings.ts";
2585
- class Bt {
2586
- constructor(t, i = N.join(process.cwd(), "dist")) {
2587
- this.extractor = t, this.virtualCwdPath = N.join(i, "/");
2588
- }
2589
- verifyTypes(t) {
2590
- const i = _(), o = /* @__PURE__ */ Object.create(null);
2591
- o[this.virtualCwdPath + Nt] = this.getVerificationFileContents(t);
2592
- const s = this.extractor.config.context.dtsEmitPath === "" ? this.virtualCwdPath : "";
2593
- for (const [f, p] of this.extractor.dtsFiles)
2594
- o[s + f] = p;
2595
- const a = {
2596
- lib: ["lib.dom.d.ts", "lib.esnext.d.ts"],
2597
- module: E.ModuleKind.ESNext,
2598
- // Our dependencies' typings are not yet moduleResolution:Node16 compatible
2599
- moduleResolution: E.ModuleResolutionKind.Bundler,
2600
- target: E.ScriptTarget.ESNext,
2601
- noPropertyAccessFromIndexSignature: !0,
2602
- noUncheckedIndexedAccess: !0,
2603
- noImplicitOverride: !0,
2604
- skipDefaultLibCheck: !0,
2605
- strict: !0,
2606
- verbatimModuleSyntax: !0,
2607
- esModuleInterop: !0,
2608
- declaration: !0,
2609
- // Performance optimization. Don't auto-load node_modules/@types
2610
- types: [],
2611
- // Performance optimization. Don't look up node_modules/@typescript/lib-...
2612
- libReplacement: !1
2613
- }, r = E.createCompilerHost(a), n = r.fileExists;
2614
- r.fileExists = (f) => f.endsWith("package.json") ? f.includes("node_modules") ? n(f) : !1 : o[f] !== void 0 ? !0 : f.endsWith(".d.ts") ? n(f) : !1, r.useCaseSensitiveFileNames = () => !0;
2615
- const l = r.readFile;
2616
- r.readFile = (f) => {
2617
- const p = o[f];
2618
- return p === void 0 ? l(f) : p;
2619
- };
2620
- const c = r.directoryExists;
2621
- r.directoryExists = (f) => f.includes("node_modules") ? c(f) : !0, r.getCurrentDirectory = () => this.virtualCwdPath, r.getCanonicalFileName = se.getCanonicalFileName;
2622
- const d = E.createProgram({
2623
- rootNames: Object.keys(o),
2624
- host: r,
2625
- options: a
2626
- }), m = E.getPreEmitDiagnostics(d).filter(this.extractor.config.verify.filterTypeCheckDiagnostic);
2627
- m.length && (this.extractor.config.context.logger.error(
2628
- E.formatDiagnosticsWithColorAndContext(m, se)
2629
- ), process.exitCode = 1, this.extractor.errorCount += m.length), this.extractor.config.context.logger.info(`${H}Types verified in ${x("green", `${i()}s`)}`);
2630
- }
2631
- printTypeParameters(t, i) {
2632
- if (t === void 0)
2633
- return "";
2634
- let o = "";
2635
- for (let s = 0; s < t.length; ++s) {
2636
- const a = t[s];
2637
- if (a.default !== void 0)
2638
- break;
2639
- o === "" ? o += "<" : o += ", ", o += a.constraint === void 0 ? "any" : le(a.constraint, i).text;
2640
- }
2641
- return o === "" ? "" : `${o}>`;
2642
- }
2643
- getVerificationFileContents(t) {
2644
- let i = `declare const $: unknown;
2645
-
2646
- `;
2647
- for (let o = 0; o < t.length; ++o) {
2648
- const s = t[o], a = h(s);
2649
- if (a.constructorPropertiesInterface !== void 0) {
2650
- const r = a.constructorPropertiesInterface.name, n = this.printTypeParameters(
2651
- a.constructorPropertiesInterface.typeParameters,
2652
- s.path
2653
- ), l = r.slice(0, -10), c = s.exports === void 0 ? l : "default";
2654
- i += `$ as import("./${s.path}.js").${c}${n} satisfies import("./${s.path}.js").${r}${n};
2655
- `;
2656
- }
2657
- }
2658
- return i;
2659
- }
2660
- }
2661
- class ei {
2662
- /**
2663
- * @public
2664
- * @param rawConfig Optional configuration for the extractor.
2665
- */
2666
- constructor(t = {}) {
2667
- 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 = Dt.bind(this), this.watch = Ot.bind(this), this.emitError = De.bind(this);
2668
- const i = Xe(t);
2669
- 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([
2670
- ...Object.keys(i.context.packageJson.dependencies ?? {}),
2671
- ...Object.keys(i.context.packageJson.peerDependencies ?? {})
2672
- ]), this.resolveJsDocLink = i.context.isLuminaMinimalExtraction ? Ee : qe.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 Bt(this, i.context.dtsEmitPath || void 0) : void 0, this.localPrivateDeclarations = i.strict ? void 0 : /* @__PURE__ */ new Map();
2673
- }
2674
- /**
2675
- * Given an array of ApiModules, add top-level api.json metadata and return
2676
- * the completed ApiJson structure.
2677
- */
2678
- wrapApiModules(t) {
2679
- return {
2680
- name: this.config.context.packageJson.name,
2681
- timestamp: (/* @__PURE__ */ new Date()).toISOString().split(".")[0],
2682
- compiler: {
2683
- // Preserve previous compiler.name for component projects as that is what
2684
- // pre 5.0 Lumina versions expect.
2685
- name: this.isComponentProject ? "@arcgis/lumina-compiler" : me.name,
2686
- version: me.version,
2687
- typescriptVersion: E.version
2688
- },
2689
- // https://github.com/webcomponents/custom-elements-manifest?tab=readme-ov-file#schema-versioning
2690
- // https://github.com/webcomponents/custom-elements-manifest/releases
2691
- schemaVersion: "2.1.0",
2692
- readme: void 0,
2693
- deprecated: void 0,
2694
- modules: t
2695
- };
2696
- }
2697
- }
2698
- export {
2699
- ei as A,
2700
- Lt as w
2701
- };