@arcgis/api-extractor 5.1.0-next.99 → 5.2.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{ApiExtractor-CYe0v4qU.js → ApiExtractor-DNNO0gUt.js} +421 -385
- package/dist/apiJson.d.ts +8 -0
- package/dist/extractor/ApiExtractor.js +3 -3
- package/dist/extractor/config.js +2 -2
- package/dist/extractor/extractors/copyDoc.d.ts +1 -1
- package/dist/extractor/processing/links.js +43 -43
- package/dist/{typeScript-BJ98xoUG.js → typeScript-Dk1Rn-2E.js} +1 -1
- package/dist/utils/inferEntrypoints.js +1 -0
- package/dist/vite/plugin.js +3 -3
- package/dist/vite/typeScript.js +1 -1
- package/dist/worker-CCFrgas5.js +3699 -0
- package/package.json +6 -6
- package/dist/worker-BKOEQXzG.js +0 -3684
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import { l as H, a as se, e as De, p as me } from "./typeScript-
|
|
2
|
-
import { a as be, o as xe, t as Le, b as Oe, c as Ne, e as Be, p as We, d as Ue, f as _, i as pe, g as
|
|
3
|
-
import { getViewUrl as Ye, postProcessDeprecated as Q, postProcessDescription as
|
|
1
|
+
import { l as H, a as se, e as De, p as me } from "./typeScript-Dk1Rn-2E.js";
|
|
2
|
+
import { a as be, o as xe, t as Le, b as Oe, c as Ne, e as Be, p as We, d as Ue, f as _, i as pe, g as je, h as ze, j as He, k as Je, n as Ve, r as Xe } from "./worker-CCFrgas5.js";
|
|
3
|
+
import { getViewUrl as Ye, postProcessDeprecated as Q, postProcessDescription as R, postProcessDocsTags as V, resolveJsDocLink as qe } from "./extractor/processing/links.js";
|
|
4
4
|
import E from "typescript";
|
|
5
5
|
import { path as N, toPosixPathSeparators as Ze } from "@arcgis/components-build-utils";
|
|
6
6
|
import { mkdir as ae, writeFile as Pe } from "fs/promises";
|
|
7
7
|
import { styleText as x } from "node:util";
|
|
8
8
|
import { kebabToPascal as _e } from "@arcgis/toolkit/string";
|
|
9
|
-
import { g as h, a as fe, b as Ke, c as Qe, d as Ie, e as
|
|
10
|
-
import { apiTypeToImportType as le, globalPackageIdentifier as
|
|
11
|
-
import { printTypeParameters as te, printTypeAlias as
|
|
9
|
+
import { g as h, a as fe, b as Ke, c as Qe, d as Ie, e as oe, p as ne } from "./privateContext-CB7P40up.js";
|
|
10
|
+
import { apiTypeToImportType as le, globalPackageIdentifier as ke, getApiMemberName as et, getMaybeStaticApiMemberName as ce, mergeApiNodes as Se, naturalSortModules as tt, compareNamedNodes as it, compareClassMembers as ot } from "./utils/apiHelpers.js";
|
|
11
|
+
import { printTypeParameters as te, printTypeAlias as nt } from "./utils/partPrinter.js";
|
|
12
12
|
import { identity as Ee, debounce as rt } from "@arcgis/toolkit/function";
|
|
13
|
-
import {
|
|
14
|
-
|
|
13
|
+
import { hasRuntimeDeclaration as st } from "./utils/inferEntrypoints.js";
|
|
14
|
+
import { opendirSync as at, watch as lt, readFileSync as ct, statSync as dt } from "node:fs";
|
|
15
|
+
const S = "/** @deprecated since 5.0. Refactor using \\@arcgis/codemod */", ft = `${S}
|
|
15
16
|
type HashMap<T> = Record<string, T | undefined>;
|
|
16
|
-
${
|
|
17
|
+
${S}
|
|
17
18
|
type nullish = null | undefined;
|
|
18
19
|
|
|
19
|
-
${
|
|
20
|
+
${S}
|
|
20
21
|
type IHandle = import("./core/Handles.js").ResourceHandle;
|
|
21
22
|
|
|
22
|
-
${
|
|
23
|
+
${S}
|
|
23
24
|
type GroupKey<T> = import("./core/Accessor.js").GroupKey<T>;
|
|
24
25
|
|
|
25
|
-
${
|
|
26
|
+
${S}
|
|
26
27
|
declare namespace __esri {
|
|
27
|
-
${
|
|
28
|
+
${S}
|
|
28
29
|
type Constructor<T> = new (...params: any[]) => T;
|
|
29
30
|
|
|
30
|
-
${
|
|
31
|
+
${S}
|
|
31
32
|
export type AnonymousAccessor = Accessor;
|
|
32
33
|
|
|
33
|
-
${
|
|
34
|
+
${S}
|
|
34
35
|
export type ReadonlyAccessor = Omit<Accessor, "set" | "_set" | "destroy" | "notifyChange" | "_get">;
|
|
35
36
|
|
|
36
|
-
`,
|
|
37
|
+
`, mt = `
|
|
37
38
|
|
|
38
|
-
${
|
|
39
|
+
${S}
|
|
39
40
|
export namespace CIM {
|
|
40
41
|
export enum ExpressionReturnType {
|
|
41
42
|
Default = "Default",
|
|
@@ -1088,24 +1089,24 @@ declare namespace __esri {
|
|
|
1088
1089
|
| ExternalReferenceEnvelope;
|
|
1089
1090
|
}
|
|
1090
1091
|
|
|
1091
|
-
${
|
|
1092
|
+
${S}
|
|
1092
1093
|
export type EventHandlerCallback = (selectionResult: SelectionResultType) => void;
|
|
1093
|
-
${
|
|
1094
|
+
${S}
|
|
1094
1095
|
export type On = (eventName: string, eventHandler: EventHandlerCallback) => IHandle;
|
|
1095
1096
|
}`;
|
|
1096
|
-
let B, D,
|
|
1097
|
-
function
|
|
1098
|
-
|
|
1097
|
+
let B, D, j, W, O = "", U = "", q = "", ee = "";
|
|
1098
|
+
function pt(e, t) {
|
|
1099
|
+
j = void 0, W = void 0, U = e.path, q = "", ee = "";
|
|
1099
1100
|
const i = `import("./${U}.js")`;
|
|
1100
|
-
let
|
|
1101
|
+
let o = "";
|
|
1101
1102
|
const s = e.exports?.[0]?.declaration.name, a = h(e);
|
|
1102
1103
|
if (a.constructorPropertiesInterface !== void 0) {
|
|
1103
|
-
const
|
|
1104
|
-
ye(
|
|
1104
|
+
const n = a.constructorPropertiesInterface;
|
|
1105
|
+
ye(n), A.length !== 0 && (o += ue(n, U, n.name, t));
|
|
1105
1106
|
}
|
|
1106
1107
|
let r;
|
|
1107
|
-
for (let
|
|
1108
|
-
const l = e.declarations[
|
|
1108
|
+
for (let n = 0; n < e.declarations.length; ++n) {
|
|
1109
|
+
const l = e.declarations[n];
|
|
1109
1110
|
if (ye(l), A.length === 0)
|
|
1110
1111
|
continue;
|
|
1111
1112
|
const c = l.name === s, d = c ? "default" : l.name, m = l.kind === "function", f = l.kind === "variable";
|
|
@@ -1120,7 +1121,7 @@ function mt(e, t) {
|
|
|
1120
1121
|
}), Z(A[0], t), D === void 0 && t.emitError("Expected default export @esriCompatibilityName tag to include a #", {
|
|
1121
1122
|
file: h(e).file,
|
|
1122
1123
|
node: void 0
|
|
1123
|
-
}),
|
|
1124
|
+
}), o += ` ${S}
|
|
1124
1125
|
interface ${D} {
|
|
1125
1126
|
${l.name}: typeof ${i}.${d};
|
|
1126
1127
|
}
|
|
@@ -1138,13 +1139,13 @@ function mt(e, t) {
|
|
|
1138
1139
|
}), Z(A[0], t), (D !== void 0 || B !== void 0) && t.emitError("Expected default export @esriCompatibilityName tag to not include a # or .", {
|
|
1139
1140
|
file: h(e).file,
|
|
1140
1141
|
node: void 0
|
|
1141
|
-
}),
|
|
1142
|
+
}), o += ` export const ${O}: typeof ${i}.default;
|
|
1142
1143
|
|
|
1143
1144
|
`;
|
|
1144
1145
|
continue;
|
|
1145
1146
|
}
|
|
1146
1147
|
for (let p = 0; p < A.length; ++p)
|
|
1147
|
-
Z(A[p], t), f &&
|
|
1148
|
+
Z(A[p], t), f && j !== void 0 ? q += ` export const ${O}: ${i}.${d};
|
|
1148
1149
|
` : ee += ` ${O}: typeof ${i}.${d};
|
|
1149
1150
|
`;
|
|
1150
1151
|
} else if (l.kind === "class" || l.kind === "mixin" || l.kind === "interface" && fe(l).isMixinBaseClass === !0) {
|
|
@@ -1152,23 +1153,23 @@ function mt(e, t) {
|
|
|
1152
1153
|
for (let C = 0; C < A.length; ++C) {
|
|
1153
1154
|
if (Z(A[C], t), O.startsWith("$")) {
|
|
1154
1155
|
const b = O.slice(1);
|
|
1155
|
-
|
|
1156
|
+
o += ut(b, l, d, U);
|
|
1156
1157
|
continue;
|
|
1157
1158
|
}
|
|
1158
1159
|
const y = B === void 0 ? " " : " ";
|
|
1159
|
-
|
|
1160
|
+
o += `${y}${S}
|
|
1160
1161
|
${y}export type ${O}${p} =${v}${g};
|
|
1161
1162
|
${y}export const ${O}: typeof${v}${u};
|
|
1162
1163
|
|
|
1163
1164
|
`;
|
|
1164
1165
|
}
|
|
1165
|
-
} else l.kind === "interface" && (
|
|
1166
|
+
} else l.kind === "interface" && (o += ue(l, U, d, t));
|
|
1166
1167
|
}
|
|
1167
|
-
return q.length > 0 && (
|
|
1168
|
+
return q.length > 0 && (j === void 0 && t.emitError("Invalid @esriCompatibilityName usage: Namespace name was not set correctly.", {
|
|
1168
1169
|
file: h(e).file,
|
|
1169
1170
|
node: void 0
|
|
1170
|
-
}),
|
|
1171
|
-
namespace ${
|
|
1171
|
+
}), o += ` ${S}
|
|
1172
|
+
namespace ${j} {
|
|
1172
1173
|
${q.slice(0, -1)} }
|
|
1173
1174
|
|
|
1174
1175
|
`), ee.length > 0 && (W === void 0 && t.emitError(
|
|
@@ -1177,52 +1178,52 @@ ${q.slice(0, -1)} }
|
|
|
1177
1178
|
file: h(e).file,
|
|
1178
1179
|
node: void 0
|
|
1179
1180
|
}
|
|
1180
|
-
),
|
|
1181
|
+
), o += ` ${S}
|
|
1181
1182
|
interface ${W} {
|
|
1182
1183
|
${ee} }
|
|
1183
1184
|
|
|
1184
1185
|
export const ${W}: ${W};
|
|
1185
1186
|
|
|
1186
|
-
`),
|
|
1187
|
+
`), o;
|
|
1187
1188
|
}
|
|
1188
|
-
function ue(e, t, i,
|
|
1189
|
+
function ue(e, t, i, o) {
|
|
1189
1190
|
const s = te(K(e.typeParameters, !1, void 0)), a = K(e.typeParameters, !1, t), r = `import("./${t}.js").${i}${s}`;
|
|
1190
|
-
let
|
|
1191
|
+
let n = "";
|
|
1191
1192
|
for (let l = 0; l < A.length; ++l) {
|
|
1192
|
-
Z(A[l],
|
|
1193
|
-
const c =
|
|
1194
|
-
B === void 0 ?
|
|
1193
|
+
Z(A[l], o);
|
|
1194
|
+
const c = nt(O, a, void 0, r);
|
|
1195
|
+
B === void 0 ? n += ` ${S}
|
|
1195
1196
|
${c}
|
|
1196
|
-
` : q += ` ${
|
|
1197
|
+
` : q += ` ${S}
|
|
1197
1198
|
${c}
|
|
1198
1199
|
|
|
1199
1200
|
`;
|
|
1200
1201
|
}
|
|
1201
|
-
return
|
|
1202
|
-
`,
|
|
1202
|
+
return n += `
|
|
1203
|
+
`, n;
|
|
1203
1204
|
}
|
|
1204
1205
|
function K(e, t, i) {
|
|
1205
1206
|
if (e === void 0)
|
|
1206
1207
|
return;
|
|
1207
|
-
const
|
|
1208
|
+
const o = [];
|
|
1208
1209
|
for (let s = 0; s < e.length; ++s) {
|
|
1209
1210
|
const a = e[s];
|
|
1210
1211
|
if (i !== void 0) {
|
|
1211
|
-
const r = a.constraint === void 0 ? void 0 : le(a.constraint, i),
|
|
1212
|
+
const r = a.constraint === void 0 ? void 0 : le(a.constraint, i), n = a.default === void 0 ? r ?? {
|
|
1212
1213
|
text: "any",
|
|
1213
1214
|
references: void 0,
|
|
1214
1215
|
values: void 0,
|
|
1215
1216
|
source: void 0
|
|
1216
1217
|
} : le(a.default, i);
|
|
1217
|
-
|
|
1218
|
+
o.push({
|
|
1218
1219
|
...a,
|
|
1219
|
-
default:
|
|
1220
|
+
default: n,
|
|
1220
1221
|
constraint: r
|
|
1221
1222
|
});
|
|
1222
1223
|
} else if (t) {
|
|
1223
1224
|
if (a.default !== void 0)
|
|
1224
1225
|
break;
|
|
1225
|
-
|
|
1226
|
+
o.push({
|
|
1226
1227
|
name: "any",
|
|
1227
1228
|
constraint: void 0,
|
|
1228
1229
|
default: void 0,
|
|
@@ -1231,7 +1232,7 @@ function K(e, t, i) {
|
|
|
1231
1232
|
out: void 0
|
|
1232
1233
|
});
|
|
1233
1234
|
} else
|
|
1234
|
-
|
|
1235
|
+
o.push({
|
|
1235
1236
|
name: a.name,
|
|
1236
1237
|
constraint: void 0,
|
|
1237
1238
|
default: void 0,
|
|
@@ -1240,7 +1241,7 @@ function K(e, t, i) {
|
|
|
1240
1241
|
out: void 0
|
|
1241
1242
|
});
|
|
1242
1243
|
}
|
|
1243
|
-
return
|
|
1244
|
+
return o.length === 0 ? void 0 : o;
|
|
1244
1245
|
}
|
|
1245
1246
|
const ie = [];
|
|
1246
1247
|
let A = ie;
|
|
@@ -1250,8 +1251,8 @@ function ye(e) {
|
|
|
1250
1251
|
function Z(e, t) {
|
|
1251
1252
|
const i = e.indexOf(".");
|
|
1252
1253
|
if (i !== -1) {
|
|
1253
|
-
B = e.slice(0, i), D = void 0, O = e.slice(i + 1),
|
|
1254
|
-
`Invalid @esriCompatibilityName usage: Multiple different namespaces in a single file are not supported. Found ${
|
|
1254
|
+
B = e.slice(0, i), D = void 0, O = e.slice(i + 1), j === void 0 ? j = B : j !== B && t.emitError(
|
|
1255
|
+
`Invalid @esriCompatibilityName usage: Multiple different namespaces in a single file are not supported. Found ${j} and ${B}`,
|
|
1255
1256
|
{
|
|
1256
1257
|
file: void 0,
|
|
1257
1258
|
scope: U,
|
|
@@ -1260,9 +1261,9 @@ function Z(e, t) {
|
|
|
1260
1261
|
);
|
|
1261
1262
|
return;
|
|
1262
1263
|
}
|
|
1263
|
-
const
|
|
1264
|
-
if (
|
|
1265
|
-
B = void 0, D = e.slice(0,
|
|
1264
|
+
const o = e.indexOf("#");
|
|
1265
|
+
if (o !== -1) {
|
|
1266
|
+
B = void 0, D = e.slice(0, o), O = e.slice(o + 1), W === void 0 ? W = D : W !== D && t.emitError(
|
|
1266
1267
|
`Invalid @esriCompatibilityName usage: Multiple different __esri interfaces in a single file are not supported. Found ${W} and ${D}`,
|
|
1267
1268
|
{
|
|
1268
1269
|
file: void 0,
|
|
@@ -1274,25 +1275,25 @@ function Z(e, t) {
|
|
|
1274
1275
|
}
|
|
1275
1276
|
B = void 0, D = void 0, O = e;
|
|
1276
1277
|
}
|
|
1277
|
-
function
|
|
1278
|
-
const s =
|
|
1279
|
-
t.name.startsWith(A[0]) ? A[0] : t.name}${_e(e)}Event`,
|
|
1280
|
-
return ` ${
|
|
1281
|
-
export type ${r}${
|
|
1282
|
-
${
|
|
1278
|
+
function ut(e, t, i, o) {
|
|
1279
|
+
const s = yt(e, t.events), r = `${// IdentityManager fake class got renamed to IdentityManagerBase real class
|
|
1280
|
+
t.name.startsWith(A[0]) ? A[0] : t.name}${_e(e)}Event`, n = ht(s, o) ?? ` = import("./${o}.js").${i}["@eventTypes"]["${e}"]`, l = n.startsWith("<") ? n.indexOf(">") + 1 : -1, c = l !== -1 ? n.slice(0, l) : "";
|
|
1281
|
+
return ` ${S}
|
|
1282
|
+
export type ${r}${n};
|
|
1283
|
+
${S}
|
|
1283
1284
|
export type ${r}Handler${c} = (event: ${r}${c}) => void;
|
|
1284
1285
|
|
|
1285
1286
|
`;
|
|
1286
1287
|
}
|
|
1287
|
-
function
|
|
1288
|
+
function yt(e, t) {
|
|
1288
1289
|
if (t !== void 0)
|
|
1289
1290
|
for (let i = 0; i < t.length; ++i) {
|
|
1290
|
-
const
|
|
1291
|
-
if (
|
|
1292
|
-
return
|
|
1291
|
+
const o = t[i];
|
|
1292
|
+
if (o.name === e)
|
|
1293
|
+
return o;
|
|
1293
1294
|
}
|
|
1294
1295
|
}
|
|
1295
|
-
function
|
|
1296
|
+
function ht(e, t) {
|
|
1296
1297
|
const i = e?.type;
|
|
1297
1298
|
if (t = e?.inheritedFrom?.module ?? t, i?.references?.length === 1) {
|
|
1298
1299
|
const a = i.references[0];
|
|
@@ -1301,31 +1302,31 @@ function yt(e, t) {
|
|
|
1301
1302
|
}
|
|
1302
1303
|
if (i?.references?.length !== 2)
|
|
1303
1304
|
return;
|
|
1304
|
-
const
|
|
1305
|
-
if (!(
|
|
1306
|
-
return t =
|
|
1305
|
+
const o = i.references[0], s = i.references[1];
|
|
1306
|
+
if (!(o.package !== void 0 || s.package !== void 0 || s.module !== void 0 || s.viewUrl !== void 0) && i.text === `${o.name}<${s.name}>`)
|
|
1307
|
+
return t = o.module ?? t, `<${s.name}> = import("./${t}.js").${o.name}<${s.name}>`;
|
|
1307
1308
|
}
|
|
1308
|
-
function
|
|
1309
|
-
let i =
|
|
1310
|
-
for (let
|
|
1311
|
-
const s = e[
|
|
1312
|
-
i +=
|
|
1309
|
+
function gt(e, t) {
|
|
1310
|
+
let i = ft;
|
|
1311
|
+
for (let o = 0; o < e.length; ++o) {
|
|
1312
|
+
const s = e[o];
|
|
1313
|
+
i += pt(s, t);
|
|
1313
1314
|
}
|
|
1314
|
-
return i +
|
|
1315
|
+
return i + mt;
|
|
1315
1316
|
}
|
|
1316
|
-
function
|
|
1317
|
-
let
|
|
1317
|
+
function vt(e, t, i) {
|
|
1318
|
+
let o = "";
|
|
1318
1319
|
const s = t.importsMap, a = /* @__PURE__ */ Object.create(null);
|
|
1319
1320
|
for (const r in s) {
|
|
1320
|
-
const
|
|
1321
|
-
if (!
|
|
1321
|
+
const n = s[r];
|
|
1322
|
+
if (!n.wasUsed)
|
|
1322
1323
|
continue;
|
|
1323
|
-
let l =
|
|
1324
|
-
if (
|
|
1325
|
-
const d = s[
|
|
1324
|
+
let l = n.specifier;
|
|
1325
|
+
if (n.replacementName !== void 0) {
|
|
1326
|
+
const d = s[n.replacementName];
|
|
1326
1327
|
if (d?.wasUsed === !0) {
|
|
1327
|
-
d.specifier !==
|
|
1328
|
-
`Failed to perform type replacement of ${r} with ${
|
|
1328
|
+
d.specifier !== n.specifier && i.emitError(
|
|
1329
|
+
`Failed to perform type replacement of ${r} with ${n.replacementName} because ${n.replacementName} is already imported from ${d.modulePath}, where as type replacement was going to import it from ${n.modulePath}. Either manually replace ${n.replacementName} usage with ${r} or alias ${r} to another name.`,
|
|
1329
1330
|
{
|
|
1330
1331
|
file: t.file,
|
|
1331
1332
|
node: void 0
|
|
@@ -1334,15 +1335,15 @@ function gt(e, t, i) {
|
|
|
1334
1335
|
continue;
|
|
1335
1336
|
}
|
|
1336
1337
|
}
|
|
1337
|
-
const c =
|
|
1338
|
-
if (
|
|
1339
|
-
if (
|
|
1340
|
-
const f =
|
|
1338
|
+
const c = n.replacementName ?? r;
|
|
1339
|
+
if (n.type === "named") {
|
|
1340
|
+
if (n.modulePath !== void 0) {
|
|
1341
|
+
const f = n.actualName ?? c, p = i.moduleMap.get(n.modulePath), g = p === void 0 ? void 0 : h(p);
|
|
1341
1342
|
if (g?.index.named[f] === void 0) {
|
|
1342
|
-
if (i.privateMixinModuleNames.has(
|
|
1343
|
+
if (i.privateMixinModuleNames.has(n.modulePath))
|
|
1343
1344
|
continue;
|
|
1344
1345
|
i.emitError(
|
|
1345
|
-
`The ${x("red", f)} imported from ${x("red", p?.sourcePath ??
|
|
1346
|
+
`The ${x("red", f)} imported from ${x("red", p?.sourcePath ?? n.modulePath)} is not @public but used in the type of a @public declaration. Add /** @public */ JSDoc, refactor out the usage, or ensure ${x("red", f)} is not a re-export, not a namespace, and not an enum.`,
|
|
1346
1347
|
{
|
|
1347
1348
|
file: t.file,
|
|
1348
1349
|
node: void 0
|
|
@@ -1351,88 +1352,88 @@ function gt(e, t, i) {
|
|
|
1351
1352
|
} else
|
|
1352
1353
|
l = re(g, t);
|
|
1353
1354
|
}
|
|
1354
|
-
const d = a[l], m =
|
|
1355
|
+
const d = a[l], m = n.actualName === void 0 ? c : `${n.actualName} as ${c}`;
|
|
1355
1356
|
a[l] = d === void 0 ? m : `${d}, ${m}`;
|
|
1356
|
-
} else if (
|
|
1357
|
-
if (
|
|
1358
|
-
const d = i.moduleMap.get(
|
|
1357
|
+
} else if (n.type === "default") {
|
|
1358
|
+
if (n.modulePath !== void 0) {
|
|
1359
|
+
const d = i.moduleMap.get(n.modulePath), m = d === void 0 ? void 0 : h(d);
|
|
1359
1360
|
m?.index.default === void 0 ? i.emitError(
|
|
1360
|
-
`The default exported declaration in ${x("red", d?.sourcePath ??
|
|
1361
|
+
`The default exported declaration in ${x("red", d?.sourcePath ?? n.modulePath)} is not @public but used in the type of a @public declaration. Add /** @public */ JSDoc or refactor out the usage.`,
|
|
1361
1362
|
{
|
|
1362
1363
|
file: t.file,
|
|
1363
1364
|
node: void 0
|
|
1364
1365
|
}
|
|
1365
1366
|
) : l = re(m, t);
|
|
1366
1367
|
}
|
|
1367
|
-
|
|
1368
|
+
o += `import type ${c} from "${l}";
|
|
1368
1369
|
`;
|
|
1369
1370
|
} else {
|
|
1370
|
-
if (
|
|
1371
|
-
const d = i.moduleMap.get(
|
|
1371
|
+
if (n.modulePath !== void 0) {
|
|
1372
|
+
const d = i.moduleMap.get(n.modulePath);
|
|
1372
1373
|
d === void 0 ? i.emitError(
|
|
1373
|
-
`Non-public module was imported: ${x("red",
|
|
1374
|
+
`Non-public module was imported: ${x("red", n.modulePath)} and used in the type of a public declaration. Ensure the imported module has at least one /** @public */ declaration or refactor out the usage.`,
|
|
1374
1375
|
{
|
|
1375
1376
|
file: t.file,
|
|
1376
1377
|
node: void 0
|
|
1377
1378
|
}
|
|
1378
1379
|
) : l = re(h(d), t);
|
|
1379
1380
|
}
|
|
1380
|
-
c === "__esri" ?
|
|
1381
|
-
${
|
|
1381
|
+
c === "__esri" ? o = `/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
1382
|
+
${o}` : o += `import type * as ${c} from "${l}";
|
|
1382
1383
|
`;
|
|
1383
1384
|
}
|
|
1384
|
-
if (
|
|
1385
|
-
const d = i.moduleMap.get(
|
|
1385
|
+
if (n.modulePath !== void 0 && i.watchFiles !== void 0) {
|
|
1386
|
+
const d = i.moduleMap.get(n.modulePath), f = (d === void 0 ? void 0 : h(d))?.file.fileName.slice(i.config.context.cwd.length);
|
|
1386
1387
|
f !== void 0 && (i.watchFiles.get(e.sourcePath).dependencies.add(f), i.watchFiles.get(f).dependents.set(e.sourcePath, !0));
|
|
1387
1388
|
}
|
|
1388
1389
|
}
|
|
1389
1390
|
if (i.produceDts) {
|
|
1390
1391
|
for (const r in a) {
|
|
1391
|
-
const
|
|
1392
|
-
|
|
1392
|
+
const n = a[r];
|
|
1393
|
+
o += `import type { ${n} } from "${r}";
|
|
1393
1394
|
`;
|
|
1394
1395
|
}
|
|
1395
|
-
t.importsText =
|
|
1396
|
+
t.importsText = o;
|
|
1396
1397
|
}
|
|
1397
1398
|
}
|
|
1398
1399
|
function re(e, t) {
|
|
1399
1400
|
return `${be(t.dtsPath, e.dtsPath)}.js`;
|
|
1400
1401
|
}
|
|
1401
|
-
function
|
|
1402
|
+
function Ct(e, t, i, o) {
|
|
1402
1403
|
const s = e.references;
|
|
1403
1404
|
if (s !== void 0) {
|
|
1404
1405
|
if (t.autoCastingRequiresType === void 0 && s.length > 1 && s[0].module === "core/Collection")
|
|
1405
1406
|
if (s.length > 2)
|
|
1406
1407
|
t.autoCastingRequiresType = !0;
|
|
1407
1408
|
else {
|
|
1408
|
-
const a = s[1], r = a.module === void 0 ? i :
|
|
1409
|
+
const a = s[1], r = a.module === void 0 ? i : o.moduleMap.get(a.module), n = r === void 0 ? void 0 : h(r), l = a.name === "default" ? n?.index.default : n?.index.named[a.name];
|
|
1409
1410
|
Ae(l) && (t.autoCastingRequiresType = !0);
|
|
1410
1411
|
}
|
|
1411
|
-
return Te(e, t,
|
|
1412
|
+
return Te(e, t, o, i, s);
|
|
1412
1413
|
}
|
|
1413
1414
|
}
|
|
1414
|
-
function Te(e, t, i,
|
|
1415
|
+
function Te(e, t, i, o, s) {
|
|
1415
1416
|
for (let a = s.length - 1; a >= 0; a--) {
|
|
1416
1417
|
const r = s[a];
|
|
1417
1418
|
if (r.package !== void 0) {
|
|
1418
|
-
r.package ===
|
|
1419
|
+
r.package === ke && r.name === "Date" && he(
|
|
1419
1420
|
e,
|
|
1420
1421
|
s,
|
|
1421
1422
|
a,
|
|
1422
|
-
{ type:
|
|
1423
|
+
{ type: xt, inheritedFrom: void 0 },
|
|
1423
1424
|
i,
|
|
1424
|
-
|
|
1425
|
+
o,
|
|
1425
1426
|
t
|
|
1426
1427
|
);
|
|
1427
1428
|
continue;
|
|
1428
1429
|
}
|
|
1429
|
-
const
|
|
1430
|
+
const n = r.module === void 0 ? o : i.moduleMap.get(r.module), l = n === void 0 ? void 0 : h(n), c = r.name === "default" ? l?.index.default : l?.index.named[r.name];
|
|
1430
1431
|
if (Ae(c)) {
|
|
1431
1432
|
const m = `(${c.type.text})`, f = e.text;
|
|
1432
1433
|
e.text = `${e.text.slice(0, r.start)}${m}${e.text.slice(r.end)}`;
|
|
1433
1434
|
const p = e.text, g = r.start + 1, u = [];
|
|
1434
1435
|
for (let C = 0; C < c.type.references.length; ++C) {
|
|
1435
|
-
const y = c.type.references[C], b = y.module ??
|
|
1436
|
+
const y = c.type.references[C], b = y.module ?? n?.path, M = b === o.path;
|
|
1436
1437
|
u.push({
|
|
1437
1438
|
...y,
|
|
1438
1439
|
module: M ? void 0 : b,
|
|
@@ -1440,7 +1441,7 @@ function Te(e, t, i, n, s) {
|
|
|
1440
1441
|
end: y.end + g
|
|
1441
1442
|
});
|
|
1442
1443
|
}
|
|
1443
|
-
if (Te(e, t, i,
|
|
1444
|
+
if (Te(e, t, i, o, u), e.text === p) {
|
|
1444
1445
|
e.text = f;
|
|
1445
1446
|
continue;
|
|
1446
1447
|
}
|
|
@@ -1451,12 +1452,12 @@ function Te(e, t, i, n, s) {
|
|
|
1451
1452
|
}
|
|
1452
1453
|
if (c?.kind !== "class")
|
|
1453
1454
|
continue;
|
|
1454
|
-
const d = $e(c,
|
|
1455
|
+
const d = $e(c, n, void 0, i);
|
|
1455
1456
|
if (d === void 0) {
|
|
1456
1457
|
i.emitError(
|
|
1457
|
-
`Failed to resolve auto-castable type for ${x("red", c.name)} from ${x("red",
|
|
1458
|
+
`Failed to resolve auto-castable type for ${x("red", c.name)} from ${x("red", n.sourcePath)}. Ensure the class either has a public constructor or a public ${x("green", c.name)}Properties interface. Auto-casting resolution was attempted because this class is used in an autocastable property in ${x("blue", o.sourcePath)} in type ${x("blue", e.text)}.`,
|
|
1458
1459
|
{
|
|
1459
|
-
file: h(
|
|
1460
|
+
file: h(n).file,
|
|
1460
1461
|
node: void 0
|
|
1461
1462
|
}
|
|
1462
1463
|
);
|
|
@@ -1468,30 +1469,30 @@ function Te(e, t, i, n, s) {
|
|
|
1468
1469
|
a,
|
|
1469
1470
|
d,
|
|
1470
1471
|
i,
|
|
1471
|
-
|
|
1472
|
+
o,
|
|
1472
1473
|
t
|
|
1473
1474
|
);
|
|
1474
1475
|
}
|
|
1475
1476
|
}
|
|
1476
|
-
function $e(e, t, i,
|
|
1477
|
+
function $e(e, t, i, o) {
|
|
1477
1478
|
const s = h(t), a = s.constructorAutoCastType;
|
|
1478
1479
|
if (a !== void 0)
|
|
1479
1480
|
return a;
|
|
1480
|
-
const r =
|
|
1481
|
+
const r = Mt(e, t, i, o);
|
|
1481
1482
|
return r !== void 0 && (s.constructorAutoCastType = r), r;
|
|
1482
1483
|
}
|
|
1483
|
-
function
|
|
1484
|
+
function Mt(e, t, i, o) {
|
|
1484
1485
|
if (e.members !== void 0)
|
|
1485
1486
|
for (let r = 0; r < e.members.length; ++r) {
|
|
1486
|
-
const
|
|
1487
|
-
if (
|
|
1487
|
+
const n = e.members[r];
|
|
1488
|
+
if (n.kind === "constructor" && // Use the last constructor for auto-casting signature
|
|
1488
1489
|
// Examples: Point, MeshTexture
|
|
1489
1490
|
e.members[r + 1]?.kind !== "constructor" && // Only consider the single-parameter signature
|
|
1490
|
-
|
|
1491
|
+
n.parameters?.length === 1 && // To avoid false positives, constructors without type references are not
|
|
1491
1492
|
// considered autocastable. This excludes core/Accessor#constructor's any[].
|
|
1492
|
-
|
|
1493
|
+
n.parameters[0].type?.references !== void 0)
|
|
1493
1494
|
return {
|
|
1494
|
-
type:
|
|
1495
|
+
type: n.parameters[0].type,
|
|
1495
1496
|
inheritedFrom: i?.path
|
|
1496
1497
|
};
|
|
1497
1498
|
}
|
|
@@ -1504,7 +1505,7 @@ function Ct(e, t, i, n) {
|
|
|
1504
1505
|
name: a.name,
|
|
1505
1506
|
module: t.path,
|
|
1506
1507
|
package: void 0,
|
|
1507
|
-
viewUrl: Ye(t.path, a.name, void 0,
|
|
1508
|
+
viewUrl: Ye(t.path, a.name, void 0, o),
|
|
1508
1509
|
start: 0,
|
|
1509
1510
|
end: a.name.length
|
|
1510
1511
|
}
|
|
@@ -1513,24 +1514,24 @@ function Ct(e, t, i, n) {
|
|
|
1513
1514
|
source: void 0
|
|
1514
1515
|
}, inheritedFrom: i?.path };
|
|
1515
1516
|
if (e.superclass !== void 0) {
|
|
1516
|
-
const r = e.superclass.module === void 0 ? t :
|
|
1517
|
+
const r = e.superclass.module === void 0 ? t : o.moduleMap.get(e.superclass.module), c = (r === void 0 ? void 0 : h(r))?.index?.class;
|
|
1517
1518
|
if (c !== void 0)
|
|
1518
|
-
return $e(c, r, r,
|
|
1519
|
+
return $e(c, r, r, o);
|
|
1519
1520
|
}
|
|
1520
1521
|
}
|
|
1521
|
-
function he(e, t, i, { type:
|
|
1522
|
-
let l =
|
|
1523
|
-
l.length === 2 && l[0].name === "ReadonlyArrayOrCollection" && l[1].name === "T" && (l = [l[0]],
|
|
1524
|
-
...
|
|
1522
|
+
function he(e, t, i, { type: o, inheritedFrom: s }, a, r, n) {
|
|
1523
|
+
let l = o.references;
|
|
1524
|
+
l.length === 2 && l[0].name === "ReadonlyArrayOrCollection" && l[1].name === "T" && (l = [l[0]], o = {
|
|
1525
|
+
...o,
|
|
1525
1526
|
text: "ReadonlyArrayOrCollection",
|
|
1526
1527
|
references: l
|
|
1527
1528
|
});
|
|
1528
|
-
let c =
|
|
1529
|
-
const d = t[i], m =
|
|
1529
|
+
let c = o.text;
|
|
1530
|
+
const d = t[i], m = o.text.length - (d.end - d.start);
|
|
1530
1531
|
let f = 0;
|
|
1531
1532
|
t.splice(i, 1);
|
|
1532
1533
|
for (let p = l.length - 1; p >= 0; p--) {
|
|
1533
|
-
const g = l[p], u =
|
|
1534
|
+
const g = l[p], u = o.text.slice(g.start, g.end);
|
|
1534
1535
|
if (u !== g.name && g.name !== "default") {
|
|
1535
1536
|
a.emitError(
|
|
1536
1537
|
`Unsupported case: cannot yet handle auto-adding imports for renamed references. Tried to add ${g.name} as ${u} from ${g.module} when resolving auto-casting type.`,
|
|
@@ -1558,9 +1559,9 @@ function he(e, t, i, { type: n, inheritedFrom: s }, a, r, o) {
|
|
|
1558
1559
|
start: g.start + M + f,
|
|
1559
1560
|
end: g.end + M + f
|
|
1560
1561
|
}, P = y.typeName;
|
|
1561
|
-
if (l.length === 1 &&
|
|
1562
|
-
const L =
|
|
1563
|
-
f += F, I.end += F, c = c.slice(0, g.start) +
|
|
1562
|
+
if (l.length === 1 && n.autoCastingRequiresType === !0 && P !== void 0) {
|
|
1563
|
+
const L = n.autoCastingDefaultType === P, k = `(${u} & { type${L ? "?" : ""}: "${P}" })`, F = k.length - u.length;
|
|
1564
|
+
f += F, I.end += F, c = c.slice(0, g.start) + k + c.slice(g.end);
|
|
1564
1565
|
}
|
|
1565
1566
|
t.splice(i, 0, I);
|
|
1566
1567
|
}
|
|
@@ -1570,10 +1571,10 @@ function he(e, t, i, { type: n, inheritedFrom: s }, a, r, o) {
|
|
|
1570
1571
|
i + (l?.length ?? 0)
|
|
1571
1572
|
), !0;
|
|
1572
1573
|
}
|
|
1573
|
-
function Fe(e, t, i,
|
|
1574
|
-
const s = h(
|
|
1574
|
+
function Fe(e, t, i, o) {
|
|
1575
|
+
const s = h(o);
|
|
1575
1576
|
if (e.package !== void 0) {
|
|
1576
|
-
if (e.package ===
|
|
1577
|
+
if (e.package === ke)
|
|
1577
1578
|
return;
|
|
1578
1579
|
i.emitError(
|
|
1579
1580
|
`Unsupported case: cannot yet handle auto-adding imports for external packages. Tried to add ${e.name} from ${e.package} when resolving auto-casting type.`,
|
|
@@ -1583,7 +1584,7 @@ function Fe(e, t, i, n) {
|
|
|
1583
1584
|
}
|
|
1584
1585
|
);
|
|
1585
1586
|
}
|
|
1586
|
-
if (t ===
|
|
1587
|
+
if (t === o)
|
|
1587
1588
|
return;
|
|
1588
1589
|
const a = h(t), r = e.name === "default" ? a.index.default?.name : e.name;
|
|
1589
1590
|
if (r === void 0) {
|
|
@@ -1596,11 +1597,11 @@ function Fe(e, t, i, n) {
|
|
|
1596
1597
|
);
|
|
1597
1598
|
return;
|
|
1598
1599
|
}
|
|
1599
|
-
let
|
|
1600
|
+
let n = r, l;
|
|
1600
1601
|
const c = Ie(e);
|
|
1601
|
-
c !== void 0 && (
|
|
1602
|
-
const d = s.importsMap[
|
|
1603
|
-
d === void 0 ? s.importsMap[
|
|
1602
|
+
c !== void 0 && (n = c, l = r);
|
|
1603
|
+
const d = s.importsMap[n];
|
|
1604
|
+
d === void 0 ? s.importsMap[n] = {
|
|
1604
1605
|
type: e.name === "default" ? "default" : "named",
|
|
1605
1606
|
modulePath: t.path,
|
|
1606
1607
|
specifier: be(s.dtsPath, a.dtsPath),
|
|
@@ -1616,19 +1617,19 @@ function Fe(e, t, i, n) {
|
|
|
1616
1617
|
) : d.wasUsed = !0;
|
|
1617
1618
|
}
|
|
1618
1619
|
function Ae(e) {
|
|
1619
|
-
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 &&
|
|
1620
|
+
return e?.kind === "interface" && e.members === void 0 && e.supertypes === void 0 && e.type?.references !== void 0 && e.type.references.length > 1 && e.typeParameters === void 0 && bt(e.type);
|
|
1620
1621
|
}
|
|
1621
|
-
function
|
|
1622
|
+
function bt(e) {
|
|
1622
1623
|
let t = 0;
|
|
1623
1624
|
for (let i = 0; i < e.references.length; ++i) {
|
|
1624
|
-
const
|
|
1625
|
+
const o = e.references[i], s = e.text.slice(t, o.start).trim();
|
|
1625
1626
|
if (s !== "" && s !== "|")
|
|
1626
1627
|
return !1;
|
|
1627
|
-
t =
|
|
1628
|
+
t = o.end;
|
|
1628
1629
|
}
|
|
1629
1630
|
return t === e.text.length;
|
|
1630
1631
|
}
|
|
1631
|
-
const
|
|
1632
|
+
const xt = {
|
|
1632
1633
|
// Wrap in parents to correctly substitute Date[] in TimeInfo.stops
|
|
1633
1634
|
text: "(Date | number | string)",
|
|
1634
1635
|
references: [
|
|
@@ -1644,39 +1645,39 @@ const bt = {
|
|
|
1644
1645
|
values: void 0,
|
|
1645
1646
|
source: void 0
|
|
1646
1647
|
};
|
|
1647
|
-
function
|
|
1648
|
+
function Pt(e, t) {
|
|
1648
1649
|
const i = e.constructorPropertiesInterface;
|
|
1649
1650
|
i.type = void 0;
|
|
1650
|
-
const
|
|
1651
|
-
i.typeParameters =
|
|
1652
|
-
const s =
|
|
1651
|
+
const o = h(t.apiModule).index.class;
|
|
1652
|
+
i.typeParameters = o.typeParameters;
|
|
1653
|
+
const s = o.superclass;
|
|
1653
1654
|
if (s !== void 0) {
|
|
1654
1655
|
const r = ge(s, t);
|
|
1655
1656
|
r !== void 0 && (i.supertypes ??= [], i.supertypes.push(r));
|
|
1656
1657
|
}
|
|
1657
|
-
if (
|
|
1658
|
-
for (let r = 0; r <
|
|
1659
|
-
const
|
|
1658
|
+
if (o.mixins !== void 0)
|
|
1659
|
+
for (let r = 0; r < o.mixins.length; ++r) {
|
|
1660
|
+
const n = o.mixins[r], l = ge(n, t);
|
|
1660
1661
|
l !== void 0 && (i.supertypes ??= [], i.supertypes.push(l));
|
|
1661
1662
|
}
|
|
1662
1663
|
let a = "";
|
|
1663
|
-
if (
|
|
1664
|
-
for (let r = 0; r <
|
|
1665
|
-
const
|
|
1666
|
-
if (
|
|
1664
|
+
if (o.members !== void 0)
|
|
1665
|
+
for (let r = 0; r < o.members.length; ++r) {
|
|
1666
|
+
const n = o.members[r];
|
|
1667
|
+
if (n.kind !== "field" || n.inheritedFrom !== void 0 || n.static !== void 0)
|
|
1667
1668
|
continue;
|
|
1668
|
-
const l =
|
|
1669
|
+
const l = oe(n);
|
|
1669
1670
|
if (l.isAbstract)
|
|
1670
1671
|
continue;
|
|
1671
|
-
let c = e.constructorOnlySetters?.[
|
|
1672
|
+
let c = e.constructorOnlySetters?.[n.name];
|
|
1672
1673
|
if (c === void 0) {
|
|
1673
|
-
if (
|
|
1674
|
+
if (n.readonly !== void 0)
|
|
1674
1675
|
continue;
|
|
1675
|
-
if (
|
|
1676
|
-
a += `${a.length === 0 ? "" : " | "}"${
|
|
1676
|
+
if (n.getterType === void 0 && l.isOverride === void 0) {
|
|
1677
|
+
a += `${a.length === 0 ? "" : " | "}"${n.name}"`;
|
|
1677
1678
|
continue;
|
|
1678
1679
|
} else
|
|
1679
|
-
c =
|
|
1680
|
+
c = n.type, c.text.includes(" | undefined") || (c = { ...c, text: `${c.text} | undefined` });
|
|
1680
1681
|
} else c.text.includes(" | undefined") || (c.text += " | undefined");
|
|
1681
1682
|
const d = {
|
|
1682
1683
|
isAbstract: void 0,
|
|
@@ -1687,8 +1688,8 @@ function xt(e, t) {
|
|
|
1687
1688
|
isConstructorOnly: void 0,
|
|
1688
1689
|
isOverride: void 0,
|
|
1689
1690
|
dtsTypeOverride: void 0
|
|
1690
|
-
}, m =
|
|
1691
|
-
[
|
|
1691
|
+
}, m = n, f = {
|
|
1692
|
+
[ne]: d,
|
|
1692
1693
|
kind: "field",
|
|
1693
1694
|
name: m.name,
|
|
1694
1695
|
static: void 0,
|
|
@@ -1711,7 +1712,7 @@ function xt(e, t) {
|
|
|
1711
1712
|
}
|
|
1712
1713
|
if (a.length > 0) {
|
|
1713
1714
|
i.supertypes ??= [];
|
|
1714
|
-
let r = `Partial<Pick<${
|
|
1715
|
+
let r = `Partial<Pick<${o.name}`;
|
|
1715
1716
|
if (i.typeParameters !== void 0) {
|
|
1716
1717
|
r += "<";
|
|
1717
1718
|
for (let l = 0; l < i.typeParameters.length; ++l) {
|
|
@@ -1721,15 +1722,15 @@ function xt(e, t) {
|
|
|
1721
1722
|
r += ">";
|
|
1722
1723
|
}
|
|
1723
1724
|
r += `, ${a}>>`;
|
|
1724
|
-
const
|
|
1725
|
-
[
|
|
1725
|
+
const n = {
|
|
1726
|
+
[ne]: r,
|
|
1726
1727
|
name: "",
|
|
1727
1728
|
module: void 0,
|
|
1728
1729
|
package: void 0,
|
|
1729
1730
|
viewUrl: void 0,
|
|
1730
1731
|
typeArguments: void 0
|
|
1731
1732
|
};
|
|
1732
|
-
i.supertypes.push(
|
|
1733
|
+
i.supertypes.push(n);
|
|
1733
1734
|
}
|
|
1734
1735
|
}
|
|
1735
1736
|
function ge(e, t) {
|
|
@@ -1738,15 +1739,15 @@ function ge(e, t) {
|
|
|
1738
1739
|
const i = t.moduleMap.get(e.module);
|
|
1739
1740
|
if (i === void 0)
|
|
1740
1741
|
return;
|
|
1741
|
-
const
|
|
1742
|
+
const o = h(i), s = o.constructorPropertiesInterface;
|
|
1742
1743
|
if (s === void 0) {
|
|
1743
|
-
const
|
|
1744
|
-
if (typeof
|
|
1745
|
-
const l = e.name === "default" ?
|
|
1744
|
+
const n = o.inheritance;
|
|
1745
|
+
if (typeof n == "object" && n.hasSettableField) {
|
|
1746
|
+
const l = e.name === "default" ? o.index.class?.name ?? e.name : e.name;
|
|
1746
1747
|
t.emitError(
|
|
1747
1748
|
`This file must have a @public ${x("green", `${l}Properties`)} interface because it contains a public class that has non-readonly public properties and it is being extended by ${t.apiModule.sourcePath}.`,
|
|
1748
1749
|
{ file: h(t.apiModule).file, node: void 0 }
|
|
1749
|
-
),
|
|
1750
|
+
), n.hasSettableField = !1;
|
|
1750
1751
|
}
|
|
1751
1752
|
return;
|
|
1752
1753
|
}
|
|
@@ -1757,28 +1758,28 @@ function ge(e, t) {
|
|
|
1757
1758
|
* views/3d/environment/SunLighting as it imports webscene/SunLighting.
|
|
1758
1759
|
* apiReference.name !== class.name for references to mixin base classes.
|
|
1759
1760
|
*/
|
|
1760
|
-
[
|
|
1761
|
+
[ne]: a === e.name ? void 0 : It(a, o.index.class.name),
|
|
1761
1762
|
name: s.name,
|
|
1762
1763
|
module: e.module,
|
|
1763
1764
|
package: e.package,
|
|
1764
1765
|
viewUrl: e.viewUrl,
|
|
1765
1766
|
typeArguments: void 0
|
|
1766
1767
|
};
|
|
1767
|
-
return Fe(r, i, t, t.apiModule), r[
|
|
1768
|
+
return Fe(r, i, t, t.apiModule), r[ne] ??= s.name, r;
|
|
1768
1769
|
}
|
|
1769
|
-
function
|
|
1770
|
+
function It(e, t) {
|
|
1770
1771
|
if (e === void 0 || e === t)
|
|
1771
1772
|
return;
|
|
1772
1773
|
const i = e.indexOf("<");
|
|
1773
1774
|
if (e = i === -1 ? e : e.slice(0, i), e !== t)
|
|
1774
1775
|
return `${e}Properties`;
|
|
1775
1776
|
}
|
|
1776
|
-
function
|
|
1777
|
+
function kt(e) {
|
|
1777
1778
|
if (e.customElement === void 0)
|
|
1778
1779
|
return;
|
|
1779
1780
|
const t = e, i = [];
|
|
1780
|
-
for (let
|
|
1781
|
-
const s = t.members[
|
|
1781
|
+
for (let o = 0; o < t.members.length; ++o) {
|
|
1782
|
+
const s = t.members[o];
|
|
1782
1783
|
if (s.kind !== "field" || s.attribute === void 0 || s.privacy !== void 0)
|
|
1783
1784
|
continue;
|
|
1784
1785
|
const a = s.type.values?.filter(
|
|
@@ -1814,14 +1815,14 @@ const de = {
|
|
|
1814
1815
|
*/
|
|
1815
1816
|
deferred: 1
|
|
1816
1817
|
};
|
|
1817
|
-
function St(e, t, i,
|
|
1818
|
+
function St(e, t, i, o) {
|
|
1818
1819
|
const s = e;
|
|
1819
|
-
|
|
1820
|
+
o.produceDts && (fe(t).eventTypesProperty = s);
|
|
1820
1821
|
const a = h(i), r = `${t.name}Events`;
|
|
1821
1822
|
if (s.type.text !== r && !s.type.text.startsWith(`${r}<`)) {
|
|
1822
1823
|
if (s.type.text === "unknown")
|
|
1823
1824
|
return;
|
|
1824
|
-
|
|
1825
|
+
o.emitError(
|
|
1825
1826
|
`The "@eventTypes" property must be of type named "${t.name}Events". Found ${x("red", s.type.text)}.`,
|
|
1826
1827
|
{
|
|
1827
1828
|
file: a.file,
|
|
@@ -1830,9 +1831,9 @@ function St(e, t, i, n) {
|
|
|
1830
1831
|
);
|
|
1831
1832
|
return;
|
|
1832
1833
|
}
|
|
1833
|
-
const
|
|
1834
|
-
if (
|
|
1835
|
-
|
|
1834
|
+
const n = a.index.named[r];
|
|
1835
|
+
if (n?.kind !== "interface") {
|
|
1836
|
+
o.emitError(
|
|
1836
1837
|
`The "${r}" referenced by the "@eventTypes" property must be a @public interface and defined in the same file as the ${t.name} class.`,
|
|
1837
1838
|
{
|
|
1838
1839
|
file: a.file,
|
|
@@ -1841,11 +1842,11 @@ function St(e, t, i, n) {
|
|
|
1841
1842
|
);
|
|
1842
1843
|
return;
|
|
1843
1844
|
}
|
|
1844
|
-
t.events ??= [], we(
|
|
1845
|
+
t.events ??= [], we(n, t, i, void 0, o);
|
|
1845
1846
|
}
|
|
1846
|
-
function we(e, t, i,
|
|
1847
|
-
const a =
|
|
1848
|
-
if (
|
|
1847
|
+
function we(e, t, i, o, s) {
|
|
1848
|
+
const a = o !== void 0;
|
|
1849
|
+
if (o ??= /* @__PURE__ */ new Set(), e.type !== void 0) {
|
|
1849
1850
|
s.emitError(
|
|
1850
1851
|
`For documentation purposes, event interface types need to be statically analyzable - include only properties & extends clauses. Found complex type in ${e.name}: ${e.type.text}`,
|
|
1851
1852
|
{
|
|
@@ -1857,10 +1858,10 @@ function we(e, t, i, n, s) {
|
|
|
1857
1858
|
}
|
|
1858
1859
|
if (e.members !== void 0)
|
|
1859
1860
|
for (let r = 0; r < e.members.length; ++r) {
|
|
1860
|
-
const
|
|
1861
|
-
if (
|
|
1861
|
+
const n = e.members[r];
|
|
1862
|
+
if (n.kind !== "field") {
|
|
1862
1863
|
s.emitError(
|
|
1863
|
-
`Event interfaces should only contain properties. Found ${et(
|
|
1864
|
+
`Event interfaces should only contain properties. Found ${et(n)} of kind ${x("red", n.kind)} in ${e.name}.`,
|
|
1864
1865
|
{
|
|
1865
1866
|
file: h(i).file,
|
|
1866
1867
|
node: void 0
|
|
@@ -1868,13 +1869,13 @@ function we(e, t, i, n, s) {
|
|
|
1868
1869
|
);
|
|
1869
1870
|
continue;
|
|
1870
1871
|
}
|
|
1871
|
-
|
|
1872
|
-
name:
|
|
1873
|
-
deprecated:
|
|
1872
|
+
o.has(n.name) || (o.add(n.name), t.events.push({
|
|
1873
|
+
name: n.name,
|
|
1874
|
+
deprecated: n.deprecated,
|
|
1874
1875
|
summary: void 0,
|
|
1875
|
-
description:
|
|
1876
|
-
docsTags:
|
|
1877
|
-
type:
|
|
1876
|
+
description: n.description,
|
|
1877
|
+
docsTags: n.docsTags,
|
|
1878
|
+
type: n.type,
|
|
1878
1879
|
inheritedFrom: a ? {
|
|
1879
1880
|
name: e.name,
|
|
1880
1881
|
module: i.path,
|
|
@@ -1889,10 +1890,10 @@ function we(e, t, i, n, s) {
|
|
|
1889
1890
|
}
|
|
1890
1891
|
if (e.supertypes !== void 0)
|
|
1891
1892
|
for (let r = 0; r < e.supertypes.length; ++r) {
|
|
1892
|
-
const
|
|
1893
|
+
const n = e.supertypes[r], l = n.module === void 0 ? i : s.moduleMap.get(n.module), c = h(l).index.named[n.name];
|
|
1893
1894
|
if (c?.kind !== "interface") {
|
|
1894
1895
|
s.emitError(
|
|
1895
|
-
`Failed to find @public interface ${x("red",
|
|
1896
|
+
`Failed to find @public interface ${x("red", n.name)} (used by ${x("green", e.name)}).`,
|
|
1896
1897
|
{
|
|
1897
1898
|
file: h(i).file,
|
|
1898
1899
|
node: void 0
|
|
@@ -1900,14 +1901,14 @@ function we(e, t, i, n, s) {
|
|
|
1900
1901
|
);
|
|
1901
1902
|
return;
|
|
1902
1903
|
}
|
|
1903
|
-
we(c, t, l,
|
|
1904
|
+
we(c, t, l, o, s);
|
|
1904
1905
|
}
|
|
1905
1906
|
}
|
|
1906
|
-
function
|
|
1907
|
-
const
|
|
1908
|
-
if (
|
|
1907
|
+
function Ge(e, t, i) {
|
|
1908
|
+
const o = h(e);
|
|
1909
|
+
if (o.inheritance !== void 0)
|
|
1909
1910
|
return;
|
|
1910
|
-
|
|
1911
|
+
o.inheritance = de.deferred;
|
|
1911
1912
|
let a = !1;
|
|
1912
1913
|
if (t.members !== void 0)
|
|
1913
1914
|
for (let m = 0; m < t.members.length; ++m) {
|
|
@@ -1917,26 +1918,26 @@ function Re(e, t, i) {
|
|
|
1917
1918
|
a = !0, St(f, t, e, i), t.members.splice(m, 1), m -= 1;
|
|
1918
1919
|
continue;
|
|
1919
1920
|
}
|
|
1920
|
-
f.inheritedFrom === void 0 &&
|
|
1921
|
+
f.inheritedFrom === void 0 && Tt(f, e, i);
|
|
1921
1922
|
}
|
|
1922
1923
|
}
|
|
1923
1924
|
const r = t;
|
|
1924
|
-
let
|
|
1925
|
+
let n = t.mixins, l = r.superclass, c = l === void 0 ? void 0 : Me(l, e, i);
|
|
1925
1926
|
if (c?.supertypes !== void 0) {
|
|
1926
|
-
|
|
1927
|
+
n = n === void 0 ? [] : [...n];
|
|
1927
1928
|
do {
|
|
1928
1929
|
const m = c.supertypes.length > 1, f = m ? 1 : 0;
|
|
1929
1930
|
for (let p = c.supertypes.length - 1; p >= f; p--) {
|
|
1930
1931
|
const g = c.supertypes[p], u = g.module === void 0 ? { ...g, module: l.module } : g;
|
|
1931
|
-
|
|
1932
|
+
n.unshift(u);
|
|
1932
1933
|
}
|
|
1933
1934
|
l = m ? c.supertypes[0] : void 0, c = l === void 0 ? void 0 : Me(l, e, i);
|
|
1934
1935
|
} while (c?.supertypes !== void 0);
|
|
1935
1936
|
}
|
|
1936
|
-
if (
|
|
1937
|
-
const m =
|
|
1938
|
-
for (let f =
|
|
1939
|
-
const p =
|
|
1937
|
+
if (n !== void 0) {
|
|
1938
|
+
const m = n.length - (t.mixins?.length ?? 0);
|
|
1939
|
+
for (let f = n.length - 1; f >= 0; f--) {
|
|
1940
|
+
const p = n[f], g = Ce(p.module ?? e.path, !0, i);
|
|
1940
1941
|
typeof g == "object" ? ve(g, t, a, i) : f >= m && (t.mixins.splice(f - m, 1), t.mixins.length === 0 && (t.mixins = void 0));
|
|
1941
1942
|
}
|
|
1942
1943
|
}
|
|
@@ -1947,25 +1948,25 @@ function Re(e, t, i) {
|
|
|
1947
1948
|
const m = Ce(d, !1, i);
|
|
1948
1949
|
typeof m == "object" && (m.declaration.privacy !== void 0 && t.privacy === void 0 && i.emitError(
|
|
1949
1950
|
`Public component may only subclass a public component to avoid broken inheritance. Tried to inherit from private ${m.declaration.name}. Remove @private from it but feel free to add a jsdoc description stating the base class is abstract - not for direct consumption. Lumina does bare minimum extraction work for private components, which makes them ineligible for public docs.`,
|
|
1950
|
-
{ file:
|
|
1951
|
+
{ file: o.file, node: void 0 }
|
|
1951
1952
|
), ve(m, t, a, i));
|
|
1952
1953
|
}
|
|
1953
1954
|
}
|
|
1954
|
-
function ve(e, t, i,
|
|
1955
|
+
function ve(e, t, i, o) {
|
|
1955
1956
|
const s = e.declaration, a = t;
|
|
1956
1957
|
if (e.indexedMembers !== void 0) {
|
|
1957
1958
|
t.members ??= [];
|
|
1958
|
-
const r = t.members,
|
|
1959
|
-
let l =
|
|
1959
|
+
const r = t.members, n = o.config.documentation.noInheritMembers[e.inheritanceData.module];
|
|
1960
|
+
let l = n === void 0 ? void 0 : new Set(n);
|
|
1960
1961
|
for (let d = 0; d < r.length; ++d) {
|
|
1961
1962
|
const m = r[d], f = ce(m), p = e.indexedMembers[f];
|
|
1962
1963
|
if (p === void 0)
|
|
1963
1964
|
continue;
|
|
1964
1965
|
if (l ??= /* @__PURE__ */ new Set(), l.add(f), m.kind === "field") {
|
|
1965
|
-
const u =
|
|
1966
|
-
|
|
1966
|
+
const u = oe(m);
|
|
1967
|
+
oe(p).isAccessor === !0 && (u.isAccessor = !0), u.isOverride = !0;
|
|
1967
1968
|
}
|
|
1968
|
-
p !== void 0 && m.inheritedFrom === void 0 &&
|
|
1969
|
+
p !== void 0 && m.inheritedFrom === void 0 && Se(p, m);
|
|
1969
1970
|
}
|
|
1970
1971
|
const c = s.members;
|
|
1971
1972
|
for (let d = 0; d < c.length; ++d) {
|
|
@@ -2005,45 +2006,45 @@ function ve(e, t, i, n) {
|
|
|
2005
2006
|
e.indexedCssStates
|
|
2006
2007
|
)), s.formAssociated === !0 && (a.formAssociated = !0);
|
|
2007
2008
|
}
|
|
2008
|
-
function X(e = [], t, i,
|
|
2009
|
+
function X(e = [], t, i, o) {
|
|
2009
2010
|
const s = /* @__PURE__ */ new Set();
|
|
2010
2011
|
for (let a = 0; a < e.length; ++a) {
|
|
2011
|
-
const r = e[a],
|
|
2012
|
-
|
|
2012
|
+
const r = e[a], n = i[r.name];
|
|
2013
|
+
n !== void 0 && (s.add(r.name), r.inheritedFrom === void 0 && Se(n, r));
|
|
2013
2014
|
}
|
|
2014
2015
|
for (let a = 0; a < t.length; ++a) {
|
|
2015
2016
|
const r = t[a];
|
|
2016
2017
|
s.has(r.name) || e.push(
|
|
2017
|
-
|
|
2018
|
+
o === void 0 || r.inheritedFrom !== void 0 ? r : { ...r, inheritedFrom: o }
|
|
2018
2019
|
);
|
|
2019
2020
|
}
|
|
2020
2021
|
return e;
|
|
2021
2022
|
}
|
|
2022
2023
|
function Ce(e, t, i) {
|
|
2023
|
-
const
|
|
2024
|
-
if (s === !1 ||
|
|
2024
|
+
const o = i.moduleMap.get(e), s = Et(o, e, t, i), a = o === void 0 ? void 0 : h(o);
|
|
2025
|
+
if (s === !1 || o === void 0)
|
|
2025
2026
|
return a !== void 0 ? a.inheritance = de.skip : t && i.privateMixinModuleNames.add(e), de.skip;
|
|
2026
|
-
const [r,
|
|
2027
|
-
|
|
2027
|
+
const [r, n] = s, l = n;
|
|
2028
|
+
Ge(o, n, i);
|
|
2028
2029
|
let c, d = !1;
|
|
2029
|
-
if (
|
|
2030
|
+
if (n.members !== void 0) {
|
|
2030
2031
|
c = /* @__PURE__ */ Object.create(null);
|
|
2031
|
-
for (let f = 0; f <
|
|
2032
|
-
const p =
|
|
2032
|
+
for (let f = 0; f < n.members.length; ++f) {
|
|
2033
|
+
const p = n.members[f], g = ce(p), v = c[g] !== void 0;
|
|
2033
2034
|
c[g] = v ? void 0 : p, d ||= p.kind === "field" && p.readonly === void 0;
|
|
2034
2035
|
}
|
|
2035
2036
|
}
|
|
2036
2037
|
const m = {
|
|
2037
2038
|
inheritanceData: {
|
|
2038
|
-
name:
|
|
2039
|
+
name: n.name,
|
|
2039
2040
|
module: r,
|
|
2040
2041
|
package: void 0,
|
|
2041
2042
|
viewUrl: void 0
|
|
2042
2043
|
},
|
|
2043
|
-
declaration:
|
|
2044
|
+
declaration: n,
|
|
2044
2045
|
hasSettableField: d,
|
|
2045
2046
|
indexedMembers: c,
|
|
2046
|
-
indexedEvents: Y(
|
|
2047
|
+
indexedEvents: Y(n.events),
|
|
2047
2048
|
indexedAttributes: Y(l.attributes),
|
|
2048
2049
|
indexedSlots: Y(l.slots),
|
|
2049
2050
|
indexedCssParts: Y(l.cssParts),
|
|
@@ -2057,15 +2058,15 @@ function Y(e) {
|
|
|
2057
2058
|
return;
|
|
2058
2059
|
const t = /* @__PURE__ */ Object.create(null);
|
|
2059
2060
|
for (let i = 0; i < e.length; ++i) {
|
|
2060
|
-
const
|
|
2061
|
-
t[
|
|
2061
|
+
const o = e[i];
|
|
2062
|
+
t[o.name] = o;
|
|
2062
2063
|
}
|
|
2063
2064
|
return t;
|
|
2064
2065
|
}
|
|
2065
|
-
function
|
|
2066
|
+
function Et(e, t, i, o) {
|
|
2066
2067
|
const s = e === void 0 ? void 0 : h(e), a = s?.index.class;
|
|
2067
|
-
return a === void 0 ? (i ||
|
|
2068
|
-
`Failed to find @public class/custom element declaration in ${x("red", t)}. Referenced in the extends clause by ${x("blue",
|
|
2068
|
+
return a === void 0 ? (i || o.emitError(
|
|
2069
|
+
`Failed to find @public class/custom element declaration in ${x("red", t)}. Referenced in the extends clause by ${x("blue", o.apiModule.sourcePath)}`,
|
|
2069
2070
|
{
|
|
2070
2071
|
file: s?.file,
|
|
2071
2072
|
scope: s === void 0 ? t : void 0,
|
|
@@ -2076,13 +2077,13 @@ function kt(e, t, i, n) {
|
|
|
2076
2077
|
function Me(e, t, i) {
|
|
2077
2078
|
if (e.package !== void 0)
|
|
2078
2079
|
return;
|
|
2079
|
-
const
|
|
2080
|
+
const o = e.module === void 0 ? t : i.moduleMap.get(e.module), s = o === void 0 ? void 0 : h(o), a = e.name === "default" ? s?.index.default : s?.index.named[e.name];
|
|
2080
2081
|
if (a === void 0) {
|
|
2081
2082
|
i.emitError(
|
|
2082
|
-
`Failed to find @public class/mixin/custom element declaration in ${x("red",
|
|
2083
|
+
`Failed to find @public class/mixin/custom element declaration in ${x("red", o?.sourcePath ?? e.module ?? t.sourcePath)}. Referenced in the extends clause by ${x("blue", t.sourcePath)}.`,
|
|
2083
2084
|
{
|
|
2084
2085
|
file: s?.file,
|
|
2085
|
-
scope:
|
|
2086
|
+
scope: o === void 0 ? t.path : void 0,
|
|
2086
2087
|
node: void 0
|
|
2087
2088
|
}
|
|
2088
2089
|
);
|
|
@@ -2090,121 +2091,153 @@ function Me(e, t, i) {
|
|
|
2090
2091
|
}
|
|
2091
2092
|
return a.kind === "interface" ? a : void 0;
|
|
2092
2093
|
}
|
|
2093
|
-
function Et(e, t, i) {
|
|
2094
|
-
const n = ne(e), s = h(t);
|
|
2095
|
-
n.hasAutoCasting === !0 && (vt(e.type, n, t, i), n.isConstructorOnly !== !0 && e.getterType?.text === e.type.text && (e.getterType = void 0)), n.isConstructorOnly === !0 && (s.constructorOnlySetters ??= {}, s.constructorOnlySetters[e.name] = e.type, e.type = e.getterType ?? e.type, e.getterType = void 0, e.readonly = !0);
|
|
2096
|
-
}
|
|
2097
2094
|
function Tt(e, t, i) {
|
|
2095
|
+
const o = oe(e), s = h(t);
|
|
2096
|
+
o.hasAutoCasting === !0 && (Ct(e.type, o, t, i), o.isConstructorOnly !== !0 && e.getterType?.text === e.type.text && (e.getterType = void 0)), o.isConstructorOnly === !0 && (s.constructorOnlySetters ??= {}, s.constructorOnlySetters[e.name] = e.type, e.type = e.getterType ?? e.type, e.getterType = void 0, e.readonly = !0);
|
|
2097
|
+
}
|
|
2098
|
+
function $t(e, t, i) {
|
|
2098
2099
|
if (!(i.watchFiles === void 0 || t.reExports === void 0))
|
|
2099
|
-
for (let
|
|
2100
|
-
const s = t.reExports[
|
|
2100
|
+
for (let o = 0; o < t.reExports.length; ++o) {
|
|
2101
|
+
const s = t.reExports[o];
|
|
2101
2102
|
if (s.modulePath === void 0)
|
|
2102
2103
|
continue;
|
|
2103
|
-
const a = i.moduleMap.get(s.modulePath),
|
|
2104
|
-
|
|
2104
|
+
const a = i.moduleMap.get(s.modulePath), n = (a === void 0 ? void 0 : h(a))?.file.fileName.slice(i.config.context.cwd.length);
|
|
2105
|
+
n !== void 0 && (i.watchFiles.get(e.sourcePath).dependencies.add(n), i.watchFiles.get(n).dependents.set(e.sourcePath, !0));
|
|
2105
2106
|
}
|
|
2106
2107
|
}
|
|
2107
|
-
function $t(e, t) {
|
|
2108
|
-
e.sort(tt), Ft(e, t), t.isComponentProject && Oe(e, t);
|
|
2109
|
-
}
|
|
2110
2108
|
function Ft(e, t) {
|
|
2109
|
+
e.sort(tt), At(e, t), t.isComponentProject && Oe(e, t);
|
|
2110
|
+
}
|
|
2111
|
+
function At(e, t) {
|
|
2111
2112
|
for (let i = 0; i < e.length; ++i) {
|
|
2112
|
-
const
|
|
2113
|
-
if (!h(
|
|
2113
|
+
const o = e[i];
|
|
2114
|
+
if (!h(o).isStale)
|
|
2114
2115
|
continue;
|
|
2115
|
-
t.apiModule =
|
|
2116
|
-
const a =
|
|
2117
|
-
for (let r = 0; r <
|
|
2118
|
-
const
|
|
2119
|
-
a &&
|
|
2120
|
-
`If module is marked as @deprecated, all its declarations must be too. Found non-deprecated ${
|
|
2116
|
+
t.apiModule = o;
|
|
2117
|
+
const a = o.deprecated !== void 0;
|
|
2118
|
+
for (let r = 0; r < o.declarations.length; ++r) {
|
|
2119
|
+
const n = o.declarations[r];
|
|
2120
|
+
a && n.deprecated === void 0 && t.emitError(
|
|
2121
|
+
`If module is marked as @deprecated, all its declarations must be too. Found non-deprecated ${n.name}`,
|
|
2121
2122
|
{
|
|
2122
|
-
file: h(
|
|
2123
|
+
file: h(o).file,
|
|
2123
2124
|
node: void 0
|
|
2124
2125
|
}
|
|
2125
|
-
), "members" in
|
|
2126
|
+
), "members" in n && n.kind !== "interface" && (Ge(o, n, t), n.events?.sort(it));
|
|
2126
2127
|
}
|
|
2127
2128
|
}
|
|
2128
2129
|
for (let i = 0; i < e.length; ++i) {
|
|
2129
|
-
const
|
|
2130
|
+
const o = e[i], s = h(o);
|
|
2130
2131
|
if (!s.isStale) {
|
|
2131
|
-
const a = t.watchFiles?.get(
|
|
2132
|
+
const a = t.watchFiles?.get(o.sourcePath);
|
|
2132
2133
|
if (a?.hasDirtyLinks === !0) {
|
|
2133
|
-
t.apiModule =
|
|
2134
|
+
t.apiModule = o;
|
|
2134
2135
|
for (let r = 0; r < a.docLinks.length; ++r) {
|
|
2135
|
-
const
|
|
2136
|
-
t.resolveJsDocLink(`{@link ${
|
|
2136
|
+
const n = a.docLinks[r];
|
|
2137
|
+
t.resolveJsDocLink(`{@link ${n}}`, n);
|
|
2137
2138
|
}
|
|
2138
2139
|
a.hasDirtyLinks = !1;
|
|
2139
2140
|
}
|
|
2140
2141
|
continue;
|
|
2141
2142
|
}
|
|
2142
|
-
t.apiModule =
|
|
2143
|
-
for (let a = 0; a <
|
|
2144
|
-
const r =
|
|
2145
|
-
if (r.deprecated = Q(r.deprecated, t), r.description =
|
|
2143
|
+
t.apiModule = o, t.inheritedModuleName = void 0, o.deprecated = Q(o.deprecated, t), o.description = R(o.description, t), V(o.docsTags, t);
|
|
2144
|
+
for (let a = 0; a < o.declarations.length; ++a) {
|
|
2145
|
+
const r = o.declarations[a];
|
|
2146
|
+
if (r.deprecated = Q(r.deprecated, t), r.description = R(r.description, t), V(r.docsTags, t), r.kind === "function") {
|
|
2146
2147
|
if (r.parameters !== void 0)
|
|
2147
2148
|
for (let l = 0; l < r.parameters.length; ++l) {
|
|
2148
2149
|
const c = r.parameters[l];
|
|
2149
|
-
c.description =
|
|
2150
|
+
c.description = R(c.description, t), V(c.docsTags, t);
|
|
2150
2151
|
}
|
|
2151
|
-
r.return !== void 0 && (r.return.description =
|
|
2152
|
+
r.return !== void 0 && (r.return.description = R(r.return.description, t));
|
|
2152
2153
|
}
|
|
2153
|
-
const
|
|
2154
|
-
if (
|
|
2155
|
-
for (let c = 0; c <
|
|
2156
|
-
const d =
|
|
2157
|
-
if (t.inheritedModuleName = m?.module, d.deprecated = Q(d.deprecated, t), d.description =
|
|
2154
|
+
const n = r;
|
|
2155
|
+
if (n.members !== void 0) {
|
|
2156
|
+
for (let c = 0; c < n.members.length; ++c) {
|
|
2157
|
+
const d = n.members[c], m = d.inheritedFrom, f = m !== void 0;
|
|
2158
|
+
if (t.inheritedModuleName = m?.module, d.deprecated = Q(d.deprecated, t), d.description = R(d.description, t), V(d.docsTags, t), !f && d.kind !== "field") {
|
|
2158
2159
|
if (d.parameters !== void 0)
|
|
2159
2160
|
for (let g = 0; g < d.parameters.length; ++g) {
|
|
2160
2161
|
const u = d.parameters[g];
|
|
2161
|
-
u.description =
|
|
2162
|
+
u.description = R(u.description, t), V(u.docsTags, t);
|
|
2162
2163
|
}
|
|
2163
2164
|
const p = d;
|
|
2164
|
-
p.return !== void 0 && (p.return.description =
|
|
2165
|
+
p.return !== void 0 && (p.return.description = R(p.return.description, t));
|
|
2165
2166
|
}
|
|
2166
2167
|
t.inheritedModuleName = void 0;
|
|
2167
2168
|
}
|
|
2168
|
-
r.kind !== "interface" &&
|
|
2169
|
+
r.kind !== "interface" && n.members.sort(ot);
|
|
2169
2170
|
const l = r;
|
|
2170
2171
|
if (l.events !== void 0) {
|
|
2171
2172
|
for (let c = 0; c < l.events.length; ++c) {
|
|
2172
2173
|
const d = l.events[c];
|
|
2173
|
-
t.inheritedModuleName = d.inheritedFrom?.module, d.deprecated = Q(d.deprecated, t), d.description =
|
|
2174
|
+
t.inheritedModuleName = d.inheritedFrom?.module, d.deprecated = Q(d.deprecated, t), d.description = R(d.description, t), V(d.docsTags, t);
|
|
2174
2175
|
}
|
|
2175
2176
|
t.inheritedModuleName = void 0;
|
|
2176
2177
|
}
|
|
2177
|
-
if (t.config.context.isLuminaMinimalExtraction ||
|
|
2178
|
+
if (t.config.context.isLuminaMinimalExtraction || kt(n), l.slots !== void 0)
|
|
2178
2179
|
for (let c = 0; c < l.slots.length; ++c) {
|
|
2179
2180
|
const d = l.slots[c];
|
|
2180
|
-
d.description =
|
|
2181
|
+
d.description = R(d.description, t);
|
|
2181
2182
|
}
|
|
2182
2183
|
if (l.cssProperties !== void 0)
|
|
2183
2184
|
for (let c = 0; c < l.cssProperties.length; ++c) {
|
|
2184
2185
|
const d = l.cssProperties[c];
|
|
2185
|
-
d.description =
|
|
2186
|
+
d.description = R(d.description, t);
|
|
2186
2187
|
}
|
|
2187
2188
|
if (l.cssParts !== void 0)
|
|
2188
2189
|
for (let c = 0; c < l.cssParts.length; ++c) {
|
|
2189
2190
|
const d = l.cssParts[c];
|
|
2190
|
-
d.description =
|
|
2191
|
+
d.description = R(d.description, t);
|
|
2191
2192
|
}
|
|
2192
2193
|
if (l.cssStates !== void 0)
|
|
2193
2194
|
for (let c = 0; c < l.cssStates.length; ++c) {
|
|
2194
2195
|
const d = l.cssStates[c];
|
|
2195
|
-
d.description =
|
|
2196
|
+
d.description = R(d.description, t);
|
|
2196
2197
|
}
|
|
2197
2198
|
if (l.demos !== void 0)
|
|
2198
2199
|
for (let c = 0; c < l.demos.length; ++c) {
|
|
2199
2200
|
const d = l.demos[c];
|
|
2200
|
-
d.description =
|
|
2201
|
+
d.description = R(d.description, t);
|
|
2201
2202
|
}
|
|
2202
|
-
} else r === s.constructorPropertiesInterface && (
|
|
2203
|
+
} else r === s.constructorPropertiesInterface && (o.declarations.splice(a, 1), a -= 1);
|
|
2203
2204
|
}
|
|
2204
|
-
s.constructorPropertiesInterface !== void 0 &&
|
|
2205
|
+
s.constructorPropertiesInterface !== void 0 && Pt(s, t), vt(o, s, t), $t(o, s, t);
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
function wt(e) {
|
|
2209
|
+
const t = [Gt];
|
|
2210
|
+
for (let i = 0; i < e.length; ++i) {
|
|
2211
|
+
const o = e[i];
|
|
2212
|
+
st(o) && t.push(
|
|
2213
|
+
` "@arcgis/core/${o.path}.js": typeof import("./${o.path}.js")${o.exports === void 0 ? "" : ".default"};
|
|
2214
|
+
`
|
|
2215
|
+
);
|
|
2205
2216
|
}
|
|
2217
|
+
return t.push(Rt), t.join("");
|
|
2206
2218
|
}
|
|
2207
|
-
const
|
|
2219
|
+
const Gt = `declare global {
|
|
2220
|
+
const $arcgis: ArcgisGlobal;
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
interface ArcgisGlobal {
|
|
2224
|
+
import: ArcgisImport;
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
interface ArcgisImport {
|
|
2228
|
+
<ModuleName extends keyof ArcgisImportModules>(module: ModuleName): Promise<ArcgisImportModules[ModuleName]>;
|
|
2229
|
+
<ModuleNames extends (keyof ArcgisImportModules)[]>(
|
|
2230
|
+
modules: [...ModuleNames],
|
|
2231
|
+
): Promise<{
|
|
2232
|
+
[ModuleName in keyof ModuleNames]: ModuleNames[ModuleName] extends keyof ArcgisImportModules
|
|
2233
|
+
? ArcgisImportModules[ModuleNames[ModuleName]]
|
|
2234
|
+
: unknown;
|
|
2235
|
+
}>;
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
export interface ArcgisImportModules {
|
|
2239
|
+
`, Rt = `}
|
|
2240
|
+
`, Dt = async function() {
|
|
2208
2241
|
if (this.isRunInProgress)
|
|
2209
2242
|
throw Error(
|
|
2210
2243
|
"The ApiExtractor.run() is already in progress, or previous run crashed with unrecoverable error. Await the previous run first or create a new ApiExtractor"
|
|
@@ -2217,7 +2250,7 @@ const At = async function() {
|
|
|
2217
2250
|
Ne(e.context.dtsEmitPath)
|
|
2218
2251
|
) : void 0;
|
|
2219
2252
|
if (e.types.typeCheckedExtraction || e.types.fullTypeCheck) {
|
|
2220
|
-
const
|
|
2253
|
+
const n = _(), l = e.types.typeScriptConfig;
|
|
2221
2254
|
if (this.watchFiles === void 0) {
|
|
2222
2255
|
const c = E.createCompilerHost(l.config.options), d = E.createProgram({
|
|
2223
2256
|
host: c,
|
|
@@ -2227,20 +2260,22 @@ const At = async function() {
|
|
|
2227
2260
|
});
|
|
2228
2261
|
this.program = d, e.types.typeScriptInstanceCreated(d, c);
|
|
2229
2262
|
}
|
|
2230
|
-
|
|
2263
|
+
Re(this, n);
|
|
2231
2264
|
}
|
|
2232
|
-
const
|
|
2233
|
-
|
|
2265
|
+
const o = _(), s = await Be(this);
|
|
2266
|
+
Ft(s, this);
|
|
2234
2267
|
const a = this.wrapApiModules(s);
|
|
2235
2268
|
e.context.logger.info(
|
|
2236
|
-
`${H}Extracted ${s.length} @public files in ${x("green", `${
|
|
2269
|
+
`${H}Extracted ${s.length} @public files in ${x("green", `${o()}s`)}`
|
|
2237
2270
|
);
|
|
2238
2271
|
const r = { apiJson: a, dtsFiles: void 0 };
|
|
2239
2272
|
if (e.afterApiJsonCreate !== Ee && e.afterApiJsonCreate(r), this.produceDts) {
|
|
2240
|
-
const
|
|
2273
|
+
const n = _(), l = this.dtsFiles;
|
|
2241
2274
|
if (this.dtsFiles = /* @__PURE__ */ new Map(), this.isJsApi) {
|
|
2242
|
-
const c =
|
|
2275
|
+
const c = gt(s, this), d = `${e.context.dtsEmitPath}interfaces.d.ts`;
|
|
2243
2276
|
this.dtsFiles.set(d, c);
|
|
2277
|
+
const m = wt(s), f = `${e.context.dtsEmitPath}arcgisGlobal.d.ts`;
|
|
2278
|
+
this.dtsFiles.set(f, m);
|
|
2244
2279
|
} else this.isComponentProject && We(s, this);
|
|
2245
2280
|
for (let c = 0; c < s.length; ++c) {
|
|
2246
2281
|
const d = s[c], m = h(d);
|
|
@@ -2269,51 +2304,51 @@ const At = async function() {
|
|
|
2269
2304
|
for (const [c, d] of this.dtsFiles)
|
|
2270
2305
|
l.get(c) !== d && this.changedDtsFiles.set(c, d);
|
|
2271
2306
|
if (t) {
|
|
2272
|
-
await i, await ae(e.context.dtsEmitPath, { recursive: !0 }), await
|
|
2307
|
+
await i, await ae(e.context.dtsEmitPath, { recursive: !0 }), await Lt(e.context.dtsEmitPath, !0, this.changedDtsFiles ?? this.dtsFiles);
|
|
2273
2308
|
const c = N.join(N.relative(process.cwd(), e.context.dtsEmitPath), "/");
|
|
2274
2309
|
e.context.logger.info(
|
|
2275
|
-
`${H}Wrote ${c}**/*${x("blue", ".d.ts")} in ${x("green", `${
|
|
2310
|
+
`${H}Wrote ${c}**/*${x("blue", ".d.ts")} in ${x("green", `${n()}s`)}`
|
|
2276
2311
|
);
|
|
2277
2312
|
}
|
|
2278
2313
|
}
|
|
2279
2314
|
if (e.context.apiJsonEmitPath !== "") {
|
|
2280
|
-
const
|
|
2281
|
-
await ae(N.dirname(
|
|
2282
|
-
|
|
2315
|
+
const n = N.resolve(e.context.cwd, e.context.apiJsonEmitPath), l = N.join(N.relative(process.cwd(), N.dirname(n)), "/");
|
|
2316
|
+
await ae(N.dirname(n), { recursive: !0 }), await Pe(
|
|
2317
|
+
n,
|
|
2283
2318
|
e.context.environment === "production" ? JSON.stringify(a) : JSON.stringify(a, null, 2)
|
|
2284
2319
|
), e.context.logger.info(
|
|
2285
|
-
`${H}Wrote ${l}${x("yellow", N.basename(
|
|
2320
|
+
`${H}Wrote ${l}${x("yellow", N.basename(n))}`
|
|
2286
2321
|
);
|
|
2287
2322
|
}
|
|
2288
2323
|
return this.typeVerifier?.verifyTypes(s), this.errorCount > 0 && e.context.logger.error(
|
|
2289
2324
|
`${H}${x("red", `Found ${this.errorCount} ${this.errorCount === 1 ? "error" : "errors"}`)}`
|
|
2290
2325
|
), this.silencedBrokenLinkCount > 0 && e.context.logger.info(`${H}Silenced ${this.silencedBrokenLinkCount} broken link errors.`), this.isRunInProgress = !1, this.produceDts && (r.dtsFiles = this.dtsFiles), r;
|
|
2291
2326
|
};
|
|
2292
|
-
async function
|
|
2293
|
-
const
|
|
2327
|
+
async function Lt(e, t, i) {
|
|
2328
|
+
const o = /* @__PURE__ */ new Set(), s = Array.from(i.entries());
|
|
2294
2329
|
for (let l = 0; l < s.length; ++l) {
|
|
2295
2330
|
const [c, d] = s[l];
|
|
2296
2331
|
if (d.length === 0)
|
|
2297
2332
|
continue;
|
|
2298
2333
|
const m = (t ? c.slice(e.length) : c).split("/");
|
|
2299
2334
|
for (let f = 1; f < m.length; ++f)
|
|
2300
|
-
|
|
2335
|
+
o.add(m.slice(0, f).join("/"));
|
|
2301
2336
|
}
|
|
2302
|
-
const a = new Array(
|
|
2303
|
-
for (const l of
|
|
2337
|
+
const a = new Array(o.size);
|
|
2338
|
+
for (const l of o)
|
|
2304
2339
|
a.push(ae(e + l, { recursive: !0 }));
|
|
2305
2340
|
await Promise.all(a);
|
|
2306
|
-
const r = new Array(s.length),
|
|
2341
|
+
const r = new Array(s.length), n = t ? "" : e;
|
|
2307
2342
|
for (let l = 0; l < s.length; ++l) {
|
|
2308
2343
|
const [c, d] = s[l];
|
|
2309
2344
|
if (d.length === 0)
|
|
2310
2345
|
continue;
|
|
2311
|
-
const m =
|
|
2346
|
+
const m = n + c;
|
|
2312
2347
|
r[l] = Pe(m, d);
|
|
2313
2348
|
}
|
|
2314
2349
|
await Promise.all(r);
|
|
2315
2350
|
}
|
|
2316
|
-
function
|
|
2351
|
+
function Re(e, t) {
|
|
2317
2352
|
if (e.config.types.fullTypeCheck)
|
|
2318
2353
|
if ("getSemanticDiagnostics" in e.program) {
|
|
2319
2354
|
const i = e.builderProgram === void 0 ? E.getPreEmitDiagnostics(e.program) : e.builderProgram.getSemanticDiagnostics();
|
|
@@ -2326,7 +2361,7 @@ function Ge(e, t) {
|
|
|
2326
2361
|
node: void 0
|
|
2327
2362
|
});
|
|
2328
2363
|
}
|
|
2329
|
-
const
|
|
2364
|
+
const Ot = async function() {
|
|
2330
2365
|
if (this.watchFiles !== void 0)
|
|
2331
2366
|
throw Error(
|
|
2332
2367
|
"The ApiExtractor.watch() is already in progress, or previous watch crashed with unrecoverable error. Stop the previous watch first or create a new ApiExtractor"
|
|
@@ -2335,11 +2370,11 @@ const Rt = async function() {
|
|
|
2335
2370
|
const e = this.config;
|
|
2336
2371
|
let t;
|
|
2337
2372
|
const i = /* @__PURE__ */ new Map();
|
|
2338
|
-
let
|
|
2373
|
+
let o = [];
|
|
2339
2374
|
const s = (u, v, C) => {
|
|
2340
|
-
r(u),
|
|
2375
|
+
r(u), n(v, C, u.previousModule);
|
|
2341
2376
|
}, a = (u, v) => {
|
|
2342
|
-
this.watchFiles.delete(v), u.module !== void 0 &&
|
|
2377
|
+
this.watchFiles.delete(v), u.module !== void 0 && o.push(u.module), r(u);
|
|
2343
2378
|
}, r = (u) => {
|
|
2344
2379
|
if (u.module === void 0)
|
|
2345
2380
|
return;
|
|
@@ -2351,9 +2386,9 @@ const Rt = async function() {
|
|
|
2351
2386
|
const b = this.watchFiles.get(C);
|
|
2352
2387
|
b !== void 0 && (y ? (b.dependencies.delete(v.sourcePath), r(b)) : b.hasDirtyLinks = !0);
|
|
2353
2388
|
}
|
|
2354
|
-
},
|
|
2389
|
+
}, n = (u, v, C) => {
|
|
2355
2390
|
if (v === void 0) {
|
|
2356
|
-
const y = e.context.cwd + u, b =
|
|
2391
|
+
const y = e.context.cwd + u, b = ct(y, "utf8");
|
|
2357
2392
|
v = Je(y, b);
|
|
2358
2393
|
}
|
|
2359
2394
|
this.watchFiles.set(u, {
|
|
@@ -2409,19 +2444,19 @@ const Rt = async function() {
|
|
|
2409
2444
|
dtsFiles: u.dtsFiles,
|
|
2410
2445
|
changedModules: v,
|
|
2411
2446
|
addedModules: C,
|
|
2412
|
-
removedModules:
|
|
2447
|
+
removedModules: o
|
|
2413
2448
|
};
|
|
2414
|
-
|
|
2449
|
+
o = [];
|
|
2415
2450
|
const b = c || v.length > 0 || C.length > 0 || y.removedModules.length > 0;
|
|
2416
2451
|
c = !1, f(b ? y : void 0), l?.();
|
|
2417
2452
|
};
|
|
2418
2453
|
if (e.types.typeCheckedExtraction || e.types.fullTypeCheck) {
|
|
2419
2454
|
const u = e.types.fullTypeCheck ? E.createSemanticDiagnosticsBuilderProgram : E.createAbstractBuilder;
|
|
2420
2455
|
let v;
|
|
2421
|
-
const C = (
|
|
2456
|
+
const C = (k, F, T, ...w) => (v = T, u(
|
|
2422
2457
|
// If not doing full type check, don't scout test files
|
|
2423
2458
|
// If non-tests import tests, they will be included implicitly anyway
|
|
2424
|
-
e.types.fullTypeCheck ?
|
|
2459
|
+
e.types.fullTypeCheck ? k : k?.filter(($) => !He($)),
|
|
2425
2460
|
F,
|
|
2426
2461
|
T,
|
|
2427
2462
|
...w
|
|
@@ -2437,14 +2472,14 @@ const Rt = async function() {
|
|
|
2437
2472
|
void 0
|
|
2438
2473
|
), b = y.setTimeout;
|
|
2439
2474
|
let M;
|
|
2440
|
-
y.setTimeout = b === void 0 ? void 0 : (
|
|
2475
|
+
y.setTimeout = b === void 0 ? void 0 : (k, F, ...T) => {
|
|
2441
2476
|
if (!(T[0] === "timerToUpdateProgram"))
|
|
2442
|
-
return b(
|
|
2443
|
-
const
|
|
2477
|
+
return b(k, F, ...T);
|
|
2478
|
+
const G = M !== void 0 ? Promise.resolve() : d === void 0 ? Promise.resolve(m()) : d.promise.finally(m);
|
|
2444
2479
|
return M = b(
|
|
2445
2480
|
(...J) => {
|
|
2446
|
-
M = void 0,
|
|
2447
|
-
this.program = void 0,
|
|
2481
|
+
M = void 0, G.finally(() => {
|
|
2482
|
+
this.program = void 0, k(...J), this.program === void 0 && f(void 0);
|
|
2448
2483
|
});
|
|
2449
2484
|
},
|
|
2450
2485
|
e.watch.debounceTime,
|
|
@@ -2452,11 +2487,11 @@ const Rt = async function() {
|
|
|
2452
2487
|
), M;
|
|
2453
2488
|
};
|
|
2454
2489
|
const I = y.onWatchStatusChange, P = 6031, L = 6032;
|
|
2455
|
-
y.onWatchStatusChange = (
|
|
2456
|
-
|
|
2457
|
-
}, y.afterProgramCreate = (
|
|
2458
|
-
this.builderProgram =
|
|
2459
|
-
const F =
|
|
2490
|
+
y.onWatchStatusChange = (k, ...F) => {
|
|
2491
|
+
k.code === L ? e.watch.clearScreen && E.sys.clearScreen?.() : k.code !== P && I?.(k, ...F);
|
|
2492
|
+
}, y.afterProgramCreate = (k) => {
|
|
2493
|
+
this.builderProgram = k;
|
|
2494
|
+
const F = k.getProgram();
|
|
2460
2495
|
this.program = F;
|
|
2461
2496
|
const T = F.getSourceFiles();
|
|
2462
2497
|
e.types.typeScriptInstanceCreated(F, v);
|
|
@@ -2464,19 +2499,19 @@ const Rt = async function() {
|
|
|
2464
2499
|
$.wasRemoved = !0;
|
|
2465
2500
|
let w = !1;
|
|
2466
2501
|
for (let $ = 0; $ < T.length; ++$) {
|
|
2467
|
-
const
|
|
2468
|
-
if (!pe(
|
|
2502
|
+
const G = T[$];
|
|
2503
|
+
if (!pe(G.fileName, this))
|
|
2469
2504
|
continue;
|
|
2470
|
-
const
|
|
2471
|
-
J === void 0 ? (
|
|
2505
|
+
const z = G.fileName.slice(e.context.cwd.length), J = this.watchFiles.get(z);
|
|
2506
|
+
J === void 0 ? (n(z, G, void 0), w = !0) : J.file !== G ? (s(J, z, G), w = !0) : J.wasRemoved = !1;
|
|
2472
2507
|
}
|
|
2473
|
-
for (const [$,
|
|
2474
|
-
|
|
2475
|
-
w ? p() : (
|
|
2508
|
+
for (const [$, G] of this.watchFiles)
|
|
2509
|
+
G.wasRemoved && (a(G, $), w = !0);
|
|
2510
|
+
w ? p() : (Re(this, _()), f(void 0));
|
|
2476
2511
|
}, t = E.createWatchProgram(y);
|
|
2477
2512
|
} else {
|
|
2478
2513
|
let u = function(y) {
|
|
2479
|
-
return
|
|
2514
|
+
return dt(y, {
|
|
2480
2515
|
throwIfNoEntry: !1
|
|
2481
2516
|
})?.isFile();
|
|
2482
2517
|
};
|
|
@@ -2488,24 +2523,24 @@ const Rt = async function() {
|
|
|
2488
2523
|
}, e.watch.debounceTime), C = (y, b) => {
|
|
2489
2524
|
const M = e.context.cwd + y, I = !b, P = this.watchFiles.get(y), L = P !== void 0;
|
|
2490
2525
|
if (I || P === void 0) {
|
|
2491
|
-
const
|
|
2492
|
-
if (
|
|
2526
|
+
const k = u(M);
|
|
2527
|
+
if (k === !1) {
|
|
2493
2528
|
let T, w = !1;
|
|
2494
2529
|
try {
|
|
2495
|
-
T =
|
|
2530
|
+
T = at(M, { recursive: !0 });
|
|
2496
2531
|
let $;
|
|
2497
2532
|
for (; ($ = T.readSync()) !== null; ) {
|
|
2498
2533
|
if ($.isDirectory())
|
|
2499
2534
|
continue;
|
|
2500
|
-
const
|
|
2501
|
-
|
|
2535
|
+
const z = `${$.parentPath}/${$.name}`.slice(e.context.cwd.length);
|
|
2536
|
+
je(z) && (w = C(z, !1) || w);
|
|
2502
2537
|
}
|
|
2503
2538
|
} finally {
|
|
2504
2539
|
T?.closeSync();
|
|
2505
2540
|
}
|
|
2506
2541
|
return w;
|
|
2507
2542
|
}
|
|
2508
|
-
const F =
|
|
2543
|
+
const F = k === !0;
|
|
2509
2544
|
if (L) {
|
|
2510
2545
|
if (F)
|
|
2511
2546
|
return s(P, y, void 0), !0;
|
|
@@ -2515,24 +2550,24 @@ const Rt = async function() {
|
|
|
2515
2550
|
}
|
|
2516
2551
|
} else {
|
|
2517
2552
|
if (F)
|
|
2518
|
-
return
|
|
2553
|
+
return n(y, void 0, void 0), !0;
|
|
2519
2554
|
{
|
|
2520
2555
|
let T = !1;
|
|
2521
2556
|
const w = `${y}/`;
|
|
2522
|
-
for (const [$,
|
|
2523
|
-
$.startsWith(w) && (a(
|
|
2557
|
+
for (const [$, G] of this.watchFiles)
|
|
2558
|
+
$.startsWith(w) && (a(G, $), T = !0);
|
|
2524
2559
|
return T;
|
|
2525
2560
|
}
|
|
2526
2561
|
}
|
|
2527
2562
|
} else
|
|
2528
2563
|
return s(P, y, void 0), !0;
|
|
2529
2564
|
};
|
|
2530
|
-
t =
|
|
2565
|
+
t = lt(this.basePath, { recursive: !0 }, (y, b) => {
|
|
2531
2566
|
const M = m(), I = b === null ? void 0 : Ze(b), P = y === "change";
|
|
2532
2567
|
if (I !== void 0 && // If changed, check if it is an included file
|
|
2533
2568
|
// For a rename, we don't know if it is directory or a file - only check
|
|
2534
2569
|
// if directory is included, and the file will be checked later.
|
|
2535
|
-
(P ? pe(this.basePath + I, this) :
|
|
2570
|
+
(P ? pe(this.basePath + I, this) : ze(this.basePath + I, this))) {
|
|
2536
2571
|
const L = e.context.basePath + I, F = (i.get(L) ?? !0) && P;
|
|
2537
2572
|
i.set(L, F);
|
|
2538
2573
|
}
|
|
@@ -2546,17 +2581,17 @@ const Rt = async function() {
|
|
|
2546
2581
|
t.close(), i.clear(), await d?.promise, this.watchFiles = void 0;
|
|
2547
2582
|
}
|
|
2548
2583
|
};
|
|
2549
|
-
},
|
|
2550
|
-
class
|
|
2584
|
+
}, Nt = ".verify-typings.ts";
|
|
2585
|
+
class Bt {
|
|
2551
2586
|
constructor(t, i = N.join(process.cwd(), "dist")) {
|
|
2552
2587
|
this.extractor = t, this.virtualCwdPath = N.join(i, "/");
|
|
2553
2588
|
}
|
|
2554
2589
|
verifyTypes(t) {
|
|
2555
|
-
const i = _(),
|
|
2556
|
-
|
|
2590
|
+
const i = _(), o = /* @__PURE__ */ Object.create(null);
|
|
2591
|
+
o[this.virtualCwdPath + Nt] = this.getVerificationFileContents(t);
|
|
2557
2592
|
const s = this.extractor.config.context.dtsEmitPath === "" ? this.virtualCwdPath : "";
|
|
2558
2593
|
for (const [f, p] of this.extractor.dtsFiles)
|
|
2559
|
-
|
|
2594
|
+
o[s + f] = p;
|
|
2560
2595
|
const a = {
|
|
2561
2596
|
lib: ["lib.dom.d.ts", "lib.esnext.d.ts"],
|
|
2562
2597
|
module: E.ModuleKind.ESNext,
|
|
@@ -2575,17 +2610,17 @@ class Dt {
|
|
|
2575
2610
|
types: [],
|
|
2576
2611
|
// Performance optimization. Don't look up node_modules/@typescript/lib-...
|
|
2577
2612
|
libReplacement: !1
|
|
2578
|
-
}, r = E.createCompilerHost(a),
|
|
2579
|
-
r.fileExists = (f) => f.endsWith("package.json") ? f.includes("node_modules") ?
|
|
2613
|
+
}, r = E.createCompilerHost(a), n = r.fileExists;
|
|
2614
|
+
r.fileExists = (f) => f.endsWith("package.json") ? f.includes("node_modules") ? n(f) : !1 : o[f] !== void 0 ? !0 : f.endsWith(".d.ts") ? n(f) : !1, r.useCaseSensitiveFileNames = () => !0;
|
|
2580
2615
|
const l = r.readFile;
|
|
2581
2616
|
r.readFile = (f) => {
|
|
2582
|
-
const p =
|
|
2617
|
+
const p = o[f];
|
|
2583
2618
|
return p === void 0 ? l(f) : p;
|
|
2584
2619
|
};
|
|
2585
2620
|
const c = r.directoryExists;
|
|
2586
2621
|
r.directoryExists = (f) => f.includes("node_modules") ? c(f) : !0, r.getCurrentDirectory = () => this.virtualCwdPath, r.getCanonicalFileName = se.getCanonicalFileName;
|
|
2587
2622
|
const d = E.createProgram({
|
|
2588
|
-
rootNames: Object.keys(
|
|
2623
|
+
rootNames: Object.keys(o),
|
|
2589
2624
|
host: r,
|
|
2590
2625
|
options: a
|
|
2591
2626
|
}), m = E.getPreEmitDiagnostics(d).filter(this.extractor.config.verify.filterTypeCheckDiagnostic);
|
|
@@ -2596,45 +2631,45 @@ class Dt {
|
|
|
2596
2631
|
printTypeParameters(t, i) {
|
|
2597
2632
|
if (t === void 0)
|
|
2598
2633
|
return "";
|
|
2599
|
-
let
|
|
2634
|
+
let o = "";
|
|
2600
2635
|
for (let s = 0; s < t.length; ++s) {
|
|
2601
2636
|
const a = t[s];
|
|
2602
2637
|
if (a.default !== void 0)
|
|
2603
2638
|
break;
|
|
2604
|
-
|
|
2639
|
+
o === "" ? o += "<" : o += ", ", o += a.constraint === void 0 ? "any" : le(a.constraint, i).text;
|
|
2605
2640
|
}
|
|
2606
|
-
return
|
|
2641
|
+
return o === "" ? "" : `${o}>`;
|
|
2607
2642
|
}
|
|
2608
2643
|
getVerificationFileContents(t) {
|
|
2609
2644
|
let i = `declare const $: unknown;
|
|
2610
2645
|
|
|
2611
2646
|
`;
|
|
2612
|
-
for (let
|
|
2613
|
-
const s = t[
|
|
2647
|
+
for (let o = 0; o < t.length; ++o) {
|
|
2648
|
+
const s = t[o], a = h(s);
|
|
2614
2649
|
if (a.constructorPropertiesInterface !== void 0) {
|
|
2615
|
-
const r = a.constructorPropertiesInterface.name,
|
|
2650
|
+
const r = a.constructorPropertiesInterface.name, n = this.printTypeParameters(
|
|
2616
2651
|
a.constructorPropertiesInterface.typeParameters,
|
|
2617
2652
|
s.path
|
|
2618
2653
|
), l = r.slice(0, -10), c = s.exports === void 0 ? l : "default";
|
|
2619
|
-
i += `$ as import("./${s.path}.js").${c}${
|
|
2654
|
+
i += `$ as import("./${s.path}.js").${c}${n} satisfies import("./${s.path}.js").${r}${n};
|
|
2620
2655
|
`;
|
|
2621
2656
|
}
|
|
2622
2657
|
}
|
|
2623
2658
|
return i;
|
|
2624
2659
|
}
|
|
2625
2660
|
}
|
|
2626
|
-
class
|
|
2661
|
+
class ei {
|
|
2627
2662
|
/**
|
|
2628
2663
|
* @public
|
|
2629
2664
|
* @param rawConfig Optional configuration for the extractor.
|
|
2630
2665
|
*/
|
|
2631
2666
|
constructor(t = {}) {
|
|
2632
|
-
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 =
|
|
2667
|
+
this.componentStories = /* @__PURE__ */ Object.create(null), this.dtsFiles = /* @__PURE__ */ new Map(), this.changedDtsFiles = void 0, this.isRunInProgress = !1, this.watchFiles = void 0, this.program = void 0, this.builderProgram = void 0, this.componentPathMapping = void 0, this.componentCssFileDocs = void 0, this.vanillaComponentTypes = void 0, this.isInLuminaMinimalExtraction = !1, this.errorCount = 0, this.silencedBrokenLinkCount = 0, this.loggedBooleanWarning = !1, this.moduleMap = void 0, this.privateMixinModuleNames = /* @__PURE__ */ new Set(), this.implicitPublicModules = void 0, this.file = void 0, this.apiModule = void 0, this.componentTagName = void 0, this.pairedSetter = void 0, this.statementJsDocs = [], this.jsDoc = void 0, this.apiObject = void 0, this.moduleContext = void 0, this.localDeclarations = /* @__PURE__ */ new Set(), this.exportDefaultName = void 0, this.objectLikeTypeParameters = void 0, this.functionLikeTypeParameters = void 0, this.apiClassLikeName = void 0, this.mixinName = void 0, this.mixinMixins = void 0, this.moduleHasAccessorLikeClass = !1, this.moduleHasClass = !1, this.inheritedModuleName = void 0, this.run = Dt.bind(this), this.watch = Ot.bind(this), this.emitError = De.bind(this);
|
|
2633
2668
|
const i = Xe(t);
|
|
2634
2669
|
this.config = i, this.produceDts = i.types.forceProduceDts || i.context.dtsEmitPath !== "" || i.verify.typeCheckTypes, this.basePath = `${i.context.cwd}${i.context.basePath}`, this.normalizedApiReferencePrefix = `https://${this.config.documentation.host}${this.config.documentation.basePath}`, this.runtimeDependencyNames = /* @__PURE__ */ new Set([
|
|
2635
2670
|
...Object.keys(i.context.packageJson.dependencies ?? {}),
|
|
2636
2671
|
...Object.keys(i.context.packageJson.peerDependencies ?? {})
|
|
2637
|
-
]), this.resolveJsDocLink = i.context.isLuminaMinimalExtraction ? Ee : qe.bind(void 0, this), this.isComponentProject = "@arcgis/lumina" in (i.context.packageJson.dependencies ?? {}), this.isJsApi = i.context.packageJson.name === "arcgis-js-api", this.typeVerifier = i.verify.typeCheckTypes ? new
|
|
2672
|
+
]), this.resolveJsDocLink = i.context.isLuminaMinimalExtraction ? Ee : qe.bind(void 0, this), this.isComponentProject = "@arcgis/lumina" in (i.context.packageJson.dependencies ?? {}), this.isJsApi = i.context.packageJson.name === "arcgis-js-api", this.typeVerifier = i.verify.typeCheckTypes ? new Bt(this, i.context.dtsEmitPath || void 0) : void 0, this.localPrivateDeclarations = i.strict ? void 0 : /* @__PURE__ */ new Map();
|
|
2638
2673
|
}
|
|
2639
2674
|
/**
|
|
2640
2675
|
* Given an array of ApiModules, add top-level api.json metadata and return
|
|
@@ -2642,6 +2677,7 @@ class qt {
|
|
|
2642
2677
|
*/
|
|
2643
2678
|
wrapApiModules(t) {
|
|
2644
2679
|
return {
|
|
2680
|
+
name: this.config.context.packageJson.name,
|
|
2645
2681
|
timestamp: (/* @__PURE__ */ new Date()).toISOString().split(".")[0],
|
|
2646
2682
|
compiler: {
|
|
2647
2683
|
// Preserve previous compiler.name for component projects as that is what
|
|
@@ -2660,6 +2696,6 @@ class qt {
|
|
|
2660
2696
|
}
|
|
2661
2697
|
}
|
|
2662
2698
|
export {
|
|
2663
|
-
|
|
2664
|
-
|
|
2699
|
+
ei as A,
|
|
2700
|
+
Lt as w
|
|
2665
2701
|
};
|