feat: slightly modified structure for better global logic
ref: N25B-450
This commit is contained in:
@@ -21,17 +21,13 @@ export type EditorWarning = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* either a single warningType, or a scoped warningKey.
|
* a scoped WarningKey,
|
||||||
*
|
* `handleId` is `null` if the warning is not specific to one handle on the node
|
||||||
* supported-scopes:
|
|
||||||
* - `handle`
|
|
||||||
*/
|
*/
|
||||||
export type WarningKey =
|
export type WarningKey = { type: WarningType, handleId: string | null }; // for warnings that can occur on a per-handle basis
|
||||||
| 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 WarningRegistry = Map<NodeId, Map<WarningKey, EditorWarning>>;
|
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 = {
|
export type EditorWarningRegistry = {
|
||||||
editorWarningRegistry: WarningRegistry;
|
editorWarningRegistry: WarningRegistry;
|
||||||
@@ -76,8 +72,8 @@ export type EditorWarningRegistry = {
|
|||||||
export const editorWarningRegistry : EditorWarningRegistry = {
|
export const editorWarningRegistry : EditorWarningRegistry = {
|
||||||
editorWarningRegistry: new Map<NodeId, Map<WarningKey, EditorWarning>>(),
|
editorWarningRegistry: new Map<NodeId, Map<WarningKey, EditorWarning>>(),
|
||||||
severityIndex: new Map([
|
severityIndex: new Map([
|
||||||
['INFO', new Set<string>()],
|
['INFO', new Set<{ nodeId: NodeId, warningKey: WarningKey}>()],
|
||||||
['WARNING', new Set<string>()]
|
['WARNING', new Set<{ nodeId: NodeId, warningKey: WarningKey}>()]
|
||||||
]),
|
]),
|
||||||
|
|
||||||
getWarningsBySeverity: (_warningSeverity) => { return []},
|
getWarningsBySeverity: (_warningSeverity) => { return []},
|
||||||
|
|||||||
Reference in New Issue
Block a user