@principal-ai/subsystems-react 0.45.0 → 0.47.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/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts +0 -4
- package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts.map +1 -1
- package/dist/stories/Subsystem/ComponentGraph/fixtures.js +0 -16
- package/dist/stories/Subsystem/ComponentGraph/fixtures.js.map +1 -1
- package/dist/subsystem/ConstructsCatalog.d.ts +1 -2
- package/dist/subsystem/ConstructsCatalog.d.ts.map +1 -1
- package/dist/subsystem/ConstructsCatalog.js +2 -13
- package/dist/subsystem/ConstructsCatalog.js.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.d.ts +0 -6
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +5 -16
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/dist/subsystem/formatDeclaration.d.ts.map +1 -1
- package/dist/subsystem/formatDeclaration.js +6 -1
- package/dist/subsystem/formatDeclaration.js.map +1 -1
- package/dist/subsystem/symbolRefs.d.ts +8 -4
- package/dist/subsystem/symbolRefs.d.ts.map +1 -1
- package/dist/subsystem/symbolRefs.js +8 -36
- package/dist/subsystem/symbolRefs.js.map +1 -1
- package/package.json +3 -3
- package/src/stories/Subsystem/ComponentDeclarationSymbols.stories.tsx +0 -9
- package/src/stories/Subsystem/ComponentGraph/fixtures.ts +0 -20
- package/src/subsystem/ConstructsCatalog.tsx +1 -15
- package/src/subsystem/SubsystemComponentGraph.tsx +4 -23
- package/src/subsystem/formatDeclaration.ts +7 -1
- package/src/subsystem/symbolRefs.test.ts +1 -9
- package/src/subsystem/symbolRefs.ts +8 -35
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbolRefs.js","sourceRoot":"","sources":["../../src/subsystem/symbolRefs.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"symbolRefs.js","sourceRoot":"","sources":["../../src/subsystem/symbolRefs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAoFH;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAyC;IAEzC,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC;AAC5B,CAAC;AAED,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E,yEAAyE;AACzE,MAAM,UAAU,GAAwB,IAAI,GAAG,CAAC;IAC9C,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,MAAM;IACN,WAAW;IACX,OAAO;IACP,KAAK;IACL,SAAS;IACT,QAAQ;IACR,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,OAAO;IACP,KAAK;IACL,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;CACN,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC;IACrD,KAAK;IACL,OAAO;IACP,QAAQ;IACR,MAAM;IACN,YAAY;CACb,CAAC,CAAC;AAEH,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC;IAChD,aAAa;IACb,SAAS;IACT,OAAO;IACP,OAAO;IACP,MAAM;IACN,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,OAAO;IACP,eAAe;IACf,aAAa;IACb,aAAa;IACb,SAAS;IACT,aAAa;IACb,KAAK;IACL,KAAK;IACL,SAAS;IACT,SAAS;IACT,UAAU;IACV,UAAU;IACV,eAAe;IACf,WAAW;IACX,SAAS;IACT,UAAU;IACV,UAAU;IACV,QAAQ;IACR,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,aAAa;IACb,cAAc;CACf,CAAC,CAAC;AAEH,SAAS,aAAa,CA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,MAAM;QACR;YACE,MAAM;KACT;IAED,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAC9B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@principal-ai/subsystems-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0",
|
|
4
4
|
"description": "React UI for Subsystem Models — graph, Pierre code views, and session-event feeds",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@pierre/diffs": ">=1.1.20",
|
|
40
40
|
"@principal-ade/industry-theme": "^0.1.7",
|
|
41
|
-
"@principal-ai/subsystems-core": "^0.
|
|
41
|
+
"@principal-ai/subsystems-core": "^0.45.0",
|
|
42
42
|
"react": "^18.0.0 || ^19.0.0",
|
|
43
43
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
44
44
|
},
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@pierre/diffs": "1.3.6",
|
|
47
47
|
"@principal-ade/industry-theme": "0.1.7",
|
|
48
48
|
"@principal-ai/agent-monitoring": "^0.3.38",
|
|
49
|
-
"@principal-ai/subsystems-core": "^0.
|
|
49
|
+
"@principal-ai/subsystems-core": "^0.45.0",
|
|
50
50
|
"@storybook/addon-docs": "10.1.2",
|
|
51
51
|
"@storybook/addon-links": "10.1.2",
|
|
52
52
|
"@storybook/addon-onboarding": "10.1.2",
|
|
@@ -47,8 +47,6 @@ const INSPECTIONS: Record<string, SymbolInspection> = {
|
|
|
47
47
|
{ name: 'at', type: 'number' },
|
|
48
48
|
{ name: 'payload', type: 'unknown' },
|
|
49
49
|
],
|
|
50
|
-
usedBy: [],
|
|
51
|
-
implementors: [],
|
|
52
50
|
},
|
|
53
51
|
},
|
|
54
52
|
BaseProcessor: {
|
|
@@ -67,8 +65,6 @@ const INSPECTIONS: Record<string, SymbolInspection> = {
|
|
|
67
65
|
properties: [],
|
|
68
66
|
extends: [],
|
|
69
67
|
implements: [],
|
|
70
|
-
instantiations: [],
|
|
71
|
-
references: [],
|
|
72
68
|
},
|
|
73
69
|
},
|
|
74
70
|
// Limited: graphify resolved the location but couldn't reconstruct the
|
|
@@ -127,8 +123,6 @@ const INSPECTIONS: Record<string, SymbolInspection> = {
|
|
|
127
123
|
{ name: 'admittedSeq', type: 'number' },
|
|
128
124
|
{ name: 'events', type: 'SessionEvent[]' },
|
|
129
125
|
],
|
|
130
|
-
usedBy: [],
|
|
131
|
-
implementors: [],
|
|
132
126
|
},
|
|
133
127
|
},
|
|
134
128
|
'capture-session': {
|
|
@@ -144,8 +138,6 @@ const INSPECTIONS: Record<string, SymbolInspection> = {
|
|
|
144
138
|
kind: 'function',
|
|
145
139
|
parameters: [{ name: 'session', type: 'SessionRecord' }],
|
|
146
140
|
returnType: 'Promise<void>',
|
|
147
|
-
callers: [],
|
|
148
|
-
callees: [],
|
|
149
141
|
},
|
|
150
142
|
},
|
|
151
143
|
};
|
|
@@ -235,7 +227,6 @@ const classComponent: SubsystemComponent = {
|
|
|
235
227
|
],
|
|
236
228
|
extends: ['BaseProcessor'],
|
|
237
229
|
implements: ['Disposable', 'EventEmitterLike'],
|
|
238
|
-
instantiations: [],
|
|
239
230
|
references: [{ nodeId: 'n-emitter', name: 'EventEmitterLike', context: 'type' }],
|
|
240
231
|
} satisfies GraphifyComponentDetail,
|
|
241
232
|
};
|
|
@@ -45,18 +45,6 @@ export function trailFromSteps(
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
/** @deprecated story helper — prefer `graphSpecFromSteps` + `trailFromSteps`. */
|
|
49
|
-
export function edges(
|
|
50
|
-
spec: Array<[from: string, to: string, mechanism: SubsystemComponentEdge['mechanism']]>,
|
|
51
|
-
): SubsystemComponentEdge[] {
|
|
52
|
-
return spec.map(([from, to, mechanism], i) => ({
|
|
53
|
-
id: `e${i}`,
|
|
54
|
-
from,
|
|
55
|
-
to,
|
|
56
|
-
mechanism,
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
48
|
/** Turn every spec entry into a trail step — the sole authored edge form. */
|
|
61
49
|
export function graphSpecFromSteps(
|
|
62
50
|
spec: Array<[from: string, to: string, mechanism: SubsystemComponentEdge['mechanism']]>,
|
|
@@ -161,11 +149,3 @@ const investigateSpec = graphSpecFromSteps([
|
|
|
161
149
|
]);
|
|
162
150
|
|
|
163
151
|
export const investigateOnlyTrails = investigateSpec.trails;
|
|
164
|
-
|
|
165
|
-
/** @deprecated use investigateOnlyTrails */
|
|
166
|
-
export const investigateOnlyEdges: SubsystemComponentEdge[] = edges([
|
|
167
|
-
['v1', 'input', 'produces'],
|
|
168
|
-
['v2', 'input', 'produces'],
|
|
169
|
-
['input', 'acc', 'feeds'],
|
|
170
|
-
['acc', 'out', 'produces'],
|
|
171
|
-
]);
|
|
@@ -60,7 +60,6 @@ export interface ConstructsCatalogProps {
|
|
|
60
60
|
sidebarExtra?: ReactNode;
|
|
61
61
|
sidebarAfterDescription?: ReactNode;
|
|
62
62
|
renderFileViewer?: (file: string, opts?: SubsystemOpenFileOptions) => ReactNode;
|
|
63
|
-
renderFileView?: (component: SubsystemComponent) => ReactNode;
|
|
64
63
|
onFileSelect?: (file: string) => void;
|
|
65
64
|
componentVerification?: ComponentVerificationState | null;
|
|
66
65
|
/** Referenced-symbol click → host graphify lookup (purl/file from the card). */
|
|
@@ -192,7 +191,6 @@ export function ConstructsCatalog({
|
|
|
192
191
|
sidebarExtra,
|
|
193
192
|
sidebarAfterDescription,
|
|
194
193
|
renderFileViewer,
|
|
195
|
-
renderFileView,
|
|
196
194
|
onFileSelect,
|
|
197
195
|
componentVerification,
|
|
198
196
|
onInspectSymbol,
|
|
@@ -537,19 +535,7 @@ export function ConstructsCatalog({
|
|
|
537
535
|
[components, show, searchActive],
|
|
538
536
|
);
|
|
539
537
|
|
|
540
|
-
const fileViewer =
|
|
541
|
-
if (renderFileViewer) return renderFileViewer;
|
|
542
|
-
if (renderFileView) {
|
|
543
|
-
const byFile = new Map(
|
|
544
|
-
components.filter((c) => c.file).map((c) => [c.file, c] as const),
|
|
545
|
-
);
|
|
546
|
-
return (file: string, _opts?: SubsystemOpenFileOptions) => {
|
|
547
|
-
const comp = byFile.get(file);
|
|
548
|
-
return comp ? renderFileView(comp) : null;
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
return undefined;
|
|
552
|
-
}, [renderFileViewer, renderFileView, components]);
|
|
538
|
+
const fileViewer = renderFileViewer;
|
|
553
539
|
|
|
554
540
|
const fileViewerRef = useRef(fileViewer);
|
|
555
541
|
fileViewerRef.current = fileViewer;
|
|
@@ -380,12 +380,6 @@ export interface SubsystemComponentGraphProps {
|
|
|
380
380
|
* to false.
|
|
381
381
|
*/
|
|
382
382
|
hideDrawer?: boolean;
|
|
383
|
-
/**
|
|
384
|
-
* Legacy component-keyed variant, kept for backward compatibility. When
|
|
385
|
-
* `renderFileViewer` is absent, drawer content resolves via the first
|
|
386
|
-
* component whose `file` matches the opened path.
|
|
387
|
-
*/
|
|
388
|
-
renderFileView?: (component: SubsystemComponent) => ReactNode;
|
|
389
383
|
/**
|
|
390
384
|
* Called when a file in the sidebar file tree is clicked (repo-root-relative
|
|
391
385
|
* path). The tree is derived from the components' `file` values.
|
|
@@ -524,7 +518,7 @@ interface InnerProps extends SubsystemComponentGraphProps {
|
|
|
524
518
|
measured: { w: number; h: number } | null;
|
|
525
519
|
}
|
|
526
520
|
|
|
527
|
-
function Inner({ components, trails, graphifyRelations, orderByLine, initialTrailId, onReorderTrails, onSelect, onEdgeSelect, measured: _measured, maxNodeWidth, showEdgeLabels, showSingletonFrames = true, moduleNesting, edgeView, title, hideSidebar, trailStepMode = 'focus', autoPlayTrails = false, trailAutoPlayIntervalMs = TRAIL_PLAY_PAUSE_MS, zoomOnTrailFocus = true, trailFocusDurationMs = 300, graphTitle, showTrailTitle = false, description, canvasOverlay, sidebarExtra, sidebarAfterDescription, diagnostic, issues, showIssues, focusIssueCategory, onSelectIssue, onApplyIssueFix, onHoverIssue,
|
|
521
|
+
function Inner({ components, trails, graphifyRelations, orderByLine, initialTrailId, onReorderTrails, onSelect, onEdgeSelect, measured: _measured, maxNodeWidth, showEdgeLabels, showSingletonFrames = true, moduleNesting, edgeView, title, hideSidebar, trailStepMode = 'focus', autoPlayTrails = false, trailAutoPlayIntervalMs = TRAIL_PLAY_PAUSE_MS, zoomOnTrailFocus = true, trailFocusDurationMs = 300, graphTitle, showTrailTitle = false, description, canvasOverlay, sidebarExtra, sidebarAfterDescription, diagnostic, issues, showIssues, focusIssueCategory, onSelectIssue, onApplyIssueFix, onHoverIssue, renderFileViewer, renderTrailViewer, onFileSelect, componentVerification, onInspectSymbol, boundaryColors, hideDrawer = false, persistKey, liveEvents, agentsPanel }: InnerProps) {
|
|
528
522
|
const { theme } = useTheme();
|
|
529
523
|
const { fitView, fitBounds, screenToFlowPosition } = useReactFlow();
|
|
530
524
|
const viewport = useViewport();
|
|
@@ -2465,21 +2459,9 @@ function Inner({ components, trails, graphifyRelations, orderByLine, initialTrai
|
|
|
2465
2459
|
return components.find((c) => c.alias === hoveredComponentAlias)?.file ?? null;
|
|
2466
2460
|
}, [components, hoveredComponentAlias]);
|
|
2467
2461
|
|
|
2468
|
-
// Drawer content renderer
|
|
2469
|
-
//
|
|
2470
|
-
const fileViewer =
|
|
2471
|
-
if (renderFileViewer) return renderFileViewer;
|
|
2472
|
-
if (renderFileView) {
|
|
2473
|
-
const byFile = new Map(
|
|
2474
|
-
components.filter((c) => c.file).map((c) => [c.file, c] as const),
|
|
2475
|
-
);
|
|
2476
|
-
return (file: string, _opts?: SubsystemOpenFileOptions) => {
|
|
2477
|
-
const comp = byFile.get(file);
|
|
2478
|
-
return comp ? renderFileView(comp) : null;
|
|
2479
|
-
};
|
|
2480
|
-
}
|
|
2481
|
-
return renderFileViewer;
|
|
2482
|
-
}, [renderFileViewer, renderFileView, components]);
|
|
2462
|
+
// Drawer content renderer. Path-keyed only — the component-keyed
|
|
2463
|
+
// `renderFileView` variant was removed; nothing in-repo passed it.
|
|
2464
|
+
const fileViewer = renderFileViewer;
|
|
2483
2465
|
|
|
2484
2466
|
const fileViewerRef = useRef(fileViewer);
|
|
2485
2467
|
fileViewerRef.current = fileViewer;
|
|
@@ -3372,7 +3354,6 @@ export function SubsystemComponentGraph(props: SubsystemComponentGraphProps) {
|
|
|
3372
3354
|
sidebarExtra={props.sidebarExtra}
|
|
3373
3355
|
sidebarAfterDescription={props.sidebarAfterDescription}
|
|
3374
3356
|
renderFileViewer={props.renderFileViewer}
|
|
3375
|
-
renderFileView={props.renderFileView}
|
|
3376
3357
|
onFileSelect={props.onFileSelect}
|
|
3377
3358
|
componentVerification={props.componentVerification}
|
|
3378
3359
|
onInspectSymbol={props.onInspectSymbol}
|
|
@@ -63,7 +63,13 @@ export function generateDeclarationString(component: SubsystemComponent): string
|
|
|
63
63
|
// bypass Prettier.
|
|
64
64
|
{
|
|
65
65
|
const kindLabel = component.entityKind ? ` — ${component.entityKind}` : '';
|
|
66
|
-
|
|
66
|
+
// `attributes` is schema-required on custom_entity, but a declaration can
|
|
67
|
+
// arrive from an older record or a direct hand-edit that predates it, so
|
|
68
|
+
// guard rather than trust. The store no longer backfills it.
|
|
69
|
+
const attrs =
|
|
70
|
+
declaration?.kind === 'custom_entity' && Array.isArray(declaration.attributes)
|
|
71
|
+
? declaration.attributes
|
|
72
|
+
: [];
|
|
67
73
|
const attrLines = attrs.map((a) => ` ${a.key}: ${a.value}`).join('\n');
|
|
68
74
|
return attrLines
|
|
69
75
|
? `entity '${name}'${kindLabel}\n${attrLines}`
|
|
@@ -22,15 +22,11 @@ describe('extractDeclarationSymbolRefs — function', () => {
|
|
|
22
22
|
{ name: 'options', type: 'Required<ProcessingOptions>' },
|
|
23
23
|
],
|
|
24
24
|
returnType: 'SessionEvent[]',
|
|
25
|
-
callers: [{ nodeId: 'c1', name: 'capture-session', source_location: 'L120' }],
|
|
26
|
-
callees: [{ nodeId: 'c2', name: 'toUniversalEvents()', source_location: 'L64' }],
|
|
27
25
|
};
|
|
28
26
|
expect(names(declaration)).toEqual([
|
|
29
27
|
'ProcessingOptions',
|
|
30
28
|
'SessionEvent',
|
|
31
29
|
'SessionRecord',
|
|
32
|
-
'capture-session',
|
|
33
|
-
'toUniversalEvents',
|
|
34
30
|
]);
|
|
35
31
|
});
|
|
36
32
|
|
|
@@ -114,21 +110,17 @@ describe('extractDeclarationSymbolRefs — class', () => {
|
|
|
114
110
|
});
|
|
115
111
|
|
|
116
112
|
describe('extractDeclarationSymbolRefs — type', () => {
|
|
117
|
-
test('collects
|
|
113
|
+
test('collects property, alias and union members', () => {
|
|
118
114
|
const declaration: GraphifyComponentDetail = {
|
|
119
115
|
kind: 'type',
|
|
120
116
|
properties: [{ name: 'id', type: 'BrandedId' }],
|
|
121
|
-
usedBy: [{ nodeId: 'u1', name: 'normalize', context: 'type' }],
|
|
122
|
-
implementors: ['HostInfo'],
|
|
123
117
|
aliasOf: 'ServerSessionRow',
|
|
124
118
|
unionOf: ["'started'", 'StoppedState'],
|
|
125
119
|
};
|
|
126
120
|
expect(names(declaration)).toEqual([
|
|
127
121
|
'BrandedId',
|
|
128
|
-
'HostInfo',
|
|
129
122
|
'ServerSessionRow',
|
|
130
123
|
'StoppedState',
|
|
131
|
-
'normalize',
|
|
132
124
|
]);
|
|
133
125
|
});
|
|
134
126
|
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
* Referenced symbols inside a component's declaration.
|
|
3
3
|
*
|
|
4
4
|
* A declaration mentions other symbols — parameter/return types, property
|
|
5
|
-
* types, `extends`/`implements
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* types, and `extends`/`implements`. This module flattens the structured
|
|
6
|
+
* declaration into a deduped, lookup-friendly list so the panel can offer a
|
|
7
|
+
* graphify inspection per name, and defines the payload graphify returns for one.
|
|
8
|
+
*
|
|
9
|
+
* Call-graph edges (`callers`/`callees`, and the class `references` / type
|
|
10
|
+
* `usedBy` + `implementors` buckets) were removed from the document: nothing
|
|
11
|
+
* ever populated them, and the inspection a click performs resolves against the
|
|
12
|
+
* host's graphify cache at call time rather than reading stored edges.
|
|
9
13
|
*
|
|
10
14
|
* Slice 1 is display-only: the inspection payload is produced by the host (or,
|
|
11
15
|
* in stories, by a fixture). Nothing here reads the graph.
|
|
@@ -232,17 +236,6 @@ function extractNestedTypeNames(type: string): string[] {
|
|
|
232
236
|
return [...found];
|
|
233
237
|
}
|
|
234
238
|
|
|
235
|
-
/**
|
|
236
|
-
* Normalize a callable/related label (`normalize()`, `.get`, `capture-session`)
|
|
237
|
-
* to a name. Labels are freer than type expressions — kebab-case is common.
|
|
238
|
-
*/
|
|
239
|
-
function normalizeRelatedName(raw: string | undefined): string | null {
|
|
240
|
-
if (!raw) return null;
|
|
241
|
-
const t = raw.trim().replace(/^\./, '').replace(/\(\)$/, '');
|
|
242
|
-
if (!/^[A-Za-z_$][\w$.-]*$/.test(t)) return null;
|
|
243
|
-
return PRIMITIVES.has(t) ? null : t;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
239
|
/**
|
|
247
240
|
* Flatten a declaration into the set of symbols it references, deduped by name.
|
|
248
241
|
* Entries backed by a `nodeId` win over bare-name entries.
|
|
@@ -287,23 +280,10 @@ export function extractDeclarationSymbolRefs(
|
|
|
287
280
|
for (const name of extractNestedTypeNames(t)) add(name, { context });
|
|
288
281
|
};
|
|
289
282
|
|
|
290
|
-
const addCall = (
|
|
291
|
-
call: { name?: string; source_location?: string } | undefined,
|
|
292
|
-
context: string,
|
|
293
|
-
) => {
|
|
294
|
-
if (!call) return;
|
|
295
|
-
add(normalizeRelatedName(call.name), {
|
|
296
|
-
context,
|
|
297
|
-
sourceLocation: call.source_location,
|
|
298
|
-
});
|
|
299
|
-
};
|
|
300
|
-
|
|
301
283
|
switch (declaration.kind) {
|
|
302
284
|
case 'function':
|
|
303
285
|
for (const p of declaration.parameters ?? []) addType(p.type, p.ref, 'parameter_type');
|
|
304
286
|
addType(declaration.returnType, declaration.returnTypeRef, 'return_type');
|
|
305
|
-
for (const c of declaration.callers ?? []) addCall(c, 'caller');
|
|
306
|
-
for (const c of declaration.callees ?? []) addCall(c, 'callee');
|
|
307
287
|
break;
|
|
308
288
|
case 'method':
|
|
309
289
|
for (const p of declaration.parameters ?? []) addType(p.type, p.ref, 'parameter_type');
|
|
@@ -319,18 +299,11 @@ export function extractDeclarationSymbolRefs(
|
|
|
319
299
|
}
|
|
320
300
|
for (const name of declaration.extends ?? []) addType(name, undefined, 'extends');
|
|
321
301
|
for (const name of declaration.implements ?? []) addType(name, undefined, 'implements');
|
|
322
|
-
for (const r of declaration.references ?? []) {
|
|
323
|
-
add(normalizeRelatedName(r.name), { ref: r, context: r.context ?? 'references' });
|
|
324
|
-
}
|
|
325
302
|
break;
|
|
326
303
|
case 'type':
|
|
327
304
|
for (const p of declaration.properties ?? []) {
|
|
328
305
|
addType(p.type, p.typeRef, 'field');
|
|
329
306
|
}
|
|
330
|
-
for (const r of declaration.usedBy ?? []) {
|
|
331
|
-
add(normalizeRelatedName(r.name), { ref: r, context: r.context ?? 'usedBy' });
|
|
332
|
-
}
|
|
333
|
-
for (const name of declaration.implementors ?? []) addType(name, undefined, 'implementor');
|
|
334
307
|
addType(declaration.aliasOf, undefined, 'alias');
|
|
335
308
|
for (const alt of declaration.unionOf ?? []) addType(alt, undefined, 'union');
|
|
336
309
|
break;
|