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 +1 -0
- package/build-stages.js +19 -5
- package/markdown/page-generators/class-page.js +24 -1
- package/package.json +2 -2
- package/runtime/components/EnumMembersTable/index.css +18 -18
- package/runtime/components/EnumMembersTable/index.module.js +3 -3
- package/runtime/components/ExampleBlock/index.css +2 -2
- package/runtime/components/ExampleBlock/index.module.js +2 -2
- package/runtime/components/MemberSignature/index.css +5 -5
- package/runtime/components/MemberSignature/index.module.js +3 -3
- package/runtime/components/ParametersTable/index.css +19 -19
- package/runtime/components/ParametersTable/index.module.js +3 -3
- package/runtime/components/SignatureBlock/index.css +5 -5
- package/runtime/components/SignatureBlock/index.module.js +3 -3
- package/runtime/components/SignatureCode/index.css +9 -9
- package/runtime/components/SignatureCode/index.module.js +3 -3
- package/runtime/components/SignatureToolbar/index.css +18 -18
- package/runtime/components/SignatureToolbar/index.module.js +7 -7
- package/runtime/components/buttons/index.css +5 -5
- package/runtime/components/buttons/index.module.js +2 -2
- package/synthetic-bases.js +74 -0
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
|
|
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(
|
|
76
|
-
const namespaceMembers = ApiParser.extractNamespaceMembers(
|
|
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
|
+
"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": "
|
|
17
|
+
"directory": "package"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"author": "Spencer Beggs",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
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.
|
|
10
|
+
html._9sEZ2a_rp-dark ._9sEZ2a_table {
|
|
11
11
|
border-color: var(--api-color-border);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.
|
|
14
|
+
._9sEZ2a_scroll {
|
|
15
15
|
-webkit-overflow-scrolling: touch;
|
|
16
16
|
overflow-x: auto;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
41
|
+
._9sEZ2a_table th:first-child {
|
|
42
42
|
width: 20%;
|
|
43
43
|
min-width: 120px;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.
|
|
46
|
+
._9sEZ2a_table th:nth-child(2) {
|
|
47
47
|
width: 25%;
|
|
48
48
|
min-width: 120px;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
.
|
|
51
|
+
._9sEZ2a_table th:last-child {
|
|
52
52
|
width: 55%;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.
|
|
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
|
-
.
|
|
61
|
+
._9sEZ2a_table td:first-child {
|
|
62
62
|
width: 20%;
|
|
63
63
|
min-width: 120px;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
.
|
|
66
|
+
._9sEZ2a_table td:nth-child(2) {
|
|
67
67
|
width: 25%;
|
|
68
68
|
min-width: 120px;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
.
|
|
71
|
+
._9sEZ2a_table td:last-child {
|
|
72
72
|
width: 55%;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
.
|
|
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
|
-
.
|
|
82
|
+
._9sEZ2a_table td:last-child p:first-child {
|
|
83
83
|
margin-top: 0;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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": "
|
|
5
|
-
"scroll": "
|
|
6
|
-
"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
|
-
.
|
|
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.
|
|
9
|
+
html.L3GWXq_rp-dark .L3GWXq_block {
|
|
10
10
|
border-color: var(--api-color-border);
|
|
11
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
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.
|
|
9
|
+
html.sBksbq_rp-dark .sBksbq_block {
|
|
10
10
|
border-color: var(--api-color-border);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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": "
|
|
5
|
-
"hasParameters": "
|
|
6
|
-
"rpDark": "
|
|
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
|
-
.
|
|
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.
|
|
10
|
+
html.qRA0fW_rp-dark .qRA0fW_table {
|
|
11
11
|
border-color: var(--api-color-border);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.
|
|
14
|
+
.qRA0fW_scroll {
|
|
15
15
|
-webkit-overflow-scrolling: touch;
|
|
16
16
|
overflow-x: auto;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
41
|
+
.qRA0fW_table th:first-child {
|
|
42
42
|
width: 20%;
|
|
43
43
|
min-width: 120px;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.
|
|
46
|
+
.qRA0fW_table th:nth-child(2) {
|
|
47
47
|
width: 30%;
|
|
48
48
|
min-width: 150px;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
.
|
|
51
|
+
.qRA0fW_table th:last-child {
|
|
52
52
|
width: 50%;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.
|
|
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
|
-
.
|
|
61
|
+
.qRA0fW_table td:first-child {
|
|
62
62
|
width: 20%;
|
|
63
63
|
min-width: 120px;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
.
|
|
66
|
+
.qRA0fW_table td:nth-child(2) {
|
|
67
67
|
width: 30%;
|
|
68
68
|
min-width: 150px;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
.
|
|
71
|
+
.qRA0fW_table td:last-child {
|
|
72
72
|
width: 50%;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
.
|
|
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
|
-
.
|
|
82
|
+
.qRA0fW_table td:last-child p:first-child {
|
|
83
83
|
margin-top: 0;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
96
|
+
.qRA0fW_table td:first-child, .qRA0fW_table th:first-child {
|
|
97
97
|
min-width: 100px;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
.
|
|
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": "
|
|
5
|
-
"scroll": "
|
|
6
|
-
"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
|
-
.
|
|
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.
|
|
9
|
+
html.PJvwTW_rp-dark .PJvwTW_block {
|
|
10
10
|
border-color: var(--api-color-border);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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": "
|
|
5
|
-
"hasParameters": "
|
|
6
|
-
"rpDark": "
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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.
|
|
18
|
+
html._5P8n3G_rp-dark ._5P8n3G_code pre {
|
|
19
19
|
background-color: var(--shiki-dark-bg);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.
|
|
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
|
-
.
|
|
31
|
+
._5P8n3G_code code span {
|
|
32
32
|
color: var(--shiki-light);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
html.
|
|
35
|
+
html._5P8n3G_rp-dark ._5P8n3G_code code span {
|
|
36
36
|
color: var(--shiki-dark);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.
|
|
39
|
+
._5P8n3G_code .line {
|
|
40
40
|
background: none;
|
|
41
41
|
min-height: 1lh;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
.
|
|
44
|
+
._5P8n3G_wrapped pre {
|
|
45
45
|
white-space: pre-wrap;
|
|
46
46
|
overflow-wrap: break-word;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.
|
|
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": "
|
|
5
|
-
"rpDark": "
|
|
6
|
-
"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
|
-
.
|
|
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.
|
|
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
|
-
.
|
|
17
|
+
.pmgBdW_toolbar:has(.pmgBdW_memberHeading) {
|
|
18
18
|
justify-content: space-between;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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.
|
|
48
|
+
html.pmgBdW_rp-dark .pmgBdW_memberHeading {
|
|
49
49
|
color: var(--api-color-text);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
.
|
|
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
|
-
.
|
|
63
|
+
.pmgBdW_memberHeading:hover .rp-header-anchor {
|
|
64
64
|
opacity: .85;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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.
|
|
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
|
-
.
|
|
111
|
+
.pmgBdW_summary p:first-child {
|
|
112
112
|
margin-top: 0;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
.
|
|
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
|
-
.
|
|
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": "
|
|
5
|
-
"memberHeading": "
|
|
6
|
-
"memberHeadingH2": "
|
|
7
|
-
"rpDark": "
|
|
8
|
-
"summary": "
|
|
9
|
-
"toolbar": "
|
|
10
|
-
"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
|
-
.
|
|
1
|
+
.yqpEWq_buttonGroup {
|
|
2
2
|
gap: var(--api-spacing-sm);
|
|
3
3
|
display: flex;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
27
|
+
.yqpEWq_button:active {
|
|
28
28
|
background-color: var(--api-color-active-bg);
|
|
29
29
|
transform: scale(.98);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
.
|
|
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": "
|
|
5
|
-
"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 };
|