@arcgis/api-extractor 5.2.0-next.86 → 5.2.0-next.87

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