mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-12-06 19:56:45 +10:30
24 lines
732 B
TypeScript
24 lines
732 B
TypeScript
export type SettingsDestination =
|
|
| { page: "settings"; section?: string; search?: string }
|
|
| {
|
|
page: "themes" | "backgrounds";
|
|
view?: "settings" | "store" | "community" | "custom";
|
|
};
|
|
|
|
export const SETTINGS_NAVIGATION_EVENT = "bsplus:navigate-settings";
|
|
|
|
let pendingDestination: SettingsDestination | null = null;
|
|
|
|
export function requestSettingsDestination(destination: SettingsDestination): void {
|
|
pendingDestination = destination;
|
|
window.dispatchEvent(
|
|
new CustomEvent(SETTINGS_NAVIGATION_EVENT, { detail: destination }),
|
|
);
|
|
}
|
|
|
|
export function consumeSettingsDestination(): SettingsDestination | null {
|
|
const destination = pendingDestination;
|
|
pendingDestination = null;
|
|
return destination;
|
|
}
|