Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / docs-shared / lib / Bridge / ClientToEditorMessage.ts
blob74cbde44561dfc5dcfcafc97890d0a4c68dbceeb
1 import type { ClientRequiresEditorMethods } from './ClientRequiresEditorMethods'
2 import type { EditorBridgeMessageType } from './EditorBridgeMessageType'
3 import type { ParamsExcludingFunctions } from './Utils'
5 export type ClientToEditorGenericMessage = {
6   type: EditorBridgeMessageType.ClientToEditorInvokation | EditorBridgeMessageType.ClientToEditorReply
9 export type ClientToEditorReplyMessage = {
10   messageId: string
11   returnValue: unknown
12   type: EditorBridgeMessageType.ClientToEditorReply
15 export type ClientToEditorInvokationMessage<K extends keyof ClientRequiresEditorMethods> = {
16   messageId: string
17   functionName: K
18   args: ParamsExcludingFunctions<Parameters<ClientRequiresEditorMethods[K]>>
19   type: EditorBridgeMessageType.ClientToEditorInvokation