@arcgis/api-extractor 4.34.0-next.99 → 5.0.0-next.1
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 +17 -0
- package/README.md +2 -14
- package/dist/extractor/index.d.ts +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.js +473 -160
- package/dist/utils/error.d.ts +12 -0
- package/dist/utils/print.d.ts +7 -0
- package/package.json +3 -3
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 ©
|
|
11
|
+
COPYRIGHT © Esri
|
|
12
12
|
|
|
13
|
-
|
|
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
|
|
2
|
-
import { path as
|
|
3
|
-
import { mappedFind as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return
|
|
8
|
-
}
|
|
9
|
-
const
|
|
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 = "5.0.0-next.1", 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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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(
|
|
331
|
+
extract(e) {
|
|
25
332
|
return {
|
|
26
333
|
timestamp: (/* @__PURE__ */ new Date()).toISOString().split(".")[0],
|
|
27
334
|
compiler: {
|
|
28
|
-
name:
|
|
29
|
-
version:
|
|
30
|
-
typescriptVersion:
|
|
335
|
+
name: N,
|
|
336
|
+
version: K,
|
|
337
|
+
typescriptVersion: c.version
|
|
31
338
|
},
|
|
32
339
|
schemaVersion: "1.0.0",
|
|
33
|
-
modules: this.extractModules(
|
|
340
|
+
modules: this.extractModules(e)
|
|
34
341
|
};
|
|
35
342
|
}
|
|
36
|
-
extractModules(
|
|
37
|
-
const
|
|
38
|
-
for (const
|
|
39
|
-
this.file =
|
|
40
|
-
return this.options.isFullApiExtraction &&
|
|
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(
|
|
43
|
-
const
|
|
349
|
+
extractModule(e) {
|
|
350
|
+
const n = {
|
|
44
351
|
kind: "javascript-module",
|
|
45
|
-
path:
|
|
352
|
+
path: P.relative(this.options.cwd, e.fileName),
|
|
46
353
|
declarations: void 0,
|
|
47
354
|
exports: void 0
|
|
48
355
|
};
|
|
49
|
-
this.apiModule =
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
const
|
|
53
|
-
|
|
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
|
|
362
|
+
return n;
|
|
56
363
|
}
|
|
57
364
|
/**
|
|
58
365
|
* For a given module, extract all public declarations.
|
|
59
366
|
*/
|
|
60
|
-
extractDeclarations(
|
|
61
|
-
const
|
|
62
|
-
for (const
|
|
63
|
-
const
|
|
64
|
-
|
|
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
|
|
373
|
+
return n;
|
|
67
374
|
}
|
|
68
375
|
/**
|
|
69
376
|
* Infer ApiModule.exports based on ApiModule.declarations.
|
|
70
377
|
*/
|
|
71
|
-
inferExports(
|
|
72
|
-
const
|
|
73
|
-
for (const
|
|
74
|
-
const
|
|
75
|
-
|
|
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
|
|
384
|
+
return n;
|
|
78
385
|
}
|
|
79
|
-
copyDoc(
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
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 [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
for (const
|
|
95
|
-
|
|
96
|
-
|
|
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
|
|
100
|
-
(
|
|
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
|
|
103
|
-
if (!
|
|
104
|
-
const
|
|
105
|
-
|
|
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
|
|
109
|
-
function
|
|
110
|
-
return
|
|
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
|
|
113
|
-
if (
|
|
114
|
-
return
|
|
419
|
+
function Me(t) {
|
|
420
|
+
if (t !== void 0 && (c.isIdentifier(t) || c.isStringLiteralLike(t)))
|
|
421
|
+
return t.text;
|
|
115
422
|
}
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
(
|
|
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
|
|
121
|
-
const
|
|
122
|
-
let
|
|
123
|
-
const
|
|
124
|
-
if (
|
|
125
|
-
const
|
|
126
|
-
|
|
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:
|
|
130
|
-
description:
|
|
436
|
+
docsTags: n,
|
|
437
|
+
description: o || void 0
|
|
131
438
|
};
|
|
132
439
|
}
|
|
133
|
-
const
|
|
440
|
+
const fe = `
|
|
134
441
|
|
|
135
|
-
{@link `,
|
|
136
|
-
name:
|
|
137
|
-
text:
|
|
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
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
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:
|
|
144
|
-
}),
|
|
450
|
+
text: t.deprecated === !0 ? void 0 : t.deprecated
|
|
451
|
+
}), n.default && e.push({
|
|
145
452
|
name: "default",
|
|
146
|
-
text:
|
|
147
|
-
}),
|
|
148
|
-
for (const
|
|
149
|
-
|
|
453
|
+
text: n.default
|
|
454
|
+
}), o.cssParts)
|
|
455
|
+
for (const r of o.cssParts)
|
|
456
|
+
e.push({
|
|
150
457
|
name: "csspart",
|
|
151
|
-
text:
|
|
458
|
+
text: T(r)
|
|
152
459
|
});
|
|
153
|
-
if (
|
|
154
|
-
for (const
|
|
155
|
-
|
|
460
|
+
if (o.cssStates)
|
|
461
|
+
for (const r of o.cssStates)
|
|
462
|
+
e.push({
|
|
156
463
|
name: "cssstate",
|
|
157
|
-
text:
|
|
464
|
+
text: T(r)
|
|
158
465
|
});
|
|
159
|
-
if (
|
|
160
|
-
for (const
|
|
161
|
-
|
|
466
|
+
if (o.slots)
|
|
467
|
+
for (const r of o.slots)
|
|
468
|
+
e.push({
|
|
162
469
|
name: "slot",
|
|
163
|
-
text:
|
|
470
|
+
text: T(r)
|
|
164
471
|
});
|
|
165
|
-
|
|
472
|
+
o.privacy === "private" && e.push({
|
|
166
473
|
name: "private",
|
|
167
474
|
text: void 0
|
|
168
475
|
});
|
|
169
|
-
const
|
|
170
|
-
return
|
|
476
|
+
const s = t.description ?? "";
|
|
477
|
+
return e.length === 0 && s.length === 0 ? [] : [he(s, e)];
|
|
171
478
|
}
|
|
172
|
-
function
|
|
479
|
+
function he(t = "", e = []) {
|
|
173
480
|
return {
|
|
174
|
-
kind:
|
|
481
|
+
kind: c.SyntaxKind.MultiLineCommentTrivia,
|
|
175
482
|
pos: -1,
|
|
176
483
|
end: -1,
|
|
177
|
-
text:
|
|
484
|
+
text: me(t, e),
|
|
178
485
|
hasTrailingNewLine: !0
|
|
179
486
|
};
|
|
180
487
|
}
|
|
181
|
-
function
|
|
182
|
-
const
|
|
183
|
-
`),
|
|
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 `*${
|
|
186
|
-
* ${
|
|
187
|
-
*` : ""}${
|
|
188
|
-
const
|
|
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 `${
|
|
191
|
-
* ` : ""}${
|
|
192
|
-
`).map((
|
|
193
|
-
* ${
|
|
194
|
-
}).join("")}${
|
|
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
|
|
198
|
-
const
|
|
199
|
-
if (
|
|
200
|
-
for (const
|
|
201
|
-
const { name:
|
|
202
|
-
|
|
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
|
-
|
|
511
|
+
n.description = o.description;
|
|
205
512
|
}
|
|
206
513
|
}
|
|
207
|
-
function
|
|
208
|
-
if (
|
|
514
|
+
function y(t) {
|
|
515
|
+
if (t === void 0)
|
|
209
516
|
return { name: "" };
|
|
210
|
-
const
|
|
211
|
-
if (
|
|
212
|
-
return
|
|
213
|
-
let
|
|
214
|
-
if (
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
const
|
|
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:
|
|
221
|
-
default:
|
|
222
|
-
description:
|
|
527
|
+
name: o,
|
|
528
|
+
default: n,
|
|
529
|
+
description: s
|
|
223
530
|
};
|
|
224
531
|
}
|
|
225
|
-
function
|
|
226
|
-
const
|
|
227
|
-
return `${
|
|
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
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
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": "
|
|
3
|
+
"version": "5.0.0-next.1",
|
|
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": "
|
|
18
|
-
"@arcgis/toolkit": "
|
|
17
|
+
"@arcgis/components-build-utils": "5.0.0-next.1",
|
|
18
|
+
"@arcgis/toolkit": "5.0.0-next.1",
|
|
19
19
|
"tslib": "^2.8.1",
|
|
20
20
|
"typescript": "~5.8.3"
|
|
21
21
|
}
|