@arcgis/api-extractor 5.1.0-next.13 → 5.1.0-next.131
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/bin/cli.js +2 -0
- package/dist/{ApiExtractor-CsZw1gc4.js → ApiExtractor-BGS5EKsb.js} +533 -496
- package/dist/apiJson.d.ts +22 -7
- package/dist/cli.js +0 -1
- package/dist/diff/apiDiffToMarkdown.js +48 -48
- package/dist/extractor/ApiExtractor.js +3 -3
- package/dist/extractor/config.d.ts +12 -3
- package/dist/extractor/config.js +7 -8
- package/dist/extractor/extractors/copyDoc.d.ts +11 -5
- package/dist/extractor/processing/links.js +40 -39
- package/dist/privateContext-CB7P40up.js +86 -0
- package/dist/typeScript-A4VCaB_l.js +66 -0
- package/dist/utils/apiHelpers.js +78 -15
- package/dist/utils/createIndex.d.ts +1 -1
- package/dist/utils/createIndex.js +46 -45
- package/dist/utils/hydrateApiType.js +25 -24
- package/dist/utils/inferEntrypoints.js +1 -0
- package/dist/utils/partPrinter.js +29 -28
- package/dist/vite/plugin.js +41 -39
- package/dist/vite/typeScript.js +1 -1
- package/dist/worker-DgLbFKBs.js +3705 -0
- package/package.json +10 -10
- package/dist/apiHelpers-BYzO767m.js +0 -161
- package/dist/typeScript-C2M4aviw.js +0 -64
- package/dist/worker-oskaUWnO.js +0 -3680
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import { l as H, a as se, e as
|
|
2
|
-
import { a as
|
|
3
|
-
import { getViewUrl as
|
|
1
|
+
import { l as H, a as se, e as De, p as pe } from "./typeScript-A4VCaB_l.js";
|
|
2
|
+
import { a as xe, o as Pe, t as Le, b as Oe, c as Ne, e as Be, p as We, d as Ue, f as _, i as ue, g as je, h as ze, j as He, k as Je, n as Ve, r as Xe } from "./worker-DgLbFKBs.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
|
-
import { path as N, toPosixPathSeparators as
|
|
6
|
-
import { mkdir as ae, writeFile as
|
|
7
|
-
import x from "
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { printTypeParameters as
|
|
12
|
-
import { identity as
|
|
13
|
-
import {
|
|
14
|
-
|
|
5
|
+
import { path as N, toPosixPathSeparators as Ze } from "@arcgis/components-build-utils";
|
|
6
|
+
import { mkdir as ae, writeFile as Ie } from "fs/promises";
|
|
7
|
+
import { styleText as x } from "node:util";
|
|
8
|
+
import { kebabToPascal as _e } from "@arcgis/toolkit/string";
|
|
9
|
+
import { g as h, a as fe, b as Ke, c as Qe, d as ke, e as oe, p as ne } from "./privateContext-CB7P40up.js";
|
|
10
|
+
import { apiTypeToImportType as le, globalPackageIdentifier as me, getApiMemberName as et, getMaybeStaticApiMemberName as ce, mergeApiNodes as Se, naturalSortModules as tt, compareNamedNodes as it, compareClassMembers as ot } from "./utils/apiHelpers.js";
|
|
11
|
+
import { printTypeParameters as te, printTypeAlias as nt } from "./utils/partPrinter.js";
|
|
12
|
+
import { identity as Ee, debounce as rt } from "@arcgis/toolkit/function";
|
|
13
|
+
import { hasRuntimeDeclaration as st } from "./utils/inferEntrypoints.js";
|
|
14
|
+
import { opendirSync as at, watch as lt, readFileSync as ct, statSync as dt } from "node:fs";
|
|
15
|
+
const S = "/** @deprecated since 5.0. Refactor using \\@arcgis/codemod */", ft = `${S}
|
|
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,25 +1089,25 @@ 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
|
-
|
|
1104
|
+
const n = a.constructorPropertiesInterface;
|
|
1105
|
+
he(n), A.length !== 0 && (o += ye(n, U, n.name, t));
|
|
1105
1106
|
}
|
|
1106
1107
|
let r;
|
|
1107
|
-
for (let
|
|
1108
|
-
const l = e.declarations[
|
|
1109
|
-
if (
|
|
1108
|
+
for (let n = 0; n < e.declarations.length; ++n) {
|
|
1109
|
+
const l = e.declarations[n];
|
|
1110
|
+
if (he(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";
|
|
1112
1113
|
if (m || f) {
|
|
@@ -1114,13 +1115,13 @@ function mt(e, t) {
|
|
|
1114
1115
|
if (l.name === r)
|
|
1115
1116
|
continue;
|
|
1116
1117
|
if (r = l.name, c) {
|
|
1117
|
-
|
|
1118
|
+
A.length !== 1 && t.emitError("Expected only a single @esriCompatibilityName tag on a default export function.", {
|
|
1118
1119
|
file: h(e).file,
|
|
1119
1120
|
node: void 0
|
|
1120
|
-
}), Z(
|
|
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
|
}
|
|
@@ -1132,97 +1133,97 @@ function mt(e, t) {
|
|
|
1132
1133
|
continue;
|
|
1133
1134
|
}
|
|
1134
1135
|
} else if (f && c) {
|
|
1135
|
-
|
|
1136
|
+
A.length !== 1 && t.emitError("Expected only a single @esriCompatibilityName tag on a default export variable.", {
|
|
1136
1137
|
file: h(e).file,
|
|
1137
1138
|
node: void 0
|
|
1138
|
-
}), Z(
|
|
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
|
-
for (let p = 0; p <
|
|
1147
|
-
Z(
|
|
1148
|
-
` :
|
|
1147
|
+
for (let p = 0; p < A.length; ++p)
|
|
1148
|
+
Z(A[p], t), f && j !== void 0 ? q += ` export const ${O}: ${i}.${d};
|
|
1149
|
+
` : ee += ` ${O}: typeof ${i}.${d};
|
|
1149
1150
|
`;
|
|
1150
|
-
} else if (l.kind === "class" || l.kind === "mixin" || l.kind === "interface" &&
|
|
1151
|
-
const p =
|
|
1152
|
-
for (let C = 0; C <
|
|
1153
|
-
if (Z(
|
|
1154
|
-
const
|
|
1155
|
-
|
|
1151
|
+
} else if (l.kind === "class" || l.kind === "mixin" || l.kind === "interface" && fe(l).isMixinBaseClass === !0) {
|
|
1152
|
+
const p = te(K(l.typeParameters, !1, U)), g = te(K(l.typeParameters, !1, void 0)), u = te(K(l.typeParameters, !0, void 0)), v = ` ${i}.${d}`;
|
|
1153
|
+
for (let C = 0; C < A.length; ++C) {
|
|
1154
|
+
if (Z(A[C], t), O.startsWith("$")) {
|
|
1155
|
+
const b = O.slice(1);
|
|
1156
|
+
o += ut(b, l, d, U);
|
|
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 += ye(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(
|
|
1175
1176
|
"Invalid @esriCompatibilityName usage: Classdec module interface name was not set correctly.",
|
|
1176
1177
|
{
|
|
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
|
|
1189
|
-
const s =
|
|
1190
|
-
let
|
|
1191
|
-
for (let l = 0; l <
|
|
1192
|
-
Z(
|
|
1193
|
-
const c =
|
|
1194
|
-
B === void 0 ?
|
|
1189
|
+
function ye(e, t, i, o) {
|
|
1190
|
+
const s = te(K(e.typeParameters, !1, void 0)), a = K(e.typeParameters, !1, t), r = `import("./${t}.js").${i}${s}`;
|
|
1191
|
+
let n = "";
|
|
1192
|
+
for (let l = 0; l < A.length; ++l) {
|
|
1193
|
+
Z(A[l], o);
|
|
1194
|
+
const c = 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,18 +1241,18 @@ 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
|
-
const
|
|
1246
|
-
let
|
|
1247
|
-
function
|
|
1248
|
-
e.kind === "variable" ?
|
|
1246
|
+
const ie = [];
|
|
1247
|
+
let A = ie;
|
|
1248
|
+
function he(e) {
|
|
1249
|
+
e.kind === "variable" ? A = Ke(e).esriCompatibilityNames ?? ie : e.kind === "function" ? A = Qe(e).esriCompatibilityNames ?? ie : A = fe(e).esriCompatibilityNames ?? ie;
|
|
1249
1250
|
}
|
|
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(
|
|
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
|
|
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,149 +1352,147 @@ 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
|
|
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
|
|
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
|
-
return `${
|
|
1400
|
+
return `${xe(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
|
-
|
|
1409
|
+
const a = s[1], r = a.module === void 0 ? i : o.moduleMap.get(a.module), n = r === void 0 ? void 0 : h(r), l = a.name === "default" ? n?.index.default : n?.index.named[a.name];
|
|
1410
|
+
Ae(l) && (t.autoCastingRequiresType = !0);
|
|
1410
1411
|
}
|
|
1411
|
-
return
|
|
1412
|
+
return Te(e, t, o, i, s);
|
|
1412
1413
|
}
|
|
1413
1414
|
}
|
|
1414
|
-
function
|
|
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 === me && r.name === "Date" && ge(
|
|
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
|
-
if (
|
|
1430
|
+
const n = r.module === void 0 ? o : i.moduleMap.get(r.module), l = n === void 0 ? void 0 : h(n), c = r.name === "default" ? l?.index.default : l?.index.named[r.name];
|
|
1431
|
+
if (Ae(c)) {
|
|
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],
|
|
1436
|
+
const y = c.type.references[C], b = y.module ?? n?.path, M = b === o.path;
|
|
1436
1437
|
u.push({
|
|
1437
1438
|
...y,
|
|
1438
|
-
module:
|
|
1439
|
+
module: M ? void 0 : b,
|
|
1439
1440
|
start: y.start + g,
|
|
1440
1441
|
end: y.end + g
|
|
1441
1442
|
});
|
|
1442
1443
|
}
|
|
1443
|
-
if (
|
|
1444
|
+
if (Te(e, t, i, o, u), e.text === p) {
|
|
1444
1445
|
e.text = f;
|
|
1445
1446
|
continue;
|
|
1446
1447
|
}
|
|
1447
1448
|
s.splice(a, 1, ...u);
|
|
1448
1449
|
const v = e.text.length - f.length;
|
|
1449
|
-
|
|
1450
|
+
Pe(s, v, a + u.length);
|
|
1450
1451
|
continue;
|
|
1451
1452
|
}
|
|
1452
1453
|
if (c?.kind !== "class")
|
|
1453
1454
|
continue;
|
|
1454
|
-
const d =
|
|
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
|
|
1458
|
-
n.sourcePath
|
|
1459
|
-
)} in type ${x.blue(e.text)}.`,
|
|
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)}.`,
|
|
1460
1459
|
{
|
|
1461
|
-
file: h(
|
|
1460
|
+
file: h(n).file,
|
|
1462
1461
|
node: void 0
|
|
1463
1462
|
}
|
|
1464
1463
|
);
|
|
1465
1464
|
continue;
|
|
1466
1465
|
}
|
|
1467
|
-
|
|
1466
|
+
ge(
|
|
1468
1467
|
e,
|
|
1469
1468
|
s,
|
|
1470
1469
|
a,
|
|
1471
1470
|
d,
|
|
1472
1471
|
i,
|
|
1473
|
-
|
|
1472
|
+
o,
|
|
1474
1473
|
t
|
|
1475
1474
|
);
|
|
1476
1475
|
}
|
|
1477
1476
|
}
|
|
1478
|
-
function
|
|
1477
|
+
function $e(e, t, i, o) {
|
|
1479
1478
|
const s = h(t), a = s.constructorAutoCastType;
|
|
1480
1479
|
if (a !== void 0)
|
|
1481
1480
|
return a;
|
|
1482
|
-
const r =
|
|
1481
|
+
const r = Mt(e, t, i, o);
|
|
1483
1482
|
return r !== void 0 && (s.constructorAutoCastType = r), r;
|
|
1484
1483
|
}
|
|
1485
|
-
function
|
|
1484
|
+
function Mt(e, t, i, o) {
|
|
1486
1485
|
if (e.members !== void 0)
|
|
1487
1486
|
for (let r = 0; r < e.members.length; ++r) {
|
|
1488
|
-
const
|
|
1489
|
-
if (
|
|
1487
|
+
const n = e.members[r];
|
|
1488
|
+
if (n.kind === "constructor" && // Use the last constructor for auto-casting signature
|
|
1490
1489
|
// Examples: Point, MeshTexture
|
|
1491
1490
|
e.members[r + 1]?.kind !== "constructor" && // Only consider the single-parameter signature
|
|
1492
|
-
|
|
1491
|
+
n.parameters?.length === 1 && // To avoid false positives, constructors without type references are not
|
|
1493
1492
|
// considered autocastable. This excludes core/Accessor#constructor's any[].
|
|
1494
|
-
|
|
1493
|
+
n.parameters[0].type?.references !== void 0)
|
|
1495
1494
|
return {
|
|
1496
|
-
type:
|
|
1495
|
+
type: n.parameters[0].type,
|
|
1497
1496
|
inheritedFrom: i?.path
|
|
1498
1497
|
};
|
|
1499
1498
|
}
|
|
@@ -1506,7 +1505,7 @@ function Ct(e, t, i, n) {
|
|
|
1506
1505
|
name: a.name,
|
|
1507
1506
|
module: t.path,
|
|
1508
1507
|
package: void 0,
|
|
1509
|
-
viewUrl:
|
|
1508
|
+
viewUrl: Ye(t.path, a.name, void 0, o),
|
|
1510
1509
|
start: 0,
|
|
1511
1510
|
end: a.name.length
|
|
1512
1511
|
}
|
|
@@ -1515,24 +1514,24 @@ function Ct(e, t, i, n) {
|
|
|
1515
1514
|
source: void 0
|
|
1516
1515
|
}, inheritedFrom: i?.path };
|
|
1517
1516
|
if (e.superclass !== void 0) {
|
|
1518
|
-
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;
|
|
1519
1518
|
if (c !== void 0)
|
|
1520
|
-
return
|
|
1519
|
+
return $e(c, r, r, o);
|
|
1521
1520
|
}
|
|
1522
1521
|
}
|
|
1523
|
-
function
|
|
1524
|
-
let l =
|
|
1525
|
-
l.length === 2 && l[0].name === "ReadonlyArrayOrCollection" && l[1].name === "T" && (l = [l[0]],
|
|
1526
|
-
...
|
|
1522
|
+
function ge(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,
|
|
1527
1526
|
text: "ReadonlyArrayOrCollection",
|
|
1528
1527
|
references: l
|
|
1529
1528
|
});
|
|
1530
|
-
let c =
|
|
1531
|
-
const d = t[i], m =
|
|
1529
|
+
let c = o.text;
|
|
1530
|
+
const d = t[i], m = o.text.length - (d.end - d.start);
|
|
1532
1531
|
let f = 0;
|
|
1533
1532
|
t.splice(i, 1);
|
|
1534
1533
|
for (let p = l.length - 1; p >= 0; p--) {
|
|
1535
|
-
const g = l[p], u =
|
|
1534
|
+
const g = l[p], u = o.text.slice(g.start, g.end);
|
|
1536
1535
|
if (u !== g.name && g.name !== "default") {
|
|
1537
1536
|
a.emitError(
|
|
1538
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.`,
|
|
@@ -1554,28 +1553,28 @@ function ye(e, t, i, { type: n, inheritedFrom: s }, a, r, o) {
|
|
|
1554
1553
|
);
|
|
1555
1554
|
continue;
|
|
1556
1555
|
}
|
|
1557
|
-
|
|
1558
|
-
const
|
|
1556
|
+
Fe(g, C, a, r);
|
|
1557
|
+
const M = d.start, I = {
|
|
1559
1558
|
...g,
|
|
1560
|
-
start: g.start +
|
|
1561
|
-
end: g.end +
|
|
1559
|
+
start: g.start + M + f,
|
|
1560
|
+
end: g.end + M + f
|
|
1562
1561
|
}, P = y.typeName;
|
|
1563
|
-
if (l.length === 1 &&
|
|
1564
|
-
const L =
|
|
1565
|
-
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);
|
|
1566
1565
|
}
|
|
1567
1566
|
t.splice(i, 0, I);
|
|
1568
1567
|
}
|
|
1569
|
-
return e.text = e.text.slice(0, d.start) + c + e.text.slice(d.end),
|
|
1568
|
+
return e.text = e.text.slice(0, d.start) + c + e.text.slice(d.end), Pe(
|
|
1570
1569
|
t,
|
|
1571
1570
|
m + f,
|
|
1572
1571
|
i + (l?.length ?? 0)
|
|
1573
1572
|
), !0;
|
|
1574
1573
|
}
|
|
1575
|
-
function
|
|
1576
|
-
const s = h(
|
|
1574
|
+
function Fe(e, t, i, o) {
|
|
1575
|
+
const s = h(o);
|
|
1577
1576
|
if (e.package !== void 0) {
|
|
1578
|
-
if (e.package ===
|
|
1577
|
+
if (e.package === me)
|
|
1579
1578
|
return;
|
|
1580
1579
|
i.emitError(
|
|
1581
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.`,
|
|
@@ -1585,7 +1584,7 @@ function Te(e, t, i, n) {
|
|
|
1585
1584
|
}
|
|
1586
1585
|
);
|
|
1587
1586
|
}
|
|
1588
|
-
if (t ===
|
|
1587
|
+
if (t === o)
|
|
1589
1588
|
return;
|
|
1590
1589
|
const a = h(t), r = e.name === "default" ? a.index.default?.name : e.name;
|
|
1591
1590
|
if (r === void 0) {
|
|
@@ -1598,14 +1597,14 @@ function Te(e, t, i, n) {
|
|
|
1598
1597
|
);
|
|
1599
1598
|
return;
|
|
1600
1599
|
}
|
|
1601
|
-
let
|
|
1602
|
-
const c = e;
|
|
1603
|
-
c
|
|
1604
|
-
const d = s.importsMap[
|
|
1605
|
-
d === void 0 ? s.importsMap[
|
|
1600
|
+
let n = r, l;
|
|
1601
|
+
const c = ke(e);
|
|
1602
|
+
c !== void 0 && (n = c, l = r);
|
|
1603
|
+
const d = s.importsMap[n];
|
|
1604
|
+
d === void 0 ? s.importsMap[n] = {
|
|
1606
1605
|
type: e.name === "default" ? "default" : "named",
|
|
1607
1606
|
modulePath: t.path,
|
|
1608
|
-
specifier:
|
|
1607
|
+
specifier: xe(s.dtsPath, a.dtsPath),
|
|
1609
1608
|
replacementName: void 0,
|
|
1610
1609
|
actualName: l,
|
|
1611
1610
|
wasUsed: !0
|
|
@@ -1617,27 +1616,27 @@ function Te(e, t, i, n) {
|
|
|
1617
1616
|
}
|
|
1618
1617
|
) : d.wasUsed = !0;
|
|
1619
1618
|
}
|
|
1620
|
-
function
|
|
1619
|
+
function Ae(e) {
|
|
1621
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);
|
|
1622
1621
|
}
|
|
1623
1622
|
function bt(e) {
|
|
1624
1623
|
let t = 0;
|
|
1625
1624
|
for (let i = 0; i < e.references.length; ++i) {
|
|
1626
|
-
const
|
|
1625
|
+
const o = e.references[i], s = e.text.slice(t, o.start).trim();
|
|
1627
1626
|
if (s !== "" && s !== "|")
|
|
1628
1627
|
return !1;
|
|
1629
|
-
t =
|
|
1628
|
+
t = o.end;
|
|
1630
1629
|
}
|
|
1631
1630
|
return t === e.text.length;
|
|
1632
1631
|
}
|
|
1633
|
-
const
|
|
1632
|
+
const xt = {
|
|
1634
1633
|
// Wrap in parents to correctly substitute Date[] in TimeInfo.stops
|
|
1635
1634
|
text: "(Date | number | string)",
|
|
1636
1635
|
references: [
|
|
1637
1636
|
{
|
|
1638
1637
|
name: "Date",
|
|
1639
1638
|
module: void 0,
|
|
1640
|
-
package:
|
|
1639
|
+
package: me,
|
|
1641
1640
|
viewUrl: "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date",
|
|
1642
1641
|
start: 1,
|
|
1643
1642
|
end: 5
|
|
@@ -1646,45 +1645,39 @@ const Mt = {
|
|
|
1646
1645
|
values: void 0,
|
|
1647
1646
|
source: void 0
|
|
1648
1647
|
};
|
|
1649
|
-
function
|
|
1648
|
+
function Pt(e, t) {
|
|
1650
1649
|
const i = e.constructorPropertiesInterface;
|
|
1651
1650
|
i.type = void 0;
|
|
1652
|
-
const
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
);
|
|
1659
|
-
r !== void 0 && (n.superTypesText = [r.printableText ?? r.name]);
|
|
1651
|
+
const o = h(t.apiModule).index.class;
|
|
1652
|
+
i.typeParameters = o.typeParameters;
|
|
1653
|
+
const s = o.superclass;
|
|
1654
|
+
if (s !== void 0) {
|
|
1655
|
+
const r = ve(s, t);
|
|
1656
|
+
r !== void 0 && (i.supertypes ??= [], i.supertypes.push(r));
|
|
1660
1657
|
}
|
|
1661
|
-
if (
|
|
1662
|
-
for (let r = 0; r <
|
|
1663
|
-
const
|
|
1664
|
-
|
|
1665
|
-
t,
|
|
1666
|
-
o.printableText
|
|
1667
|
-
);
|
|
1668
|
-
l !== void 0 && (n.superTypesText ??= [], n.superTypesText.push(l.printableText ?? l.name));
|
|
1658
|
+
if (o.mixins !== void 0)
|
|
1659
|
+
for (let r = 0; r < o.mixins.length; ++r) {
|
|
1660
|
+
const n = o.mixins[r], l = ve(n, t);
|
|
1661
|
+
l !== void 0 && (i.supertypes ??= [], i.supertypes.push(l));
|
|
1669
1662
|
}
|
|
1670
1663
|
let a = "";
|
|
1671
|
-
if (
|
|
1672
|
-
for (let r = 0; r <
|
|
1673
|
-
const
|
|
1674
|
-
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)
|
|
1675
1668
|
continue;
|
|
1676
|
-
const l = oe(
|
|
1669
|
+
const l = oe(n);
|
|
1677
1670
|
if (l.isAbstract)
|
|
1678
1671
|
continue;
|
|
1679
|
-
let c = e.constructorOnlySetters?.[
|
|
1672
|
+
let c = e.constructorOnlySetters?.[n.name];
|
|
1680
1673
|
if (c === void 0) {
|
|
1681
|
-
if (
|
|
1674
|
+
if (n.readonly !== void 0)
|
|
1682
1675
|
continue;
|
|
1683
|
-
if (
|
|
1684
|
-
a += `${a.length === 0 ? "" : " | "}"${
|
|
1676
|
+
if (n.getterType === void 0 && l.isOverride === void 0) {
|
|
1677
|
+
a += `${a.length === 0 ? "" : " | "}"${n.name}"`;
|
|
1685
1678
|
continue;
|
|
1686
1679
|
} else
|
|
1687
|
-
c =
|
|
1680
|
+
c = n.type, c.text.includes(" | undefined") || (c = { ...c, text: `${c.text} | undefined` });
|
|
1688
1681
|
} else c.text.includes(" | undefined") || (c.text += " | undefined");
|
|
1689
1682
|
const d = {
|
|
1690
1683
|
isAbstract: void 0,
|
|
@@ -1695,8 +1688,8 @@ function xt(e, t) {
|
|
|
1695
1688
|
isConstructorOnly: void 0,
|
|
1696
1689
|
isOverride: void 0,
|
|
1697
1690
|
dtsTypeOverride: void 0
|
|
1698
|
-
}, m =
|
|
1699
|
-
[
|
|
1691
|
+
}, m = n, f = {
|
|
1692
|
+
[ne]: d,
|
|
1700
1693
|
kind: "field",
|
|
1701
1694
|
name: m.name,
|
|
1702
1695
|
static: void 0,
|
|
@@ -1718,66 +1711,75 @@ function xt(e, t) {
|
|
|
1718
1711
|
i.members ??= [], i.members.push(f);
|
|
1719
1712
|
}
|
|
1720
1713
|
if (a.length > 0) {
|
|
1721
|
-
|
|
1722
|
-
let r = `Partial<Pick<${
|
|
1714
|
+
i.supertypes ??= [];
|
|
1715
|
+
let r = `Partial<Pick<${o.name}`;
|
|
1723
1716
|
if (i.typeParameters !== void 0) {
|
|
1724
1717
|
r += "<";
|
|
1725
|
-
for (let
|
|
1726
|
-
const
|
|
1727
|
-
r +=
|
|
1718
|
+
for (let l = 0; l < i.typeParameters.length; ++l) {
|
|
1719
|
+
const c = i.typeParameters[l];
|
|
1720
|
+
r += c.name, l < i.typeParameters.length - 1 && (r += ", ");
|
|
1728
1721
|
}
|
|
1729
1722
|
r += ">";
|
|
1730
1723
|
}
|
|
1731
|
-
r += `, ${a}
|
|
1724
|
+
r += `, ${a}>>`;
|
|
1725
|
+
const n = {
|
|
1726
|
+
[ne]: r,
|
|
1727
|
+
name: "",
|
|
1728
|
+
module: void 0,
|
|
1729
|
+
package: void 0,
|
|
1730
|
+
viewUrl: void 0,
|
|
1731
|
+
typeArguments: void 0
|
|
1732
|
+
};
|
|
1733
|
+
i.supertypes.push(n);
|
|
1732
1734
|
}
|
|
1733
1735
|
}
|
|
1734
|
-
function
|
|
1736
|
+
function ve(e, t) {
|
|
1735
1737
|
if (e.package !== void 0)
|
|
1736
1738
|
return;
|
|
1737
|
-
const
|
|
1738
|
-
if (
|
|
1739
|
+
const i = t.moduleMap.get(e.module);
|
|
1740
|
+
if (i === void 0)
|
|
1739
1741
|
return;
|
|
1740
|
-
const
|
|
1741
|
-
if (
|
|
1742
|
-
const
|
|
1743
|
-
if (typeof
|
|
1744
|
-
const l = e.name === "default" ?
|
|
1742
|
+
const o = h(i), s = o.constructorPropertiesInterface;
|
|
1743
|
+
if (s === void 0) {
|
|
1744
|
+
const n = o.inheritance;
|
|
1745
|
+
if (typeof n == "object" && n.hasSettableField) {
|
|
1746
|
+
const l = e.name === "default" ? o.index.class?.name ?? e.name : e.name;
|
|
1745
1747
|
t.emitError(
|
|
1746
|
-
`This file must have a @public ${x
|
|
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}.`,
|
|
1747
1749
|
{ file: h(t.apiModule).file, node: void 0 }
|
|
1748
|
-
),
|
|
1750
|
+
), n.hasSettableField = !1;
|
|
1749
1751
|
}
|
|
1750
1752
|
return;
|
|
1751
1753
|
}
|
|
1752
|
-
const r = {
|
|
1753
|
-
name: a.name,
|
|
1754
|
-
module: e.module,
|
|
1755
|
-
package: e.package,
|
|
1756
|
-
viewUrl: e.viewUrl,
|
|
1757
|
-
typeArguments: void 0,
|
|
1754
|
+
const a = ke(e), r = {
|
|
1758
1755
|
/**
|
|
1759
1756
|
* If class was renamed when imported, also rename the created Properties
|
|
1760
1757
|
* interface. This avoids name collision inside of
|
|
1761
1758
|
* views/3d/environment/SunLighting as it imports webscene/SunLighting.
|
|
1762
1759
|
* apiReference.name !== class.name for references to mixin base classes.
|
|
1763
1760
|
*/
|
|
1764
|
-
|
|
1761
|
+
[ne]: a === e.name ? void 0 : It(a, o.index.class.name),
|
|
1762
|
+
name: s.name,
|
|
1763
|
+
module: e.module,
|
|
1764
|
+
package: e.package,
|
|
1765
|
+
viewUrl: e.viewUrl,
|
|
1766
|
+
typeArguments: void 0
|
|
1765
1767
|
};
|
|
1766
|
-
return
|
|
1768
|
+
return Fe(r, i, t, t.apiModule), r[ne] ??= s.name, r;
|
|
1767
1769
|
}
|
|
1768
|
-
function
|
|
1770
|
+
function It(e, t) {
|
|
1769
1771
|
if (e === void 0 || e === t)
|
|
1770
1772
|
return;
|
|
1771
1773
|
const i = e.indexOf("<");
|
|
1772
1774
|
if (e = i === -1 ? e : e.slice(0, i), e !== t)
|
|
1773
1775
|
return `${e}Properties`;
|
|
1774
1776
|
}
|
|
1775
|
-
function
|
|
1777
|
+
function kt(e) {
|
|
1776
1778
|
if (e.customElement === void 0)
|
|
1777
1779
|
return;
|
|
1778
1780
|
const t = e, i = [];
|
|
1779
|
-
for (let
|
|
1780
|
-
const s = t.members[
|
|
1781
|
+
for (let o = 0; o < t.members.length; ++o) {
|
|
1782
|
+
const s = t.members[o];
|
|
1781
1783
|
if (s.kind !== "field" || s.attribute === void 0 || s.privacy !== void 0)
|
|
1782
1784
|
continue;
|
|
1783
1785
|
const a = s.type.values?.filter(
|
|
@@ -1789,7 +1791,7 @@ function It(e) {
|
|
|
1789
1791
|
description: s.description,
|
|
1790
1792
|
inheritedFrom: s.inheritedFrom,
|
|
1791
1793
|
type: a === void 0 || a.length === 0 ? s.type : {
|
|
1792
|
-
text:
|
|
1794
|
+
text: Le(a),
|
|
1793
1795
|
references: void 0,
|
|
1794
1796
|
values: a,
|
|
1795
1797
|
source: void 0
|
|
@@ -1813,15 +1815,15 @@ const de = {
|
|
|
1813
1815
|
*/
|
|
1814
1816
|
deferred: 1
|
|
1815
1817
|
};
|
|
1816
|
-
function St(e, t, i,
|
|
1818
|
+
function St(e, t, i, o) {
|
|
1817
1819
|
const s = e;
|
|
1818
|
-
|
|
1820
|
+
o.produceDts && (fe(t).eventTypesProperty = s);
|
|
1819
1821
|
const a = h(i), r = `${t.name}Events`;
|
|
1820
1822
|
if (s.type.text !== r && !s.type.text.startsWith(`${r}<`)) {
|
|
1821
1823
|
if (s.type.text === "unknown")
|
|
1822
1824
|
return;
|
|
1823
|
-
|
|
1824
|
-
`The "@eventTypes" property must be of type named "${t.name}Events". Found ${x
|
|
1825
|
+
o.emitError(
|
|
1826
|
+
`The "@eventTypes" property must be of type named "${t.name}Events". Found ${x("red", s.type.text)}.`,
|
|
1825
1827
|
{
|
|
1826
1828
|
file: a.file,
|
|
1827
1829
|
node: void 0
|
|
@@ -1829,9 +1831,9 @@ function St(e, t, i, n) {
|
|
|
1829
1831
|
);
|
|
1830
1832
|
return;
|
|
1831
1833
|
}
|
|
1832
|
-
const
|
|
1833
|
-
if (
|
|
1834
|
-
|
|
1834
|
+
const n = a.index.named[r];
|
|
1835
|
+
if (n?.kind !== "interface") {
|
|
1836
|
+
o.emitError(
|
|
1835
1837
|
`The "${r}" referenced by the "@eventTypes" property must be a @public interface and defined in the same file as the ${t.name} class.`,
|
|
1836
1838
|
{
|
|
1837
1839
|
file: a.file,
|
|
@@ -1840,11 +1842,11 @@ function St(e, t, i, n) {
|
|
|
1840
1842
|
);
|
|
1841
1843
|
return;
|
|
1842
1844
|
}
|
|
1843
|
-
t.events ??= [],
|
|
1845
|
+
t.events ??= [], we(n, t, i, void 0, o);
|
|
1844
1846
|
}
|
|
1845
|
-
function
|
|
1846
|
-
const a =
|
|
1847
|
-
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) {
|
|
1848
1850
|
s.emitError(
|
|
1849
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}`,
|
|
1850
1852
|
{
|
|
@@ -1856,10 +1858,10 @@ function Fe(e, t, i, n, s) {
|
|
|
1856
1858
|
}
|
|
1857
1859
|
if (e.members !== void 0)
|
|
1858
1860
|
for (let r = 0; r < e.members.length; ++r) {
|
|
1859
|
-
const
|
|
1860
|
-
if (
|
|
1861
|
+
const n = e.members[r];
|
|
1862
|
+
if (n.kind !== "field") {
|
|
1861
1863
|
s.emitError(
|
|
1862
|
-
`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}.`,
|
|
1863
1865
|
{
|
|
1864
1866
|
file: h(i).file,
|
|
1865
1867
|
node: void 0
|
|
@@ -1867,13 +1869,13 @@ function Fe(e, t, i, n, s) {
|
|
|
1867
1869
|
);
|
|
1868
1870
|
continue;
|
|
1869
1871
|
}
|
|
1870
|
-
|
|
1871
|
-
name:
|
|
1872
|
-
deprecated:
|
|
1872
|
+
o.has(n.name) || (o.add(n.name), t.events.push({
|
|
1873
|
+
name: n.name,
|
|
1874
|
+
deprecated: n.deprecated,
|
|
1873
1875
|
summary: void 0,
|
|
1874
|
-
description:
|
|
1875
|
-
docsTags:
|
|
1876
|
-
type:
|
|
1876
|
+
description: n.description,
|
|
1877
|
+
docsTags: n.docsTags,
|
|
1878
|
+
type: n.type,
|
|
1877
1879
|
inheritedFrom: a ? {
|
|
1878
1880
|
name: e.name,
|
|
1879
1881
|
module: i.path,
|
|
@@ -1888,10 +1890,10 @@ function Fe(e, t, i, n, s) {
|
|
|
1888
1890
|
}
|
|
1889
1891
|
if (e.supertypes !== void 0)
|
|
1890
1892
|
for (let r = 0; r < e.supertypes.length; ++r) {
|
|
1891
|
-
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];
|
|
1892
1894
|
if (c?.kind !== "interface") {
|
|
1893
1895
|
s.emitError(
|
|
1894
|
-
`Failed to find @public interface ${x
|
|
1896
|
+
`Failed to find @public interface ${x("red", n.name)} (used by ${x("green", e.name)}).`,
|
|
1895
1897
|
{
|
|
1896
1898
|
file: h(i).file,
|
|
1897
1899
|
node: void 0
|
|
@@ -1899,14 +1901,14 @@ function Fe(e, t, i, n, s) {
|
|
|
1899
1901
|
);
|
|
1900
1902
|
return;
|
|
1901
1903
|
}
|
|
1902
|
-
|
|
1904
|
+
we(c, t, l, o, s);
|
|
1903
1905
|
}
|
|
1904
1906
|
}
|
|
1905
|
-
function
|
|
1906
|
-
const
|
|
1907
|
-
if (
|
|
1907
|
+
function Ge(e, t, i) {
|
|
1908
|
+
const o = h(e);
|
|
1909
|
+
if (o.inheritance !== void 0)
|
|
1908
1910
|
return;
|
|
1909
|
-
|
|
1911
|
+
o.inheritance = de.deferred;
|
|
1910
1912
|
let a = !1;
|
|
1911
1913
|
if (t.members !== void 0)
|
|
1912
1914
|
for (let m = 0; m < t.members.length; ++m) {
|
|
@@ -1916,46 +1918,46 @@ function we(e, t, i) {
|
|
|
1916
1918
|
a = !0, St(f, t, e, i), t.members.splice(m, 1), m -= 1;
|
|
1917
1919
|
continue;
|
|
1918
1920
|
}
|
|
1919
|
-
f.inheritedFrom === void 0 &&
|
|
1921
|
+
f.inheritedFrom === void 0 && Tt(f, e, i);
|
|
1920
1922
|
}
|
|
1921
1923
|
}
|
|
1922
1924
|
const r = t;
|
|
1923
|
-
let
|
|
1925
|
+
let n = t.mixins, l = r.superclass, c = l === void 0 ? void 0 : be(l, e, i);
|
|
1924
1926
|
if (c?.supertypes !== void 0) {
|
|
1925
|
-
|
|
1927
|
+
n = n === void 0 ? [] : [...n];
|
|
1926
1928
|
do {
|
|
1927
1929
|
const m = c.supertypes.length > 1, f = m ? 1 : 0;
|
|
1928
1930
|
for (let p = c.supertypes.length - 1; p >= f; p--) {
|
|
1929
1931
|
const g = c.supertypes[p], u = g.module === void 0 ? { ...g, module: l.module } : g;
|
|
1930
|
-
|
|
1932
|
+
n.unshift(u);
|
|
1931
1933
|
}
|
|
1932
|
-
l = m ? c.supertypes[0] : void 0, c = l === void 0 ? void 0 :
|
|
1934
|
+
l = m ? c.supertypes[0] : void 0, c = l === void 0 ? void 0 : be(l, e, i);
|
|
1933
1935
|
} while (c?.supertypes !== void 0);
|
|
1934
1936
|
}
|
|
1935
|
-
if (
|
|
1936
|
-
const m =
|
|
1937
|
-
for (let f =
|
|
1938
|
-
const p =
|
|
1939
|
-
typeof g == "object" ?
|
|
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 = Me(p.module ?? e.path, !0, i);
|
|
1941
|
+
typeof g == "object" ? Ce(g, t, a, i) : f >= m && (t.mixins.splice(f - m, 1), t.mixins.length === 0 && (t.mixins = void 0));
|
|
1940
1942
|
}
|
|
1941
1943
|
}
|
|
1942
1944
|
if (l?.package !== void 0)
|
|
1943
1945
|
return;
|
|
1944
1946
|
const d = l?.module;
|
|
1945
1947
|
if (d !== void 0) {
|
|
1946
|
-
const m =
|
|
1948
|
+
const m = Me(d, !1, i);
|
|
1947
1949
|
typeof m == "object" && (m.declaration.privacy !== void 0 && t.privacy === void 0 && i.emitError(
|
|
1948
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.`,
|
|
1949
|
-
{ file:
|
|
1950
|
-
),
|
|
1951
|
+
{ file: o.file, node: void 0 }
|
|
1952
|
+
), Ce(m, t, a, i));
|
|
1951
1953
|
}
|
|
1952
1954
|
}
|
|
1953
|
-
function
|
|
1955
|
+
function Ce(e, t, i, o) {
|
|
1954
1956
|
const s = e.declaration, a = t;
|
|
1955
1957
|
if (e.indexedMembers !== void 0) {
|
|
1956
1958
|
t.members ??= [];
|
|
1957
|
-
const r = t.members,
|
|
1958
|
-
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);
|
|
1959
1961
|
for (let d = 0; d < r.length; ++d) {
|
|
1960
1962
|
const m = r[d], f = ce(m), p = e.indexedMembers[f];
|
|
1961
1963
|
if (p === void 0)
|
|
@@ -1964,7 +1966,7 @@ function ge(e, t, i, n) {
|
|
|
1964
1966
|
const u = oe(m);
|
|
1965
1967
|
oe(p).isAccessor === !0 && (u.isAccessor = !0), u.isOverride = !0;
|
|
1966
1968
|
}
|
|
1967
|
-
p !== void 0 && m.inheritedFrom === void 0 &&
|
|
1969
|
+
p !== void 0 && m.inheritedFrom === void 0 && Se(p, m);
|
|
1968
1970
|
}
|
|
1969
1971
|
const c = s.members;
|
|
1970
1972
|
for (let d = 0; d < c.length; ++d) {
|
|
@@ -2002,47 +2004,47 @@ function ge(e, t, i, n) {
|
|
|
2002
2004
|
a.cssStates,
|
|
2003
2005
|
s.cssStates,
|
|
2004
2006
|
e.indexedCssStates
|
|
2005
|
-
));
|
|
2007
|
+
)), s.formAssociated === !0 && (a.formAssociated = !0);
|
|
2006
2008
|
}
|
|
2007
|
-
function X(e = [], t, i,
|
|
2009
|
+
function X(e = [], t, i, o) {
|
|
2008
2010
|
const s = /* @__PURE__ */ new Set();
|
|
2009
2011
|
for (let a = 0; a < e.length; ++a) {
|
|
2010
|
-
const r = e[a],
|
|
2011
|
-
|
|
2012
|
+
const r = e[a], n = i[r.name];
|
|
2013
|
+
n !== void 0 && (s.add(r.name), r.inheritedFrom === void 0 && Se(n, r));
|
|
2012
2014
|
}
|
|
2013
2015
|
for (let a = 0; a < t.length; ++a) {
|
|
2014
2016
|
const r = t[a];
|
|
2015
2017
|
s.has(r.name) || e.push(
|
|
2016
|
-
|
|
2018
|
+
o === void 0 || r.inheritedFrom !== void 0 ? r : { ...r, inheritedFrom: o }
|
|
2017
2019
|
);
|
|
2018
2020
|
}
|
|
2019
2021
|
return e;
|
|
2020
2022
|
}
|
|
2021
|
-
function
|
|
2022
|
-
const
|
|
2023
|
-
if (s === !1 ||
|
|
2023
|
+
function Me(e, t, i) {
|
|
2024
|
+
const o = i.moduleMap.get(e), s = Et(o, e, t, i), a = o === void 0 ? void 0 : h(o);
|
|
2025
|
+
if (s === !1 || o === void 0)
|
|
2024
2026
|
return a !== void 0 ? a.inheritance = de.skip : t && i.privateMixinModuleNames.add(e), de.skip;
|
|
2025
|
-
const [r,
|
|
2026
|
-
|
|
2027
|
+
const [r, n] = s, l = n;
|
|
2028
|
+
Ge(o, n, i);
|
|
2027
2029
|
let c, d = !1;
|
|
2028
|
-
if (
|
|
2030
|
+
if (n.members !== void 0) {
|
|
2029
2031
|
c = /* @__PURE__ */ Object.create(null);
|
|
2030
|
-
for (let f = 0; f <
|
|
2031
|
-
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;
|
|
2032
2034
|
c[g] = v ? void 0 : p, d ||= p.kind === "field" && p.readonly === void 0;
|
|
2033
2035
|
}
|
|
2034
2036
|
}
|
|
2035
2037
|
const m = {
|
|
2036
2038
|
inheritanceData: {
|
|
2037
|
-
name:
|
|
2039
|
+
name: n.name,
|
|
2038
2040
|
module: r,
|
|
2039
2041
|
package: void 0,
|
|
2040
2042
|
viewUrl: void 0
|
|
2041
2043
|
},
|
|
2042
|
-
declaration:
|
|
2044
|
+
declaration: n,
|
|
2043
2045
|
hasSettableField: d,
|
|
2044
2046
|
indexedMembers: c,
|
|
2045
|
-
indexedEvents: Y(
|
|
2047
|
+
indexedEvents: Y(n.events),
|
|
2046
2048
|
indexedAttributes: Y(l.attributes),
|
|
2047
2049
|
indexedSlots: Y(l.slots),
|
|
2048
2050
|
indexedCssParts: Y(l.cssParts),
|
|
@@ -2056,15 +2058,15 @@ function Y(e) {
|
|
|
2056
2058
|
return;
|
|
2057
2059
|
const t = /* @__PURE__ */ Object.create(null);
|
|
2058
2060
|
for (let i = 0; i < e.length; ++i) {
|
|
2059
|
-
const
|
|
2060
|
-
t[
|
|
2061
|
+
const o = e[i];
|
|
2062
|
+
t[o.name] = o;
|
|
2061
2063
|
}
|
|
2062
2064
|
return t;
|
|
2063
2065
|
}
|
|
2064
|
-
function
|
|
2066
|
+
function Et(e, t, i, o) {
|
|
2065
2067
|
const s = e === void 0 ? void 0 : h(e), a = s?.index.class;
|
|
2066
|
-
return a === void 0 ? (i ||
|
|
2067
|
-
`Failed to find @public class/custom element declaration in ${x
|
|
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)}`,
|
|
2068
2070
|
{
|
|
2069
2071
|
file: s?.file,
|
|
2070
2072
|
scope: s === void 0 ? t : void 0,
|
|
@@ -2072,16 +2074,16 @@ function kt(e, t, i, n) {
|
|
|
2072
2074
|
}
|
|
2073
2075
|
), !1) : [t, a];
|
|
2074
2076
|
}
|
|
2075
|
-
function
|
|
2077
|
+
function be(e, t, i) {
|
|
2076
2078
|
if (e.package !== void 0)
|
|
2077
2079
|
return;
|
|
2078
|
-
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];
|
|
2079
2081
|
if (a === void 0) {
|
|
2080
2082
|
i.emitError(
|
|
2081
|
-
`Failed to find @public class/mixin/custom element declaration in ${x
|
|
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)}.`,
|
|
2082
2084
|
{
|
|
2083
2085
|
file: s?.file,
|
|
2084
|
-
scope:
|
|
2086
|
+
scope: o === void 0 ? t.path : void 0,
|
|
2085
2087
|
node: void 0
|
|
2086
2088
|
}
|
|
2087
2089
|
);
|
|
@@ -2089,121 +2091,153 @@ function Ce(e, t, i) {
|
|
|
2089
2091
|
}
|
|
2090
2092
|
return a.kind === "interface" ? a : void 0;
|
|
2091
2093
|
}
|
|
2092
|
-
function Et(e, t, i) {
|
|
2093
|
-
const n = oe(e), s = h(t);
|
|
2094
|
-
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);
|
|
2095
|
-
}
|
|
2096
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) {
|
|
2097
2099
|
if (!(i.watchFiles === void 0 || t.reExports === void 0))
|
|
2098
|
-
for (let
|
|
2099
|
-
const s = t.reExports[
|
|
2100
|
+
for (let o = 0; o < t.reExports.length; ++o) {
|
|
2101
|
+
const s = t.reExports[o];
|
|
2100
2102
|
if (s.modulePath === void 0)
|
|
2101
2103
|
continue;
|
|
2102
|
-
const a = i.moduleMap.get(s.modulePath),
|
|
2103
|
-
|
|
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));
|
|
2104
2106
|
}
|
|
2105
2107
|
}
|
|
2106
|
-
function $t(e, t) {
|
|
2107
|
-
e.sort(tt), Ft(e, t), t.isComponentProject && De(e, t);
|
|
2108
|
-
}
|
|
2109
2108
|
function Ft(e, t) {
|
|
2109
|
+
e.sort(tt), At(e, t), t.isComponentProject && Oe(e, t);
|
|
2110
|
+
}
|
|
2111
|
+
function At(e, t) {
|
|
2110
2112
|
for (let i = 0; i < e.length; ++i) {
|
|
2111
|
-
const
|
|
2112
|
-
if (!h(
|
|
2113
|
+
const o = e[i];
|
|
2114
|
+
if (!h(o).isStale)
|
|
2113
2115
|
continue;
|
|
2114
|
-
t.apiModule =
|
|
2115
|
-
const a =
|
|
2116
|
-
for (let r = 0; r <
|
|
2117
|
-
const
|
|
2118
|
-
a &&
|
|
2119
|
-
`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}`,
|
|
2120
2122
|
{
|
|
2121
|
-
file: h(
|
|
2123
|
+
file: h(o).file,
|
|
2122
2124
|
node: void 0
|
|
2123
2125
|
}
|
|
2124
|
-
), "members" in
|
|
2126
|
+
), "members" in n && n.kind !== "interface" && (Ge(o, n, t), n.events?.sort(it));
|
|
2125
2127
|
}
|
|
2126
2128
|
}
|
|
2127
2129
|
for (let i = 0; i < e.length; ++i) {
|
|
2128
|
-
const
|
|
2130
|
+
const o = e[i], s = h(o);
|
|
2129
2131
|
if (!s.isStale) {
|
|
2130
|
-
const a = t.watchFiles?.get(
|
|
2132
|
+
const a = t.watchFiles?.get(o.sourcePath);
|
|
2131
2133
|
if (a?.hasDirtyLinks === !0) {
|
|
2132
|
-
t.apiModule =
|
|
2134
|
+
t.apiModule = o;
|
|
2133
2135
|
for (let r = 0; r < a.docLinks.length; ++r) {
|
|
2134
|
-
const
|
|
2135
|
-
t.resolveJsDocLink(`{@link ${
|
|
2136
|
+
const n = a.docLinks[r];
|
|
2137
|
+
t.resolveJsDocLink(`{@link ${n}}`, n);
|
|
2136
2138
|
}
|
|
2137
2139
|
a.hasDirtyLinks = !1;
|
|
2138
2140
|
}
|
|
2139
2141
|
continue;
|
|
2140
2142
|
}
|
|
2141
|
-
t.apiModule =
|
|
2142
|
-
for (let a = 0; a <
|
|
2143
|
-
const r =
|
|
2144
|
-
if (r.deprecated =
|
|
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") {
|
|
2145
2147
|
if (r.parameters !== void 0)
|
|
2146
2148
|
for (let l = 0; l < r.parameters.length; ++l) {
|
|
2147
2149
|
const c = r.parameters[l];
|
|
2148
|
-
c.description =
|
|
2150
|
+
c.description = R(c.description, t), V(c.docsTags, t);
|
|
2149
2151
|
}
|
|
2150
|
-
r.return !== void 0 && (r.return.description =
|
|
2152
|
+
r.return !== void 0 && (r.return.description = R(r.return.description, t));
|
|
2151
2153
|
}
|
|
2152
|
-
const
|
|
2153
|
-
if (
|
|
2154
|
-
for (let c = 0; c <
|
|
2155
|
-
const d =
|
|
2156
|
-
if (t.inheritedModuleName = m?.module, d.deprecated =
|
|
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") {
|
|
2157
2159
|
if (d.parameters !== void 0)
|
|
2158
2160
|
for (let g = 0; g < d.parameters.length; ++g) {
|
|
2159
2161
|
const u = d.parameters[g];
|
|
2160
|
-
u.description =
|
|
2162
|
+
u.description = R(u.description, t), V(u.docsTags, t);
|
|
2161
2163
|
}
|
|
2162
2164
|
const p = d;
|
|
2163
|
-
p.return !== void 0 && (p.return.description =
|
|
2165
|
+
p.return !== void 0 && (p.return.description = R(p.return.description, t));
|
|
2164
2166
|
}
|
|
2165
2167
|
t.inheritedModuleName = void 0;
|
|
2166
2168
|
}
|
|
2167
|
-
r.kind !== "interface" &&
|
|
2169
|
+
r.kind !== "interface" && n.members.sort(ot);
|
|
2168
2170
|
const l = r;
|
|
2169
2171
|
if (l.events !== void 0) {
|
|
2170
2172
|
for (let c = 0; c < l.events.length; ++c) {
|
|
2171
2173
|
const d = l.events[c];
|
|
2172
|
-
t.inheritedModuleName = d.inheritedFrom?.module, d.deprecated =
|
|
2174
|
+
t.inheritedModuleName = d.inheritedFrom?.module, d.deprecated = Q(d.deprecated, t), d.description = R(d.description, t), V(d.docsTags, t);
|
|
2173
2175
|
}
|
|
2174
2176
|
t.inheritedModuleName = void 0;
|
|
2175
2177
|
}
|
|
2176
|
-
if (t.config.context.isLuminaMinimalExtraction ||
|
|
2178
|
+
if (t.config.context.isLuminaMinimalExtraction || kt(n), l.slots !== void 0)
|
|
2177
2179
|
for (let c = 0; c < l.slots.length; ++c) {
|
|
2178
2180
|
const d = l.slots[c];
|
|
2179
|
-
d.description =
|
|
2181
|
+
d.description = R(d.description, t);
|
|
2180
2182
|
}
|
|
2181
2183
|
if (l.cssProperties !== void 0)
|
|
2182
2184
|
for (let c = 0; c < l.cssProperties.length; ++c) {
|
|
2183
2185
|
const d = l.cssProperties[c];
|
|
2184
|
-
d.description =
|
|
2186
|
+
d.description = R(d.description, t);
|
|
2185
2187
|
}
|
|
2186
2188
|
if (l.cssParts !== void 0)
|
|
2187
2189
|
for (let c = 0; c < l.cssParts.length; ++c) {
|
|
2188
2190
|
const d = l.cssParts[c];
|
|
2189
|
-
d.description =
|
|
2191
|
+
d.description = R(d.description, t);
|
|
2190
2192
|
}
|
|
2191
2193
|
if (l.cssStates !== void 0)
|
|
2192
2194
|
for (let c = 0; c < l.cssStates.length; ++c) {
|
|
2193
2195
|
const d = l.cssStates[c];
|
|
2194
|
-
d.description =
|
|
2196
|
+
d.description = R(d.description, t);
|
|
2195
2197
|
}
|
|
2196
2198
|
if (l.demos !== void 0)
|
|
2197
2199
|
for (let c = 0; c < l.demos.length; ++c) {
|
|
2198
2200
|
const d = l.demos[c];
|
|
2199
|
-
d.description =
|
|
2201
|
+
d.description = R(d.description, t);
|
|
2200
2202
|
}
|
|
2201
|
-
} else r === s.constructorPropertiesInterface && (
|
|
2203
|
+
} else r === s.constructorPropertiesInterface && (o.declarations.splice(a, 1), a -= 1);
|
|
2202
2204
|
}
|
|
2203
|
-
s.constructorPropertiesInterface !== void 0 &&
|
|
2205
|
+
s.constructorPropertiesInterface !== void 0 && Pt(s, t), vt(o, s, t), $t(o, s, t);
|
|
2204
2206
|
}
|
|
2205
2207
|
}
|
|
2206
|
-
|
|
2208
|
+
function wt(e) {
|
|
2209
|
+
const t = [Gt];
|
|
2210
|
+
for (let i = 0; i < e.length; ++i) {
|
|
2211
|
+
const o = e[i];
|
|
2212
|
+
st(o) && t.push(
|
|
2213
|
+
` "@arcgis/core/${o.path}.js": typeof import("./${o.path}.js")${o.exports === void 0 ? "" : ".default"};
|
|
2214
|
+
`
|
|
2215
|
+
);
|
|
2216
|
+
}
|
|
2217
|
+
return t.push(Rt), t.join("");
|
|
2218
|
+
}
|
|
2219
|
+
const Gt = `declare global {
|
|
2220
|
+
const $arcgis: ArcgisGlobal;
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
interface ArcgisGlobal {
|
|
2224
|
+
import: ArcgisImport;
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
interface ArcgisImport {
|
|
2228
|
+
<ModuleName extends keyof ArcgisImportModules>(module: ModuleName): Promise<ArcgisImportModules[ModuleName]>;
|
|
2229
|
+
<ModuleNames extends (keyof ArcgisImportModules)[]>(
|
|
2230
|
+
modules: [...ModuleNames],
|
|
2231
|
+
): Promise<{
|
|
2232
|
+
[ModuleName in keyof ModuleNames]: ModuleNames[ModuleName] extends keyof ArcgisImportModules
|
|
2233
|
+
? ArcgisImportModules[ModuleNames[ModuleName]]
|
|
2234
|
+
: unknown;
|
|
2235
|
+
}>;
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
export interface ArcgisImportModules {
|
|
2239
|
+
`, Rt = `}
|
|
2240
|
+
`, Dt = async function() {
|
|
2207
2241
|
if (this.isRunInProgress)
|
|
2208
2242
|
throw Error(
|
|
2209
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"
|
|
@@ -2213,10 +2247,10 @@ const wt = async function() {
|
|
|
2213
2247
|
this.watchFiles === void 0 && (this.moduleMap = /* @__PURE__ */ new Map());
|
|
2214
2248
|
const t = e.context.dtsEmitPath !== "", i = e.context.emptyDtsEmitPath && t ? (
|
|
2215
2249
|
// This takes 80ms for JSAPI
|
|
2216
|
-
|
|
2250
|
+
Ne(e.context.dtsEmitPath)
|
|
2217
2251
|
) : void 0;
|
|
2218
2252
|
if (e.types.typeCheckedExtraction || e.types.fullTypeCheck) {
|
|
2219
|
-
const
|
|
2253
|
+
const n = _(), l = e.types.typeScriptConfig;
|
|
2220
2254
|
if (this.watchFiles === void 0) {
|
|
2221
2255
|
const c = E.createCompilerHost(l.config.options), d = E.createProgram({
|
|
2222
2256
|
host: c,
|
|
@@ -2226,26 +2260,28 @@ const wt = async function() {
|
|
|
2226
2260
|
});
|
|
2227
2261
|
this.program = d, e.types.typeScriptInstanceCreated(d, c);
|
|
2228
2262
|
}
|
|
2229
|
-
|
|
2263
|
+
Re(this, n);
|
|
2230
2264
|
}
|
|
2231
|
-
const
|
|
2232
|
-
|
|
2265
|
+
const o = _(), s = await Be(this);
|
|
2266
|
+
Ft(s, this);
|
|
2233
2267
|
const a = this.wrapApiModules(s);
|
|
2234
2268
|
e.context.logger.info(
|
|
2235
|
-
`${H}Extracted ${s.length} @public files in ${x
|
|
2269
|
+
`${H}Extracted ${s.length} @public files in ${x("green", `${o()}s`)}`
|
|
2236
2270
|
);
|
|
2237
2271
|
const r = { apiJson: a, dtsFiles: void 0 };
|
|
2238
|
-
if (e.afterApiJsonCreate !==
|
|
2239
|
-
const
|
|
2272
|
+
if (e.afterApiJsonCreate !== Ee && e.afterApiJsonCreate(r), this.produceDts) {
|
|
2273
|
+
const n = _(), l = this.dtsFiles;
|
|
2240
2274
|
if (this.dtsFiles = /* @__PURE__ */ new Map(), this.isJsApi) {
|
|
2241
|
-
const c =
|
|
2275
|
+
const c = gt(s, this), d = `${e.context.dtsEmitPath}interfaces.d.ts`;
|
|
2242
2276
|
this.dtsFiles.set(d, c);
|
|
2243
|
-
|
|
2277
|
+
const m = wt(s), f = `${e.context.dtsEmitPath}arcgisGlobal.d.ts`;
|
|
2278
|
+
this.dtsFiles.set(f, m);
|
|
2279
|
+
} else this.isComponentProject && We(s, this);
|
|
2244
2280
|
for (let c = 0; c < s.length; ++c) {
|
|
2245
2281
|
const d = s[c], m = h(d);
|
|
2246
2282
|
let f = `${e.context.dtsEmitPath + m.dtsPath}.d.ts`, p;
|
|
2247
2283
|
if (m.isStale) {
|
|
2248
|
-
if (p =
|
|
2284
|
+
if (p = Ue(d, this), e.types.declarationTextTransformers.length > 0) {
|
|
2249
2285
|
let v = { filePath: f, content: p };
|
|
2250
2286
|
for (let C = 0; C < e.types.declarationTextTransformers.length; ++C) {
|
|
2251
2287
|
const y = e.types.declarationTextTransformers[C];
|
|
@@ -2268,64 +2304,64 @@ const wt = async function() {
|
|
|
2268
2304
|
for (const [c, d] of this.dtsFiles)
|
|
2269
2305
|
l.get(c) !== d && this.changedDtsFiles.set(c, d);
|
|
2270
2306
|
if (t) {
|
|
2271
|
-
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);
|
|
2272
2308
|
const c = N.join(N.relative(process.cwd(), e.context.dtsEmitPath), "/");
|
|
2273
2309
|
e.context.logger.info(
|
|
2274
|
-
`${H}Wrote ${c}**/*${x
|
|
2310
|
+
`${H}Wrote ${c}**/*${x("blue", ".d.ts")} in ${x("green", `${n()}s`)}`
|
|
2275
2311
|
);
|
|
2276
2312
|
}
|
|
2277
2313
|
}
|
|
2278
2314
|
if (e.context.apiJsonEmitPath !== "") {
|
|
2279
|
-
const
|
|
2280
|
-
await ae(N.dirname(
|
|
2281
|
-
|
|
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 Ie(
|
|
2317
|
+
n,
|
|
2282
2318
|
e.context.environment === "production" ? JSON.stringify(a) : JSON.stringify(a, null, 2)
|
|
2283
2319
|
), e.context.logger.info(
|
|
2284
|
-
`${H}Wrote ${l}${x
|
|
2320
|
+
`${H}Wrote ${l}${x("yellow", N.basename(n))}`
|
|
2285
2321
|
);
|
|
2286
2322
|
}
|
|
2287
2323
|
return this.typeVerifier?.verifyTypes(s), this.errorCount > 0 && e.context.logger.error(
|
|
2288
|
-
`${H}${x
|
|
2324
|
+
`${H}${x("red", `Found ${this.errorCount} ${this.errorCount === 1 ? "error" : "errors"}`)}`
|
|
2289
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;
|
|
2290
2326
|
};
|
|
2291
|
-
async function
|
|
2292
|
-
const
|
|
2327
|
+
async function Lt(e, t, i) {
|
|
2328
|
+
const o = /* @__PURE__ */ new Set(), s = Array.from(i.entries());
|
|
2293
2329
|
for (let l = 0; l < s.length; ++l) {
|
|
2294
2330
|
const [c, d] = s[l];
|
|
2295
2331
|
if (d.length === 0)
|
|
2296
2332
|
continue;
|
|
2297
2333
|
const m = (t ? c.slice(e.length) : c).split("/");
|
|
2298
2334
|
for (let f = 1; f < m.length; ++f)
|
|
2299
|
-
|
|
2335
|
+
o.add(m.slice(0, f).join("/"));
|
|
2300
2336
|
}
|
|
2301
|
-
const a = new Array(
|
|
2302
|
-
for (const l of
|
|
2337
|
+
const a = new Array(o.size);
|
|
2338
|
+
for (const l of o)
|
|
2303
2339
|
a.push(ae(e + l, { recursive: !0 }));
|
|
2304
2340
|
await Promise.all(a);
|
|
2305
|
-
const r = new Array(s.length),
|
|
2341
|
+
const r = new Array(s.length), n = t ? "" : e;
|
|
2306
2342
|
for (let l = 0; l < s.length; ++l) {
|
|
2307
2343
|
const [c, d] = s[l];
|
|
2308
2344
|
if (d.length === 0)
|
|
2309
2345
|
continue;
|
|
2310
|
-
const m =
|
|
2311
|
-
r[l] =
|
|
2346
|
+
const m = n + c;
|
|
2347
|
+
r[l] = Ie(m, d);
|
|
2312
2348
|
}
|
|
2313
2349
|
await Promise.all(r);
|
|
2314
2350
|
}
|
|
2315
|
-
function
|
|
2351
|
+
function Re(e, t) {
|
|
2316
2352
|
if (e.config.types.fullTypeCheck)
|
|
2317
2353
|
if ("getSemanticDiagnostics" in e.program) {
|
|
2318
2354
|
const i = e.builderProgram === void 0 ? E.getPreEmitDiagnostics(e.program) : e.builderProgram.getSemanticDiagnostics();
|
|
2319
2355
|
i.length > 0 && (e.config.context.logger.error(
|
|
2320
2356
|
E.formatDiagnosticsWithColorAndContext(i, se)
|
|
2321
|
-
), e.errorCount += i.length, process.exitCode = 1), e.config.types.afterDiagnostic(i), e.config.context.logger.info(`${H}Type checked in ${
|
|
2357
|
+
), e.errorCount += i.length, process.exitCode = 1), e.config.types.afterDiagnostic(i), e.config.context.logger.info(`${H}Type checked in ${x("cyan", `${t()}s`)}`);
|
|
2322
2358
|
} else
|
|
2323
2359
|
e.emitError("Can't do type checking as the passed ts.Program is not a ts.Program instance.", {
|
|
2324
2360
|
file: void 0,
|
|
2325
2361
|
node: void 0
|
|
2326
2362
|
});
|
|
2327
2363
|
}
|
|
2328
|
-
const
|
|
2364
|
+
const Ot = async function() {
|
|
2329
2365
|
if (this.watchFiles !== void 0)
|
|
2330
2366
|
throw Error(
|
|
2331
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"
|
|
@@ -2334,11 +2370,11 @@ const Rt = async function() {
|
|
|
2334
2370
|
const e = this.config;
|
|
2335
2371
|
let t;
|
|
2336
2372
|
const i = /* @__PURE__ */ new Map();
|
|
2337
|
-
let
|
|
2373
|
+
let o = [];
|
|
2338
2374
|
const s = (u, v, C) => {
|
|
2339
|
-
r(u),
|
|
2375
|
+
r(u), n(v, C, u.previousModule);
|
|
2340
2376
|
}, a = (u, v) => {
|
|
2341
|
-
this.watchFiles.delete(v), u.module !== void 0 &&
|
|
2377
|
+
this.watchFiles.delete(v), u.module !== void 0 && o.push(u.module), r(u);
|
|
2342
2378
|
}, r = (u) => {
|
|
2343
2379
|
if (u.module === void 0)
|
|
2344
2380
|
return;
|
|
@@ -2347,13 +2383,13 @@ const Rt = async function() {
|
|
|
2347
2383
|
for (const C of u.dependencies)
|
|
2348
2384
|
this.watchFiles.get(C)?.dependents.delete(v.sourcePath);
|
|
2349
2385
|
for (const [C, y] of u.dependents) {
|
|
2350
|
-
const
|
|
2351
|
-
|
|
2386
|
+
const b = this.watchFiles.get(C);
|
|
2387
|
+
b !== void 0 && (y ? (b.dependencies.delete(v.sourcePath), r(b)) : b.hasDirtyLinks = !0);
|
|
2352
2388
|
}
|
|
2353
|
-
},
|
|
2389
|
+
}, n = (u, v, C) => {
|
|
2354
2390
|
if (v === void 0) {
|
|
2355
|
-
const y = e.context.cwd + u,
|
|
2356
|
-
v =
|
|
2391
|
+
const y = e.context.cwd + u, b = ct(y, "utf8");
|
|
2392
|
+
v = Je(y, b);
|
|
2357
2393
|
}
|
|
2358
2394
|
this.watchFiles.set(u, {
|
|
2359
2395
|
file: v,
|
|
@@ -2380,50 +2416,50 @@ const Rt = async function() {
|
|
|
2380
2416
|
let u;
|
|
2381
2417
|
try {
|
|
2382
2418
|
u = await this.run();
|
|
2383
|
-
} catch (
|
|
2384
|
-
throw f(void 0),
|
|
2419
|
+
} catch (M) {
|
|
2420
|
+
throw f(void 0), M;
|
|
2385
2421
|
}
|
|
2386
2422
|
const v = [], C = [];
|
|
2387
|
-
for (const
|
|
2388
|
-
const I =
|
|
2423
|
+
for (const M of this.watchFiles.values()) {
|
|
2424
|
+
const I = M.module, P = M.previousModule;
|
|
2389
2425
|
if (I === void 0)
|
|
2390
|
-
P !== void 0 && (
|
|
2426
|
+
P !== void 0 && (M.module = M.previousModule, a(M, P.sourcePath));
|
|
2391
2427
|
else {
|
|
2392
|
-
P === void 0 ? (c || C.push(I),
|
|
2428
|
+
P === void 0 ? (c || C.push(I), M.previousModule = I) : I !== P && (Ve(I, P) ? M.module = P : (v.push({ old: P, new: I }), M.previousModule = I));
|
|
2393
2429
|
const L = h(I);
|
|
2394
2430
|
L.isStale && (L.isStale = !1);
|
|
2395
2431
|
}
|
|
2396
2432
|
}
|
|
2397
2433
|
this.program ??= {
|
|
2398
2434
|
getSourceFiles: () => {
|
|
2399
|
-
const
|
|
2435
|
+
const M = [];
|
|
2400
2436
|
for (const I of this.watchFiles.values())
|
|
2401
|
-
|
|
2402
|
-
return
|
|
2437
|
+
M.push(I.file);
|
|
2438
|
+
return M;
|
|
2403
2439
|
},
|
|
2404
|
-
getSourceFile: (
|
|
2440
|
+
getSourceFile: (M) => this.watchFiles.get(M.slice(e.context.cwd.length))?.file
|
|
2405
2441
|
};
|
|
2406
2442
|
const y = {
|
|
2407
2443
|
apiJson: u.apiJson,
|
|
2408
2444
|
dtsFiles: u.dtsFiles,
|
|
2409
2445
|
changedModules: v,
|
|
2410
2446
|
addedModules: C,
|
|
2411
|
-
removedModules:
|
|
2447
|
+
removedModules: o
|
|
2412
2448
|
};
|
|
2413
|
-
|
|
2414
|
-
const
|
|
2415
|
-
c = !1, f(
|
|
2449
|
+
o = [];
|
|
2450
|
+
const b = c || v.length > 0 || C.length > 0 || y.removedModules.length > 0;
|
|
2451
|
+
c = !1, f(b ? y : void 0), l?.();
|
|
2416
2452
|
};
|
|
2417
2453
|
if (e.types.typeCheckedExtraction || e.types.fullTypeCheck) {
|
|
2418
2454
|
const u = e.types.fullTypeCheck ? E.createSemanticDiagnosticsBuilderProgram : E.createAbstractBuilder;
|
|
2419
2455
|
let v;
|
|
2420
|
-
const C = (
|
|
2456
|
+
const C = (k, F, T, ...w) => (v = T, u(
|
|
2421
2457
|
// If not doing full type check, don't scout test files
|
|
2422
2458
|
// If non-tests import tests, they will be included implicitly anyway
|
|
2423
|
-
e.types.fullTypeCheck ?
|
|
2459
|
+
e.types.fullTypeCheck ? k : k?.filter(($) => !He($)),
|
|
2424
2460
|
F,
|
|
2425
2461
|
T,
|
|
2426
|
-
...
|
|
2462
|
+
...w
|
|
2427
2463
|
// Type cast to keep types simpler&aligned between two branches
|
|
2428
2464
|
)), y = E.createWatchCompilerHost(
|
|
2429
2465
|
// This parses the config file again (we already do it) and computes the
|
|
@@ -2434,77 +2470,77 @@ const Rt = async function() {
|
|
|
2434
2470
|
C,
|
|
2435
2471
|
void 0,
|
|
2436
2472
|
void 0
|
|
2437
|
-
),
|
|
2438
|
-
let
|
|
2439
|
-
y.setTimeout =
|
|
2473
|
+
), b = y.setTimeout;
|
|
2474
|
+
let M;
|
|
2475
|
+
y.setTimeout = b === void 0 ? void 0 : (k, F, ...T) => {
|
|
2440
2476
|
if (!(T[0] === "timerToUpdateProgram"))
|
|
2441
|
-
return
|
|
2442
|
-
const
|
|
2443
|
-
return
|
|
2477
|
+
return b(k, F, ...T);
|
|
2478
|
+
const G = M !== void 0 ? Promise.resolve() : d === void 0 ? Promise.resolve(m()) : d.promise.finally(m);
|
|
2479
|
+
return M = b(
|
|
2444
2480
|
(...J) => {
|
|
2445
|
-
|
|
2446
|
-
this.program = void 0,
|
|
2481
|
+
M = void 0, G.finally(() => {
|
|
2482
|
+
this.program = void 0, k(...J), this.program === void 0 && f(void 0);
|
|
2447
2483
|
});
|
|
2448
2484
|
},
|
|
2449
2485
|
e.watch.debounceTime,
|
|
2450
2486
|
...T
|
|
2451
|
-
),
|
|
2487
|
+
), M;
|
|
2452
2488
|
};
|
|
2453
2489
|
const I = y.onWatchStatusChange, P = 6031, L = 6032;
|
|
2454
|
-
y.onWatchStatusChange = (
|
|
2455
|
-
|
|
2456
|
-
}, y.afterProgramCreate = (
|
|
2457
|
-
this.builderProgram =
|
|
2458
|
-
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();
|
|
2459
2495
|
this.program = F;
|
|
2460
2496
|
const T = F.getSourceFiles();
|
|
2461
2497
|
e.types.typeScriptInstanceCreated(F, v);
|
|
2462
2498
|
for (const $ of this.watchFiles.values())
|
|
2463
2499
|
$.wasRemoved = !0;
|
|
2464
|
-
let
|
|
2500
|
+
let w = !1;
|
|
2465
2501
|
for (let $ = 0; $ < T.length; ++$) {
|
|
2466
|
-
const
|
|
2467
|
-
if (!
|
|
2502
|
+
const G = T[$];
|
|
2503
|
+
if (!ue(G.fileName, this))
|
|
2468
2504
|
continue;
|
|
2469
|
-
const
|
|
2470
|
-
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;
|
|
2471
2507
|
}
|
|
2472
|
-
for (const [$,
|
|
2473
|
-
|
|
2474
|
-
|
|
2508
|
+
for (const [$, G] of this.watchFiles)
|
|
2509
|
+
G.wasRemoved && (a(G, $), w = !0);
|
|
2510
|
+
w ? p() : (Re(this, _()), f(void 0));
|
|
2475
2511
|
}, t = E.createWatchProgram(y);
|
|
2476
2512
|
} else {
|
|
2477
2513
|
let u = function(y) {
|
|
2478
|
-
return
|
|
2514
|
+
return dt(y, {
|
|
2479
2515
|
throwIfNoEntry: !1
|
|
2480
2516
|
})?.isFile();
|
|
2481
2517
|
};
|
|
2482
2518
|
const v = rt(() => {
|
|
2483
2519
|
let y = !1;
|
|
2484
|
-
for (const [
|
|
2485
|
-
y = C(
|
|
2520
|
+
for (const [b, M] of i)
|
|
2521
|
+
y = C(b, M) || y;
|
|
2486
2522
|
i.clear(), y ? (e.watch.clearScreen && E.sys.clearScreen?.(), p()) : f(void 0);
|
|
2487
|
-
}, e.watch.debounceTime), C = (y,
|
|
2488
|
-
const
|
|
2523
|
+
}, e.watch.debounceTime), C = (y, b) => {
|
|
2524
|
+
const M = e.context.cwd + y, I = !b, P = this.watchFiles.get(y), L = P !== void 0;
|
|
2489
2525
|
if (I || P === void 0) {
|
|
2490
|
-
const
|
|
2491
|
-
if (
|
|
2492
|
-
let T,
|
|
2526
|
+
const k = u(M);
|
|
2527
|
+
if (k === !1) {
|
|
2528
|
+
let T, w = !1;
|
|
2493
2529
|
try {
|
|
2494
|
-
T =
|
|
2530
|
+
T = at(M, { recursive: !0 });
|
|
2495
2531
|
let $;
|
|
2496
2532
|
for (; ($ = T.readSync()) !== null; ) {
|
|
2497
2533
|
if ($.isDirectory())
|
|
2498
2534
|
continue;
|
|
2499
|
-
const
|
|
2500
|
-
|
|
2535
|
+
const z = `${$.parentPath}/${$.name}`.slice(e.context.cwd.length);
|
|
2536
|
+
je(z) && (w = C(z, !1) || w);
|
|
2501
2537
|
}
|
|
2502
2538
|
} finally {
|
|
2503
2539
|
T?.closeSync();
|
|
2504
2540
|
}
|
|
2505
|
-
return
|
|
2541
|
+
return w;
|
|
2506
2542
|
}
|
|
2507
|
-
const F =
|
|
2543
|
+
const F = k === !0;
|
|
2508
2544
|
if (L) {
|
|
2509
2545
|
if (F)
|
|
2510
2546
|
return s(P, y, void 0), !0;
|
|
@@ -2514,28 +2550,28 @@ const Rt = async function() {
|
|
|
2514
2550
|
}
|
|
2515
2551
|
} else {
|
|
2516
2552
|
if (F)
|
|
2517
|
-
return
|
|
2553
|
+
return n(y, void 0, void 0), !0;
|
|
2518
2554
|
{
|
|
2519
2555
|
let T = !1;
|
|
2520
|
-
const
|
|
2521
|
-
for (const [$,
|
|
2522
|
-
$.startsWith(
|
|
2556
|
+
const w = `${y}/`;
|
|
2557
|
+
for (const [$, G] of this.watchFiles)
|
|
2558
|
+
$.startsWith(w) && (a(G, $), T = !0);
|
|
2523
2559
|
return T;
|
|
2524
2560
|
}
|
|
2525
2561
|
}
|
|
2526
2562
|
} else
|
|
2527
2563
|
return s(P, y, void 0), !0;
|
|
2528
2564
|
};
|
|
2529
|
-
t =
|
|
2530
|
-
const
|
|
2565
|
+
t = lt(this.basePath, { recursive: !0 }, (y, b) => {
|
|
2566
|
+
const M = m(), I = b === null ? void 0 : Ze(b), P = y === "change";
|
|
2531
2567
|
if (I !== void 0 && // If changed, check if it is an included file
|
|
2532
2568
|
// For a rename, we don't know if it is directory or a file - only check
|
|
2533
2569
|
// if directory is included, and the file will be checked later.
|
|
2534
|
-
(P ?
|
|
2570
|
+
(P ? ue(this.basePath + I, this) : ze(this.basePath + I, this))) {
|
|
2535
2571
|
const L = e.context.basePath + I, F = (i.get(L) ?? !0) && P;
|
|
2536
2572
|
i.set(L, F);
|
|
2537
2573
|
}
|
|
2538
|
-
|
|
2574
|
+
M && v();
|
|
2539
2575
|
}), p(), l = () => {
|
|
2540
2576
|
i.size > 0 && v();
|
|
2541
2577
|
};
|
|
@@ -2545,17 +2581,17 @@ const Rt = async function() {
|
|
|
2545
2581
|
t.close(), i.clear(), await d?.promise, this.watchFiles = void 0;
|
|
2546
2582
|
}
|
|
2547
2583
|
};
|
|
2548
|
-
},
|
|
2549
|
-
class
|
|
2584
|
+
}, Nt = ".verify-typings.ts";
|
|
2585
|
+
class Bt {
|
|
2550
2586
|
constructor(t, i = N.join(process.cwd(), "dist")) {
|
|
2551
2587
|
this.extractor = t, this.virtualCwdPath = N.join(i, "/");
|
|
2552
2588
|
}
|
|
2553
2589
|
verifyTypes(t) {
|
|
2554
|
-
const i = _(),
|
|
2555
|
-
|
|
2590
|
+
const i = _(), o = /* @__PURE__ */ Object.create(null);
|
|
2591
|
+
o[this.virtualCwdPath + Nt] = this.getVerificationFileContents(t);
|
|
2556
2592
|
const s = this.extractor.config.context.dtsEmitPath === "" ? this.virtualCwdPath : "";
|
|
2557
2593
|
for (const [f, p] of this.extractor.dtsFiles)
|
|
2558
|
-
|
|
2594
|
+
o[s + f] = p;
|
|
2559
2595
|
const a = {
|
|
2560
2596
|
lib: ["lib.dom.d.ts", "lib.esnext.d.ts"],
|
|
2561
2597
|
module: E.ModuleKind.ESNext,
|
|
@@ -2574,66 +2610,66 @@ class Dt {
|
|
|
2574
2610
|
types: [],
|
|
2575
2611
|
// Performance optimization. Don't look up node_modules/@typescript/lib-...
|
|
2576
2612
|
libReplacement: !1
|
|
2577
|
-
}, r = E.createCompilerHost(a),
|
|
2578
|
-
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;
|
|
2579
2615
|
const l = r.readFile;
|
|
2580
2616
|
r.readFile = (f) => {
|
|
2581
|
-
const p =
|
|
2617
|
+
const p = o[f];
|
|
2582
2618
|
return p === void 0 ? l(f) : p;
|
|
2583
2619
|
};
|
|
2584
2620
|
const c = r.directoryExists;
|
|
2585
2621
|
r.directoryExists = (f) => f.includes("node_modules") ? c(f) : !0, r.getCurrentDirectory = () => this.virtualCwdPath, r.getCanonicalFileName = se.getCanonicalFileName;
|
|
2586
2622
|
const d = E.createProgram({
|
|
2587
|
-
rootNames: Object.keys(
|
|
2623
|
+
rootNames: Object.keys(o),
|
|
2588
2624
|
host: r,
|
|
2589
2625
|
options: a
|
|
2590
2626
|
}), m = E.getPreEmitDiagnostics(d).filter(this.extractor.config.verify.filterTypeCheckDiagnostic);
|
|
2591
2627
|
m.length && (this.extractor.config.context.logger.error(
|
|
2592
2628
|
E.formatDiagnosticsWithColorAndContext(m, se)
|
|
2593
|
-
), process.exitCode = 1, this.extractor.errorCount += m.length), this.extractor.config.context.logger.info(`${H}Types verified in ${x
|
|
2629
|
+
), process.exitCode = 1, this.extractor.errorCount += m.length), this.extractor.config.context.logger.info(`${H}Types verified in ${x("green", `${i()}s`)}`);
|
|
2594
2630
|
}
|
|
2595
2631
|
printTypeParameters(t, i) {
|
|
2596
2632
|
if (t === void 0)
|
|
2597
2633
|
return "";
|
|
2598
|
-
let
|
|
2634
|
+
let o = "";
|
|
2599
2635
|
for (let s = 0; s < t.length; ++s) {
|
|
2600
2636
|
const a = t[s];
|
|
2601
2637
|
if (a.default !== void 0)
|
|
2602
2638
|
break;
|
|
2603
|
-
|
|
2639
|
+
o === "" ? o += "<" : o += ", ", o += a.constraint === void 0 ? "any" : le(a.constraint, i).text;
|
|
2604
2640
|
}
|
|
2605
|
-
return
|
|
2641
|
+
return o === "" ? "" : `${o}>`;
|
|
2606
2642
|
}
|
|
2607
2643
|
getVerificationFileContents(t) {
|
|
2608
2644
|
let i = `declare const $: unknown;
|
|
2609
2645
|
|
|
2610
2646
|
`;
|
|
2611
|
-
for (let
|
|
2612
|
-
const s = t[
|
|
2647
|
+
for (let o = 0; o < t.length; ++o) {
|
|
2648
|
+
const s = t[o], a = h(s);
|
|
2613
2649
|
if (a.constructorPropertiesInterface !== void 0) {
|
|
2614
|
-
const r = a.constructorPropertiesInterface.name,
|
|
2650
|
+
const r = a.constructorPropertiesInterface.name, n = this.printTypeParameters(
|
|
2615
2651
|
a.constructorPropertiesInterface.typeParameters,
|
|
2616
2652
|
s.path
|
|
2617
2653
|
), l = r.slice(0, -10), c = s.exports === void 0 ? l : "default";
|
|
2618
|
-
i += `$ as import("./${s.path}.js").${c}${
|
|
2654
|
+
i += `$ as import("./${s.path}.js").${c}${n} satisfies import("./${s.path}.js").${r}${n};
|
|
2619
2655
|
`;
|
|
2620
2656
|
}
|
|
2621
2657
|
}
|
|
2622
2658
|
return i;
|
|
2623
2659
|
}
|
|
2624
2660
|
}
|
|
2625
|
-
class
|
|
2661
|
+
class ei {
|
|
2626
2662
|
/**
|
|
2627
2663
|
* @public
|
|
2628
2664
|
* @param rawConfig Optional configuration for the extractor.
|
|
2629
2665
|
*/
|
|
2630
2666
|
constructor(t = {}) {
|
|
2631
|
-
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 =
|
|
2632
|
-
const i =
|
|
2667
|
+
this.componentStories = /* @__PURE__ */ Object.create(null), this.dtsFiles = /* @__PURE__ */ new Map(), this.changedDtsFiles = void 0, this.isRunInProgress = !1, this.watchFiles = void 0, this.program = void 0, this.builderProgram = void 0, this.componentPathMapping = void 0, this.componentCssFileDocs = void 0, this.vanillaComponentTypes = void 0, this.isInLuminaMinimalExtraction = !1, this.errorCount = 0, this.silencedBrokenLinkCount = 0, this.loggedBooleanWarning = !1, this.moduleMap = void 0, this.privateMixinModuleNames = /* @__PURE__ */ new Set(), this.implicitPublicModules = void 0, this.file = void 0, this.apiModule = void 0, this.componentTagName = void 0, this.pairedSetter = void 0, this.statementJsDocs = [], this.jsDoc = void 0, this.apiObject = void 0, this.moduleContext = void 0, this.localDeclarations = /* @__PURE__ */ new Set(), this.exportDefaultName = void 0, this.objectLikeTypeParameters = void 0, this.functionLikeTypeParameters = void 0, this.apiClassLikeName = void 0, this.mixinName = void 0, this.mixinMixins = void 0, this.moduleHasAccessorLikeClass = !1, this.moduleHasClass = !1, this.inheritedModuleName = void 0, this.run = Dt.bind(this), this.watch = Ot.bind(this), this.emitError = De.bind(this);
|
|
2668
|
+
const i = Xe(t);
|
|
2633
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([
|
|
2634
2670
|
...Object.keys(i.context.packageJson.dependencies ?? {}),
|
|
2635
2671
|
...Object.keys(i.context.packageJson.peerDependencies ?? {})
|
|
2636
|
-
]), this.resolveJsDocLink = i.context.isLuminaMinimalExtraction ?
|
|
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();
|
|
2637
2673
|
}
|
|
2638
2674
|
/**
|
|
2639
2675
|
* Given an array of ApiModules, add top-level api.json metadata and return
|
|
@@ -2641,12 +2677,13 @@ class qt {
|
|
|
2641
2677
|
*/
|
|
2642
2678
|
wrapApiModules(t) {
|
|
2643
2679
|
return {
|
|
2680
|
+
name: this.config.context.packageJson.name,
|
|
2644
2681
|
timestamp: (/* @__PURE__ */ new Date()).toISOString().split(".")[0],
|
|
2645
2682
|
compiler: {
|
|
2646
2683
|
// Preserve previous compiler.name for component projects as that is what
|
|
2647
2684
|
// pre 5.0 Lumina versions expect.
|
|
2648
|
-
name: this.isComponentProject ? "@arcgis/lumina-compiler" :
|
|
2649
|
-
version:
|
|
2685
|
+
name: this.isComponentProject ? "@arcgis/lumina-compiler" : pe.name,
|
|
2686
|
+
version: pe.version,
|
|
2650
2687
|
typescriptVersion: E.version
|
|
2651
2688
|
},
|
|
2652
2689
|
// https://github.com/webcomponents/custom-elements-manifest?tab=readme-ov-file#schema-versioning
|
|
@@ -2659,6 +2696,6 @@ class qt {
|
|
|
2659
2696
|
}
|
|
2660
2697
|
}
|
|
2661
2698
|
export {
|
|
2662
|
-
|
|
2663
|
-
|
|
2699
|
+
ei as A,
|
|
2700
|
+
Lt as w
|
|
2664
2701
|
};
|