@arcgis/api-extractor 5.0.0-next.142 → 5.0.0-next.144

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { l as j, a as re, e as Re, p as de } from "./typeScript-DEqHrfvQ.js";
2
- import { a as be, o as xe, t as Ge, b as Le, c as Oe, e as Ne, d as Z, p as Be, f as We, i as fe, g as ze, h as Ue, j as je, k as He, n as Je, r as Ve } from "./worker-ChyOmzAh.js";
1
+ import { l as j, a as re, e as Re, p as de } from "./typeScript-BSl6gr8_.js";
2
+ import { a as Me, o as xe, t as Ge, b as Le, c as Oe, e as Ne, d as Z, p as Be, f as We, i as fe, g as ze, h as Ue, j as je, k as He, n as Je, r as Ve } from "./worker-BnxFV-69.js";
3
3
  import { getViewUrl as Xe, postProcessDeprecated as Q, postProcessDescription as D, postProcessDocsTags as J, resolveJsDocLink as Ye } from "./extractor/processing/links.js";
4
4
  import k from "typescript";
5
5
  import { path as O, toPosixPathSeparators as qe } from "@arcgis/components-build-utils";
@@ -7,8 +7,7 @@ import { mkdir as se, writeFile as Pe } from "fs/promises";
7
7
  import x from "chalk";
8
8
  import { styleText as Ze } from "util";
9
9
  import { kebabToPascal as _e } from "@arcgis/toolkit/string";
10
- import { getModuleContext as h, getObjectLikeContext as K, getVariableContext as Ke, getFunctionLikeContext as Qe, getPropertyContext as ne, privateContextSymbol as et } from "./extractor/privateContext.js";
11
- import { apiTypeToImportType as ae, globalPackageIdentifier as Ie, getApiMemberName as tt, getMaybeStaticApiMemberName as le, mergeApiNodes as Se, naturalSortModules as it, compareNamedNodes as nt, compareClassMembers as ot } from "./utils/apiHelpers.js";
10
+ import { g as h, a as K, b as Ke, c as Qe, d as ae, e as Ie, f as ne, p as et, h as tt, i as le, m as Se, n as it, j as nt, k as ot } from "./apiHelpers-BYzO767m.js";
12
11
  import { printTypeParameters as te, printTypeAlias as rt } from "./utils/partPrinter.js";
13
12
  import { identity as ke, debounce as st } from "@arcgis/toolkit/function";
14
13
  import { opendirSync as at, watch as lt, readFileSync as ct, statSync as dt } from "node:fs";
@@ -70,8 +69,8 @@ function ft(e, t) {
70
69
  const p = te(_(l.typeParameters, !1, W)), g = te(_(l.typeParameters, !1, void 0)), u = te(_(l.typeParameters, !0, void 0)), v = ` ${i}.${d}`;
71
70
  for (let C = 0; C < $.length; ++C) {
72
71
  if (q($[C], t), L.startsWith("$")) {
73
- const b = L.slice(1);
74
- n += mt(b, l, d, W);
72
+ const M = L.slice(1);
73
+ n += mt(M, l, d, W);
75
74
  continue;
76
75
  }
77
76
  const y = N === void 0 ? " " : " ";
@@ -1379,7 +1378,7 @@ ${n}` : n += `import type * as ${c} from "${l}";
1379
1378
  }
1380
1379
  }
1381
1380
  function oe(e, t) {
1382
- return `${be(t.dtsPath, e.dtsPath)}.js`;
1381
+ return `${Me(t.dtsPath, e.dtsPath)}.js`;
1383
1382
  }
1384
1383
  function Ct(e, t, i, n) {
1385
1384
  const s = e.references;
@@ -1415,10 +1414,10 @@ function Ee(e, t, i, n, s) {
1415
1414
  e.text = `${e.text.slice(0, r.start)}${m}${e.text.slice(r.end)}`;
1416
1415
  const p = e.text, g = r.start + 1, u = [];
1417
1416
  for (let C = 0; C < c.type.references.length; ++C) {
1418
- const y = c.type.references[C], b = y.module ?? o?.path, M = b === n.path;
1417
+ const y = c.type.references[C], M = y.module ?? o?.path, b = M === n.path;
1419
1418
  u.push({
1420
1419
  ...y,
1421
- module: M ? void 0 : b,
1420
+ module: b ? void 0 : M,
1422
1421
  start: y.start + g,
1423
1422
  end: y.end + g
1424
1423
  });
@@ -1462,10 +1461,10 @@ function Te(e, t, i, n) {
1462
1461
  const s = h(t), a = s.constructorAutoCastType;
1463
1462
  if (a !== void 0)
1464
1463
  return a;
1465
- const r = Mt(e, t, i, n);
1464
+ const r = bt(e, t, i, n);
1466
1465
  return r !== void 0 && (s.constructorAutoCastType = r), r;
1467
1466
  }
1468
- function Mt(e, t, i, n) {
1467
+ function bt(e, t, i, n) {
1469
1468
  if (e.members !== void 0)
1470
1469
  for (let r = 0; r < e.members.length; ++r) {
1471
1470
  const o = e.members[r];
@@ -1538,10 +1537,10 @@ function he(e, t, i, { type: n, inheritedFrom: s }, a, r, o) {
1538
1537
  continue;
1539
1538
  }
1540
1539
  Fe(g, C, a, r);
1541
- const M = d.start, I = {
1540
+ const b = d.start, I = {
1542
1541
  ...g,
1543
- start: g.start + M + f,
1544
- end: g.end + M + f
1542
+ start: g.start + b + f,
1543
+ end: g.end + b + f
1545
1544
  }, P = y.typeName;
1546
1545
  if (l.length === 1 && o.autoCastingRequiresType === !0 && P !== void 0) {
1547
1546
  const G = o.autoCastingDefaultType === P, S = `(${u} & { type${G ? "?" : ""}: "${P}" })`, F = S.length - u.length;
@@ -1588,7 +1587,7 @@ function Fe(e, t, i, n) {
1588
1587
  d === void 0 ? s.importsMap[o] = {
1589
1588
  type: e.name === "default" ? "default" : "named",
1590
1589
  modulePath: t.path,
1591
- specifier: be(s.dtsPath, a.dtsPath),
1590
+ specifier: Me(s.dtsPath, a.dtsPath),
1592
1591
  replacementName: void 0,
1593
1592
  actualName: l,
1594
1593
  wasUsed: !0
@@ -1601,9 +1600,9 @@ function Fe(e, t, i, n) {
1601
1600
  ) : d.wasUsed = !0;
1602
1601
  }
1603
1602
  function $e(e) {
1604
- return e?.kind === "interface" && e.members === void 0 && e.supertypes === void 0 && e.type?.references !== void 0 && e.type.references.length > 1 && e.typeParameters === void 0 && bt(e.type);
1603
+ 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 && Mt(e.type);
1605
1604
  }
1606
- function bt(e) {
1605
+ function Mt(e) {
1607
1606
  let t = 0;
1608
1607
  for (let i = 0; i < e.references.length; ++i) {
1609
1608
  const n = e.references[i], s = e.text.slice(t, n.start).trim();
@@ -1900,7 +1899,7 @@ function Ae(e, t, i) {
1900
1899
  }
1901
1900
  }
1902
1901
  const r = t;
1903
- let o = t.mixins, l = r.superclass, c = l === void 0 ? void 0 : Me(l, e, i);
1902
+ let o = t.mixins, l = r.superclass, c = l === void 0 ? void 0 : be(l, e, i);
1904
1903
  if (c?.supertypes !== void 0) {
1905
1904
  o = o === void 0 ? [] : [...o];
1906
1905
  do {
@@ -1909,7 +1908,7 @@ function Ae(e, t, i) {
1909
1908
  const g = c.supertypes[p], u = g.module === void 0 ? { ...g, module: l.module } : g;
1910
1909
  o.unshift(u);
1911
1910
  }
1912
- l = m ? c.supertypes[0] : void 0, c = l === void 0 ? void 0 : Me(l, e, i);
1911
+ l = m ? c.supertypes[0] : void 0, c = l === void 0 ? void 0 : be(l, e, i);
1913
1912
  } while (c?.supertypes !== void 0);
1914
1913
  }
1915
1914
  if (o !== void 0) {
@@ -2052,7 +2051,7 @@ function Et(e, t, i, n) {
2052
2051
  }
2053
2052
  ), !1) : [t, a];
2054
2053
  }
2055
- function Me(e, t, i) {
2054
+ function be(e, t, i) {
2056
2055
  if (e.package !== void 0)
2057
2056
  return;
2058
2057
  const n = e.module === void 0 ? t : i.moduleMap.get(e.module), s = n === void 0 ? void 0 : h(n), a = e.name === "default" ? s?.index.default : s?.index.named[e.name];
@@ -2327,13 +2326,13 @@ const Rt = async function() {
2327
2326
  for (const C of u.dependencies)
2328
2327
  this.watchFiles.get(C)?.dependents.delete(v.sourcePath);
2329
2328
  for (const [C, y] of u.dependents) {
2330
- const b = this.watchFiles.get(C);
2331
- b !== void 0 && (y ? (b.dependencies.delete(v.sourcePath), r(b)) : b.hasDirtyLinks = !0);
2329
+ const M = this.watchFiles.get(C);
2330
+ M !== void 0 && (y ? (M.dependencies.delete(v.sourcePath), r(M)) : M.hasDirtyLinks = !0);
2332
2331
  }
2333
2332
  }, o = (u, v, C) => {
2334
2333
  if (v === void 0) {
2335
- const y = e.context.cwd + u, b = ct(y, "utf8");
2336
- v = He(y, b);
2334
+ const y = e.context.cwd + u, M = ct(y, "utf8");
2335
+ v = He(y, M);
2337
2336
  }
2338
2337
  this.watchFiles.set(u, {
2339
2338
  file: v,
@@ -2360,28 +2359,28 @@ const Rt = async function() {
2360
2359
  let u;
2361
2360
  try {
2362
2361
  u = await this.run();
2363
- } catch (M) {
2364
- throw f(void 0), M;
2362
+ } catch (b) {
2363
+ throw f(void 0), b;
2365
2364
  }
2366
2365
  const v = [], C = [];
2367
- for (const M of this.watchFiles.values()) {
2368
- const I = M.module, P = M.previousModule;
2366
+ for (const b of this.watchFiles.values()) {
2367
+ const I = b.module, P = b.previousModule;
2369
2368
  if (I === void 0)
2370
- P !== void 0 && (M.module = M.previousModule, a(M, P.sourcePath));
2369
+ P !== void 0 && (b.module = b.previousModule, a(b, P.sourcePath));
2371
2370
  else {
2372
- P === void 0 ? (c || C.push(I), M.previousModule = I) : I !== P && (Je(I, P) ? M.module = P : (v.push({ old: P, new: I }), M.previousModule = I));
2371
+ P === void 0 ? (c || C.push(I), b.previousModule = I) : I !== P && (Je(I, P) ? b.module = P : (v.push({ old: P, new: I }), b.previousModule = I));
2373
2372
  const G = h(I);
2374
2373
  G.isStale && (G.isStale = !1);
2375
2374
  }
2376
2375
  }
2377
2376
  this.program ??= {
2378
2377
  getSourceFiles: () => {
2379
- const M = [];
2378
+ const b = [];
2380
2379
  for (const I of this.watchFiles.values())
2381
- M.push(I.file);
2382
- return M;
2380
+ b.push(I.file);
2381
+ return b;
2383
2382
  },
2384
- getSourceFile: (M) => this.watchFiles.get(M.slice(e.context.cwd.length))?.file
2383
+ getSourceFile: (b) => this.watchFiles.get(b.slice(e.context.cwd.length))?.file
2385
2384
  };
2386
2385
  const y = {
2387
2386
  apiJson: u.apiJson,
@@ -2391,8 +2390,8 @@ const Rt = async function() {
2391
2390
  removedModules: n
2392
2391
  };
2393
2392
  n = [];
2394
- const b = c || v.length > 0 || C.length > 0 || y.removedModules.length > 0;
2395
- c = !1, f(b ? y : void 0), l?.();
2393
+ const M = c || v.length > 0 || C.length > 0 || y.removedModules.length > 0;
2394
+ c = !1, f(M ? y : void 0), l?.();
2396
2395
  };
2397
2396
  if (e.types.typeCheckedExtraction || e.types.fullTypeCheck) {
2398
2397
  const u = e.types.fullTypeCheck ? k.createSemanticDiagnosticsBuilderProgram : k.createAbstractBuilder;
@@ -2414,21 +2413,21 @@ const Rt = async function() {
2414
2413
  C,
2415
2414
  void 0,
2416
2415
  void 0
2417
- ), b = y.setTimeout;
2418
- let M;
2419
- y.setTimeout = b === void 0 ? void 0 : (S, F, ...E) => {
2416
+ ), M = y.setTimeout;
2417
+ let b;
2418
+ y.setTimeout = M === void 0 ? void 0 : (S, F, ...E) => {
2420
2419
  if (!(E[0] === "timerToUpdateProgram"))
2421
- return b(S, F, ...E);
2422
- const A = M !== void 0 ? Promise.resolve() : d === void 0 ? Promise.resolve(m()) : d.promise.finally(m);
2423
- return M = b(
2420
+ return M(S, F, ...E);
2421
+ const A = b !== void 0 ? Promise.resolve() : d === void 0 ? Promise.resolve(m()) : d.promise.finally(m);
2422
+ return b = M(
2424
2423
  (...H) => {
2425
- M = void 0, A.finally(() => {
2424
+ b = void 0, A.finally(() => {
2426
2425
  this.program = void 0, S(...H), this.program === void 0 && f(void 0);
2427
2426
  });
2428
2427
  },
2429
2428
  e.watch.debounceTime,
2430
2429
  ...E
2431
- ), M;
2430
+ ), b;
2432
2431
  };
2433
2432
  const I = y.onWatchStatusChange, P = 6031, G = 6032;
2434
2433
  y.onWatchStatusChange = (S, ...F) => {
@@ -2461,17 +2460,17 @@ const Rt = async function() {
2461
2460
  };
2462
2461
  const v = st(() => {
2463
2462
  let y = !1;
2464
- for (const [b, M] of i)
2465
- y = C(b, M) || y;
2463
+ for (const [M, b] of i)
2464
+ y = C(M, b) || y;
2466
2465
  i.clear(), y ? (e.watch.clearScreen && k.sys.clearScreen?.(), p()) : f(void 0);
2467
- }, e.watch.debounceTime), C = (y, b) => {
2468
- const M = e.context.cwd + y, I = !b, P = this.watchFiles.get(y), G = P !== void 0;
2466
+ }, e.watch.debounceTime), C = (y, M) => {
2467
+ const b = e.context.cwd + y, I = !M, P = this.watchFiles.get(y), G = P !== void 0;
2469
2468
  if (I || P === void 0) {
2470
- const S = u(M);
2469
+ const S = u(b);
2471
2470
  if (S === !1) {
2472
2471
  let E, w = !1;
2473
2472
  try {
2474
- E = at(M, { recursive: !0 });
2473
+ E = at(b, { recursive: !0 });
2475
2474
  let T;
2476
2475
  for (; (T = E.readSync()) !== null; ) {
2477
2476
  if (T.isDirectory())
@@ -2506,8 +2505,8 @@ const Rt = async function() {
2506
2505
  } else
2507
2506
  return s(P, y, void 0), !0;
2508
2507
  };
2509
- t = lt(this.basePath, { recursive: !0 }, (y, b) => {
2510
- const M = m(), I = b === null ? void 0 : qe(b), P = y === "change";
2508
+ t = lt(this.basePath, { recursive: !0 }, (y, M) => {
2509
+ const b = m(), I = M === null ? void 0 : qe(M), P = y === "change";
2511
2510
  if (I !== void 0 && // If changed, check if it is an included file
2512
2511
  // For a rename, we don't know if it is directory or a file - only check
2513
2512
  // if directory is included, and the file will be checked later.
@@ -2515,7 +2514,7 @@ const Rt = async function() {
2515
2514
  const G = e.context.basePath + I, F = (i.get(G) ?? !0) && P;
2516
2515
  i.set(G, F);
2517
2516
  }
2518
- M && v();
2517
+ b && v();
2519
2518
  }), p(), l = () => {
2520
2519
  i.size > 0 && v();
2521
2520
  };
@@ -2602,7 +2601,7 @@ class Lt {
2602
2601
  return i;
2603
2602
  }
2604
2603
  }
2605
- class _t {
2604
+ class Zt {
2606
2605
  /**
2607
2606
  * @public
2608
2607
  * @param rawConfig Optional configuration for the extractor.
@@ -2639,6 +2638,6 @@ class _t {
2639
2638
  }
2640
2639
  }
2641
2640
  export {
2642
- _t as A,
2641
+ Zt as A,
2643
2642
  Dt as w
2644
2643
  };
@@ -0,0 +1,161 @@
1
+ const c = Symbol("privateContext");
2
+ function m(e, o, i, n) {
3
+ return {
4
+ isStale: !0,
5
+ file: e,
6
+ dtsPath: o,
7
+ importsMap: i,
8
+ importsText: void 0,
9
+ constructorPropertiesInterface: void 0,
10
+ constructorOnlySetters: void 0,
11
+ constructorAutoCastType: void 0,
12
+ typeName: void 0,
13
+ inheritance: void 0,
14
+ index: n,
15
+ reExports: void 0,
16
+ namespaces: void 0
17
+ };
18
+ }
19
+ function x() {
20
+ return {
21
+ hasExplicitAbstract: void 0,
22
+ isDefaultExported: void 0,
23
+ superClassText: void 0,
24
+ superTypesText: void 0,
25
+ eventTypesProperty: void 0,
26
+ isMixinBaseClass: void 0,
27
+ emitAsTypeAlias: void 0,
28
+ esriCompatibilityNames: void 0
29
+ };
30
+ }
31
+ function g() {
32
+ return {
33
+ isAbstract: void 0,
34
+ isAccessor: void 0,
35
+ hasAutoCasting: void 0,
36
+ autoCastingRequiresType: void 0,
37
+ autoCastingDefaultType: void 0,
38
+ isConstructorOnly: void 0,
39
+ isOverride: void 0,
40
+ dtsTypeOverride: void 0
41
+ };
42
+ }
43
+ function y() {
44
+ return {
45
+ isAbstract: void 0,
46
+ isDefaultExported: void 0,
47
+ hasQuestionToken: void 0,
48
+ esriCompatibilityNames: void 0
49
+ };
50
+ }
51
+ function C() {
52
+ return {
53
+ isDefaultExported: void 0,
54
+ esriCompatibilityNames: void 0
55
+ };
56
+ }
57
+ function v(e) {
58
+ return e[c];
59
+ }
60
+ function h(e) {
61
+ return e[c];
62
+ }
63
+ function T(e) {
64
+ return e[c];
65
+ }
66
+ function b(e) {
67
+ return e[c];
68
+ }
69
+ function A(e) {
70
+ return e[c];
71
+ }
72
+ const k = (e) => e.kind === "method", S = (e) => e.kind === "field";
73
+ function P(e, o) {
74
+ const i = e.sourcePath, n = o.sourcePath;
75
+ let t = 0;
76
+ for (; ; ) {
77
+ const a = i.indexOf("/", t), s = n.indexOf("/", t);
78
+ if (a === -1)
79
+ return s === -1 ? i.slice(t) < n.slice(t) ? -1 : 1 : -1;
80
+ if (s === -1)
81
+ return 1;
82
+ {
83
+ const r = i.slice(t, a), d = n.slice(t, s);
84
+ if (r !== d)
85
+ return r < d ? -1 : 1;
86
+ t = a + 1;
87
+ }
88
+ }
89
+ }
90
+ const f = "global:";
91
+ function M(e, o, i) {
92
+ const n = v(i.apiModule).file, t = n.text.indexOf(o) ?? -1;
93
+ i.emitError(`${e}${t === -1 ? `. Found in: ${o}` : ""}`, {
94
+ file: n,
95
+ node: void 0,
96
+ scope: n === void 0 ? i.apiModule.sourcePath : void 0,
97
+ start: t,
98
+ length: o.length
99
+ });
100
+ }
101
+ const l = new Intl.Collator("en", { numeric: !0 }).compare, N = (e, o) => l(e.name, o.name), O = (e, o) => e.static !== void 0 && o.static === void 0 ? -1 : o.static !== void 0 && e.static === void 0 ? 1 : e.name === void 0 ? o.name === void 0 ? 0 : -1 : o.name === void 0 || "return" in e && !("return" in o) ? 1 : "return" in o && !("return" in e) ? -1 : l(e.name, o.name), u = (e) => e.name ?? (e.kind === "constructor" ? "constructor" : "call-signature"), D = (e) => e.static === !0 ? `static ${u(e)}` : u(e), $ = (e) => ("bubbles" in e ? "@" : "") + (e.tagName ?? e.name ?? (e.kind === "constructor" ? "constructor" : "")) + ("return" in e ? "()" : "");
102
+ function E(e, o, i = -1) {
103
+ "description" in o && (o.description ??= e.description), "deprecated" in o && (o.deprecated ??= e.deprecated), "return" in o && e.return !== void 0 && (o.return.description ??= e.return?.description), "readonly" in o && (o.readonly ??= e.readonly);
104
+ const { docsTags: n } = e, t = o;
105
+ if (i !== -1 && (n === void 0 && t.docsTags.length === 1 ? t.docsTags = void 0 : t.docsTags.splice(i, 1)), n !== void 0) {
106
+ t.docsTags ??= [];
107
+ const a = /* @__PURE__ */ new Set();
108
+ for (let s = 0; s < t.docsTags.length; ++s)
109
+ a.add(t.docsTags[s].name);
110
+ for (let s = 0; s < n.length; ++s) {
111
+ const r = n[s];
112
+ a.has(r.name) && r.name !== "example" && r.name !== "see" || t.docsTags.push(r);
113
+ }
114
+ }
115
+ }
116
+ function I(e, o) {
117
+ let i = e.text;
118
+ if (e.references !== void 0)
119
+ for (let n = e.references.length - 1; n >= 0; n--) {
120
+ const t = e.references[n];
121
+ if (t.package === f || t.module === void 0 && t.package === void 0 && t.viewUrl === void 0)
122
+ continue;
123
+ const r = t.name === "default" ? "default" : t.name, p = `import("${t.package === void 0 ? `./${t.module ?? o}.js` : t.package + (t.module === void 0 ? "" : `/${t.module}`)}").${r}`;
124
+ i = i.slice(0, t.start) + p + i.slice(t.end);
125
+ }
126
+ return {
127
+ ...e,
128
+ text: i,
129
+ references: void 0
130
+ };
131
+ }
132
+ function w(e) {
133
+ return e.return.type.text.startsWith("Promise<");
134
+ }
135
+ export {
136
+ h as a,
137
+ A as b,
138
+ b as c,
139
+ I as d,
140
+ f as e,
141
+ T as f,
142
+ v as g,
143
+ u as h,
144
+ D as i,
145
+ N as j,
146
+ O as k,
147
+ y as l,
148
+ E as m,
149
+ P as n,
150
+ m as o,
151
+ c as p,
152
+ w as q,
153
+ g as r,
154
+ x as s,
155
+ C as t,
156
+ M as u,
157
+ $ as v,
158
+ k as w,
159
+ S as x,
160
+ l as y
161
+ };
@@ -1,5 +1,4 @@
1
1
  import type ts from "typescript";
2
- import type { ApiModule } from "../apiJson.js";
3
2
  import type { ApiExtractorConfig, ResolvedApiExtractorConfig } from "./config.js";
4
3
  import type { ApiExtractorResult, ApiExtractorWatcher } from "./types.js";
5
4
 
@@ -39,8 +38,6 @@ export class ApiExtractor {
39
38
  * @default 0
40
39
  */
41
40
  errorCount: number;
42
- /** @experimental */
43
- moduleMap: Map<string, ApiModule>;
44
41
  /**
45
42
  * @experimental
46
43
  * @example "https://developers.arcgis.com/javascript/latest/api-reference/esri-"
@@ -1,6 +1,6 @@
1
- import "../typeScript-DEqHrfvQ.js";
2
- import { A as x } from "../ApiExtractor-DCrXNOTy.js";
3
- import "../worker-ChyOmzAh.js";
1
+ import "../typeScript-BSl6gr8_.js";
2
+ import { A as x } from "../ApiExtractor-DY7mtZzx.js";
3
+ import "../worker-BnxFV-69.js";
4
4
  import "./processing/links.js";
5
5
  import "typescript";
6
6
  import "@arcgis/toolkit/function";
@@ -1,8 +1,8 @@
1
1
  import "@arcgis/components-build-utils";
2
- import "../typeScript-DEqHrfvQ.js";
3
- import { l, m as n, r as A } from "../worker-ChyOmzAh.js";
2
+ import "../typeScript-BSl6gr8_.js";
3
+ import { l, m as n, r as A } from "../worker-BnxFV-69.js";
4
4
  import "chalk";
5
- import "../utils/apiHelpers.js";
5
+ import "../apiHelpers-BYzO767m.js";
6
6
  import "@arcgis/toolkit/string";
7
7
  import "typescript";
8
8
  import "fs/promises";
@@ -1,42 +1,41 @@
1
1
  import $ from "chalk";
2
- import { emitJsDocError as a, getApiNodeLabel as D } from "../../utils/apiHelpers.js";
3
- import { getModuleContext as y } from "../privateContext.js";
2
+ import { u as c, g as y, v as D } from "../../apiHelpers-BYzO767m.js";
4
3
  import { kebabToPascal as I } from "@arcgis/toolkit/string";
5
- function H(e, n) {
4
+ function S(e, n) {
6
5
  if (typeof e == "string") {
7
6
  const t = e.replaceAll(F, n.resolveJsDocLink).replaceAll(n.alternativeDocumentationHost, n.normalizedDocumentationHost);
8
- return e.includes("](.") && a(P, e, n), t;
7
+ return e.includes("](.") && c(P, e, n), t;
9
8
  }
10
9
  return e;
11
10
  }
12
- function W(e, n) {
11
+ function H(e, n) {
13
12
  if (e) {
14
13
  const t = e.replaceAll(F, n.resolveJsDocLink).replaceAll(n.alternativeDocumentationHost, n.normalizedDocumentationHost);
15
- return t.includes("](.") && a(P, t, n), t;
14
+ return t.includes("](.") && c(P, t, n), t;
16
15
  }
17
16
  return e;
18
17
  }
19
- function x(e, n) {
18
+ function W(e, n) {
20
19
  if (e !== void 0 && n.inheritedModuleName === void 0)
21
20
  for (let t = 0; t < e.length; ++t) {
22
21
  const d = e[t];
23
- d.text && (d.text = d.text.replaceAll(F, n.resolveJsDocLink).replaceAll(n.alternativeDocumentationHost, n.normalizedDocumentationHost), d.text.includes("](.") && a(P, d.text, n));
22
+ d.text && (d.text = d.text.replaceAll(F, n.resolveJsDocLink).replaceAll(n.alternativeDocumentationHost, n.normalizedDocumentationHost), d.text.includes("](.") && c(P, d.text, n));
24
23
  }
25
24
  }
26
25
  const P = "Unexpected relative markdown link. For links to API within the package use {@link}. For all other links, use absolute markdown. Documentation: https://webgis.esri.com/webgis/core/core/documenting-api#link", F = /\{@link +([^}]+)\}/gu;
27
- function J(e, n, t) {
26
+ function x(e, n, t) {
28
27
  let d = t.indexOf(" ");
29
28
  d === -1 && (d = t.length);
30
29
  const m = t.slice(0, d), u = t.slice(d + 1);
31
30
  if (m.startsWith("https://"))
32
- return e.config.strict ? (a(
31
+ return e.config.strict ? (c(
33
32
  "Did not expect absolute URLs in a @link tag. Please use markdown links for external links. See https://webgis.esri.com/webgis/core/core/documenting-api#link",
34
33
  n,
35
34
  e
36
35
  ), "") : `[${u || m}](${m})`;
37
36
  const [g, s] = m.split("#"), [r, w] = g.split("!");
38
37
  if (r === "")
39
- return a(
38
+ return c(
40
39
  `Expected @link reference to start with a module name (before ! or #), but got: ${m}`,
41
40
  n,
42
41
  e
@@ -50,7 +49,7 @@ function J(e, n, t) {
50
49
  }
51
50
  }
52
51
  if (b === void 0)
53
- return e.config.verify.detectBrokenLinks ? a(
52
+ return e.config.verify.detectBrokenLinks ? c(
54
53
  `Failed to find referenced module: ${$.red(r)}${r.startsWith("module:") ? '. Module name in @link does not need the "module:" prefix' : r.startsWith("esri/") ? '. Module name in @link does not need to start with the "esri/" prefix.' : ""}`,
55
54
  n,
56
55
  e
@@ -65,17 +64,17 @@ function J(e, n, t) {
65
64
  const C = M(b.path, w, s, e);
66
65
  if (w !== void 0) {
67
66
  if (s !== void 0)
68
- return a(
67
+ return c(
69
68
  `Documentation UI does not yet support linking to members in non-classes. If linking to a class member, omit the class name from the link (${$.green(`${r}#${s}`)})`,
70
69
  n,
71
70
  e
72
71
  ), n;
73
72
  const f = k.index.named[w];
74
- return f === void 0 ? (e.config.verify.detectBrokenLinks ? a(
73
+ return f === void 0 ? (e.config.verify.detectBrokenLinks ? c(
75
74
  `Failed to find the referenced declaration inside the module: ${$.red(`${r}!${w}`)}`,
76
75
  n,
77
76
  e
78
- ) : e.silencedBrokenLinkCount += 1, n) : f === k.index.class ? (a(
77
+ ) : e.silencedBrokenLinkCount += 1, n) : f === k.index.class ? (c(
79
78
  `Invalid reference syntax used. Class/mixin/custom element declarations must be referenced without specifying the class name. Expected ${$.green(r)}`,
80
79
  n,
81
80
  e
@@ -83,71 +82,71 @@ function J(e, n, t) {
83
82
  } else if (s !== void 0) {
84
83
  const f = b.path === L.path, i = k.index.class;
85
84
  if (i === void 0)
86
- return k.index.named[s] === void 0 ? e.config.verify.detectBrokenLinks ? a(
85
+ return k.index.named[s] === void 0 ? e.config.verify.detectBrokenLinks ? c(
87
86
  'Failed to find the referenced member. Class member reference syntax was used, yet current module does not expose a class/mixin/custom element? Linking to properties in interfaces is not yet supported. For event links, prefix with "event-"',
88
87
  n,
89
88
  e
90
- ) : e.silencedBrokenLinkCount += 1 : a(
89
+ ) : e.silencedBrokenLinkCount += 1 : c(
91
90
  `Invalid reference syntax used. This syntax is only permitted on modules that export a class/mixin/web component. Perhaps you meant to use ${$.red(`${r}!${s}`)} instead? Linking to properties in interfaces is not yet supported`,
92
91
  n,
93
92
  e
94
93
  ), n;
95
94
  const h = k.inheritance, p = typeof h == "object" ? h : void 0;
96
- let c;
95
+ let a;
97
96
  if (s.startsWith("event-")) {
98
97
  const o = s.slice(6);
99
98
  if (p !== void 0)
100
- c = p.indexedEvents?.[o];
99
+ a = p.indexedEvents?.[o];
101
100
  else if (i.events !== void 0)
102
101
  for (let l = 0; l < i.events.length; ++l) {
103
102
  const v = i.events[l];
104
103
  if (o === v.name) {
105
- c = v;
104
+ a = v;
106
105
  break;
107
106
  }
108
107
  }
109
108
  } else if (s.startsWith("slot-")) {
110
109
  const o = s.slice(5);
111
110
  if (p !== void 0)
112
- c = p.indexedSlots?.[o];
111
+ a = p.indexedSlots?.[o];
113
112
  else if (i.slots !== void 0)
114
113
  for (let l = 0; l < i.slots.length; ++l) {
115
114
  const v = i.slots[l];
116
115
  if (o === v.name) {
117
- c = v;
116
+ a = v;
118
117
  break;
119
118
  }
120
119
  }
121
120
  } else if (s.startsWith("--")) {
122
121
  const o = s.slice(2);
123
122
  if (p !== void 0)
124
- c = p.indexedCssProperties?.[o];
123
+ a = p.indexedCssProperties?.[o];
125
124
  else if (i.cssProperties !== void 0)
126
125
  for (let l = 0; l < i.cssProperties.length; ++l) {
127
126
  const v = i.cssProperties[l];
128
127
  if (o === v.name) {
129
- c = v;
128
+ a = v;
130
129
  break;
131
130
  }
132
131
  }
133
- } else if (p?.indexedMembers !== void 0 && (c = p.indexedMembers[s] ?? p.indexedMembers[`static ${s}`]), c === void 0 && i.members !== void 0) {
132
+ } else if (p?.indexedMembers !== void 0 && (a = p.indexedMembers[s] ?? p.indexedMembers[`static ${s}`]), a === void 0 && i.members !== void 0) {
134
133
  for (let o = 0; o < i.members.length; ++o) {
135
134
  const l = i.members[o];
136
135
  if (s === l.name) {
137
- c = l;
136
+ a = l;
138
137
  break;
139
138
  }
140
139
  }
141
- if (c === void 0 && !e.config.strict && e.isComponentProject && i.events !== void 0)
140
+ if (a === void 0 && !e.config.strict && e.isComponentProject && i.events !== void 0)
142
141
  for (let o = 0; o < i.events.length; ++o) {
143
142
  const l = i.events[o];
144
143
  if (s === l.name) {
145
- c = l;
144
+ a = l;
146
145
  break;
147
146
  }
148
147
  }
149
148
  }
150
- return c === void 0 ? (e.config.verify.detectBrokenLinks ? a("Failed to find the referenced class member", n, e) : e.silencedBrokenLinkCount += 1, n) : `[${u || (f ? D(c) : `${D(i)}.${D(c)}`)}](${C})`;
149
+ return a === void 0 ? (e.config.verify.detectBrokenLinks ? c("Failed to find the referenced class member", n, e) : e.silencedBrokenLinkCount += 1, n) : `[${u || (f ? D(a) : `${D(i)}.${D(a)}`)}](${C})`;
151
150
  } else {
152
151
  const f = k.index.class === void 0 ? U(r) : D(k.index.class);
153
152
  return `[${u || f}](${C})`;
@@ -167,8 +166,8 @@ function U(e) {
167
166
  }
168
167
  export {
169
168
  M as getViewUrl,
170
- H as postProcessDeprecated,
171
- W as postProcessDescription,
172
- x as postProcessDocsTags,
173
- J as resolveJsDocLink
169
+ S as postProcessDeprecated,
170
+ H as postProcessDescription,
171
+ W as postProcessDocsTags,
172
+ x as resolveJsDocLink
174
173
  };
@@ -1,4 +1,4 @@
1
- import type { ApiReference, ApiClassDeclaration, ApiMixinDeclaration, ApiClassMember, ApiCustomElementMember, ApiEvent, ApiAttribute, ApiSlot, ApiCssPart, ApiCssCustomProperty, ApiCssCustomState, ApiCustomElementDeclaration, ApiDeclaration, ApiJson } from "../apiJson.js";
1
+ import type { ApiJson } from "../apiJson.js";
2
2
 
3
3
  /**
4
4
  * If there were errors, they will be logged using the provided logger, and the
@@ -16,25 +16,4 @@ export interface ApiExtractorResult {
16
16
  export interface ApiExtractorWatcher {
17
17
  /** Callback to stop the watcher. */
18
18
  close(): Promise<void>;
19
- }
20
-
21
- /** @experimental */
22
- export interface ApiExtractorInheritanceData {
23
- readonly inheritanceData: ApiReference;
24
- readonly declaration: ApiClassDeclaration | ApiMixinDeclaration;
25
- /** Indexed by name for quick lookup of "overridden" status. */
26
- readonly indexedMembers?: Record<string, ApiClassMember | ApiCustomElementMember | undefined>;
27
- readonly indexedEvents?: Record<string, ApiEvent>;
28
- readonly indexedAttributes?: Record<string, ApiAttribute>;
29
- readonly indexedSlots?: Record<string, ApiSlot>;
30
- readonly indexedCssParts?: Record<string, ApiCssPart>;
31
- readonly indexedCssProperties?: Record<string, ApiCssCustomProperty>;
32
- readonly indexedCssStates?: Record<string, ApiCssCustomState>;
33
- }
34
-
35
- /** @experimental */
36
- export interface IndexedModuleDeclarations {
37
- class?: ApiClassDeclaration | ApiCustomElementDeclaration | ApiMixinDeclaration;
38
- default?: ApiDeclaration;
39
- named: Record<string, ApiDeclaration>;
40
19
  }
@@ -2,7 +2,7 @@ import { findPath as v, path as C, toSystemPathSeparators as y } from "@arcgis/c
2
2
  import t from "typescript";
3
3
  import E, { supportsColorStderr as S } from "chalk";
4
4
  import { styleText as w } from "util";
5
- const P = "@arcgis/api-extractor", D = "5.0.0-next.142", N = {
5
+ const P = "@arcgis/api-extractor", D = "5.0.0-next.144", N = {
6
6
  name: P,
7
7
  version: D
8
8
  };
@@ -1,80 +1,17 @@
1
- import { getModuleContext as f } from "../extractor/privateContext.js";
2
- const g = (e) => e.kind === "method", v = (e) => e.kind === "field";
3
- function h(e, n) {
4
- const o = e.sourcePath, i = n.sourcePath;
5
- let t = 0;
6
- for (; ; ) {
7
- const c = o.indexOf("/", t), s = i.indexOf("/", t);
8
- if (c === -1)
9
- return s === -1 ? o.slice(t) < i.slice(t) ? -1 : 1 : -1;
10
- if (s === -1)
11
- return 1;
12
- {
13
- const r = o.slice(t, c), a = i.slice(t, s);
14
- if (r !== a)
15
- return r < a ? -1 : 1;
16
- t = c + 1;
17
- }
18
- }
19
- }
20
- const p = "global:";
21
- function x(e, n, o) {
22
- const i = f(o.apiModule).file, t = i.text.indexOf(n) ?? -1;
23
- o.emitError(`${e}${t === -1 ? `. Found in: ${n}` : ""}`, {
24
- file: i,
25
- node: void 0,
26
- scope: i === void 0 ? o.apiModule.sourcePath : void 0,
27
- start: t,
28
- length: n.length
29
- });
30
- }
31
- const l = new Intl.Collator("en", { numeric: !0 }).compare, S = (e, n) => l(e.name, n.name), M = (e, n) => e.static !== void 0 && n.static === void 0 ? -1 : n.static !== void 0 && e.static === void 0 ? 1 : e.name === void 0 ? n.name === void 0 ? 0 : -1 : n.name === void 0 || "return" in e && !("return" in n) ? 1 : "return" in n && !("return" in e) ? -1 : l(e.name, n.name), d = (e) => e.name ?? (e.kind === "constructor" ? "constructor" : "call-signature"), P = (e) => e.static === !0 ? `static ${d(e)}` : d(e), T = (e) => ("bubbles" in e ? "@" : "") + (e.tagName ?? e.name ?? (e.kind === "constructor" ? "constructor" : "")) + ("return" in e ? "()" : "");
32
- function k(e, n, o = -1) {
33
- "description" in n && (n.description ??= e.description), "deprecated" in n && (n.deprecated ??= e.deprecated), "return" in n && e.return !== void 0 && (n.return.description ??= e.return?.description), "readonly" in n && (n.readonly ??= e.readonly);
34
- const { docsTags: i } = e, t = n;
35
- if (o !== -1 && (i === void 0 && t.docsTags.length === 1 ? t.docsTags = void 0 : t.docsTags.splice(o, 1)), i !== void 0) {
36
- t.docsTags ??= [];
37
- const c = /* @__PURE__ */ new Set();
38
- for (let s = 0; s < t.docsTags.length; ++s)
39
- c.add(t.docsTags[s].name);
40
- for (let s = 0; s < i.length; ++s) {
41
- const r = i[s];
42
- c.has(r.name) && r.name !== "example" && r.name !== "see" || t.docsTags.push(r);
43
- }
44
- }
45
- }
46
- function y(e, n) {
47
- let o = e.text;
48
- if (e.references !== void 0)
49
- for (let i = e.references.length - 1; i >= 0; i--) {
50
- const t = e.references[i];
51
- if (t.package === p || t.module === void 0 && t.package === void 0 && t.viewUrl === void 0)
52
- continue;
53
- const r = t.name === "default" ? "default" : t.name, u = `import("${t.package === void 0 ? `./${t.module ?? n}.js` : t.package + (t.module === void 0 ? "" : `/${t.module}`)}").${r}`;
54
- o = o.slice(0, t.start) + u + o.slice(t.end);
55
- }
56
- return {
57
- ...e,
58
- text: o,
59
- references: void 0
60
- };
61
- }
62
- function A(e) {
63
- return e.return.type.text.startsWith("Promise<");
64
- }
1
+ import { d as s, k as r, j as o, y as i, u as p, h as t, v as m, i as d, e as A, w as c, q as g, x as M, m as b, n as l } from "../apiHelpers-BYzO767m.js";
65
2
  export {
66
- y as apiTypeToImportType,
67
- M as compareClassMembers,
68
- S as compareNamedNodes,
69
- l as compareStrings,
70
- x as emitJsDocError,
71
- d as getApiMemberName,
72
- T as getApiNodeLabel,
73
- P as getMaybeStaticApiMemberName,
74
- p as globalPackageIdentifier,
75
- g as isApiMethod,
76
- A as isApiMethodAsync,
77
- v as isApiProperty,
78
- k as mergeApiNodes,
79
- h as naturalSortModules
3
+ s as apiTypeToImportType,
4
+ r as compareClassMembers,
5
+ o as compareNamedNodes,
6
+ i as compareStrings,
7
+ p as emitJsDocError,
8
+ t as getApiMemberName,
9
+ m as getApiNodeLabel,
10
+ d as getMaybeStaticApiMemberName,
11
+ A as globalPackageIdentifier,
12
+ c as isApiMethod,
13
+ g as isApiMethodAsync,
14
+ M as isApiProperty,
15
+ b as mergeApiNodes,
16
+ l as naturalSortModules
80
17
  };
@@ -0,0 +1,30 @@
1
+ import type { ApiClassDeclaration, ApiCustomElementDeclaration, ApiJson, ApiMixinDeclaration, ApiModule, ApiReferenceWithTypeArguments } from "../apiJson.js";
2
+
3
+ /** Everything is indexed by the module path. */
4
+ export type IndexedModules = Map<string, IndexedModule>;
5
+
6
+ export interface IndexedModule {
7
+ readonly apiModule: ApiModule;
8
+ readonly classLike?: ApiClassDeclaration | ApiCustomElementDeclaration | ApiMixinDeclaration;
9
+ /**
10
+ * Mixins and superclasses ancestors. Sorted from most immediate to furthest
11
+ * ancestor.
12
+ *
13
+ * The type reference may refer to a local module or an external package.
14
+ *
15
+ * If type argument were passed, they will be included.
16
+ * In the docs UI, it makes the most sense to show type arguments only for the
17
+ * immediate superclass.
18
+ */
19
+ ancestors?: ApiReferenceWithTypeArguments[];
20
+ /** Includes only direct children. */
21
+ children?: IndexedModule[];
22
+ }
23
+
24
+ /**
25
+ * Compute a list of subclasses and parent hierarchy for each class in the api.json.
26
+ * Everything is indexed by the module path.
27
+ *
28
+ * @param apiJson
29
+ */
30
+ export function createIndex(apiJson: Pick<ApiJson, "modules">): IndexedModules;
@@ -0,0 +1,83 @@
1
+ function y(s) {
2
+ const t = g(s.modules);
3
+ return k(t), t;
4
+ }
5
+ function g(s) {
6
+ const t = /* @__PURE__ */ new Map();
7
+ for (let o = 0; o < s.length; ++o) {
8
+ const n = s[o];
9
+ let i;
10
+ for (let a = 0; a < n.declarations.length; ++a) {
11
+ const r = n.declarations[a];
12
+ if (r.kind === "class" || r.kind === "mixin") {
13
+ i = r;
14
+ break;
15
+ }
16
+ }
17
+ t.set(n.path, {
18
+ apiModule: n,
19
+ classLike: i,
20
+ ancestors: void 0,
21
+ children: void 0
22
+ });
23
+ }
24
+ return t;
25
+ }
26
+ function k(s) {
27
+ for (const t of s.values())
28
+ p(t, s);
29
+ }
30
+ function p(s, t) {
31
+ const o = s.classLike;
32
+ if (o === void 0)
33
+ return;
34
+ const n = o;
35
+ if (!(s.ancestors !== void 0 || o.mixins === void 0 && n.superclass === void 0)) {
36
+ if (s.ancestors ??= [], o.mixins !== void 0)
37
+ for (let a = o.mixins.length - 1; a >= 0; --a)
38
+ v(o.mixins[a], s, t);
39
+ n.superclass !== void 0 && h(n.superclass, s, t);
40
+ }
41
+ }
42
+ function v(s, t, o) {
43
+ if (s.module !== void 0 && s.package === void 0) {
44
+ const n = o.get(s.module);
45
+ p(n, o), n.children ??= [], n.children.push(t);
46
+ }
47
+ t.ancestors.push(s);
48
+ }
49
+ function h(s, t, o) {
50
+ if (!(s.module !== void 0 && s.package === void 0)) {
51
+ t.ancestors.push(s);
52
+ return;
53
+ }
54
+ const i = o.get(s.module);
55
+ p(i, o), i.children ??= [], i.children.push(t);
56
+ const a = i.classLike;
57
+ if (a.kind === "mixin" && a.name !== s.name && s.name !== "default") {
58
+ const u = i.apiModule.declarations;
59
+ for (let e = 0; e < u.length; ++e) {
60
+ const f = u[e];
61
+ if (f.name === s.name) {
62
+ const l = f;
63
+ for (let m = l.supertypes.length - 1; m >= 1; --m) {
64
+ const c = l.supertypes[m], d = c.module === void 0 && c.package === void 0 ? {
65
+ name: c.name,
66
+ module: s.module,
67
+ package: void 0,
68
+ viewUrl: c.viewUrl,
69
+ typeArguments: c.typeArguments
70
+ } : c;
71
+ v(d, t, o);
72
+ }
73
+ h(l.supertypes[0], t, o);
74
+ break;
75
+ }
76
+ }
77
+ } else
78
+ t.ancestors.push(s);
79
+ i.ancestors !== void 0 && t.ancestors.push(...i.ancestors);
80
+ }
81
+ export {
82
+ y as createIndex
83
+ };
@@ -13,7 +13,7 @@ const d = {
13
13
  never: "https://www.typescriptlang.org/docs/handbook/2/functions.html#never",
14
14
  any: "https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any",
15
15
  this: "#"
16
- }, h = Object.keys(d).join("|"), g = new RegExp(`\\b(?:${h})\\b`, "u");
16
+ }, h = Object.keys(d).join("|"), g = new RegExp(`(?<!["'-])\\b(?:${h})\\b(?!["'-])`, "u");
17
17
  function p(e, c) {
18
18
  const n = [];
19
19
  let o = e.text.length;
@@ -1,6 +1,6 @@
1
- import { l as T, m as J } from "../worker-ChyOmzAh.js";
2
- import { A as b, w as S } from "../ApiExtractor-DCrXNOTy.js";
3
- import { p as k, l as A } from "../typeScript-DEqHrfvQ.js";
1
+ import { l as T, m as J } from "../worker-BnxFV-69.js";
2
+ import { A as b, w as S } from "../ApiExtractor-DY7mtZzx.js";
3
+ import { p as k, l as A } from "../typeScript-BSl6gr8_.js";
4
4
  import { writeFile as C } from "node:fs/promises";
5
5
  import { path as w } from "@arcgis/components-build-utils";
6
6
  const M = k.name;
@@ -1,6 +1,6 @@
1
1
  import "@arcgis/components-build-utils";
2
2
  import "typescript";
3
- import { b as t } from "../typeScript-DEqHrfvQ.js";
3
+ import { b as t } from "../typeScript-BSl6gr8_.js";
4
4
  export {
5
5
  t as loadTypeScriptConfig
6
6
  };
@@ -1,11 +1,10 @@
1
1
  import { path as $e, existsAsync as qt, getCwd as Ci, retrievePackageJson as lt, toPosixPathSeparators as bi } from "@arcgis/components-build-utils";
2
- import { b as Mi, p as Pi, l as xi } from "./typeScript-DEqHrfvQ.js";
2
+ import { b as Mi, p as Pi, l as xi } from "./typeScript-BSl6gr8_.js";
3
3
  import ne from "chalk";
4
- import { globalPackageIdentifier as De, mergeApiNodes as Ri, isApiMethodAsync as Di } from "./utils/apiHelpers.js";
5
- import { uncapitalize as Li, camelToKebab as Ii, kebabToPascal as Ai } from "@arcgis/toolkit/string";
4
+ import { a as te, c as Tt, b as Xt, g as ae, l as Ze, o as Qt, p as Y, f as Ri, e as De, m as Di, q as Li, r as Ii, s as Yt, t as Ai } from "./apiHelpers-BYzO767m.js";
5
+ import { uncapitalize as ki, camelToKebab as Fi, kebabToPascal as wi } from "@arcgis/toolkit/string";
6
6
  import o from "typescript";
7
7
  import "fs/promises";
8
- import { getObjectLikeContext as te, getFunctionLikeContext as Tt, getVariableContext as Xt, getModuleContext as ae, createFunctionLikeContext as Ze, createModuleContext as Qt, privateContextSymbol as Y, getPropertyContext as ki, createPropertyContext as Fi, createObjectLikeContext as Yt, createVariableContext as wi } from "./extractor/privateContext.js";
9
8
  import { maybeEscapePropertyName as xt, printTypeAlias as Rt, printInterface as Ni, printFunction as Oi, printVariable as Gi, printClass as Vi, printMethod as _i, printProperty as fe, printGetterSetter as Wi, printSignature as Ki } from "./utils/partPrinter.js";
10
9
  import { readFile as Dt, opendir as Lt, rm as Hi } from "node:fs/promises";
11
10
  import { pathIsComponentEntrypoint as $i, findDeclaredComponent as Bi } from "./extractor/webComponent/findComponents.js";
@@ -18,7 +17,7 @@ import { pathToFileURL as ji } from "node:url";
18
17
  import Ji from "path";
19
18
  import { getWidenedLiteralType as qi, unsafeUndocumentedTs as Xi, unsafeGetUndocumentedPrinter as Qi } from "./utils/internalTypeScriptApis.js";
20
19
  import { getViewUrl as Ve } from "./extractor/processing/links.js";
21
- function ra(e) {
20
+ function aa(e) {
22
21
  if (e.isResolvedConfig === !0)
23
22
  return e;
24
23
  const t = e.context, n = e.types, i = e.documentation, r = `${t?.cwd === void 0 ? Ci() : $e.resolve(t?.cwd)}/`, l = t?.packageJson ?? lt(r);
@@ -105,7 +104,7 @@ function ra(e) {
105
104
  afterApiJsonCreate: e.afterApiJsonCreate ?? ge
106
105
  };
107
106
  }
108
- async function sa(e = process.cwd(), t) {
107
+ async function ra(e = process.cwd(), t) {
109
108
  const n = t !== void 0, i = $e.resolve(e, t ?? "api-extractor.config.ts"), a = await qt(i);
110
109
  if (n && !a)
111
110
  throw Error(`The provided config file at ${i} does not exist.`);
@@ -120,7 +119,7 @@ async function sa(e = process.cwd(), t) {
120
119
  }
121
120
  };
122
121
  }
123
- function la(e, t) {
122
+ function sa(e, t) {
124
123
  const n = e.context, i = t.context, a = e.types, r = t.types, l = e.documentation, s = t.documentation, c = e.verify, m = t.verify, d = e.watch, p = t.watch;
125
124
  return {
126
125
  isResolvedConfig: e.isResolvedConfig || t.isResolvedConfig || void 0,
@@ -534,7 +533,7 @@ export namespace tsx {
534
533
  return e;
535
534
  }
536
535
  }
537
- function ca(e, t) {
536
+ function la(e, t) {
538
537
  let n = `/// <reference types="../index.d.ts" />
539
538
  `, i = `
540
539
 
@@ -677,7 +676,7 @@ function cn(e, t) {
677
676
  ` : "";
678
677
  return [r.length === 0 ? "" : `${r}, `, l];
679
678
  }
680
- function da(e, t) {
679
+ function ca(e, t) {
681
680
  const n = t.moduleMap.get("index");
682
681
  if (n === void 0)
683
682
  e.unshift(dn);
@@ -805,7 +804,7 @@ const dn = {
805
804
  declarations: [ti, ii],
806
805
  exports: void 0
807
806
  };
808
- function pa(e, t) {
807
+ function da(e, t) {
809
808
  const n = Te(e), i = he(n), a = ae(e);
810
809
  if (a.index.class?.privacy !== void 0)
811
810
  return e.declarations.length > 1 && t.emitError(
@@ -998,7 +997,7 @@ ${s}}`)}
998
997
  const pn = "@arcgis/lumina";
999
998
  function Ft(e) {
1000
999
  let t = "";
1001
- const n = ki(e), i = n.isAccessor === !0, a = e.readonly === !0;
1000
+ const n = Ri(e), i = n.isAccessor === !0, a = e.readonly === !0;
1002
1001
  if (e.getterType !== void 0 || i && a)
1003
1002
  t += Wi(
1004
1003
  e.privacy !== void 0,
@@ -1046,7 +1045,7 @@ Use EventNames and EventTypes helpers from @arcgis/core/Evented`
1046
1045
  }
1047
1046
  ]
1048
1047
  });
1049
- function ma() {
1048
+ function pa() {
1050
1049
  const e = Date.now();
1051
1050
  return () => (Date.now() - e) / un;
1052
1051
  }
@@ -2137,7 +2136,7 @@ const di = { text: "unknown", references: void 0, values: void 0, source: void 0
2137
2136
  function io(e, t) {
2138
2137
  if (t.isInLuminaMinimalExtraction)
2139
2138
  return;
2140
- const n = Li(e.name), i = {
2139
+ const n = ki(e.name), i = {
2141
2140
  [Y]: no,
2142
2141
  kind: "method",
2143
2142
  name: "componentOnReady",
@@ -2219,7 +2218,7 @@ function de(e, t, n, i, a) {
2219
2218
  file: e.file,
2220
2219
  node: t
2221
2220
  }
2222
- ), !(typeof s == "function" && (s = s(i, a, e.apiModule), s === void 0)) && Ri(s, i, r);
2221
+ ), !(typeof s == "function" && (s = s(i, a, e.apiModule), s === void 0)) && Di(s, i, r);
2223
2222
  }
2224
2223
  function Ct(e, t, n) {
2225
2224
  n.apiModule.exports.push({
@@ -2370,7 +2369,7 @@ function Ae(e, t, n, i) {
2370
2369
  T &&= L.optional === !0 || L.rest === !0, !T && L.optional && (L.optional = void 0, L.type.text += " | undefined");
2371
2370
  }
2372
2371
  }
2373
- l && i.componentTagName !== void 0 && (R.signature = Ki(R), v && !Di(R) && i.emitError("Public method marked as async must have a Promise<SomeType> return type annotation.", {
2372
+ l && i.componentTagName !== void 0 && (R.signature = Ki(R), v && !Li(R) && i.emitError("Public method marked as async must have a Promise<SomeType> return type annotation.", {
2374
2373
  file: i.file,
2375
2374
  node: e
2376
2375
  })), i.functionLikeTypeParameters = void 0;
@@ -2518,7 +2517,7 @@ function $t(e) {
2518
2517
  }
2519
2518
  t & Co || n || (re = !0);
2520
2519
  }
2521
- const Co = o.TypeFlags.Null | o.TypeFlags.VoidLike, ua = (e) => e.map(bo).join(" | "), bo = (e) => e.type === "string" && e.value !== void 0 ? `"${e.value}"` : e.value ?? e.type;
2520
+ const Co = o.TypeFlags.Null | o.TypeFlags.VoidLike, ma = (e) => e.map(bo).join(" | "), bo = (e) => e.type === "string" && e.value !== void 0 ? `"${e.value}"` : e.value ?? e.type;
2522
2521
  function Mo(e, t, n) {
2523
2522
  let i;
2524
2523
  const a = e.initializer;
@@ -2618,7 +2617,7 @@ function ui(e, t, n, i) {
2618
2617
  i.emitError("Computed property names are not yet supported", { file: i.file, node: e });
2619
2618
  return;
2620
2619
  }
2621
- const a = e, r = Pe(a.modifiers, "property") ?? (i.pairedSetter === void 0 ? void 0 : Pe(i.pairedSetter.modifiers, "property")), l = r?.arguments[0], s = l !== void 0 && o.isObjectLiteralExpression(l) ? l.properties : void 0, c = o.isPropertyDeclaration(e) || o.isPropertySignature(e), m = o.isGetAccessor(e), d = Fi(), p = i.isInLuminaMinimalExtraction || i.jsDoc === Ee;
2620
+ const a = e, r = Pe(a.modifiers, "property") ?? (i.pairedSetter === void 0 ? void 0 : Pe(i.pairedSetter.modifiers, "property")), l = r?.arguments[0], s = l !== void 0 && o.isObjectLiteralExpression(l) ? l.properties : void 0, c = o.isPropertyDeclaration(e) || o.isPropertySignature(e), m = o.isGetAccessor(e), d = Ii(), p = i.isInLuminaMinimalExtraction || i.jsDoc === Ee;
2622
2621
  let f = !1, u = !1, g, C = !1, y, h, M;
2623
2622
  if (c && e.modifiers !== void 0)
2624
2623
  for (let T = 0; T < e.modifiers.length; ++T)
@@ -2738,7 +2737,7 @@ function ui(e, t, n, i) {
2738
2737
  inheritedFrom: void 0,
2739
2738
  privacy: g,
2740
2739
  source: void 0,
2741
- attribute: !b || h === !1 ? void 0 : typeof h == "string" ? h : Ii(t),
2740
+ attribute: !b || h === !1 ? void 0 : typeof h == "string" ? h : Fi(t),
2742
2741
  reflects: M,
2743
2742
  docsOnlyReadonly: void 0
2744
2743
  };
@@ -2849,7 +2848,7 @@ function Ye(e, t) {
2849
2848
  * prefix (Arcgis), where as tag name always does. This also matches
2850
2849
  * Stencil's behavior.
2851
2850
  */
2852
- Ai(a)
2851
+ wi(a)
2853
2852
  ),
2854
2853
  deprecated: void 0,
2855
2854
  summary: void 0,
@@ -2950,7 +2949,7 @@ function Ro(e, t, n, i, a) {
2950
2949
  if (m.name === "LitElement") {
2951
2950
  m.name = "PublicLitElement", m.module = "PublicLitElement", m.package = "@arcgis/lumina";
2952
2951
  const p = a.moduleContext.importsMap.LitElement;
2953
- p === void 0 ? a.emitError("Expected LitElement import to be defined", { file: a.file, node: i }) : (p.specifier = "@arcgis/lumina/PublicLitElement", p.actualName = "PublicLitElement");
2952
+ p === void 0 ? a.emitError("Expected LitElement import to be defined", { file: a.file, node: i }) : p.actualName = "PublicLitElement";
2954
2953
  }
2955
2954
  const d = te(n);
2956
2955
  d.superClassText = m.printableText, m.printableText = void 0, n.superclass = m;
@@ -3189,7 +3188,7 @@ function Ao(e, t) {
3189
3188
  ) : c = ht(u, m ? O.shallow : O.false, t.file, t);
3190
3189
  } else if (c = Et(c), o.isFunctionTypeNode(c))
3191
3190
  return Wt(c, r, e, t);
3192
- const d = wi(), p = {
3191
+ const d = Ai(), p = {
3193
3192
  [Y]: d,
3194
3193
  kind: "variable",
3195
3194
  name: r,
@@ -3433,7 +3432,7 @@ function Fo(e, t) {
3433
3432
  }
3434
3433
  ) : (C && p.docsTags.push(W.internal), nn(h, p))), h;
3435
3434
  }
3436
- async function fa(e) {
3435
+ async function ua(e) {
3437
3436
  const t = [], n = e.basePath, i = e.config.context.excludedDirectories, a = `${e.basePath}components/`, r = [], l = !e.config.strict || e.config.context.includeLuminaPrivateComponents;
3438
3437
  e.componentPathMapping = /* @__PURE__ */ Object.create(null);
3439
3438
  const s = e.isComponentProject ? (p) => $i(p, a) : () => !1, c = e.isComponentProject ? m : d;
@@ -3522,7 +3521,7 @@ async function fa(e) {
3522
3521
  const wo = (e, t) => No(e) && Oo(e, t), No = (e) => (e.endsWith(".ts") || e.endsWith(".tsx")) && !Si(e), Si = (e) => e.includes("__test") || e.includes(".e2e.") || e.includes(".spec.") || e.includes(".test."), Oo = (e, t) => e.startsWith(t.basePath) && !t.config.context.excludedDirectories.has(
3523
3522
  fn(e.slice(t.basePath.length))
3524
3523
  ) && !e.includes("node_modules"), jt = 32, Go = 64, Ti = "@public", Vo = Buffer.from(Ti), hi = "@internal", _o = Buffer.from(hi);
3525
- async function ya(e) {
3524
+ async function fa(e) {
3526
3525
  await qt(e) && await Ei(e, /* @__PURE__ */ new Set(), Hi);
3527
3526
  }
3528
3527
  async function Ei(e, t, n) {
@@ -3577,21 +3576,21 @@ function Jt(e, t) {
3577
3576
  }
3578
3577
  export {
3579
3578
  ye as a,
3580
- da as b,
3581
- ya as c,
3582
- ma as d,
3583
- fa as e,
3584
- pa as f,
3579
+ ca as b,
3580
+ fa as c,
3581
+ pa as d,
3582
+ ua as e,
3583
+ da as f,
3585
3584
  No as g,
3586
3585
  Oo as h,
3587
3586
  wo as i,
3588
3587
  Si as j,
3589
3588
  Jt as k,
3590
- sa as l,
3591
- la as m,
3589
+ ra as l,
3590
+ sa as m,
3592
3591
  Ot as n,
3593
3592
  Nt as o,
3594
- ca as p,
3595
- ra as r,
3596
- ua as t
3593
+ la as p,
3594
+ aa as r,
3595
+ ma as t
3597
3596
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/api-extractor",
3
- "version": "5.0.0-next.142",
3
+ "version": "5.0.0-next.144",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -17,7 +17,6 @@
17
17
  "./diff/fetchApiJsonFromNpm": "./dist/diff/fetchApiJsonFromNpm.js",
18
18
  "./diffTypes": "./dist/diffTypes/index.js",
19
19
  "./extractor/ApiExtractor": "./dist/extractor/ApiExtractor.js",
20
- "./extractor/privateContext": "./dist/extractor/privateContext.js",
21
20
  "./extractor/types": {
22
21
  "types": "./dist/extractor/types.d.ts"
23
22
  },
@@ -31,6 +30,7 @@
31
30
  "./uiUtils": "./dist/uiUtils/index.js",
32
31
  "./utils/apiHelpers": "./dist/utils/apiHelpers.js",
33
32
  "./utils/astHelpers": "./dist/utils/astHelpers.js",
33
+ "./utils/createIndex": "./dist/utils/createIndex.js",
34
34
  "./utils/hydrateApiType": "./dist/utils/hydrateApiType.js",
35
35
  "./utils/inferEntrypoints": "./dist/utils/inferEntrypoints.js",
36
36
  "./utils/internalTypeScriptApis": "./dist/utils/internalTypeScriptApis.js",
@@ -49,9 +49,8 @@
49
49
  "chalk": "^5.4.1",
50
50
  "commander": "^14.0.0",
51
51
  "tslib": "^2.8.1",
52
- "vite": "^7.2.2",
53
- "@arcgis/components-build-utils": "5.0.0-next.142",
54
- "@arcgis/toolkit": "5.0.0-next.142"
52
+ "@arcgis/components-build-utils": "5.0.0-next.144",
53
+ "@arcgis/toolkit": "5.0.0-next.144"
55
54
  },
56
55
  "peerDependencies": {
57
56
  "typescript": "~5.9.3",
@@ -1,19 +0,0 @@
1
- import type { ApiModule } from "../apiJson.js";
2
- import type { IndexedModuleDeclarations } from "./types.js";
3
-
4
- /** @experimental */
5
- export interface ModuleContext {
6
- /** @experimental */
7
- readonly index: IndexedModuleDeclarations;
8
- }
9
-
10
- /**
11
- * Get metadata about ApiModule that is not stored in api.json. This exposes
12
- * internal extractor details.
13
- *
14
- * Separate function for each node kind to improve typing and V8 inlining.
15
- *
16
- * @param node
17
- * @internal
18
- */
19
- export function getModuleContext(node: ApiModule): ModuleContext;
@@ -1,84 +0,0 @@
1
- const e = Symbol("privateContext");
2
- function s(t, o, i, n) {
3
- return {
4
- isStale: !0,
5
- file: t,
6
- dtsPath: o,
7
- importsMap: i,
8
- importsText: void 0,
9
- constructorPropertiesInterface: void 0,
10
- constructorOnlySetters: void 0,
11
- constructorAutoCastType: void 0,
12
- typeName: void 0,
13
- inheritance: void 0,
14
- index: n,
15
- reExports: void 0,
16
- namespaces: void 0
17
- };
18
- }
19
- function c() {
20
- return {
21
- hasExplicitAbstract: void 0,
22
- isDefaultExported: void 0,
23
- superClassText: void 0,
24
- superTypesText: void 0,
25
- eventTypesProperty: void 0,
26
- isMixinBaseClass: void 0,
27
- emitAsTypeAlias: void 0,
28
- esriCompatibilityNames: void 0
29
- };
30
- }
31
- function a() {
32
- return {
33
- isAbstract: void 0,
34
- isAccessor: void 0,
35
- hasAutoCasting: void 0,
36
- autoCastingRequiresType: void 0,
37
- autoCastingDefaultType: void 0,
38
- isConstructorOnly: void 0,
39
- isOverride: void 0,
40
- dtsTypeOverride: void 0
41
- };
42
- }
43
- function u() {
44
- return {
45
- isAbstract: void 0,
46
- isDefaultExported: void 0,
47
- hasQuestionToken: void 0,
48
- esriCompatibilityNames: void 0
49
- };
50
- }
51
- function d() {
52
- return {
53
- isDefaultExported: void 0,
54
- esriCompatibilityNames: void 0
55
- };
56
- }
57
- function v(t) {
58
- return t[e];
59
- }
60
- function x(t) {
61
- return t[e];
62
- }
63
- function p(t) {
64
- return t[e];
65
- }
66
- function C(t) {
67
- return t[e];
68
- }
69
- function l(t) {
70
- return t[e];
71
- }
72
- export {
73
- u as createFunctionLikeContext,
74
- s as createModuleContext,
75
- c as createObjectLikeContext,
76
- a as createPropertyContext,
77
- d as createVariableContext,
78
- C as getFunctionLikeContext,
79
- v as getModuleContext,
80
- x as getObjectLikeContext,
81
- p as getPropertyContext,
82
- l as getVariableContext,
83
- e as privateContextSymbol
84
- };