@arcgis/api-extractor 5.2.0-next.13 → 5.2.0-next.130
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 +4 -2
- package/README.md +2 -2
- package/dist/apiJson.d.ts +13 -57
- package/dist/chunks/ApiExtractor.js +6498 -0
- package/dist/{cli-7PX_wNxb.js → chunks/cli.js} +3 -3
- package/dist/chunks/config.js +193 -0
- package/dist/chunks/links.js +412 -0
- package/dist/{privateContext-CB7P40up.js → chunks/privateContext.js} +12 -10
- package/dist/cli.js +1 -1
- package/dist/diff/apiDiffToMarkdown.js +1 -1
- package/dist/diff/diffApiJson.js +108 -113
- package/dist/diffTypes/index.js +1 -1
- package/dist/extractor/ApiExtractor.d.ts +3 -0
- package/dist/extractor/ApiExtractor.js +4 -5
- package/dist/extractor/config.d.ts +23 -6
- package/dist/extractor/config.js +9 -14
- package/dist/extractor/processing/links.js +12 -171
- package/dist/extractor/webComponent/pathMapping.js +1 -1
- package/dist/utils/apiHelpers.js +1 -1
- package/dist/utils/hydrateApiType.d.ts +1 -1
- package/dist/utils/partPrinter.js +18 -18
- package/dist/vite/plugin.d.ts +3 -1
- package/dist/vite/plugin.js +10 -11
- package/package.json +10 -9
- package/dist/ApiExtractor-DvPsb5qn.js +0 -2718
- package/dist/typeScript-DX5Qih0X.js +0 -66
- package/dist/vite/typeScript.d.ts +0 -16
- package/dist/vite/typeScript.js +0 -6
- package/dist/worker-BKxM34wj.js +0 -3736
package/dist/diff/diffApiJson.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
function w(
|
|
2
|
-
if (
|
|
1
|
+
function w(r, a) {
|
|
2
|
+
if (r.compiler?.name !== "@arcgis/core:manual" || r.compiler?.version !== "4.34")
|
|
3
3
|
return;
|
|
4
|
-
const
|
|
5
|
-
return
|
|
6
|
-
|
|
4
|
+
const o = {};
|
|
5
|
+
return r.modules.forEach((t) => {
|
|
6
|
+
o[t.path] = t;
|
|
7
7
|
}), {
|
|
8
|
-
...
|
|
9
|
-
modules:
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
if (
|
|
8
|
+
...a,
|
|
9
|
+
modules: a.modules.filter((t) => {
|
|
10
|
+
const e = o[t.path];
|
|
11
|
+
return t.declarations = t.declarations.filter((n) => {
|
|
12
|
+
if (n.kind === "mixin")
|
|
13
13
|
return !1;
|
|
14
|
-
if (
|
|
15
|
-
const
|
|
16
|
-
(d) => d.name ===
|
|
14
|
+
if (n.kind === "interface") {
|
|
15
|
+
const s = e?.declarations.find(
|
|
16
|
+
(d) => d.name === n.name && d.kind === "interface"
|
|
17
17
|
);
|
|
18
|
-
return
|
|
18
|
+
return n.members = void 0, s !== void 0;
|
|
19
19
|
}
|
|
20
20
|
return !0;
|
|
21
|
-
}),
|
|
21
|
+
}), t.declarations.length > 0;
|
|
22
22
|
})
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
function x(
|
|
26
|
-
const
|
|
25
|
+
function x(r) {
|
|
26
|
+
const a = /* @__PURE__ */ new Set([
|
|
27
27
|
// Fake class turned into a variable
|
|
28
28
|
"config",
|
|
29
29
|
// Wasn't visible directly before due to doc mismatch
|
|
@@ -38,13 +38,13 @@ function x(i) {
|
|
|
38
38
|
"views/layers/PointCloudLayerView",
|
|
39
39
|
// ENUM-like objects turned into const variable + interfaces
|
|
40
40
|
"layers/support/rasterFunctionConstants"
|
|
41
|
-
]),
|
|
42
|
-
if (
|
|
41
|
+
]), o = r.modules.filter((i) => {
|
|
42
|
+
if (a.has(i.path))
|
|
43
43
|
return !1;
|
|
44
|
-
const
|
|
45
|
-
return
|
|
44
|
+
const t = i.path.startsWith("widgets/");
|
|
45
|
+
return i.declarations = i.declarations.filter((e) => t ? e.deprecated === void 0 && e.removed === void 0 ? !1 : ((e.kind === "class" || e.kind === "interface" || e.kind === "mixin") && (e.members = void 0), !0) : e.kind === "class" ? e.members === void 0 ? !0 : (e.members = e.members.filter((n) => !(n.kind === "constructor" || n.kind === "call-signature" || A.has(n.name))), e.members.length > 0) : !0), i.declarations.length > 0;
|
|
46
46
|
});
|
|
47
|
-
return { ...
|
|
47
|
+
return { ...r, modules: o };
|
|
48
48
|
}
|
|
49
49
|
const A = /* @__PURE__ */ new Set([
|
|
50
50
|
// Excluded from api.json inheritance to keep file size in check
|
|
@@ -96,44 +96,44 @@ const A = /* @__PURE__ */ new Set([
|
|
|
96
96
|
// 6
|
|
97
97
|
"loadWarnings"
|
|
98
98
|
]);
|
|
99
|
-
function
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
b(d,
|
|
99
|
+
function I(r, a) {
|
|
100
|
+
const o = w(r, a), i = o ?? a, t = r.compiler?.version.startsWith("4.") === !0 && i.compiler?.version.startsWith("4.") !== !0, e = new Map(
|
|
101
|
+
r.modules.map((d) => [
|
|
102
|
+
b(d, t),
|
|
103
103
|
d
|
|
104
104
|
])
|
|
105
|
-
),
|
|
106
|
-
for (const d of
|
|
107
|
-
const l =
|
|
108
|
-
m !== void 0 &&
|
|
105
|
+
), n = [];
|
|
106
|
+
for (const d of i.modules) {
|
|
107
|
+
const l = e.get(d.path), m = y(l, d, !0);
|
|
108
|
+
m !== void 0 && n.push(m), e.delete(d.path);
|
|
109
109
|
}
|
|
110
|
-
for (const d of
|
|
110
|
+
for (const d of e.values()) {
|
|
111
111
|
const l = y(
|
|
112
112
|
void 0,
|
|
113
|
-
|
|
113
|
+
t ? { ...d, path: b(d, t) } : d,
|
|
114
114
|
!1
|
|
115
115
|
);
|
|
116
|
-
l !== void 0 &&
|
|
116
|
+
l !== void 0 && n.push(l);
|
|
117
117
|
}
|
|
118
|
-
const
|
|
119
|
-
return
|
|
118
|
+
const s = { modules: n };
|
|
119
|
+
return o === void 0 ? s : x(s);
|
|
120
120
|
}
|
|
121
|
-
function b(
|
|
122
|
-
return
|
|
121
|
+
function b(r, a) {
|
|
122
|
+
return a ? r.declarations?.[0]?.importPath ?? r.path : r.path;
|
|
123
123
|
}
|
|
124
|
-
function y(
|
|
125
|
-
const
|
|
126
|
-
for (const
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
const g = m === void 0 && !
|
|
124
|
+
function y(r, a, o) {
|
|
125
|
+
const i = [], t = h(r?.declarations ?? []), e = h(a.declarations ?? []);
|
|
126
|
+
for (const n of e.values()) {
|
|
127
|
+
const s = n.at(-1), d = s.tagName, l = d ?? s.name, m = t.get(l);
|
|
128
|
+
t.delete(l);
|
|
129
|
+
const g = m === void 0 && !o ? !0 : void 0, v = (
|
|
130
130
|
// Only mark as deprecated if all overloads are deprecated
|
|
131
|
-
|
|
132
|
-
), k = !v && m === void 0 &&
|
|
131
|
+
n.length === 1 || n.every((c) => c.deprecated !== void 0) ? s.deprecated : void 0
|
|
132
|
+
), k = !v && m === void 0 && o ? !0 : void 0;
|
|
133
133
|
if (g || k) {
|
|
134
|
-
|
|
135
|
-
kind:
|
|
136
|
-
name:
|
|
134
|
+
i.push({
|
|
135
|
+
kind: s.kind,
|
|
136
|
+
name: s.name,
|
|
137
137
|
tagName: d,
|
|
138
138
|
members: void 0,
|
|
139
139
|
removed: g,
|
|
@@ -141,10 +141,10 @@ function y(i, o, a) {
|
|
|
141
141
|
deprecated: v
|
|
142
142
|
});
|
|
143
143
|
continue;
|
|
144
|
-
} else if (!
|
|
144
|
+
} else if (!o)
|
|
145
145
|
continue;
|
|
146
146
|
if (d !== void 0) {
|
|
147
|
-
const c =
|
|
147
|
+
const c = s, u = m?.[0], f = {
|
|
148
148
|
kind: c.kind,
|
|
149
149
|
name: c.name,
|
|
150
150
|
tagName: c.tagName,
|
|
@@ -158,108 +158,103 @@ function y(i, o, a) {
|
|
|
158
158
|
cssProperties: p(u?.cssProperties, c.cssProperties),
|
|
159
159
|
cssStates: p(u?.cssStates, c.cssStates)
|
|
160
160
|
};
|
|
161
|
-
(v !== void 0 || f.members !== void 0 || f.events !== void 0 || f.slots !== void 0 || f.cssParts !== void 0 || f.cssProperties !== void 0 || f.cssStates !== void 0) &&
|
|
162
|
-
} else if (
|
|
161
|
+
(v !== void 0 || f.members !== void 0 || f.events !== void 0 || f.slots !== void 0 || f.cssParts !== void 0 || f.cssProperties !== void 0 || f.cssStates !== void 0) && i.push(f);
|
|
162
|
+
} else if (s.kind === "class" || s.kind === "interface" || s.kind === "mixin") {
|
|
163
163
|
const c = m?.[0], u = {
|
|
164
|
-
kind:
|
|
165
|
-
name:
|
|
164
|
+
kind: s.kind,
|
|
165
|
+
name: s.name,
|
|
166
166
|
deprecated: v,
|
|
167
167
|
added: void 0,
|
|
168
168
|
removed: void 0,
|
|
169
|
-
members: M(c?.members,
|
|
170
|
-
events: "events" in
|
|
169
|
+
members: M(c?.members, s.members),
|
|
170
|
+
events: "events" in s ? p(c?.events, s.events) : void 0
|
|
171
171
|
};
|
|
172
|
-
(v !== void 0 || u.members !== void 0 || u.events !== void 0) &&
|
|
173
|
-
} else v !== void 0 &&
|
|
174
|
-
kind:
|
|
175
|
-
name:
|
|
172
|
+
(v !== void 0 || u.members !== void 0 || u.events !== void 0) && i.push(u);
|
|
173
|
+
} else v !== void 0 && i.push({
|
|
174
|
+
kind: s.kind,
|
|
175
|
+
name: s.name,
|
|
176
176
|
deprecated: v,
|
|
177
177
|
added: void 0,
|
|
178
178
|
removed: void 0
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
if (
|
|
182
|
-
for (const [
|
|
183
|
-
|
|
184
|
-
kind:
|
|
185
|
-
name:
|
|
186
|
-
tagName:
|
|
181
|
+
if (o)
|
|
182
|
+
for (const [n] of t.values())
|
|
183
|
+
i.push({
|
|
184
|
+
kind: n.kind,
|
|
185
|
+
name: n.name,
|
|
186
|
+
tagName: n.tagName,
|
|
187
187
|
members: void 0,
|
|
188
188
|
removed: !0,
|
|
189
189
|
added: void 0,
|
|
190
|
-
deprecated:
|
|
190
|
+
deprecated: n.deprecated
|
|
191
191
|
});
|
|
192
|
-
if (
|
|
192
|
+
if (i.length !== 0)
|
|
193
193
|
return {
|
|
194
|
-
path:
|
|
195
|
-
declarations:
|
|
194
|
+
path: a.path,
|
|
195
|
+
declarations: i
|
|
196
196
|
};
|
|
197
197
|
}
|
|
198
|
-
function h(
|
|
199
|
-
const
|
|
200
|
-
for (let
|
|
201
|
-
const
|
|
202
|
-
P(
|
|
198
|
+
function h(r) {
|
|
199
|
+
const a = /* @__PURE__ */ new Map();
|
|
200
|
+
for (let o = 0; o < r.length; ++o) {
|
|
201
|
+
const i = r[o], t = i.tagName ?? i.name ?? i.kind, e = a.get(t);
|
|
202
|
+
P(i.docsTags) || (e === void 0 ? a.set(t, [i]) : e.push(i));
|
|
203
203
|
}
|
|
204
|
-
return
|
|
204
|
+
return a;
|
|
205
205
|
}
|
|
206
|
-
function P(
|
|
207
|
-
if (
|
|
208
|
-
for (let
|
|
209
|
-
if (
|
|
206
|
+
function P(r) {
|
|
207
|
+
if (r !== void 0) {
|
|
208
|
+
for (let a = 0; a < r.length; ++a)
|
|
209
|
+
if (r[a].name === "internal")
|
|
210
210
|
return !0;
|
|
211
211
|
}
|
|
212
212
|
return !1;
|
|
213
213
|
}
|
|
214
|
-
function p(
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
name: e.name,
|
|
223
|
-
deprecated: e.deprecated
|
|
224
|
-
}), a.delete(e.name);
|
|
225
|
-
for (const [e] of a.values())
|
|
226
|
-
n.push({
|
|
214
|
+
function p(r, a) {
|
|
215
|
+
const o = h(r ?? []), i = h(a ?? []), t = [];
|
|
216
|
+
for (const [e, n] of i) {
|
|
217
|
+
const s = n.at(-1), d = o.get(e)?.at(-1);
|
|
218
|
+
o.delete(e), d === void 0 ? t.push({ name: e, added: !0 }) : s.deprecated && t.push({ name: e, deprecated: s.deprecated });
|
|
219
|
+
}
|
|
220
|
+
for (const [e] of o.values())
|
|
221
|
+
t.push({
|
|
227
222
|
name: e.name,
|
|
228
223
|
removed: !0,
|
|
229
224
|
deprecated: e.deprecated
|
|
230
225
|
});
|
|
231
|
-
return
|
|
226
|
+
return t.length ? t : void 0;
|
|
232
227
|
}
|
|
233
|
-
function M(
|
|
234
|
-
const
|
|
235
|
-
for (const [
|
|
236
|
-
const
|
|
237
|
-
|
|
228
|
+
function M(r, a) {
|
|
229
|
+
const o = h(r ?? []), i = h(a ?? []), t = [];
|
|
230
|
+
for (const [e, n] of i.entries()) {
|
|
231
|
+
const s = n.at(-1), d = o.get(e);
|
|
232
|
+
o.delete(e);
|
|
238
233
|
const l = (
|
|
239
234
|
// Only mark as deprecated if all overloads are deprecated
|
|
240
|
-
|
|
241
|
-
), m =
|
|
242
|
-
l ?
|
|
243
|
-
kind:
|
|
235
|
+
n.length === 1 || n.every((g) => g.deprecated !== void 0) ? s.deprecated : void 0
|
|
236
|
+
), m = e === "constructor" || e === "call-signature" ? void 0 : e;
|
|
237
|
+
l ? t.push({
|
|
238
|
+
kind: s.kind,
|
|
244
239
|
name: m,
|
|
245
240
|
deprecated: l
|
|
246
|
-
}) : d === void 0 &&
|
|
247
|
-
kind:
|
|
241
|
+
}) : d === void 0 && t.push({
|
|
242
|
+
kind: s.kind,
|
|
248
243
|
name: m,
|
|
249
244
|
added: !0
|
|
250
245
|
});
|
|
251
246
|
}
|
|
252
|
-
for (const [
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
kind:
|
|
256
|
-
name:
|
|
247
|
+
for (const [e, [n]] of o.entries()) {
|
|
248
|
+
const s = e === "constructor" || e === "call-signature" ? void 0 : e;
|
|
249
|
+
t.push({
|
|
250
|
+
kind: n.kind,
|
|
251
|
+
name: s,
|
|
257
252
|
removed: !0,
|
|
258
|
-
deprecated:
|
|
253
|
+
deprecated: n.deprecated
|
|
259
254
|
});
|
|
260
255
|
}
|
|
261
|
-
return
|
|
256
|
+
return t.length ? t : void 0;
|
|
262
257
|
}
|
|
263
258
|
export {
|
|
264
|
-
|
|
259
|
+
I as diffApiJson
|
|
265
260
|
};
|
package/dist/diffTypes/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { path as s } from "@arcgis/
|
|
1
|
+
import { path as s } from "@arcgis/node-toolkit/path";
|
|
2
2
|
import { execSync as c } from "node:child_process";
|
|
3
3
|
import { mkdir as m, writeFile as d } from "node:fs/promises";
|
|
4
4
|
const a = "diff --new-file --recursive", u = `${a} --unified=2`;
|
|
@@ -58,9 +58,12 @@ export class ApiExtractor {
|
|
|
58
58
|
run(): Promise<ApiExtractorResult>;
|
|
59
59
|
/**
|
|
60
60
|
* The high-level API for starting a watch-mode extraction on the current project.
|
|
61
|
+
*
|
|
61
62
|
* When watching, double check that the configuration options the ApiExtractor
|
|
62
63
|
* was created with are appropriate for watch mode (disable full type check
|
|
63
64
|
* and type verifier if not necessary).
|
|
65
|
+
*
|
|
66
|
+
* Use [ApiExtractorConfig](https://developers.arcgis.com/javascript/latest/references/api-extractor/extractor/config/#ApiExtractorConfig-watch) to configure the watch callback to receive a reference to the api.json each time it is re-generated.
|
|
64
67
|
*/
|
|
65
68
|
watch(): Promise<ApiExtractorWatcher>;
|
|
66
69
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../
|
|
3
|
-
import "./processing/links.js";
|
|
1
|
+
import "../chunks/config.js";
|
|
2
|
+
import "../chunks/links.js";
|
|
4
3
|
import "typescript";
|
|
5
|
-
import { A as
|
|
4
|
+
import { A as a } from "../chunks/ApiExtractor.js";
|
|
6
5
|
import "@arcgis/toolkit/function";
|
|
7
6
|
export {
|
|
8
|
-
|
|
7
|
+
a as ApiExtractor
|
|
9
8
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type ts from "typescript";
|
|
2
|
-
import type { PackageJson } from "@arcgis/
|
|
2
|
+
import type { PackageJson } from "@arcgis/node-toolkit/packageJson";
|
|
3
3
|
import type { CopyDocDefinitions } from "./extractors/copyDoc.js";
|
|
4
4
|
import type { ApiExtractor } from "./ApiExtractor.js";
|
|
5
|
-
import type { TypeScriptConfigResult } from "
|
|
6
|
-
import type { ApiModule } from "../apiJson.js";
|
|
5
|
+
import type { TypeScriptConfigResult } from "@arcgis/node-toolkit/vite/typeScript";
|
|
6
|
+
import type { ApiInterfaceDeclaration, ApiModule } from "../apiJson.js";
|
|
7
7
|
import type { ApiExtractorResult } from "./types.js";
|
|
8
8
|
|
|
9
9
|
export interface ApiExtractorConfig {
|
|
@@ -161,7 +161,7 @@ export interface ApiExtractorTypesConfig {
|
|
|
161
161
|
* If doing full type check, typed extraction is practically free:
|
|
162
162
|
*
|
|
163
163
|
* ```log
|
|
164
|
-
* [
|
|
164
|
+
* [typescript] Type checked in 0.911s
|
|
165
165
|
* [@arcgis/api-extractor] Extracted 5 \@public files in 0.008s
|
|
166
166
|
* ```
|
|
167
167
|
*
|
|
@@ -215,7 +215,7 @@ export interface ApiExtractorTypesConfig {
|
|
|
215
215
|
*/
|
|
216
216
|
readonly typeScriptConfigPath?: string;
|
|
217
217
|
/**
|
|
218
|
-
* A resolved config returned by
|
|
218
|
+
* A resolved config returned by \@arcgis/node-toolkit/vite/typeScript
|
|
219
219
|
* Useful if you already resolved the config for other purposes and wish to
|
|
220
220
|
* deduplicate the work.
|
|
221
221
|
*/
|
|
@@ -271,7 +271,7 @@ export interface DeclarationFile {
|
|
|
271
271
|
*
|
|
272
272
|
* @see https://devtopia.esri.com/WebGIS/arcgis-js-api/discussions/60843
|
|
273
273
|
* @see https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/69911
|
|
274
|
-
* @see https://devtopia.esri.com/WebGIS/
|
|
274
|
+
* @see https://devtopia.esri.com/WebGIS/webgis-sdk/issues/20807
|
|
275
275
|
*/
|
|
276
276
|
export type TypeReplacements = Record<string, Record<string, readonly [modulePath: string, name: string, type: "default" | "named"] | undefined> | undefined>;
|
|
277
277
|
|
|
@@ -379,6 +379,23 @@ export interface ApiExtractorVerifyConfig {
|
|
|
379
379
|
* ```
|
|
380
380
|
*/
|
|
381
381
|
filterTypeCheckDiagnostic?(diagnostic: ts.Diagnostic): boolean;
|
|
382
|
+
/**
|
|
383
|
+
* Return false to suppress an unreferenced exported type error when
|
|
384
|
+
* [ApiExtractorVerifyConfig](https://developers.arcgis.com/javascript/latest/references/api-extractor/extractor/config/#ApiExtractorVerifyConfig-typeCheckTypes) is enabled.
|
|
385
|
+
*
|
|
386
|
+
* Usually, types that are not referenced by any runtime API are a mistake.
|
|
387
|
+
* Use this option to suppress intentional cases or backwards compatibility
|
|
388
|
+
* cases.
|
|
389
|
+
*
|
|
390
|
+
* @param declaration - The unreferenced interface or type alias.
|
|
391
|
+
* @param module - The module containing the declaration.
|
|
392
|
+
* @example
|
|
393
|
+
* ```ts
|
|
394
|
+
* filterUnreferencedType: (declaration, module) =>
|
|
395
|
+
* !(module.path === "types" && declaration.name === "StandaloneType"),
|
|
396
|
+
* ```
|
|
397
|
+
*/
|
|
398
|
+
filterUnreferencedType?(declaration: ApiInterfaceDeclaration, module: ApiModule): boolean;
|
|
382
399
|
/**
|
|
383
400
|
* @deprecated REFACTOR: Drop this flag in 5.1
|
|
384
401
|
* @default false
|
package/dist/extractor/config.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import "@arcgis/
|
|
2
|
-
import "
|
|
3
|
-
import
|
|
4
|
-
import "
|
|
5
|
-
import "typescript";
|
|
6
|
-
import "fs/promises";
|
|
7
|
-
import "node:util";
|
|
8
|
-
import "@arcgis/toolkit/string";
|
|
9
|
-
import "../utils/apiHelpers.js";
|
|
10
|
-
import "@arcgis/toolkit/array";
|
|
1
|
+
import "@arcgis/node-toolkit/file";
|
|
2
|
+
import "@arcgis/node-toolkit/path";
|
|
3
|
+
import "@arcgis/node-toolkit/packageJson";
|
|
4
|
+
import "@arcgis/node-toolkit/vite/typeScript";
|
|
11
5
|
import "@arcgis/toolkit/function";
|
|
12
|
-
import "
|
|
6
|
+
import { l as f, m as g, r as x } from "../chunks/config.js";
|
|
13
7
|
import "node:url";
|
|
8
|
+
import "../chunks/links.js";
|
|
14
9
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
f as loadApiExtractorConfig,
|
|
11
|
+
g as mergeApiExtractorConfigs,
|
|
12
|
+
x as resolveApiExtractorConfig
|
|
18
13
|
};
|
|
@@ -1,173 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
if (typeof e == "string") {
|
|
7
|
-
const i = e.replaceAll(F, n.resolveJsDocLink).replaceAll(n.config.documentation.alternativeHost, n.config.documentation.host);
|
|
8
|
-
return e.includes("](.") && a(P, e, n), i;
|
|
9
|
-
}
|
|
10
|
-
return e;
|
|
11
|
-
}
|
|
12
|
-
function j(e, n) {
|
|
13
|
-
if (e) {
|
|
14
|
-
const i = e.replaceAll(F, n.resolveJsDocLink).replaceAll(n.config.documentation.alternativeHost, n.config.documentation.host);
|
|
15
|
-
return i.includes("](.") && a(P, i, n), i;
|
|
16
|
-
}
|
|
17
|
-
return e;
|
|
18
|
-
}
|
|
19
|
-
function J(e, n) {
|
|
20
|
-
if (e !== void 0 && n.inheritedModuleName === void 0)
|
|
21
|
-
for (let i = 0; i < e.length; ++i) {
|
|
22
|
-
const d = e[i];
|
|
23
|
-
d.text && (d.text = d.text.replaceAll(F, n.resolveJsDocLink).replaceAll(n.config.documentation.alternativeHost, n.config.documentation.host), d.text.includes("](.") && a(P, d.text, n));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
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/references/api-extractor/tags-reference#link)", F = /\{@link +([^}]+)\}/gu;
|
|
27
|
-
function N(e, n, i) {
|
|
28
|
-
let d = i.indexOf(" ");
|
|
29
|
-
d === -1 && (d = i.length);
|
|
30
|
-
const u = i.slice(0, d), m = i.slice(d + 1);
|
|
31
|
-
if (u.startsWith("https://"))
|
|
32
|
-
return e.config.strict ? (a(
|
|
33
|
-
"Did not expect absolute URLs in a @link tag. Please use markdown links for external links. See https://webgis.esri.com/references/api-extractor/tags-reference#link)",
|
|
34
|
-
n,
|
|
35
|
-
e
|
|
36
|
-
), "") : `[${m || u}](${u})`;
|
|
37
|
-
const [k, t] = u.split("#"), [f, L] = k.split("!");
|
|
38
|
-
if (f === "")
|
|
39
|
-
return a(
|
|
40
|
-
`Expected @link reference to start with a module name (before ! or #), but got: ${u}`,
|
|
41
|
-
n,
|
|
42
|
-
e
|
|
43
|
-
), n;
|
|
44
|
-
let g = e.moduleMap.get(f);
|
|
45
|
-
if (g === void 0 && e.isComponentProject && !e.config.strict) {
|
|
46
|
-
for (const r of e.moduleMap.values())
|
|
47
|
-
if (y(r).index.class?.name === f) {
|
|
48
|
-
g = r;
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if (g === void 0)
|
|
53
|
-
return e.config.verify.detectBrokenLinks ? a(
|
|
54
|
-
`Failed to find referenced module: ${C("red", f)}${f.startsWith("module:") ? '. Module name in @link does not need the "module:" prefix' : f.startsWith("esri/") ? '. Module name in @link does not need to start with the "esri/" prefix.' : ""}`,
|
|
55
|
-
n,
|
|
56
|
-
e
|
|
57
|
-
) : e.silencedBrokenLinkCount += 1, n;
|
|
58
|
-
const v = y(g), D = e.inheritedModuleName === void 0 ? e.apiModule : e.moduleMap.get(e.inheritedModuleName) ?? e.apiModule;
|
|
59
|
-
if (e.watchFiles !== void 0 && f !== D.path && y(D).isStale) {
|
|
60
|
-
const r = y(D).file.fileName.slice(e.config.context.cwd.length), s = v.file.fileName.slice(e.config.context.cwd.length);
|
|
61
|
-
e.watchFiles.get(r).docLinks.push(i), e.watchFiles.get(r).dependencies.add(s);
|
|
62
|
-
const b = e.watchFiles.get(s).dependents;
|
|
63
|
-
b.has(r) || b.set(r, !1);
|
|
64
|
-
}
|
|
65
|
-
let h = M(g.path, L, t, e);
|
|
66
|
-
if (L !== void 0) {
|
|
67
|
-
const r = v.index.named[L];
|
|
68
|
-
return r === void 0 ? (e.config.verify.detectBrokenLinks ? a(
|
|
69
|
-
`Failed to find the referenced declaration inside the module: ${C("red", `${f}!${L}`)}`,
|
|
70
|
-
n,
|
|
71
|
-
e
|
|
72
|
-
) : e.silencedBrokenLinkCount += 1, n) : r === v.index.class ? (a(
|
|
73
|
-
`Invalid reference syntax used. Class/mixin/custom element declarations must be referenced without specifying the class name. Expected ${C("green", f)}`,
|
|
74
|
-
n,
|
|
75
|
-
e
|
|
76
|
-
), n) : `[${m || w(r)}](${h})`;
|
|
77
|
-
} else if (t !== void 0) {
|
|
78
|
-
const r = g.path === D.path, s = v.index.class;
|
|
79
|
-
if (s === void 0)
|
|
80
|
-
return v.index.named[t] === void 0 ? e.config.verify.detectBrokenLinks ? a(
|
|
81
|
-
'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-"',
|
|
82
|
-
n,
|
|
83
|
-
e
|
|
84
|
-
) : e.silencedBrokenLinkCount += 1 : a(
|
|
85
|
-
`Invalid reference syntax used. This syntax is only permitted on modules that export a class/mixin/web component. Perhaps you meant to use ${C("red", `${f}!${t}`)} instead? Linking to properties in interfaces is not yet supported`,
|
|
86
|
-
n,
|
|
87
|
-
e
|
|
88
|
-
), n;
|
|
89
|
-
const b = v.inheritance, p = typeof b == "object" ? b : void 0;
|
|
90
|
-
let c;
|
|
91
|
-
if (t.startsWith("event-")) {
|
|
92
|
-
const o = t.slice(6);
|
|
93
|
-
if (p !== void 0)
|
|
94
|
-
c = p.indexedEvents?.[o];
|
|
95
|
-
else if (s.events !== void 0)
|
|
96
|
-
for (let l = 0; l < s.events.length; ++l) {
|
|
97
|
-
const $ = s.events[l];
|
|
98
|
-
if (o === $.name) {
|
|
99
|
-
c = $;
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
} else if (t.startsWith("slot-")) {
|
|
104
|
-
const o = t.slice(5);
|
|
105
|
-
if (p !== void 0)
|
|
106
|
-
c = p.indexedSlots?.[o];
|
|
107
|
-
else if (s.slots !== void 0)
|
|
108
|
-
for (let l = 0; l < s.slots.length; ++l) {
|
|
109
|
-
const $ = s.slots[l];
|
|
110
|
-
if (o === $.name) {
|
|
111
|
-
c = $;
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
} else if (t.startsWith("--")) {
|
|
116
|
-
if (p !== void 0)
|
|
117
|
-
c = p.indexedCssProperties?.[t];
|
|
118
|
-
else if (s.cssProperties !== void 0)
|
|
119
|
-
for (let o = 0; o < s.cssProperties.length; ++o) {
|
|
120
|
-
const l = s.cssProperties[o];
|
|
121
|
-
if (t === l.name) {
|
|
122
|
-
c = l;
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
} else if (p?.indexedMembers !== void 0 && (c = p.indexedMembers[t] ?? p.indexedMembers[`static ${t}`]), c === void 0 && s.members !== void 0) {
|
|
127
|
-
for (let o = 0; o < s.members.length; ++o) {
|
|
128
|
-
const l = s.members[o];
|
|
129
|
-
if (t === l.name) {
|
|
130
|
-
c = l;
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
if (c === void 0 && !e.config.strict && e.isComponentProject && s.events !== void 0)
|
|
135
|
-
for (let o = 0; o < s.events.length; ++o) {
|
|
136
|
-
const l = s.events[o];
|
|
137
|
-
if (t === l.name) {
|
|
138
|
-
c = l, h = h.replace("#", "#event-");
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return c === void 0 ? (e.config.verify.detectBrokenLinks ? a("Failed to find the referenced class member", n, e) : e.silencedBrokenLinkCount += 1, n) : `[${m || (r ? w(c) : `${w(s)}.${w(c)}`)}](${h})`;
|
|
144
|
-
} else {
|
|
145
|
-
const r = v.index.class === void 0 ? U(f) : w(v.index.class);
|
|
146
|
-
return `[${m || r}](${h})`;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
function M(e, n, i, d) {
|
|
150
|
-
let u;
|
|
151
|
-
if (d.isComponentProject && typeof d.config.documentation.getComponentDocsUrl == "function" && e.startsWith("components/")) {
|
|
152
|
-
const m = e.slice(11), k = m.indexOf("/"), t = k === -1 ? m : m.slice(0, k), f = d.config.documentation.getComponentDocsUrl(t, I(t));
|
|
153
|
-
f !== void 0 && (u = f + (k === -1 ? "" : m.slice(k + 1)));
|
|
154
|
-
}
|
|
155
|
-
return u ??= `${d.normalizedApiReferencePrefix}${e}/`, x(u, n, i);
|
|
156
|
-
}
|
|
157
|
-
function x(e, n, i) {
|
|
158
|
-
return n !== void 0 ? i === void 0 ? `${e}#${encodeURIComponent(n)}` : `${e}#${encodeURIComponent(n)}-${encodeURIComponent(i)}` : i !== void 0 ? `${e}#${encodeURIComponent(i)}` : e;
|
|
159
|
-
}
|
|
160
|
-
function U(e) {
|
|
161
|
-
const n = e.lastIndexOf("/");
|
|
162
|
-
return n === -1 ? e : e.slice(n + 1);
|
|
163
|
-
}
|
|
164
|
-
const E = (e) => `/javascript/latest/references/${e}/`;
|
|
1
|
+
import "node:util";
|
|
2
|
+
import "../../utils/apiHelpers.js";
|
|
3
|
+
import "../../chunks/privateContext.js";
|
|
4
|
+
import "@arcgis/toolkit/string";
|
|
5
|
+
import { b as i, g as p, a as c, n as l, o as m, q as D, r as g } from "../../chunks/links.js";
|
|
165
6
|
export {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
7
|
+
i as buildViewUrl,
|
|
8
|
+
p as getDefaultBasePath,
|
|
9
|
+
c as getViewUrl,
|
|
10
|
+
l as postProcessDeprecated,
|
|
11
|
+
m as postProcessDescription,
|
|
12
|
+
D as postProcessDocsTags,
|
|
13
|
+
g as resolveJsDocLink
|
|
173
14
|
};
|
package/dist/utils/apiHelpers.js
CHANGED
|
@@ -8,7 +8,7 @@ import type { ApiType, ApiTypeReference } from "../apiJson.js";
|
|
|
8
8
|
*
|
|
9
9
|
* @param apiType - The ApiType to hydrate
|
|
10
10
|
* @param hydratePart - A callback that converts a type reference into desired output
|
|
11
|
-
* @see [Type References](https://devtopia.esri.com/WebGIS/
|
|
11
|
+
* @see [Type References](https://devtopia.esri.com/WebGIS/webgis-sdk/blob/main/packages/support-packages/api-extractor/src/const/typeReferences/README.md)
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
14
14
|
* const markdownTypeString = hydrateApiType(
|