feat: 优化架构
Some checks failed
Frontend CI / build-and-push-web (push) Successful in 2m39s
Frontend CI / ota-android (push) Successful in 10m22s
Frontend CI / build-android-apk (push) Has been cancelled

This commit is contained in:
lafay
2026-04-13 01:30:37 +08:00
parent 2adc9360a5
commit fe6a03da5d
93 changed files with 386 additions and 211 deletions

View File

@@ -0,0 +1,25 @@
export type PromptType = 'info' | 'success' | 'warning' | 'error';
export interface PromptPayload {
title?: string;
message: string;
type?: PromptType;
duration?: number;
}
type PromptListener = (payload: PromptPayload) => void;
let promptListener: PromptListener | null = null;
export const bindPromptListener = (listener: PromptListener) => {
promptListener = listener;
return () => {
if (promptListener === listener) {
promptListener = null;
}
};
};
export const showPrompt = (payload: PromptPayload) => {
promptListener?.(payload);
};