Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3979 Improve TypeScript definitions of EditActionData #2407

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
#3979 Improve TypeScript definitions of EditActionData
Signed-off-by: Jeena Jose <Jeena.Jose@ibm.com>
JeenaJose123 committed Mar 15, 2025
commit fa72c53940096351f35d6e3d92622b03a2e16827
33 changes: 19 additions & 14 deletions canvas_modules/common-canvas/types/common-canvas.ts
Original file line number Diff line number Diff line change
@@ -2810,24 +2810,29 @@ export type CtxMenuHandlerSource =
selectedObjectIds: string[];
mousePos: { x: string; y: string };
};


export type EditActionTargetObject = CanvasNode | (CanvasNodeLink & {
srcObj?: unknown;
trgNode?: unknown;
});
export interface EditActionNode {
id?: string;
portId?: string;
}
export interface EditActionData {
editType:
| "createComment"
| "createNode"
| "moveObjects"
| "linkNodes"
| "linkComment"
| "resizeObjects"
| "editComment"
| "expandSuperNodeInPlace"
| "displaySubPipeline"
| "displayPreviousPipeline"
| string;
editType: "createComment" | "createNode" | "moveObjects" | "linkNodes" | "deleteSelectedObjects" | "deleteLink" | "createAutoNode" | "setNodeLabelEditingMode" | "setZoom" | "linkComment" | "resizeObjects" | "editComment" | "expandSuperNodeInPlace" | "displaySubPipeline" | "displayPreviousPipeline" | string;
editSource: "contextmenu" | "toolbar" | "keyboard" | "canvas" | "api" | "controller";
selectedObjects: Record<string, unknown>[];
/** @deprecated */
selectedObjectIds: string[];
type?: "nodeLink" | "node" | string;
linkIds?: string[];
linkType?: string;
nodes?: EditActionNode[];
targetNodes?: EditActionNode[];
newNode?: CanvasNode;
targetObject?: EditActionTargetObject;
newLink?: CanvasNodeLink;
sourceNode?: CanvasNode;
[key: string]: unknown;
}