mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
+2
-1
@@ -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({
|
||||
|
||||
+2
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user