@arcgis/api-extractor 5.2.0-next.0 → 5.2.0-next.10

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,8 +1,8 @@
1
- import "../typeScript-Dk1Rn-2E.js";
2
- import "../worker-CCFrgas5.js";
1
+ import "../typeScript-B79ma30F.js";
2
+ import "../worker-DDand5P_.js";
3
3
  import "./processing/links.js";
4
4
  import "typescript";
5
- import { A as x } from "../ApiExtractor-DNNO0gUt.js";
5
+ import { A as x } from "../ApiExtractor-CE7LmkJj.js";
6
6
  import "@arcgis/toolkit/function";
7
7
  export {
8
8
  x as ApiExtractor
@@ -1,6 +1,6 @@
1
1
  import "@arcgis/components-build-utils";
2
- import "../typeScript-Dk1Rn-2E.js";
3
- import { l, m as n, r as A } from "../worker-CCFrgas5.js";
2
+ import "../typeScript-B79ma30F.js";
3
+ import { l, m as n, r as A } from "../worker-DDand5P_.js";
4
4
  import "./processing/links.js";
5
5
  import "typescript";
6
6
  import "fs/promises";
@@ -1,4 +1,4 @@
1
- import type { ApiClassDeclaration, ApiClassMethod, ApiCustomElementDeclaration, ApiCustomElementField, ApiEvent, ApiFunctionDeclaration, ApiInterfaceDeclaration, ApiModule, ApiVariableDeclaration } from "../../apiJson.js";
1
+ import type { ApiClassDeclaration, ApiClassMethod, ApiCustomElementDeclaration, ApiCustomElementField, ApiEvent, ApiFunctionDeclaration, ApiInterfaceDeclaration, ApiModule, ApiVariableDeclaration, ApiWithDeprecated, ApiWithDescription, ApiWithDocsTags } from "../../apiJson.js";
2
2
 
3
3
  /** [Documentation](https://webgis.esri.com/references/api-extractor/tags-reference#copydoc)) */
4
4
  export interface CopyDocDefinitions {
@@ -18,8 +18,14 @@ export interface CopyDocDefinitions {
18
18
  interfaces?: CopyDocDeclarations<ApiInterfaceDeclaration>;
19
19
  }
20
20
 
21
- export type CopiableFields = "deprecated" | "description" | "docsTags" | "readonly" | "return";
21
+ /**
22
+ * A common shape for metadata that can be included in declarative copy doc.
23
+ * Extra fields can be specified by imperatively mutating the API declaration.
24
+ */
25
+ export interface CopyDocCommonBase extends Partial<ApiWithDescription>, Partial<ApiWithDocsTags>, Partial<ApiWithDeprecated> {
26
+ return?: ApiWithDescription;
27
+ }
22
28
 
23
- export type CopyDocDeclarations<ApiType extends Partial<Record<CopiableFields, unknown>>> = Record<string, Partial<Pick<ApiType, CopiableFields>> | ((apiDeclaration: ApiType, module: ApiModule) => Partial<Pick<ApiType, CopiableFields>>) | undefined>;
29
+ export type CopyDocDeclarations<ApiType extends Partial<CopyDocCommonBase>> = Record<string, Pick<CopyDocCommonBase, keyof ApiType & keyof CopyDocCommonBase> | ((apiDeclaration: ApiType, module: ApiModule) => Pick<CopyDocCommonBase, keyof ApiType & keyof CopyDocCommonBase>) | undefined>;
24
30
 
25
- export type CopyDocMemberDeclarations<ApiType extends Partial<Record<CopiableFields, unknown>>> = Record<string, Partial<Pick<ApiType, CopiableFields>> | ((apiDeclaration: ApiType, classOrComponent: ApiClassDeclaration | ApiCustomElementDeclaration, module: ApiModule) => Partial<Pick<ApiType, CopiableFields>>) | undefined>;
31
+ export type CopyDocMemberDeclarations<ApiType extends Partial<CopyDocCommonBase>> = Record<string, Pick<CopyDocCommonBase, keyof ApiType & keyof CopyDocCommonBase> | ((apiDeclaration: ApiType, classOrComponent: ApiClassDeclaration | ApiCustomElementDeclaration, module: ApiModule) => Pick<CopyDocCommonBase, keyof ApiType & keyof CopyDocCommonBase> | undefined) | undefined>;
@@ -1,7 +1,7 @@
1
1
  import { findPath as E, path as u, toSystemPathSeparators as S } from "@arcgis/components-build-utils";
2
2
  import t from "typescript";
3
3
  import { styleText as f } from "util";
4
- const w = "@arcgis/api-extractor", P = "5.2.0-next.0", D = {
4
+ const w = "@arcgis/api-extractor", P = "5.2.0-next.10", D = {
5
5
  name: w,
6
6
  version: P
7
7
  };
@@ -12,6 +12,9 @@ export const globalPackageIdentifier: "global:";
12
12
  /**
13
13
  * Get a name from a class member.
14
14
  *
15
+ * > We don't need a similar utility for ApiModule declarations as each
16
+ * > declaration has a name.
17
+ *
15
18
  * @param member
16
19
  * @example
17
20
  * - method named "test" => "test"
@@ -30,7 +30,7 @@ function x(e, n, o) {
30
30
  }
31
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
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);
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);
34
34
  const { docsTags: i } = e, t = n;
35
35
  if (o !== -1 && (i === void 0 && t.docsTags.length === 1 ? t.docsTags = void 0 : t.docsTags.splice(o, 1)), i !== void 0) {
36
36
  t.docsTags ??= [];
@@ -43,7 +43,7 @@ function k(e, n, o = -1) {
43
43
  }
44
44
  }
45
45
  }
46
- function y(e, n) {
46
+ function A(e, n) {
47
47
  let o = e.text;
48
48
  if (e.references !== void 0)
49
49
  for (let i = e.references.length - 1; i >= 0; i--) {
@@ -59,11 +59,11 @@ function y(e, n) {
59
59
  references: void 0
60
60
  };
61
61
  }
62
- function A(e) {
62
+ function N(e) {
63
63
  return e.return.type.text.startsWith("Promise<");
64
64
  }
65
65
  export {
66
- y as apiTypeToImportType,
66
+ A as apiTypeToImportType,
67
67
  M as compareClassMembers,
68
68
  S as compareNamedNodes,
69
69
  l as compareStrings,
@@ -73,7 +73,7 @@ export {
73
73
  P as getMaybeStaticApiMemberName,
74
74
  p as globalPackageIdentifier,
75
75
  g as isApiMethod,
76
- A as isApiMethodAsync,
76
+ N as isApiMethodAsync,
77
77
  v as isApiProperty,
78
78
  k as mergeApiNodes,
79
79
  h as naturalSortModules
@@ -1,3 +1,4 @@
1
+ import { globalPackageIdentifier as h } from "./apiHelpers.js";
1
2
  const d = {
2
3
  // Create a null prototype object to avoid collisions with Object.prototype when doing lookups
3
4
  // eslint-disable-next-line @typescript-eslint/naming-convention
@@ -13,50 +14,50 @@ const d = {
13
14
  never: "https://www.typescriptlang.org/docs/handbook/2/functions.html#never",
14
15
  any: "https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any",
15
16
  this: "#"
16
- }, h = Object.keys(d).join("|"), g = new RegExp(`(?<!["'-])\\b(?:${h})\\b(?!["'-])`, "u");
17
- function p(e, c) {
18
- const n = [];
19
- let o = e.text.length;
17
+ }, g = Object.keys(d).join("|"), p = new RegExp(`(?<!["'-])\\b(?:${g})\\b(?!["'-])`, "u");
18
+ function v(e, l) {
19
+ const o = [];
20
+ let n = e.text.length;
20
21
  if (e.references !== void 0)
21
- for (let l = e.references.length - 1; l >= 0; l--) {
22
- const t = e.references[l];
22
+ for (let c = e.references.length - 1; c >= 0; c--) {
23
+ const t = e.references[c];
23
24
  if (t.start === void 0 || t.end === void 0)
24
25
  continue;
25
- const r = e.text.slice(t.end, o);
26
- r.length > 0 && i(r, c, n);
26
+ const r = e.text.slice(t.end, n);
27
+ r.length > 0 && i(r, l, o);
27
28
  const s = e.text.slice(t.start, t.end);
28
- o = t.start, t.viewUrl === void 0 ? n.push(s) : n.push(
29
- c(s, t)
29
+ n = t.start, t.viewUrl === void 0 ? o.push(s) : o.push(
30
+ l(s, t)
30
31
  );
31
32
  }
32
- if (o > 0) {
33
- const l = e.text.slice(0, o);
34
- i(l, c, n);
33
+ if (n > 0) {
34
+ const c = e.text.slice(0, n);
35
+ i(c, l, o);
35
36
  }
36
- return n.reverse();
37
+ return o.reverse();
37
38
  }
38
- function i(e, c, n) {
39
- const o = n.length;
40
- for (let l = 0; l < e.length; ) {
41
- const t = e.match(g);
39
+ function i(e, l, o) {
40
+ const n = o.length;
41
+ for (let c = 0; c < e.length; ) {
42
+ const t = e.match(p);
42
43
  if (t?.index === void 0)
43
44
  break;
44
45
  const r = e.slice(0, t.index);
45
- r.length > 0 && n.splice(o, 0, r);
46
+ r.length > 0 && o.splice(n, 0, r);
46
47
  const s = t[0];
47
48
  e = e.slice(t.index + s.length);
48
- const a = d[s], b = c(s, {
49
+ const a = d[s], b = l(s, {
49
50
  name: s,
50
51
  module: void 0,
51
- package: s === "this" ? void 0 : "global:",
52
+ package: s === "this" ? void 0 : h,
52
53
  viewUrl: a,
53
54
  start: void 0,
54
55
  end: void 0
55
56
  });
56
- n.splice(o, 0, b);
57
+ o.splice(n, 0, b);
57
58
  }
58
- e.length > 0 && n.splice(o, 0, e);
59
+ e.length > 0 && o.splice(n, 0, e);
59
60
  }
60
61
  export {
61
- p as hydrateApiType
62
+ v as hydrateApiType
62
63
  };
@@ -1,6 +1,6 @@
1
- import { l as O, m as J } from "../worker-CCFrgas5.js";
2
- import { A as S, w as T } from "../ApiExtractor-DNNO0gUt.js";
3
- import { p as A, l as C } from "../typeScript-Dk1Rn-2E.js";
1
+ import { l as O, m as J } from "../worker-DDand5P_.js";
2
+ import { A as S, w as T } from "../ApiExtractor-CE7LmkJj.js";
3
+ import { p as A, l as C } from "../typeScript-B79ma30F.js";
4
4
  import { writeFile as M } from "node:fs/promises";
5
5
  import { path as w } from "@arcgis/components-build-utils";
6
6
  const N = A.name;
@@ -1,6 +1,6 @@
1
1
  import "@arcgis/components-build-utils";
2
2
  import "typescript";
3
- import { b as t } from "../typeScript-Dk1Rn-2E.js";
3
+ import { b as t } from "../typeScript-B79ma30F.js";
4
4
  export {
5
5
  t as loadTypeScriptConfig
6
6
  };