Skip to content

Commit

Permalink
refactor(editor): Type node view event bus (no-changelog) (#10396)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomi authored and riascho committed Aug 26, 2024
1 parent 86b0114 commit 4d9ad2f
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion packages/editor-ui/src/event-bus/node-view.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
import { createEventBus } from 'n8n-design-system/utils';
import type { IDataObject } from 'n8n-workflow';

export const nodeViewEventBus = createEventBus();
/** Callback function called after workflow has been save */
export type OnSaveWorkflowFn = () => void;

export interface NodeViewEventBusEvents {
/** Command to create a new workflow */
newWorkflow: never;

/** Command to open the chat */
openChat: never;

/** Command to save the current workflow */
saveWorkflow: OnSaveWorkflowFn;

/** Command to import a workflow from given data */
importWorkflowData: IDataObject;

/** Command to import a workflow from given URL */
importWorkflowUrl: IDataObject;

'runWorkflowButton:mouseenter': never;

'runWorkflowButton:mouseleave': never;
}

export const nodeViewEventBus = createEventBus<NodeViewEventBusEvents>();

0 comments on commit 4d9ad2f

Please sign in to comment.