/** * Messages from platform except for CLOSE_AUTH_FAIL */ interface ClientProtocol { header: string; body: Init | Update; } /** * Initial message from platform to seed uiState */ interface Init { profile: Profile; messages: Message[]; } /** * Update something in uiState */ interface Update { name: string; data: Profile | Message[] | Message | Annotation | string; } /** * A standard message in Messenger */ interface Message { modifier: string; content: Content[]; context: Context; seen: boolean; uid: string; } interface Content { text: string; audio: string | boolean; } interface Context { img: string | boolean; text: string | boolean; } /** * Update a specific attribute in a given message */ interface Annotation { name: string; data: Context | Content[] | boolean; uid: string; } /** * Send raw, uncategorized data to the platform */ interface Raw { text: string | boolean; audio: Int16Array | boolean; } /** * The oppisite of Raw, when you know exactly what needs to get done */ interface PlatformRequest { intent: string; params: any; epic: string | boolean; confidence: number; } interface WindowState { width: number; height: number; x: number | null; y: number | null; } interface Profile { crimata_id: string; name: string; photo: string; } interface AccountCredentials { email: string; password: string; } /* * Electron Ipc */ interface IpcHandlerCallback { (payload: I | null): Promise; } interface IpcListenerCallback { (payload: T): void; } interface IIpcHandler { handle(): void; remove(): void; readonly _handlerCallback: IpcHandlerCallback; } interface IIpcListener { listen(): void; remove(): void; readonly _listenerCallback: IpcListenerCallback; } interface IPCHandlers { [handler: string]: IIpcHandler; } interface IPCListeners { [listener: string]: IIpcListener | null; } interface IpcRendererEvent { channel: string; payload: T | null; } interface FocusPayload { isFocused: boolean; }