backsplash-app
Version:
An AI powered wallpaper app.
25 lines (22 loc) • 548 B
text/typescript
/**
* Constants for store-related IPC channels
*/
export const STORE_CHANNELS = {
GET: "store:get",
SET: "store:set",
HAS: "store:has",
DELETE: "store:delete",
CLEAR: "store:clear",
} as const;
/**
* Utility to serialize a value to JSON string for IPC transmission
*/
export function serializeForIPC<T>(value: T): string {
return JSON.stringify(value);
}
/**
* Utility to deserialize a value from JSON string after IPC transmission
*/
export function deserializeFromIPC<T>(value: string): T {
return JSON.parse(value) as T;
}