diff --git a/ui/api/src/api.ts b/ui/api/src/api.ts index 94a2147fcb713..61be0636ffa1f 100644 --- a/ui/api/src/api.ts +++ b/ui/api/src/api.ts @@ -1,4 +1,5 @@ import { type PubsubCallback, type PubsubEvent, pubsub } from 'common/pubsub'; +import { alert, confirm, prompt, domDialog } from 'common/dialog'; // #TODO document these somewhere const publicEvents = ['ply', 'analysis.change', 'chat.resize', 'analysis.closeAll']; @@ -20,6 +21,12 @@ export interface Api { chat: { post: (text: string) => void; }; + dialog: { + alert: typeof alert; + confirm: typeof confirm; + prompt: typeof prompt; + domDialog: typeof domDialog; + }; overrides: { [key: string]: (...args: any[]) => unknown; }; @@ -71,6 +78,12 @@ export const api: Api = { chat: { post: (text: string) => pubsub.emit('socket.send', 'talk', text), }, + dialog: { + alert, + confirm, + prompt, + domDialog, + }, // some functions will be exposed here // to be overriden by browser extensions overrides: {},