soulsync/webui/src/platform/shell/globals.d.ts
2026-05-13 22:26:23 +03:00

43 lines
1.6 KiB
TypeScript

import type {
DownloadMissingAlbumWorkflowInput,
WishlistAlbumWorkflowInput,
} from '@/platform/workflows/album-workflows';
import type { IssueDomainBridge } from '@/routes/issues/-issues.types';
import type { ShellProfileContext, ShellRouteDefinition, ShellPageId } from './bridge';
declare global {
interface Window {
showToast?: (message: string, type?: string, durationOrContext?: number | string) => void;
SoulSyncIssueDomain?: IssueDomainBridge;
SoulSyncWorkflowActions?: {
openDownloadMissingAlbum: (input: DownloadMissingAlbumWorkflowInput) => void | Promise<void>;
openAddToWishlistAlbum: (input: WishlistAlbumWorkflowInput) => void | Promise<void>;
notify?: (message: string, type?: string) => void;
};
SoulSyncWebRouter?: {
routeManifest: ShellRouteDefinition[];
getCurrentPageId: () => ShellPageId | null;
getCurrentPath: () => string;
resolvePageId: (pathname: string) => ShellPageId | null;
navigateToPage: (
pageId: ShellPageId,
options?: {
replace?: boolean;
},
) => Promise<boolean>;
};
SoulSyncWebShellBridge?: {
getCurrentPageId: () => ShellPageId;
getCurrentProfileContext: () => ShellProfileContext | null;
isPageAllowed: (pageId: ShellPageId) => boolean;
getProfileHomePage: () => ShellPageId;
resolveLegacyPath: (pathname: string) => ShellPageId | null;
setActivePageChrome: (pageId: ShellPageId) => void;
activateLegacyPath: (pathname: string) => void;
showReactHost: (pageId: ShellPageId) => void;
};
}
}
export {};