feat: slightly modified structure for better global logic

ref: N25B-450
This commit is contained in:
JGerla
2026-01-14 16:11:48 +01:00
parent 67558a7ac7
commit b3b77b94ad

View File

@@ -21,17 +21,13 @@ export type EditorWarning = {
};
/**
* either a single warningType, or a scoped warningKey.
*
* supported-scopes:
* - `handle`
* a scoped WarningKey,
* `handleId` is `null` if the warning is not specific to one handle on the node
*/
export type WarningKey =
| WarningType // for warnings that can only occur once per node
| { type: WarningType, handleId: string }; // for warnings that can occur on a per-handle basis
export type WarningKey = { type: WarningType, handleId: string | null }; // for warnings that can occur on a per-handle basis
export type WarningRegistry = Map<NodeId, Map<WarningKey, EditorWarning>>;
export type SeverityIndex = Map<WarningSeverity, Set<string>>;
export type SeverityIndex = Map<WarningSeverity, Set<{ nodeId: NodeId, warningKey: WarningKey}>>;
export type EditorWarningRegistry = {
editorWarningRegistry: WarningRegistry;
@@ -76,8 +72,8 @@ export type EditorWarningRegistry = {
export const editorWarningRegistry : EditorWarningRegistry = {
editorWarningRegistry: new Map<NodeId, Map<WarningKey, EditorWarning>>(),
severityIndex: new Map([
['INFO', new Set<string>()],
['WARNING', new Set<string>()]
['INFO', new Set<{ nodeId: NodeId, warningKey: WarningKey}>()],
['WARNING', new Set<{ nodeId: NodeId, warningKey: WarningKey}>()]
]),
getWarningsBySeverity: (_warningSeverity) => { return []},