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