@arcgis/api-extractor 4.34.0-next.98 → 4.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,17 @@
1
+ # Licensing
2
+
3
+ COPYRIGHT © Esri
4
+
5
+ All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
6
+
7
+ This material is licensed for use under the [Esri Master License Agreement (MLA)](https://www.esri.com/content/dam/esrisites/en-us/media/legal/ma-full/ma-full.pdf), and is bound by the terms of that agreement.
8
+ You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
9
+
10
+ For additional information, contact:
11
+ Environmental Systems Research Institute, Inc.
12
+ Attn: Contracts and Legal Services Department
13
+ 380 New York Street
14
+ Redlands, California, USA 92373
15
+ USA
16
+
17
+ email: legal@esri.com
package/README.md CHANGED
@@ -8,18 +8,6 @@ It is not intended to be used directly, but rather used as a dependency by other
8
8
 
9
9
  ## License
10
10
 
11
- COPYRIGHT © 2025 Esri
11
+ COPYRIGHT © Esri
12
12
 
13
- All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
14
-
15
- This material is licensed for use under the [Esri Master License Agreement (MLA)](https://www.esri.com/content/dam/esrisites/en-us/media/legal/ma-full/ma-full.pdf), and is bound by the terms of that agreement.
16
- You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
17
-
18
- For additional information, contact:
19
- Environmental Systems Research Institute, Inc.
20
- Attn: Contracts and Legal Services Department
21
- 380 New York Street
22
- Redlands, California, USA 92373
23
- USA
24
-
25
- email: legal@esri.com
13
+ This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package.
@@ -40,7 +40,7 @@ export declare abstract class ApiExtractor {
40
40
  * Infer ApiExport based on ApiDeclaration
41
41
  */
42
42
  protected abstract inferExport(declaration: ApiDeclaration): ApiExport | undefined;
43
- copyDoc(copyDocDefinition: CopyPropertyDoc | undefined, property: ApiCustomElementField, component: ApiCustomElementDeclaration): void;
44
- copyDoc(copyDocDefinition: CopyMethodDoc | undefined, method: ApiClassMethod, component: ApiCustomElementDeclaration): void;
45
- copyDoc(copyDocDefinition: CopyEventDoc | undefined, event: ApiEvent, component: ApiCustomElementDeclaration): void;
43
+ copyDoc(errorReportingNode: ts.Node, copyDocDefinition: CopyPropertyDoc | undefined, property: ApiCustomElementField, component: ApiCustomElementDeclaration): void;
44
+ copyDoc(errorReportingNode: ts.Node, copyDocDefinition: CopyMethodDoc | undefined, method: ApiClassMethod, component: ApiCustomElementDeclaration): void;
45
+ copyDoc(errorReportingNode: ts.Node, copyDocDefinition: CopyEventDoc | undefined, event: ApiEvent, component: ApiCustomElementDeclaration): void;
46
46
  }
package/dist/index.d.ts CHANGED
@@ -2,5 +2,7 @@ export { ApiExtractor, type ApiExtractorOptions } from './extractor';
2
2
  export type * from './apiJson';
3
3
  export { hasIgnoredModifier, setDefaultFromInitializer, getMemberName, findDecorator } from './utils/astHelpers';
4
4
  export { isApiMethod, isApiProperty, globalPackageIdentifier, multipleJsDocTags } from './utils/apiHelpers';
5
+ export { apiExtractorError, apiExtractorErrorCount, apiExtractorErrorFiles, setApiExtractorErrorLogger, type ApiExtractorErrorContext, } from './utils/error';
6
+ export { debugPrintNode, printNode } from './utils/print';
5
7
  export type { CopyDocDefinitions } from './types';
6
8
  export { symbolToDocs, apiMemberToSynthesizedComments, setApiDocFromJsDoc } from './utils/docHelpers';
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import a from "typescript";
2
- import { path as x } from "@arcgis/components-build-utils";
3
- import { mappedFind as m } from "@arcgis/toolkit/array";
4
- const h = "@arcgis/api-extractor", g = "4.34.0-next.98", j = (e) => e.kind === "method", A = (e) => e.kind === "field";
5
- function v(e, s) {
6
- const t = e.path.split("/"), n = t.pop(), i = t.join("/"), o = s.path.split("/"), c = o.pop(), r = o.join("/");
7
- return i === r ? n < c ? -1 : 1 : i.startsWith(r) ? 1 : r.startsWith(i) || i < r ? -1 : 1;
8
- }
9
- const C = "global:", T = /* @__PURE__ */ new Set([
1
+ import c from "typescript";
2
+ import { path as P } from "@arcgis/components-build-utils";
3
+ import { mappedFind as R } from "@arcgis/toolkit/array";
4
+ const N = "@arcgis/api-extractor", K = "4.34.0", ye = (t) => t.kind === "method", Te = (t) => t.kind === "field";
5
+ function W(t, e) {
6
+ const n = t.path.split("/"), o = n.pop(), s = n.join("/"), r = e.path.split("/"), i = r.pop(), a = r.join("/");
7
+ return s === a ? o < i ? -1 : 1 : s.startsWith(a) ? 1 : a.startsWith(s) || s < a ? -1 : 1;
8
+ }
9
+ const Se = "global:", G = /* @__PURE__ */ new Set([
10
10
  "example",
11
11
  "see",
12
12
  "param",
@@ -15,228 +15,541 @@ const C = "global:", T = /* @__PURE__ */ new Set([
15
15
  "slot",
16
16
  "csspart",
17
17
  "cssstate"
18
- ]);
19
- class F {
20
- constructor(s) {
21
- this.options = s;
18
+ ]), v = 10, M = (t = 0) => (e) => `\x1B[${e + t}m`, k = (t = 0) => (e) => `\x1B[${38 + t};5;${e}m`, w = (t = 0) => (e, n, o) => `\x1B[${38 + t};2;${e};${n};${o}m`, l = {
19
+ modifier: {
20
+ reset: [0, 0],
21
+ // 21 isn't widely supported and 22 does the same thing
22
+ bold: [1, 22],
23
+ dim: [2, 22],
24
+ italic: [3, 23],
25
+ underline: [4, 24],
26
+ overline: [53, 55],
27
+ inverse: [7, 27],
28
+ hidden: [8, 28],
29
+ strikethrough: [9, 29]
30
+ },
31
+ color: {
32
+ black: [30, 39],
33
+ red: [31, 39],
34
+ green: [32, 39],
35
+ yellow: [33, 39],
36
+ blue: [34, 39],
37
+ magenta: [35, 39],
38
+ cyan: [36, 39],
39
+ white: [37, 39],
40
+ // Bright color
41
+ blackBright: [90, 39],
42
+ gray: [90, 39],
43
+ // Alias of `blackBright`
44
+ grey: [90, 39],
45
+ // Alias of `blackBright`
46
+ redBright: [91, 39],
47
+ greenBright: [92, 39],
48
+ yellowBright: [93, 39],
49
+ blueBright: [94, 39],
50
+ magentaBright: [95, 39],
51
+ cyanBright: [96, 39],
52
+ whiteBright: [97, 39]
53
+ },
54
+ bgColor: {
55
+ bgBlack: [40, 49],
56
+ bgRed: [41, 49],
57
+ bgGreen: [42, 49],
58
+ bgYellow: [43, 49],
59
+ bgBlue: [44, 49],
60
+ bgMagenta: [45, 49],
61
+ bgCyan: [46, 49],
62
+ bgWhite: [47, 49],
63
+ // Bright color
64
+ bgBlackBright: [100, 49],
65
+ bgGray: [100, 49],
66
+ // Alias of `bgBlackBright`
67
+ bgGrey: [100, 49],
68
+ // Alias of `bgBlackBright`
69
+ bgRedBright: [101, 49],
70
+ bgGreenBright: [102, 49],
71
+ bgYellowBright: [103, 49],
72
+ bgBlueBright: [104, 49],
73
+ bgMagentaBright: [105, 49],
74
+ bgCyanBright: [106, 49],
75
+ bgWhiteBright: [107, 49]
76
+ }
77
+ };
78
+ Object.keys(l.modifier);
79
+ const V = Object.keys(l.color), Y = Object.keys(l.bgColor);
80
+ [...V, ...Y];
81
+ function J() {
82
+ const t = /* @__PURE__ */ new Map();
83
+ for (const [e, n] of Object.entries(l)) {
84
+ for (const [o, s] of Object.entries(n))
85
+ l[o] = {
86
+ open: `\x1B[${s[0]}m`,
87
+ close: `\x1B[${s[1]}m`
88
+ }, n[o] = l[o], t.set(s[0], s[1]);
89
+ Object.defineProperty(l, e, {
90
+ value: n,
91
+ enumerable: !1
92
+ });
93
+ }
94
+ return Object.defineProperty(l, "codes", {
95
+ value: t,
96
+ enumerable: !1
97
+ }), l.color.close = "\x1B[39m", l.bgColor.close = "\x1B[49m", l.color.ansi = M(), l.color.ansi256 = k(), l.color.ansi16m = w(), l.bgColor.ansi = M(v), l.bgColor.ansi256 = k(v), l.bgColor.ansi16m = w(v), Object.defineProperties(l, {
98
+ rgbToAnsi256: {
99
+ value(e, n, o) {
100
+ return e === n && n === o ? e < 8 ? 16 : e > 248 ? 231 : Math.round((e - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(e / 255 * 5) + 6 * Math.round(n / 255 * 5) + Math.round(o / 255 * 5);
101
+ },
102
+ enumerable: !1
103
+ },
104
+ hexToRgb: {
105
+ value(e) {
106
+ const n = /[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));
107
+ if (!n)
108
+ return [0, 0, 0];
109
+ let [o] = n;
110
+ o.length === 3 && (o = [...o].map((r) => r + r).join(""));
111
+ const s = Number.parseInt(o, 16);
112
+ return [
113
+ /* eslint-disable no-bitwise */
114
+ s >> 16 & 255,
115
+ s >> 8 & 255,
116
+ s & 255
117
+ /* eslint-enable no-bitwise */
118
+ ];
119
+ },
120
+ enumerable: !1
121
+ },
122
+ hexToAnsi256: {
123
+ value: (e) => l.rgbToAnsi256(...l.hexToRgb(e)),
124
+ enumerable: !1
125
+ },
126
+ ansi256ToAnsi: {
127
+ value(e) {
128
+ if (e < 8)
129
+ return 30 + e;
130
+ if (e < 16)
131
+ return 90 + (e - 8);
132
+ let n, o, s;
133
+ if (e >= 232)
134
+ n = ((e - 232) * 10 + 8) / 255, o = n, s = n;
135
+ else {
136
+ e -= 16;
137
+ const a = e % 36;
138
+ n = Math.floor(e / 36) / 5, o = Math.floor(a / 6) / 5, s = a % 6 / 5;
139
+ }
140
+ const r = Math.max(n, o, s) * 2;
141
+ if (r === 0)
142
+ return 30;
143
+ let i = 30 + (Math.round(s) << 2 | Math.round(o) << 1 | Math.round(n));
144
+ return r === 2 && (i += 60), i;
145
+ },
146
+ enumerable: !1
147
+ },
148
+ rgbToAnsi: {
149
+ value: (e, n, o) => l.ansi256ToAnsi(l.rgbToAnsi256(e, n, o)),
150
+ enumerable: !1
151
+ },
152
+ hexToAnsi: {
153
+ value: (e) => l.ansi256ToAnsi(l.hexToAnsi256(e)),
154
+ enumerable: !1
155
+ }
156
+ }), l;
157
+ }
158
+ const d = J(), B = (() => {
159
+ if (!("navigator" in globalThis))
160
+ return 0;
161
+ if (globalThis.navigator.userAgentData) {
162
+ const t = navigator.userAgentData.brands.find(({ brand: e }) => e === "Chromium");
163
+ if (t && t.version > 93)
164
+ return 3;
165
+ }
166
+ return /\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent) ? 1 : 0;
167
+ })(), j = B !== 0 && {
168
+ level: B
169
+ }, U = {
170
+ stdout: j,
171
+ stderr: j
172
+ };
173
+ function z(t, e, n) {
174
+ let o = t.indexOf(e);
175
+ if (o === -1)
176
+ return t;
177
+ const s = e.length;
178
+ let r = 0, i = "";
179
+ do
180
+ i += t.slice(r, o) + e + n, r = o + s, o = t.indexOf(e, r);
181
+ while (o !== -1);
182
+ return i += t.slice(r), i;
183
+ }
184
+ function H(t, e, n, o) {
185
+ let s = 0, r = "";
186
+ do {
187
+ const i = t[o - 1] === "\r";
188
+ r += t.slice(s, i ? o - 1 : o) + e + (i ? `\r
189
+ ` : `
190
+ `) + n, s = o + 1, o = t.indexOf(`
191
+ `, s);
192
+ } while (o !== -1);
193
+ return r += t.slice(s), r;
194
+ }
195
+ const { stdout: $, stderr: S } = U, A = Symbol("GENERATOR"), f = Symbol("STYLER"), h = Symbol("IS_EMPTY"), D = [
196
+ "ansi",
197
+ "ansi",
198
+ "ansi256",
199
+ "ansi16m"
200
+ ], p = /* @__PURE__ */ Object.create(null), q = (t, e = {}) => {
201
+ if (e.level && !(Number.isInteger(e.level) && e.level >= 0 && e.level <= 3))
202
+ throw new Error("The `level` option should be an integer from 0 to 3");
203
+ const n = $ ? $.level : 0;
204
+ t.level = e.level === void 0 ? n : e.level;
205
+ }, Q = (t) => {
206
+ const e = (...n) => n.join(" ");
207
+ return q(e, t), Object.setPrototypeOf(e, m.prototype), e;
208
+ };
209
+ function m(t) {
210
+ return Q(t);
211
+ }
212
+ Object.setPrototypeOf(m.prototype, Function.prototype);
213
+ for (const [t, e] of Object.entries(d))
214
+ p[t] = {
215
+ get() {
216
+ const n = x(this, E(e.open, e.close, this[f]), this[h]);
217
+ return Object.defineProperty(this, t, { value: n }), n;
218
+ }
219
+ };
220
+ p.visible = {
221
+ get() {
222
+ const t = x(this, this[f], !0);
223
+ return Object.defineProperty(this, "visible", { value: t }), t;
224
+ }
225
+ };
226
+ const C = (t, e, n, ...o) => t === "rgb" ? e === "ansi16m" ? d[n].ansi16m(...o) : e === "ansi256" ? d[n].ansi256(d.rgbToAnsi256(...o)) : d[n].ansi(d.rgbToAnsi(...o)) : t === "hex" ? C("rgb", e, n, ...d.hexToRgb(...o)) : d[n][t](...o), X = ["rgb", "hex", "ansi256"];
227
+ for (const t of X) {
228
+ p[t] = {
229
+ get() {
230
+ const { level: n } = this;
231
+ return function(...o) {
232
+ const s = E(C(t, D[n], "color", ...o), d.color.close, this[f]);
233
+ return x(this, s, this[h]);
234
+ };
235
+ }
236
+ };
237
+ const e = "bg" + t[0].toUpperCase() + t.slice(1);
238
+ p[e] = {
239
+ get() {
240
+ const { level: n } = this;
241
+ return function(...o) {
242
+ const s = E(C(t, D[n], "bgColor", ...o), d.bgColor.close, this[f]);
243
+ return x(this, s, this[h]);
244
+ };
245
+ }
246
+ };
247
+ }
248
+ const Z = Object.defineProperties(() => {
249
+ }, {
250
+ ...p,
251
+ level: {
252
+ enumerable: !0,
253
+ get() {
254
+ return this[A].level;
255
+ },
256
+ set(t) {
257
+ this[A].level = t;
258
+ }
259
+ }
260
+ }), E = (t, e, n) => {
261
+ let o, s;
262
+ return n === void 0 ? (o = t, s = e) : (o = n.openAll + t, s = e + n.closeAll), {
263
+ open: t,
264
+ close: e,
265
+ openAll: o,
266
+ closeAll: s,
267
+ parent: n
268
+ };
269
+ }, x = (t, e, n) => {
270
+ const o = (...s) => _(o, s.length === 1 ? "" + s[0] : s.join(" "));
271
+ return Object.setPrototypeOf(o, Z), o[A] = t, o[f] = e, o[h] = n, o;
272
+ }, _ = (t, e) => {
273
+ if (t.level <= 0 || !e)
274
+ return t[h] ? "" : e;
275
+ let n = t[f];
276
+ if (n === void 0)
277
+ return e;
278
+ const { openAll: o, closeAll: s } = n;
279
+ if (e.includes("\x1B"))
280
+ for (; n !== void 0; )
281
+ e = z(e, n.close, n.open), n = n.parent;
282
+ const r = e.indexOf(`
283
+ `);
284
+ return r !== -1 && (e = H(e, s, o, r)), o + e + s;
285
+ };
286
+ Object.defineProperties(m.prototype, p);
287
+ const ee = m();
288
+ m({ level: S ? S.level : 0 });
289
+ const te = c.createPrinter();
290
+ function ne(t) {
291
+ return te.printNode(c.EmitHint.Unspecified, t, void 0);
292
+ }
293
+ function oe(t, e) {
294
+ return t.pos !== -1 && t.end !== -1 && e !== void 0 ? t.getText(e) : ne(t);
295
+ }
296
+ let se = 0;
297
+ const re = /* @__PURE__ */ new Set();
298
+ let I = console.error;
299
+ function Ae(t) {
300
+ I = t;
301
+ }
302
+ const ie = {
303
+ getCurrentDirectory: process.cwd,
304
+ getCanonicalFileName: (t) => t,
305
+ getNewLine: () => c.sys.newLine
306
+ };
307
+ function le(t, { file: e, node: n, scope: o, start: s, length: r }) {
308
+ se += 1, process.exitCode = 1;
309
+ const i = e?.fileName;
310
+ i !== void 0 && re.add(i), s ??= n?.getStart(e, !1) ?? -1;
311
+ const a = n?.end ?? -1;
312
+ r ??= a === -1 ? -1 : Math.max(1, a - s);
313
+ const u = s >= 0 && r >= 0, g = !u && o !== void 0, b = {
314
+ category: c.DiagnosticCategory.Error,
315
+ code: u ? N : ce,
316
+ file: g ? void 0 : e,
317
+ start: u ? s : 0,
318
+ length: u ? r : 0,
319
+ messageText: (g ? `${ee.cyan(o)}: ` : "") + t + (u || n === void 0 ? "" : `
320
+
321
+ ${oe(n, e)}`)
322
+ }, O = c.formatDiagnosticsWithColorAndContext([b], ie), F = S ? O : O.replaceAll(ae, "");
323
+ I(F);
324
+ }
325
+ const ce = 1490, ae = /\x1B\[[0-9;]*m/gu;
326
+ class Ce {
327
+ constructor(e) {
328
+ this.options = e;
22
329
  }
23
330
  /** Given an array of TypeScript source files, generate an api.json file */
24
- extract(s) {
331
+ extract(e) {
25
332
  return {
26
333
  timestamp: (/* @__PURE__ */ new Date()).toISOString().split(".")[0],
27
334
  compiler: {
28
- name: h,
29
- version: g,
30
- typescriptVersion: a.version
335
+ name: N,
336
+ version: K,
337
+ typescriptVersion: c.version
31
338
  },
32
339
  schemaVersion: "1.0.0",
33
- modules: this.extractModules(s)
340
+ modules: this.extractModules(e)
34
341
  };
35
342
  }
36
- extractModules(s) {
37
- const t = [];
38
- for (const n of s)
39
- this.file = n, t.push(this.extractModule(n));
40
- return this.options.isFullApiExtraction && t.sort(v), t;
343
+ extractModules(e) {
344
+ const n = [];
345
+ for (const o of e)
346
+ this.file = o, n.push(this.extractModule(o));
347
+ return this.options.isFullApiExtraction && n.sort(W), n;
41
348
  }
42
- extractModule(s) {
43
- const t = {
349
+ extractModule(e) {
350
+ const n = {
44
351
  kind: "javascript-module",
45
- path: x.relative(this.options.cwd, s.fileName),
352
+ path: P.relative(this.options.cwd, e.fileName),
46
353
  declarations: void 0,
47
354
  exports: void 0
48
355
  };
49
- this.apiModule = t;
50
- const n = this.extractDeclarations(s);
51
- if (t.declarations = n, this.options.isFullApiExtraction) {
52
- const i = this.inferExports(n);
53
- i.length > 0 && (t.exports = i);
356
+ this.apiModule = n;
357
+ const o = this.extractDeclarations(e);
358
+ if (n.declarations = o, this.options.isFullApiExtraction) {
359
+ const s = this.inferExports(o);
360
+ s.length > 0 && (n.exports = s);
54
361
  }
55
- return t;
362
+ return n;
56
363
  }
57
364
  /**
58
365
  * For a given module, extract all public declarations.
59
366
  */
60
- extractDeclarations(s) {
61
- const t = [];
62
- for (const n of s.statements) {
63
- const i = this.extractDeclaration(n);
64
- i !== void 0 && t.push(i);
367
+ extractDeclarations(e) {
368
+ const n = [];
369
+ for (const o of e.statements) {
370
+ const s = this.extractDeclaration(o);
371
+ s !== void 0 && n.push(s);
65
372
  }
66
- return t;
373
+ return n;
67
374
  }
68
375
  /**
69
376
  * Infer ApiModule.exports based on ApiModule.declarations.
70
377
  */
71
- inferExports(s) {
72
- const t = [];
73
- for (const n of s) {
74
- const i = this.inferExport(n);
75
- i !== void 0 && t.push(i);
378
+ inferExports(e) {
379
+ const n = [];
380
+ for (const o of e) {
381
+ const s = this.inferExport(o);
382
+ s !== void 0 && n.push(s);
76
383
  }
77
- return t;
384
+ return n;
78
385
  }
79
- copyDoc(s, t, n) {
80
- const i = t.docsTags?.findIndex((r) => r.name === "copyDoc");
81
- if (i === void 0 || i === -1)
386
+ copyDoc(e, n, o, s) {
387
+ const r = o.docsTags?.findIndex((u) => u.name === "copyDoc");
388
+ if (r === void 0 || r === -1)
82
389
  return;
83
- if (s === void 0)
84
- throw Error(
85
- `The ${t.name} ${"kind" in t ? t.kind : "event"} in ${n.name} has @copyDoc tag, but failed to find copyDoc definition for it.`
86
- );
87
- const o = s?.(t, n);
88
- if (o === void 0)
390
+ n === void 0 && le("@copyDoc tag was used, but failed to find copyDoc definition for it.", {
391
+ file: this.file,
392
+ node: e
393
+ });
394
+ const i = n?.(o, s);
395
+ if (i === void 0)
89
396
  return;
90
- for (const [r, d] of Object.entries(o))
91
- r !== "docsTags" && (t[r] = t[r] ?? d);
92
- t.docsTags.splice(i, 1);
93
- const c = new Set(t.docsTags.map(({ name: r }) => r));
94
- for (const r of o.docsTags ?? [])
95
- c.has(r.name) && !T.has(r.name) || t.docsTags.push(r);
96
- t.docsTags.length === 0 && (t.docsTags = void 0);
397
+ for (const [u, g] of Object.entries(i))
398
+ u !== "docsTags" && (o[u] = o[u] ?? g);
399
+ o.docsTags.splice(r, 1);
400
+ const a = new Set(o.docsTags.map(({ name: u }) => u));
401
+ for (const u of i.docsTags ?? [])
402
+ a.has(u.name) && !G.has(u.name) || o.docsTags.push(u);
403
+ o.docsTags.length === 0 && (o.docsTags = void 0);
97
404
  }
98
405
  }
99
- const N = (e) => e.modifiers?.some?.(
100
- (s) => s.kind === a.SyntaxKind.StaticKeyword || s.kind === a.SyntaxKind.PrivateKeyword || s.kind === a.SyntaxKind.ProtectedKeyword
406
+ const Ee = (t) => t.modifiers?.some?.(
407
+ (e) => e.kind === c.SyntaxKind.StaticKeyword || e.kind === c.SyntaxKind.PrivateKeyword || e.kind === c.SyntaxKind.ProtectedKeyword
101
408
  ) ?? !1;
102
- function O(e, s, t) {
103
- if (!s.default && "initializer" in e && e.initializer) {
104
- const n = u(e.initializer);
105
- y(n) && (s.default = n.getText(t));
409
+ function Oe(t, e, n) {
410
+ if (!e.default && "initializer" in t && t.initializer) {
411
+ const o = L(t.initializer);
412
+ ue(o) && (e.default = o.getText(n));
106
413
  }
107
414
  }
108
- const y = (e) => a.isLiteralExpression(e) || e.kind === a.SyntaxKind.TrueKeyword || e.kind === a.SyntaxKind.FalseKeyword || a.isPrefixUnaryExpression(e) && a.isLiteralExpression(e.operand);
109
- function u(e) {
110
- return a.isSatisfiesExpression(e) || a.isParenthesizedExpression(e) ? u(e.expression) : e;
415
+ const ue = (t) => c.isLiteralExpression(t) || t.kind === c.SyntaxKind.TrueKeyword || t.kind === c.SyntaxKind.FalseKeyword || c.isPrefixUnaryExpression(t) && c.isLiteralExpression(t.operand);
416
+ function L(t) {
417
+ return c.isSatisfiesExpression(t) || c.isParenthesizedExpression(t) ? L(t.expression) : t;
111
418
  }
112
- function b(e) {
113
- if (e !== void 0 && (a.isIdentifier(e) || a.isStringLiteralLike(e)))
114
- return e.text;
419
+ function Me(t) {
420
+ if (t !== void 0 && (c.isIdentifier(t) || c.isStringLiteralLike(t)))
421
+ return t.text;
115
422
  }
116
- const W = ({ modifiers: e = [] }, s) => m(
117
- e,
118
- (t) => a.isDecorator(t) && a.isCallExpression(t.expression) && a.isIdentifier(t.expression.expression) && t.expression.expression.text === s ? t.expression : void 0
423
+ const ke = ({ modifiers: t = [] }, e) => R(
424
+ t,
425
+ (n) => c.isDecorator(n) && c.isCallExpression(n.expression) && c.isIdentifier(n.expression.expression) && n.expression.expression.text === e ? n.expression : void 0
119
426
  );
120
- function S(e, s) {
121
- const t = $(s.getJsDocTags());
122
- let n = a.displayPartsToString(s.getDocumentationComment(e));
123
- const i = t.at(-1), o = i?.text?.indexOf(k);
124
- if (o !== void 0 && o !== -1) {
125
- const c = i.text.indexOf(D);
126
- c !== -1 && (n += i.text.slice(c), i.text = i.text?.slice(0, c));
427
+ function de(t, e) {
428
+ const n = ge(e.getJsDocTags());
429
+ let o = c.displayPartsToString(e.getDocumentationComment(t));
430
+ const s = n.at(-1), r = s?.text?.indexOf(pe);
431
+ if (r !== void 0 && r !== -1) {
432
+ const i = s.text.indexOf(fe);
433
+ i !== -1 && (o += s.text.slice(i), s.text = s.text?.slice(0, i));
127
434
  }
128
435
  return {
129
- docsTags: t,
130
- description: n || void 0
436
+ docsTags: n,
437
+ description: o || void 0
131
438
  };
132
439
  }
133
- const D = `
440
+ const fe = `
134
441
 
135
- {@link `, k = "Read more...}", $ = (e) => e.map((s) => ({
136
- name: s.name,
137
- text: s.text?.map((t) => t.text).join("")
442
+ {@link `, pe = "Read more...}", ge = (t) => t.filter((e) => e.name !== "privateRemarks").map((e) => ({
443
+ name: e.name,
444
+ text: e.text?.map((n) => n.text).join("")
138
445
  }));
139
- function J(e) {
140
- const s = Array.from(e.docsTags ?? []), t = e, n = e;
141
- if (e.deprecated && s.push({
446
+ function we(t) {
447
+ const e = Array.from(t.docsTags ?? []), n = t, o = t;
448
+ if (t.deprecated && e.push({
142
449
  name: "deprecated",
143
- text: e.deprecated === !0 ? void 0 : e.deprecated
144
- }), t.default && s.push({
450
+ text: t.deprecated === !0 ? void 0 : t.deprecated
451
+ }), n.default && e.push({
145
452
  name: "default",
146
- text: t.default
147
- }), n.cssParts)
148
- for (const o of n.cssParts)
149
- s.push({
453
+ text: n.default
454
+ }), o.cssParts)
455
+ for (const r of o.cssParts)
456
+ e.push({
150
457
  name: "csspart",
151
- text: f(o)
458
+ text: T(r)
152
459
  });
153
- if (n.cssStates)
154
- for (const o of n.cssStates)
155
- s.push({
460
+ if (o.cssStates)
461
+ for (const r of o.cssStates)
462
+ e.push({
156
463
  name: "cssstate",
157
- text: f(o)
464
+ text: T(r)
158
465
  });
159
- if (n.slots)
160
- for (const o of n.slots)
161
- s.push({
466
+ if (o.slots)
467
+ for (const r of o.slots)
468
+ e.push({
162
469
  name: "slot",
163
- text: f(o)
470
+ text: T(r)
164
471
  });
165
- n.privacy === "private" && s.push({
472
+ o.privacy === "private" && e.push({
166
473
  name: "private",
167
474
  text: void 0
168
475
  });
169
- const i = e.description ?? "";
170
- return s.length === 0 && i.length === 0 ? [] : [E(i, s)];
476
+ const s = t.description ?? "";
477
+ return e.length === 0 && s.length === 0 ? [] : [he(s, e)];
171
478
  }
172
- function E(e = "", s = []) {
479
+ function he(t = "", e = []) {
173
480
  return {
174
- kind: a.SyntaxKind.MultiLineCommentTrivia,
481
+ kind: c.SyntaxKind.MultiLineCommentTrivia,
175
482
  pos: -1,
176
483
  end: -1,
177
- text: I(e, s),
484
+ text: me(t, e),
178
485
  hasTrailingNewLine: !0
179
486
  };
180
487
  }
181
- function I(e = "", s = []) {
182
- const t = e === "" ? [] : e.split(`
183
- `), i = t.length + s.length > 1 || (s.at(0)?.text?.includes(`
488
+ function me(t = "", e = []) {
489
+ const n = t === "" ? [] : t.split(`
490
+ `), s = n.length + e.length > 1 || (e.at(0)?.text?.includes(`
184
491
  `) ?? !1);
185
- return `*${i ? t.map((o) => `
186
- * ${o}`).join("") : ` ${e}`}${t.length > 0 && s.length > 0 ? `
187
- *` : ""}${s.map((o) => {
188
- const c = `@${o.name}`, r = o.text ?? "", d = o.text?.includes(`
492
+ return `*${s ? n.map((r) => `
493
+ * ${r}`).join("") : ` ${t}`}${n.length > 0 && e.length > 0 ? `
494
+ *` : ""}${e.map((r) => {
495
+ const i = `@${r.name}`, a = r.text ?? "", u = r.text?.includes(`
189
496
  `) ?? !1;
190
- return `${i ? `
191
- * ` : ""}${c}${d ? r.split(`
192
- `).map((p) => `
193
- * ${p}`).join("") : r.length > 0 ? ` ${r}` : ""}`;
194
- }).join("")}${i ? `
497
+ return `${s ? `
498
+ * ` : ""}${i}${u ? a.split(`
499
+ `).map((b) => `
500
+ * ${b}`).join("") : a.length > 0 ? ` ${a}` : ""}`;
501
+ }).join("")}${s ? `
195
502
  ` : ""} `;
196
503
  }
197
- function V(e, s, t, n) {
198
- const i = s.getSymbolAtLocation(e);
199
- if (n ??= i === void 0 ? void 0 : S(s, i), n !== void 0) {
200
- for (const o of n.docsTags) {
201
- const { name: c, text: r } = o;
202
- c === "deprecated" ? t.deprecated = r || !0 : c === "default" ? t.default = r : c === "readonly" ? t.readonly = !0 : c === "private" ? t.privacy = "private" : c === "csspart" ? t.cssParts.push(l(r)) : c === "cssstate" ? t.cssStates.push(l(r)) : c === "slot" ? t.slots.push(l(r)) : (t.docsTags ??= [], t.docsTags.push(o));
504
+ function Be(t, e, n, o) {
505
+ const s = e.getSymbolAtLocation(t);
506
+ if (o ??= s === void 0 ? void 0 : de(e, s), o !== void 0) {
507
+ for (const r of o.docsTags) {
508
+ const { name: i, text: a } = r;
509
+ i === "deprecated" ? n.deprecated = a || !0 : i === "default" ? n.default = a : i === "readonly" ? n.readonly = !0 : i === "private" ? n.privacy = "private" : i === "csspart" ? n.cssParts.push(y(a)) : i === "cssstate" ? n.cssStates.push(y(a)) : i === "slot" ? n.slots.push(y(a)) : (n.docsTags ??= [], n.docsTags.push(r));
203
510
  }
204
- t.description = n.description;
511
+ n.description = o.description;
205
512
  }
206
513
  }
207
- function l(e) {
208
- if (e === void 0)
514
+ function y(t) {
515
+ if (t === void 0)
209
516
  return { name: "" };
210
- const s = e.indexOf(" - ");
211
- if (s === -1)
212
- return e.startsWith("- ") ? { name: "", description: e.slice(2) } : { name: e };
213
- let t, n = e.slice(0, s);
214
- if (n.startsWith("[") && n.endsWith("]")) {
215
- const o = n.slice(1, -1), c = o.indexOf("=");
216
- n = o.slice(0, c), t = o.slice(c + 1);
217
- }
218
- const i = e.slice(s + 3);
517
+ const e = t.indexOf(" - ");
518
+ if (e === -1)
519
+ return t.startsWith("- ") ? { name: "", description: t.slice(2) } : { name: t };
520
+ let n, o = t.slice(0, e);
521
+ if (o.startsWith("[") && o.endsWith("]")) {
522
+ const r = o.slice(1, -1), i = r.indexOf("=");
523
+ o = r.slice(0, i), n = r.slice(i + 1);
524
+ }
525
+ const s = t.slice(e + 3);
219
526
  return {
220
- name: n,
221
- default: t,
222
- description: i
527
+ name: o,
528
+ default: n,
529
+ description: s
223
530
  };
224
531
  }
225
- function f(e) {
226
- const s = e.name + (e.default !== void 0 ? `=${e.default}` : ""), t = s.length > 0 ? `[${s}]` : "", n = e.description ?? "", i = n.length > 0 ? ` - ${n}` : "";
227
- return `${t}${i}`;
532
+ function T(t) {
533
+ const e = t.name + (t.default !== void 0 ? `=${t.default}` : ""), n = e.length > 0 ? `[${e}]` : "", o = t.description ?? "", s = o.length > 0 ? ` - ${o}` : "";
534
+ return `${n}${s}`;
228
535
  }
229
536
  export {
230
- F as ApiExtractor,
231
- J as apiMemberToSynthesizedComments,
232
- W as findDecorator,
233
- b as getMemberName,
234
- C as globalPackageIdentifier,
235
- N as hasIgnoredModifier,
236
- j as isApiMethod,
237
- A as isApiProperty,
238
- T as multipleJsDocTags,
239
- V as setApiDocFromJsDoc,
240
- O as setDefaultFromInitializer,
241
- S as symbolToDocs
537
+ Ce as ApiExtractor,
538
+ le as apiExtractorError,
539
+ se as apiExtractorErrorCount,
540
+ re as apiExtractorErrorFiles,
541
+ we as apiMemberToSynthesizedComments,
542
+ oe as debugPrintNode,
543
+ ke as findDecorator,
544
+ Me as getMemberName,
545
+ Se as globalPackageIdentifier,
546
+ Ee as hasIgnoredModifier,
547
+ ye as isApiMethod,
548
+ Te as isApiProperty,
549
+ G as multipleJsDocTags,
550
+ ne as printNode,
551
+ Be as setApiDocFromJsDoc,
552
+ Ae as setApiExtractorErrorLogger,
553
+ Oe as setDefaultFromInitializer,
554
+ de as symbolToDocs
242
555
  };
@@ -0,0 +1,12 @@
1
+ import { default as ts } from 'typescript';
2
+ export declare let apiExtractorErrorCount: number;
3
+ export declare const apiExtractorErrorFiles: Set<string>;
4
+ export declare function setApiExtractorErrorLogger(logger: (msg: string) => void): void;
5
+ export interface ApiExtractorErrorContext {
6
+ file: ts.SourceFile | undefined;
7
+ node: ts.Node | undefined;
8
+ scope?: string;
9
+ start?: number;
10
+ length?: number;
11
+ }
12
+ export declare function apiExtractorError(message: string, { file, node, scope, start, length }: ApiExtractorErrorContext): void;
@@ -0,0 +1,7 @@
1
+ import { default as ts } from 'typescript';
2
+ export declare function printNode(node: ts.Node): string;
3
+ /**
4
+ * For usage in error messages. Print original node text if available. Otherwise,
5
+ * print the AST.
6
+ */
7
+ export declare function debugPrintNode(node: ts.Node, sourceFile: ts.SourceFile | undefined): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/api-extractor",
3
- "version": "4.34.0-next.98",
3
+ "version": "4.34.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -14,8 +14,8 @@
14
14
  ],
15
15
  "license": "SEE LICENSE IN LICENSE.md",
16
16
  "dependencies": {
17
- "@arcgis/components-build-utils": "4.34.0-next.98",
18
- "@arcgis/toolkit": "4.34.0-next.98",
17
+ "@arcgis/components-build-utils": "4.34.0",
18
+ "@arcgis/toolkit": "4.34.0",
19
19
  "tslib": "^2.8.1",
20
20
  "typescript": "~5.8.3"
21
21
  }