refactor(devtools): update debug signal node type to match core type (#64127)

Use a union string type instead of a generic string.

PR Close #64127
This commit is contained in:
hawkgs
2025-09-29 10:43:25 +03:00
committed by Jessica Janiuk
parent daaad1e6b0
commit 9b7a79af3a
3 changed files with 12 additions and 3 deletions
@@ -19,13 +19,14 @@ import {
} from './signals-value-tree/signals-value-tree.component';
import {ButtonComponent} from '../../../../shared/button/button.component';
const TYPE_CLASS_MAP: {[key: string]: string} = {
const TYPE_CLASS_MAP: {[key in DebugSignalGraphNode['kind']]: string} = {
'signal': 'type-signal',
'computed': 'type-computed',
'effect': 'type-effect',
'afterRenderEffectPhase': 'type-effect',
'template': 'type-template',
'linkedSignal': 'type-linked-signal',
'unknown': 'type-unknown',
};
@Component({
@@ -10,13 +10,14 @@ import {DebugSignalGraph, DebugSignalGraphNode} from '../../../../../../protocol
import * as d3 from 'd3';
import {graphlib, render as dagreRender} from 'dagre-d3-es';
const KIND_CLASS_MAP: {[key: string]: string} = {
const KIND_CLASS_MAP: {[key in DebugSignalGraphNode['kind']]: string} = {
'signal': 'kind-signal',
'computed': 'kind-computed',
'effect': 'kind-effect',
'afterRenderEffectPhase': 'kind-effect',
'template': 'kind-template',
'linkedSignal': 'kind-linked-signal',
'unknown': 'kind-unknown',
};
export class SignalsGraphVisualizer {
@@ -18,7 +18,14 @@ import {
export interface DebugSignalGraphNode {
id: string;
kind: string;
kind:
| 'signal'
| 'computed'
| 'effect'
| 'template'
| 'linkedSignal'
| 'afterRenderEffectPhase'
| 'unknown';
epoch: number;
label?: string;
preview: Descriptor;