api: init notification queue

This commit is contained in:
Johannes Kirschbauer
2025-08-11 12:23:41 +02:00
parent 0859a86ce0
commit bb6fab1168
5 changed files with 66 additions and 2 deletions

9
pkgs/clan-app/ui/index.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
import { ProcessMessage } from "./src/hooks/api";
export {};
declare global {
interface Window {
notifyBus: (data: ProcessMessage) => void;
}
}

View File

@@ -99,3 +99,14 @@ export const callApi = <K extends OperationNames>(
},
};
};
export interface ProcessMessage {
topic: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
data: any;
origin: string | null;
}
window.notifyBus = (data) => {
console.debug("Channel function called with data:", data);
};