rspress-plugin-api-extractor 0.3.8 → 0.5.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/README.md CHANGED
@@ -49,6 +49,7 @@ The plugin reads your `.api.json` model and writes one MDX page per public API i
49
49
  - Generates API docs from `.api.json` models for classes, interfaces, functions, type aliases, enums, variables and namespaces.
50
50
  - Type-checks code examples and adds Twoslash hover tooltips that show inferred types.
51
51
  - Cross-links type references between pages, so a type named in a signature links to its own page.
52
+ - Inlines compiler-generated base declarations (the `Foo_base` pattern from Effect `Schema.Class`, `Data.TaggedError` and mixin factories) in a "Base Class" section on the owning class page instead of documenting them as orphan variables.
52
53
  - Drives single-package sites, multi-package portals, RSPress multiVersion and i18n from one plugin.
53
54
  - Handles multi-entry-point packages: it deduplicates re-exports and notes which entry points each item is available from.
54
55
  - Writes per-package `llms*.txt` files and in-page actions for pointing an assistant at one package's docs.
package/build-stages.js CHANGED
@@ -18,6 +18,7 @@ import { resolveEntryPoints } from "./multi-entry-resolver.js";
18
18
  import { OpenGraphResolver } from "./og-resolver.js";
19
19
  import { assertNoRouteCollisions } from "./route-collisions.js";
20
20
  import { SnapshotService } from "./services/SnapshotService.js";
21
+ import { BASE_CLASS_ANCHOR, detectSyntheticBases } from "./synthetic-bases.js";
21
22
  import path from "node:path";
22
23
  import { Effect, Metric, Stream } from "effect";
23
24
  import { FileSystem } from "@effect/platform";
@@ -67,13 +68,15 @@ function sanitizeId(displayName) {
67
68
  function prepareWorkItems(input) {
68
69
  const { apiPackage, categories, baseRoute } = input;
69
70
  const resolvedItems = resolveEntryPoints(apiPackage);
71
+ const syntheticBases = detectSyntheticBases(resolvedItems.map((r) => r.item));
72
+ const docItems = syntheticBases.bases.size ? resolvedItems.filter((r) => !syntheticBases.bases.has(r.item)) : resolvedItems;
70
73
  const resolvedLookup = /* @__PURE__ */ new Map();
71
- for (const resolved of resolvedItems) {
74
+ for (const resolved of docItems) {
72
75
  const key = `${resolved.item.displayName}::${resolved.item.kind}`;
73
76
  resolvedLookup.set(key, resolved);
74
77
  }
75
- const items = ApiParser.categorizeApiItems(resolvedItems, categories);
76
- const namespaceMembers = ApiParser.extractNamespaceMembers(resolvedItems);
78
+ const items = ApiParser.categorizeApiItems(docItems, categories);
79
+ const namespaceMembers = ApiParser.extractNamespaceMembers(docItems);
77
80
  const candidates = [];
78
81
  for (const [categoryKey, categoryConfig] of Object.entries(categories)) for (const item of items[categoryKey] || []) candidates.push({
79
82
  id: `${item.displayName}::${item.kind}`,
@@ -142,17 +145,28 @@ function prepareWorkItems(input) {
142
145
  kinds.set(displayName, nsMember.item.kind);
143
146
  }
144
147
  }
148
+ for (const [baseItem, syntheticBase] of syntheticBases.bases) {
149
+ const baseName = baseItem.displayName;
150
+ if (routes.has(baseName)) continue;
151
+ const owner = syntheticBase.ownerClasses[0];
152
+ const ownerRoute = owner ? routes.get(owner.displayName) : void 0;
153
+ if (!ownerRoute) continue;
154
+ routes.set(baseName, `${ownerRoute}#${BASE_CLASS_ANCHOR}`);
155
+ kinds.set(baseName, baseItem.kind);
156
+ }
145
157
  const workItems = [];
146
158
  for (const [categoryKey, categoryConfig] of Object.entries(categories)) {
147
159
  const categoryItems = items[categoryKey] || [];
148
160
  for (const item of categoryItems) {
149
161
  const lookupKey = `${item.displayName}::${item.kind}`;
150
162
  const resolved = resolvedLookup.get(lookupKey);
163
+ const syntheticBase = syntheticBases.baseByOwner.get(item);
151
164
  workItems.push({
152
165
  item,
153
166
  categoryKey,
154
167
  categoryConfig,
155
- ...resolved?.availableFrom != null ? { availableFrom: resolved.availableFrom } : {}
168
+ ...resolved?.availableFrom != null ? { availableFrom: resolved.availableFrom } : {},
169
+ ...syntheticBase != null ? { syntheticBase } : {}
156
170
  });
157
171
  }
158
172
  }
@@ -197,7 +211,7 @@ function generateSinglePage(workItem, ctx) {
197
211
  switch (item.kind) {
198
212
  case ApiItemKind.Class: {
199
213
  const generator = new ClassPageGenerator();
200
- page = yield* Effect.promise(() => generator.generate(item, baseRoute, packageName, categoryConfig.singularName, apiScope, apiName, source, suppressExampleErrors, llmsPlugin, workItem.availableFrom));
214
+ page = yield* Effect.promise(() => generator.generate(item, baseRoute, packageName, categoryConfig.singularName, apiScope, apiName, source, suppressExampleErrors, llmsPlugin, workItem.availableFrom, workItem.syntheticBase));
201
215
  page = {
202
216
  routePath: page.routePath.replace("/class/", `/${categoryConfig.folderName}/`),
203
217
  content: page.content
@@ -62,7 +62,7 @@ var ClassPageGenerator = class {
62
62
  *
63
63
  * @param apiScope - API scope identifier for VFS lookup
64
64
  */
65
- async generate(apiClass, baseRoute, packageName, singularName, apiScope, apiName, sourceConfig, suppressExampleErrors, llmsPlugin, availableFrom) {
65
+ async generate(apiClass, baseRoute, packageName, singularName, apiScope, apiName, sourceConfig, suppressExampleErrors, llmsPlugin, availableFrom, syntheticBase) {
66
66
  const shouldSuppressErrors = suppressExampleErrors ?? true;
67
67
  const name = apiClass.displayName;
68
68
  const summary = ApiParser.getSummary(apiClass) || "No description available.";
@@ -95,6 +95,7 @@ var ClassPageGenerator = class {
95
95
  const skeleton = this.generateClassSkeletonWithTwoslash(apiClass, packageName);
96
96
  const displayCode = stripTwoslashDirectives(skeleton);
97
97
  content += `<ApiSignature code={${JSON.stringify(displayCode)}} source={${JSON.stringify(skeleton)}} apiScope={${JSON.stringify(apiScope)}} />\n\n`;
98
+ content += this.generateBaseClassSection(apiClass, syntheticBase, packageName, apiScope);
98
99
  const constructors = apiClass.members.filter((m) => m.kind === "Constructor");
99
100
  if (constructors.length > 0) {
100
101
  content += `## Constructors\n\n`;
@@ -214,6 +215,28 @@ var ClassPageGenerator = class {
214
215
  };
215
216
  }
216
217
  /**
218
+ * Render the inline "Base Class" section for a synthetic base declaration
219
+ * (an unexported item referenced by the class's extends clause, e.g. the
220
+ * `Foo_base` variable TypeScript emits for `Schema.Class`-style patterns).
221
+ *
222
+ * The `## Base Class` heading slugs to `BASE_CLASS_ANCHOR` from
223
+ * `synthetic-bases.ts`, which is where the cross-link route for the base
224
+ * name points.
225
+ */
226
+ generateBaseClassSection(apiClass, syntheticBase, packageName, apiScope) {
227
+ const baseDecl = syntheticBase;
228
+ if (!baseDecl?.excerpt?.text) return "";
229
+ let section = `## Base Class\n\n`;
230
+ section += `\`${apiClass.displayName}\` extends \`${baseDecl.displayName}\`, a compiler-generated declaration that is not exported from \`${packageName}\`.\n\n`;
231
+ const signature = this.typeFormatter.format(baseDecl.excerpt).trim();
232
+ let source = signature;
233
+ const apiPackage = apiClass.getAssociatedPackage?.();
234
+ if (apiPackage) source = prependHiddenImports(signature, new TypeReferenceExtractor(apiPackage, packageName).extractImportsForApiItem(baseDecl));
235
+ const displayCode = stripTwoslashDirectives(source);
236
+ section += `<ApiSignature code={${JSON.stringify(displayCode)}} source={${JSON.stringify(source)}} apiScope={${JSON.stringify(apiScope)}} />\n\n`;
237
+ return section;
238
+ }
239
+ /**
217
240
  * Group class members by their type (static, instance, getters/setters)
218
241
  */
219
242
  groupClassMembers(members) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rspress-plugin-api-extractor",
3
- "version": "0.3.8",
3
+ "version": "0.5.0",
4
4
  "private": false,
5
5
  "description": "RSPress plugin for generating API documentation from TypeScript API Extractor models",
6
6
  "keywords": [
@@ -14,7 +14,7 @@
14
14
  "repository": {
15
15
  "type": "git",
16
16
  "url": "git+https://github.com/spencerbeggs/rspress-plugin-api-extractor.git",
17
- "directory": "plugin"
17
+ "directory": "package"
18
18
  },
19
19
  "license": "MIT",
20
20
  "author": "Spencer Beggs",
@@ -1,4 +1,4 @@
1
- .WkJdOG_table {
1
+ ._9sEZ2a_table {
2
2
  border: 1px solid var(--api-color-border);
3
3
  border-radius: 0 0 var(--api-border-radius) var(--api-border-radius);
4
4
  border-top: none;
@@ -7,16 +7,16 @@
7
7
  overflow: hidden;
8
8
  }
9
9
 
10
- html.WkJdOG_rp-dark .WkJdOG_table {
10
+ html._9sEZ2a_rp-dark ._9sEZ2a_table {
11
11
  border-color: var(--api-color-border);
12
12
  }
13
13
 
14
- .WkJdOG_scroll {
14
+ ._9sEZ2a_scroll {
15
15
  -webkit-overflow-scrolling: touch;
16
16
  overflow-x: auto;
17
17
  }
18
18
 
19
- .WkJdOG_table table {
19
+ ._9sEZ2a_table table {
20
20
  border-collapse: collapse;
21
21
  width: 100%;
22
22
  font-size: var(--api-font-size-base);
@@ -25,12 +25,12 @@ html.WkJdOG_rp-dark .WkJdOG_table {
25
25
  margin: 0;
26
26
  }
27
27
 
28
- .WkJdOG_table thead {
28
+ ._9sEZ2a_table thead {
29
29
  background-color: var(--api-color-bg);
30
30
  border-bottom: 1px solid var(--api-color-border);
31
31
  }
32
32
 
33
- .WkJdOG_table th {
33
+ ._9sEZ2a_table th {
34
34
  padding: var(--api-spacing-md) var(--api-spacing-lg);
35
35
  text-align: left;
36
36
  color: var(--api-color-text);
@@ -38,62 +38,62 @@ html.WkJdOG_rp-dark .WkJdOG_table {
38
38
  font-weight: 600;
39
39
  }
40
40
 
41
- .WkJdOG_table th:first-child {
41
+ ._9sEZ2a_table th:first-child {
42
42
  width: 20%;
43
43
  min-width: 120px;
44
44
  }
45
45
 
46
- .WkJdOG_table th:nth-child(2) {
46
+ ._9sEZ2a_table th:nth-child(2) {
47
47
  width: 25%;
48
48
  min-width: 120px;
49
49
  }
50
50
 
51
- .WkJdOG_table th:last-child {
51
+ ._9sEZ2a_table th:last-child {
52
52
  width: 55%;
53
53
  }
54
54
 
55
- .WkJdOG_table td {
55
+ ._9sEZ2a_table td {
56
56
  padding: var(--api-spacing-md) var(--api-spacing-lg);
57
57
  border-top: 1px solid var(--api-color-border);
58
58
  vertical-align: top;
59
59
  }
60
60
 
61
- .WkJdOG_table td:first-child {
61
+ ._9sEZ2a_table td:first-child {
62
62
  width: 20%;
63
63
  min-width: 120px;
64
64
  }
65
65
 
66
- .WkJdOG_table td:nth-child(2) {
66
+ ._9sEZ2a_table td:nth-child(2) {
67
67
  width: 25%;
68
68
  min-width: 120px;
69
69
  }
70
70
 
71
- .WkJdOG_table td:last-child {
71
+ ._9sEZ2a_table td:last-child {
72
72
  width: 55%;
73
73
  }
74
74
 
75
- .WkJdOG_table td code, .WkJdOG_table th code {
75
+ ._9sEZ2a_table td code, ._9sEZ2a_table th code {
76
76
  font-size: var(--api-font-size-sm);
77
77
  background-color: var(--api-color-code-bg);
78
78
  border-radius: var(--api-border-radius-sm);
79
79
  padding: .125rem .375rem;
80
80
  }
81
81
 
82
- .WkJdOG_table td:last-child p:first-child {
82
+ ._9sEZ2a_table td:last-child p:first-child {
83
83
  margin-top: 0;
84
84
  }
85
85
 
86
- .WkJdOG_table td:last-child p:last-child, .WkJdOG_table td:last-child ul:last-child, .WkJdOG_table td:last-child ol:last-child {
86
+ ._9sEZ2a_table td:last-child p:last-child, ._9sEZ2a_table td:last-child ul:last-child, ._9sEZ2a_table td:last-child ol:last-child {
87
87
  margin-bottom: 0;
88
88
  }
89
89
 
90
90
  @media (width <= 768px) {
91
- .WkJdOG_table td, .WkJdOG_table th {
91
+ ._9sEZ2a_table td, ._9sEZ2a_table th {
92
92
  padding: var(--api-spacing-sm) var(--api-spacing-md);
93
93
  font-size: var(--api-font-size-sm);
94
94
  }
95
95
 
96
- .WkJdOG_table td:first-child, .WkJdOG_table th:first-child, .WkJdOG_table td:nth-child(2), .WkJdOG_table th:nth-child(2) {
96
+ ._9sEZ2a_table td:first-child, ._9sEZ2a_table th:first-child, ._9sEZ2a_table td:nth-child(2), ._9sEZ2a_table th:nth-child(2) {
97
97
  min-width: 100px;
98
98
  }
99
99
  }
@@ -1,9 +1,9 @@
1
1
  import './index.css';
2
2
  //#region src/runtime/components/EnumMembersTable/index.module.css
3
3
  var index_module_default = {
4
- "rpDark": "WkJdOG_rp-dark",
5
- "scroll": "WkJdOG_scroll",
6
- "table": "WkJdOG_table"
4
+ "rpDark": "_9sEZ2a_rp-dark",
5
+ "scroll": "_9sEZ2a_scroll",
6
+ "table": "_9sEZ2a_table"
7
7
  };
8
8
 
9
9
  //#endregion
@@ -1,4 +1,4 @@
1
- .PkJPlW_block {
1
+ .L3GWXq_block {
2
2
  margin: var(--api-spacing-xl) 0;
3
3
  border-radius: var(--api-border-radius);
4
4
  border: 1px solid var(--api-color-border);
@@ -6,6 +6,6 @@
6
6
  overflow: visible;
7
7
  }
8
8
 
9
- html.PkJPlW_rp-dark .PkJPlW_block {
9
+ html.L3GWXq_rp-dark .L3GWXq_block {
10
10
  border-color: var(--api-color-border);
11
11
  }
@@ -1,8 +1,8 @@
1
1
  import './index.css';
2
2
  //#region src/runtime/components/ExampleBlock/index.module.css
3
3
  var index_module_default = {
4
- "block": "PkJPlW_block",
5
- "rpDark": "PkJPlW_rp-dark"
4
+ "block": "L3GWXq_block",
5
+ "rpDark": "L3GWXq_rp-dark"
6
6
  };
7
7
 
8
8
  //#endregion
@@ -1,4 +1,4 @@
1
- .gRiZQa_block {
1
+ .sBksbq_block {
2
2
  margin: var(--api-spacing-xl) 0;
3
3
  border-radius: var(--api-border-radius);
4
4
  border: 1px solid var(--api-color-border);
@@ -6,21 +6,21 @@
6
6
  overflow: visible;
7
7
  }
8
8
 
9
- html.gRiZQa_rp-dark .gRiZQa_block {
9
+ html.sBksbq_rp-dark .sBksbq_block {
10
10
  border-color: var(--api-color-border);
11
11
  }
12
12
 
13
- .gRiZQa_hasParameters {
13
+ .sBksbq_hasParameters {
14
14
  border-bottom-right-radius: 0;
15
15
  border-bottom-left-radius: 0;
16
16
  margin-bottom: 0;
17
17
  }
18
18
 
19
- .gRiZQa_hasParameters .api-signature-code {
19
+ .sBksbq_hasParameters .api-signature-code {
20
20
  border-bottom-right-radius: 0;
21
21
  border-bottom-left-radius: 0;
22
22
  }
23
23
 
24
- .gRiZQa_hasParameters .api-signature-code pre {
24
+ .sBksbq_hasParameters .api-signature-code pre {
25
25
  border-radius: 0;
26
26
  }
@@ -1,9 +1,9 @@
1
1
  import './index.css';
2
2
  //#region src/runtime/components/MemberSignature/index.module.css
3
3
  var index_module_default = {
4
- "block": "gRiZQa_block",
5
- "hasParameters": "gRiZQa_hasParameters",
6
- "rpDark": "gRiZQa_rp-dark"
4
+ "block": "sBksbq_block",
5
+ "hasParameters": "sBksbq_hasParameters",
6
+ "rpDark": "sBksbq_rp-dark"
7
7
  };
8
8
 
9
9
  //#endregion
@@ -1,4 +1,4 @@
1
- .NDYkiG_table {
1
+ .qRA0fW_table {
2
2
  border: 1px solid var(--api-color-border);
3
3
  border-radius: 0 0 var(--api-border-radius) var(--api-border-radius);
4
4
  border-top: none;
@@ -7,16 +7,16 @@
7
7
  overflow: hidden;
8
8
  }
9
9
 
10
- html.NDYkiG_rp-dark .NDYkiG_table {
10
+ html.qRA0fW_rp-dark .qRA0fW_table {
11
11
  border-color: var(--api-color-border);
12
12
  }
13
13
 
14
- .NDYkiG_scroll {
14
+ .qRA0fW_scroll {
15
15
  -webkit-overflow-scrolling: touch;
16
16
  overflow-x: auto;
17
17
  }
18
18
 
19
- .NDYkiG_table table {
19
+ .qRA0fW_table table {
20
20
  border-collapse: collapse;
21
21
  width: 100%;
22
22
  font-size: var(--api-font-size-base);
@@ -25,12 +25,12 @@ html.NDYkiG_rp-dark .NDYkiG_table {
25
25
  margin: 0;
26
26
  }
27
27
 
28
- .NDYkiG_table thead {
28
+ .qRA0fW_table thead {
29
29
  background-color: var(--api-color-bg);
30
30
  border-bottom: 1px solid var(--api-color-border);
31
31
  }
32
32
 
33
- .NDYkiG_table th {
33
+ .qRA0fW_table th {
34
34
  padding: var(--api-spacing-md) var(--api-spacing-lg);
35
35
  text-align: left;
36
36
  color: var(--api-color-text);
@@ -38,66 +38,66 @@ html.NDYkiG_rp-dark .NDYkiG_table {
38
38
  font-weight: 600;
39
39
  }
40
40
 
41
- .NDYkiG_table th:first-child {
41
+ .qRA0fW_table th:first-child {
42
42
  width: 20%;
43
43
  min-width: 120px;
44
44
  }
45
45
 
46
- .NDYkiG_table th:nth-child(2) {
46
+ .qRA0fW_table th:nth-child(2) {
47
47
  width: 30%;
48
48
  min-width: 150px;
49
49
  }
50
50
 
51
- .NDYkiG_table th:last-child {
51
+ .qRA0fW_table th:last-child {
52
52
  width: 50%;
53
53
  }
54
54
 
55
- .NDYkiG_table td {
55
+ .qRA0fW_table td {
56
56
  padding: var(--api-spacing-md) var(--api-spacing-lg);
57
57
  border-top: 1px solid var(--api-color-border);
58
58
  vertical-align: top;
59
59
  }
60
60
 
61
- .NDYkiG_table td:first-child {
61
+ .qRA0fW_table td:first-child {
62
62
  width: 20%;
63
63
  min-width: 120px;
64
64
  }
65
65
 
66
- .NDYkiG_table td:nth-child(2) {
66
+ .qRA0fW_table td:nth-child(2) {
67
67
  width: 30%;
68
68
  min-width: 150px;
69
69
  }
70
70
 
71
- .NDYkiG_table td:last-child {
71
+ .qRA0fW_table td:last-child {
72
72
  width: 50%;
73
73
  }
74
74
 
75
- .NDYkiG_table td code, .NDYkiG_table th code {
75
+ .qRA0fW_table td code, .qRA0fW_table th code {
76
76
  font-size: var(--api-font-size-sm);
77
77
  background-color: var(--api-color-code-bg);
78
78
  border-radius: var(--api-border-radius-sm);
79
79
  padding: .125rem .375rem;
80
80
  }
81
81
 
82
- .NDYkiG_table td:last-child p:first-child {
82
+ .qRA0fW_table td:last-child p:first-child {
83
83
  margin-top: 0;
84
84
  }
85
85
 
86
- .NDYkiG_table td:last-child p:last-child, .NDYkiG_table td:last-child ul:last-child, .NDYkiG_table td:last-child ol:last-child {
86
+ .qRA0fW_table td:last-child p:last-child, .qRA0fW_table td:last-child ul:last-child, .qRA0fW_table td:last-child ol:last-child {
87
87
  margin-bottom: 0;
88
88
  }
89
89
 
90
90
  @media (width <= 768px) {
91
- .NDYkiG_table td, .NDYkiG_table th {
91
+ .qRA0fW_table td, .qRA0fW_table th {
92
92
  padding: var(--api-spacing-sm) var(--api-spacing-md);
93
93
  font-size: var(--api-font-size-sm);
94
94
  }
95
95
 
96
- .NDYkiG_table td:first-child, .NDYkiG_table th:first-child {
96
+ .qRA0fW_table td:first-child, .qRA0fW_table th:first-child {
97
97
  min-width: 100px;
98
98
  }
99
99
 
100
- .NDYkiG_table td:nth-child(2), .NDYkiG_table th:nth-child(2) {
100
+ .qRA0fW_table td:nth-child(2), .qRA0fW_table th:nth-child(2) {
101
101
  min-width: 120px;
102
102
  }
103
103
  }
@@ -1,9 +1,9 @@
1
1
  import './index.css';
2
2
  //#region src/runtime/components/ParametersTable/index.module.css
3
3
  var index_module_default = {
4
- "rpDark": "NDYkiG_rp-dark",
5
- "scroll": "NDYkiG_scroll",
6
- "table": "NDYkiG_table"
4
+ "rpDark": "qRA0fW_rp-dark",
5
+ "scroll": "qRA0fW_scroll",
6
+ "table": "qRA0fW_table"
7
7
  };
8
8
 
9
9
  //#endregion
@@ -1,4 +1,4 @@
1
- .L_PAPG_block {
1
+ .PJvwTW_block {
2
2
  margin: var(--api-spacing-xl) 0;
3
3
  border-radius: var(--api-border-radius);
4
4
  border: 1px solid var(--api-color-border);
@@ -6,21 +6,21 @@
6
6
  overflow: visible;
7
7
  }
8
8
 
9
- html.L_PAPG_rp-dark .L_PAPG_block {
9
+ html.PJvwTW_rp-dark .PJvwTW_block {
10
10
  border-color: var(--api-color-border);
11
11
  }
12
12
 
13
- .L_PAPG_hasParameters {
13
+ .PJvwTW_hasParameters {
14
14
  border-bottom-right-radius: 0;
15
15
  border-bottom-left-radius: 0;
16
16
  margin-bottom: 0;
17
17
  }
18
18
 
19
- .L_PAPG_hasParameters .api-signature-code {
19
+ .PJvwTW_hasParameters .api-signature-code {
20
20
  border-bottom-right-radius: 0;
21
21
  border-bottom-left-radius: 0;
22
22
  }
23
23
 
24
- .L_PAPG_hasParameters .api-signature-code pre {
24
+ .PJvwTW_hasParameters .api-signature-code pre {
25
25
  border-radius: 0;
26
26
  }
@@ -1,9 +1,9 @@
1
1
  import './index.css';
2
2
  //#region src/runtime/components/SignatureBlock/index.module.css
3
3
  var index_module_default = {
4
- "block": "L_PAPG_block",
5
- "hasParameters": "L_PAPG_hasParameters",
6
- "rpDark": "L_PAPG_rp-dark"
4
+ "block": "PJvwTW_block",
5
+ "hasParameters": "PJvwTW_hasParameters",
6
+ "rpDark": "PJvwTW_rp-dark"
7
7
  };
8
8
 
9
9
  //#endregion
@@ -1,11 +1,11 @@
1
- .Ze8uHG_code {
1
+ ._5P8n3G_code {
2
2
  border-bottom-left-radius: var(--api-border-radius);
3
3
  border-bottom-right-radius: var(--api-border-radius);
4
4
  position: relative;
5
5
  container-type: inline-size;
6
6
  }
7
7
 
8
- .Ze8uHG_code pre {
8
+ ._5P8n3G_code pre {
9
9
  height: auto;
10
10
  max-height: none;
11
11
  padding: var(--api-spacing-lg);
@@ -15,11 +15,11 @@
15
15
  overflow-x: auto;
16
16
  }
17
17
 
18
- html.Ze8uHG_rp-dark .Ze8uHG_code pre {
18
+ html._5P8n3G_rp-dark ._5P8n3G_code pre {
19
19
  background-color: var(--shiki-dark-bg);
20
20
  }
21
21
 
22
- .Ze8uHG_code code {
22
+ ._5P8n3G_code code {
23
23
  background-color: unset;
24
24
  min-height: var(--api-font-size-md);
25
25
  line-height: var(--api-line-height-base);
@@ -28,25 +28,25 @@ html.Ze8uHG_rp-dark .Ze8uHG_code pre {
28
28
  display: flex;
29
29
  }
30
30
 
31
- .Ze8uHG_code code span {
31
+ ._5P8n3G_code code span {
32
32
  color: var(--shiki-light);
33
33
  }
34
34
 
35
- html.Ze8uHG_rp-dark .Ze8uHG_code code span {
35
+ html._5P8n3G_rp-dark ._5P8n3G_code code span {
36
36
  color: var(--shiki-dark);
37
37
  }
38
38
 
39
- .Ze8uHG_code .line {
39
+ ._5P8n3G_code .line {
40
40
  background: none;
41
41
  min-height: 1lh;
42
42
  }
43
43
 
44
- .Ze8uHG_wrapped pre {
44
+ ._5P8n3G_wrapped pre {
45
45
  white-space: pre-wrap;
46
46
  overflow-wrap: break-word;
47
47
  }
48
48
 
49
- .Ze8uHG_wrapped code {
49
+ ._5P8n3G_wrapped code {
50
50
  white-space: pre-wrap;
51
51
  overflow-wrap: break-word;
52
52
  }
@@ -1,9 +1,9 @@
1
1
  import './index.css';
2
2
  //#region src/runtime/components/SignatureCode/index.module.css
3
3
  var index_module_default = {
4
- "code": "Ze8uHG_code",
5
- "rpDark": "Ze8uHG_rp-dark",
6
- "wrapped": "Ze8uHG_wrapped"
4
+ "code": "_5P8n3G_code",
5
+ "rpDark": "_5P8n3G_rp-dark",
6
+ "wrapped": "_5P8n3G_wrapped"
7
7
  };
8
8
 
9
9
  //#endregion
@@ -1,4 +1,4 @@
1
- .HQ_pKG_toolbar {
1
+ .pmgBdW_toolbar {
2
2
  justify-content: flex-end;
3
3
  align-items: flex-end;
4
4
  gap: var(--api-spacing-sm);
@@ -9,16 +9,16 @@
9
9
  display: flex;
10
10
  }
11
11
 
12
- html.HQ_pKG_rp-dark .HQ_pKG_toolbar {
12
+ html.pmgBdW_rp-dark .pmgBdW_toolbar {
13
13
  background-color: var(--api-color-bg);
14
14
  border-bottom-color: var(--api-color-border);
15
15
  }
16
16
 
17
- .HQ_pKG_toolbar:has(.HQ_pKG_memberHeading) {
17
+ .pmgBdW_toolbar:has(.pmgBdW_memberHeading) {
18
18
  justify-content: space-between;
19
19
  }
20
20
 
21
- .HQ_pKG_toolbar h2, .HQ_pKG_toolbar h3 {
21
+ .pmgBdW_toolbar h2, .pmgBdW_toolbar h3 {
22
22
  font-size: var(--api-font-size-lg);
23
23
  padding-left: var(--api-spacing-sm);
24
24
  font-family: var(--rp-font-family-mono);
@@ -26,14 +26,14 @@ html.HQ_pKG_rp-dark .HQ_pKG_toolbar {
26
26
  margin-bottom: 0;
27
27
  }
28
28
 
29
- .HQ_pKG_toolbarLeft {
29
+ .pmgBdW_toolbarLeft {
30
30
  gap: var(--api-spacing-sm);
31
31
  flex-direction: column;
32
32
  flex: 1;
33
33
  display: flex;
34
34
  }
35
35
 
36
- .HQ_pKG_memberHeading {
36
+ .pmgBdW_memberHeading {
37
37
  font-size: var(--api-font-size-md);
38
38
  color: var(--api-color-text);
39
39
  height: auto;
@@ -45,11 +45,11 @@ html.HQ_pKG_rp-dark .HQ_pKG_toolbar {
45
45
  overflow: visible;
46
46
  }
47
47
 
48
- html.HQ_pKG_rp-dark .HQ_pKG_memberHeading {
48
+ html.pmgBdW_rp-dark .pmgBdW_memberHeading {
49
49
  color: var(--api-color-text);
50
50
  }
51
51
 
52
- .HQ_pKG_memberHeading .rp-header-anchor {
52
+ .pmgBdW_memberHeading .rp-header-anchor {
53
53
  opacity: 0;
54
54
  font-weight: 500;
55
55
  font-size: inherit;
@@ -60,16 +60,16 @@ html.HQ_pKG_rp-dark .HQ_pKG_memberHeading {
60
60
  left: -1.2rem;
61
61
  }
62
62
 
63
- .HQ_pKG_memberHeading:hover .rp-header-anchor {
63
+ .pmgBdW_memberHeading:hover .rp-header-anchor {
64
64
  opacity: .85;
65
65
  }
66
66
 
67
- .HQ_pKG_memberHeading .rp-header-anchor:hover {
67
+ .pmgBdW_memberHeading .rp-header-anchor:hover {
68
68
  border-bottom: 1px solid var(--rp-c-brand);
69
69
  opacity: .85;
70
70
  }
71
71
 
72
- .HQ_pKG_memberHeadingH2 {
72
+ .pmgBdW_memberHeadingH2 {
73
73
  font-size: var(--api-font-size-lg);
74
74
  text-transform: lowercase;
75
75
  border-top: none;
@@ -80,19 +80,19 @@ html.HQ_pKG_rp-dark .HQ_pKG_memberHeading {
80
80
  line-height: 2rem;
81
81
  }
82
82
 
83
- .HQ_pKG_memberHeadingH2:before, .HQ_pKG_memberHeadingH2:after {
83
+ .pmgBdW_memberHeadingH2:before, .pmgBdW_memberHeadingH2:after {
84
84
  content: none;
85
85
  margin: 0;
86
86
  padding: 0;
87
87
  display: none;
88
88
  }
89
89
 
90
- .HQ_pKG_memberHeadingH2 .rp-header-anchor {
90
+ .pmgBdW_memberHeadingH2 .rp-header-anchor {
91
91
  font-size: var(--api-font-size-lg);
92
92
  left: -1.5rem;
93
93
  }
94
94
 
95
- .HQ_pKG_summary {
95
+ .pmgBdW_summary {
96
96
  padding: 0;
97
97
  padding-left: var(--api-spacing-sm);
98
98
  font-size: var(--api-font-size-md);
@@ -102,21 +102,21 @@ html.HQ_pKG_rp-dark .HQ_pKG_memberHeading {
102
102
  border: none;
103
103
  }
104
104
 
105
- html.HQ_pKG_rp-dark .HQ_pKG_summary {
105
+ html.pmgBdW_rp-dark .pmgBdW_summary {
106
106
  color: var(--api-color-text-secondary);
107
107
  background-color: #0000;
108
108
  border: none;
109
109
  }
110
110
 
111
- .HQ_pKG_summary p:first-child {
111
+ .pmgBdW_summary p:first-child {
112
112
  margin-top: 0;
113
113
  }
114
114
 
115
- .HQ_pKG_summary p:last-child, .HQ_pKG_summary ul:last-child, .HQ_pKG_summary ol:last-child {
115
+ .pmgBdW_summary p:last-child, .pmgBdW_summary ul:last-child, .pmgBdW_summary ol:last-child {
116
116
  margin-bottom: 0;
117
117
  }
118
118
 
119
- .HQ_pKG_buttons {
119
+ .pmgBdW_buttons {
120
120
  gap: var(--api-spacing-sm);
121
121
  display: flex;
122
122
  }
@@ -1,13 +1,13 @@
1
1
  import './index.css';
2
2
  //#region src/runtime/components/SignatureToolbar/index.module.css
3
3
  var index_module_default = {
4
- "buttons": "HQ_pKG_buttons",
5
- "memberHeading": "HQ_pKG_memberHeading",
6
- "memberHeadingH2": "HQ_pKG_memberHeadingH2",
7
- "rpDark": "HQ_pKG_rp-dark",
8
- "summary": "HQ_pKG_summary",
9
- "toolbar": "HQ_pKG_toolbar",
10
- "toolbarLeft": "HQ_pKG_toolbarLeft"
4
+ "buttons": "pmgBdW_buttons",
5
+ "memberHeading": "pmgBdW_memberHeading",
6
+ "memberHeadingH2": "pmgBdW_memberHeadingH2",
7
+ "rpDark": "pmgBdW_rp-dark",
8
+ "summary": "pmgBdW_summary",
9
+ "toolbar": "pmgBdW_toolbar",
10
+ "toolbarLeft": "pmgBdW_toolbarLeft"
11
11
  };
12
12
 
13
13
  //#endregion
@@ -1,9 +1,9 @@
1
- .Fw3JAa_buttonGroup {
1
+ .yqpEWq_buttonGroup {
2
2
  gap: var(--api-spacing-sm);
3
3
  display: flex;
4
4
  }
5
5
 
6
- .Fw3JAa_button {
6
+ .yqpEWq_button {
7
7
  align-items: center;
8
8
  gap: var(--api-spacing-xs);
9
9
  padding: var(--api-spacing-xs) var(--api-spacing-md);
@@ -19,17 +19,17 @@
19
19
  display: inline-flex;
20
20
  }
21
21
 
22
- .Fw3JAa_button:hover {
22
+ .yqpEWq_button:hover {
23
23
  background-color: var(--api-color-hover-bg);
24
24
  border-color: var(--api-color-border-hover);
25
25
  }
26
26
 
27
- .Fw3JAa_button:active {
27
+ .yqpEWq_button:active {
28
28
  background-color: var(--api-color-active-bg);
29
29
  transform: scale(.98);
30
30
  }
31
31
 
32
- .Fw3JAa_button svg {
32
+ .yqpEWq_button svg {
33
33
  flex-shrink: 0;
34
34
  width: 16px;
35
35
  height: 16px;
@@ -1,8 +1,8 @@
1
1
  import './index.css';
2
2
  //#region src/runtime/components/buttons/index.module.css
3
3
  var index_module_default = {
4
- "button": "Fw3JAa_button",
5
- "buttonGroup": "Fw3JAa_buttonGroup"
4
+ "button": "yqpEWq_button",
5
+ "buttonGroup": "yqpEWq_buttonGroup"
6
6
  };
7
7
 
8
8
  //#endregion
@@ -0,0 +1,74 @@
1
+ import { ApiExportedMixin, ApiItemKind, ExcerptTokenKind } from "@microsoft/api-extractor-model";
2
+
3
+ //#region src/synthetic-bases.ts
4
+ /**
5
+ * Anchor id of the inline "Base Class" section rendered on the owner class
6
+ * page. Must match the slug RSPress derives from the `## Base Class` heading
7
+ * emitted by ClassPageGenerator.
8
+ */
9
+ const BASE_CLASS_ANCHOR = "base-class";
10
+ const EMPTY_DETECTION = {
11
+ bases: /* @__PURE__ */ new Map(),
12
+ baseByOwner: /* @__PURE__ */ new Map()
13
+ };
14
+ /**
15
+ * Strip the trailing meaning (`:class`, `:var`, `:function(1)`, ...) from a
16
+ * canonical reference string so the reference token in an extends clause
17
+ * (`example!~Person_base`) matches the declaration's canonical reference
18
+ * (`example!~Person_base:var`).
19
+ */
20
+ function stripMeaning(canonicalRef) {
21
+ return canonicalRef.replace(/:[a-z]+(\(\d+\))?$/i, "");
22
+ }
23
+ /** True when the item carries ApiExportedMixin and is NOT exported from its entry point. */
24
+ function isUnexported(item) {
25
+ return ApiExportedMixin.isBaseClassOf(item) && !item.isExported;
26
+ }
27
+ /**
28
+ * Detect synthetic base declarations among top-level API items.
29
+ *
30
+ * An item qualifies when it is unexported (hoisted into the model only because
31
+ * something references it) AND at least one class's extends clause references
32
+ * its canonical symbol. Unexported items with no class referencing them
33
+ * (genuine forgotten exports) are left alone, as are extends references whose
34
+ * target is absent from the model.
35
+ */
36
+ function detectSyntheticBases(items) {
37
+ const unexportedByRef = /* @__PURE__ */ new Map();
38
+ for (const item of items) {
39
+ if (!isUnexported(item)) continue;
40
+ const ref = item.canonicalReference?.toString();
41
+ if (ref) unexportedByRef.set(stripMeaning(ref), item);
42
+ }
43
+ if (unexportedByRef.size === 0) return EMPTY_DETECTION;
44
+ const owners = /* @__PURE__ */ new Map();
45
+ const baseByOwner = /* @__PURE__ */ new Map();
46
+ for (const item of items) {
47
+ if (item.kind !== ApiItemKind.Class) continue;
48
+ const apiClass = item;
49
+ const extendsType = apiClass.extendsType;
50
+ if (!extendsType) continue;
51
+ for (const token of extendsType.excerpt.spannedTokens) {
52
+ if (token.kind !== ExcerptTokenKind.Reference || !token.canonicalReference) continue;
53
+ const base = unexportedByRef.get(stripMeaning(token.canonicalReference.toString()));
54
+ if (!base || base === item || baseByOwner.has(item)) continue;
55
+ baseByOwner.set(item, base);
56
+ const ownerList = owners.get(base);
57
+ if (ownerList) ownerList.push(apiClass);
58
+ else owners.set(base, [apiClass]);
59
+ }
60
+ }
61
+ if (owners.size === 0) return EMPTY_DETECTION;
62
+ const bases = /* @__PURE__ */ new Map();
63
+ for (const [baseItem, ownerClasses] of owners) bases.set(baseItem, {
64
+ baseItem,
65
+ ownerClasses
66
+ });
67
+ return {
68
+ bases,
69
+ baseByOwner
70
+ };
71
+ }
72
+
73
+ //#endregion
74
+ export { BASE_CLASS_ANCHOR, detectSyntheticBases };