-
Notifications
You must be signed in to change notification settings - Fork 9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(editor): Add types to ndv event bus (no-changelog) (#10451)
- Loading branch information
Showing
2 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
import type { IUpdateInformation } from '@/Interface'; | ||
import { createEventBus } from 'n8n-design-system/utils'; | ||
|
||
export const ndvEventBus = createEventBus(); | ||
export type Position = 'minLeft' | 'maxRight' | 'initial'; | ||
|
||
export type CreateNewCredentialOpts = { | ||
type: string; | ||
showAuthOptions: boolean; | ||
}; | ||
|
||
export interface NdvEventBusEvents { | ||
/** Command to let the user create a new credential by opening the credentials modal */ | ||
'credential.createNew': CreateNewCredentialOpts; | ||
|
||
/** Command to set the NDV panels' (input, output, main) positions based on the given value */ | ||
setPositionByName: Position; | ||
|
||
updateParameterValue: IUpdateInformation; | ||
} | ||
|
||
export const ndvEventBus = createEventBus<NdvEventBusEvents>(); |