Skip to main content

Interface: IpcResponse<T>

Defined in: electron/services/ipc/types.ts:50

Base IPC response interface for consistent communication between main and renderer processes.

Remarks

Provides a standardized structure for all IPC handler responses, ensuring consistent error handling and data format across the application. All IPC handlers should use this response format.

Example

// Success response
const response: IpcResponse<Site[]> = {
success: true,
data: sites,
};

// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error response
const response: IpcResponse<void> = {
success: false,
error: "Failed to retrieve sites",
};

Extended by

Type Parameters

T

T = unknown

Properties

data?

optional data: T

Defined in: electron/services/ipc/types.ts:52

The response data when operation succeeds


error?

optional error: string

Defined in: electron/services/ipc/types.ts:54

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Error message when operation fails


metadata?

optional metadata: UnknownRecord

Defined in: electron/services/ipc/types.ts:56

Additional metadata about the operation


success

success: boolean

Defined in: electron/services/ipc/types.ts:58

Indicates if the operation was successful


warnings?

optional warnings: readonly string[]

Defined in: electron/services/ipc/types.ts:60

Non-critical warnings about the operation