feat(media-hosting): add multi-provider configurable upload with fallback

Add Random/Preferred/None modes, preferred provider selection, and provider-order fallback. Catbox/Imgur/PostImages on Android via WebView; Electron CDP automation for Imgur/PostImages. Hide upload controls on web runtime.
This commit is contained in:
plebeius
2026-02-18 18:51:02 +08:00
parent 72b70915fd
commit 96a4aaec0e
63 changed files with 1991 additions and 201 deletions
+5 -4
View File
@@ -4,14 +4,15 @@ declare global {
}
}
import type { ProviderId } from './lib/media-hosting/types';
declare global {
interface Window {
electronApi?: {
isElectron: boolean;
invoke: (channel: string, ...args: any[]) => Promise<any>;
getNotificationStatus: () => Promise<'granted' | 'denied' | 'not-determined' | 'not-supported'>;
getPlatform: () => Promise<NodeJS.Platform>;
testNotification: () => Promise<{ success: boolean; reason?: string }>;
copyToClipboard: (text: string) => Promise<{ success: boolean; error?: string }>;
getPlatform: () => Promise<{ platform: NodeJS.Platform; arch: string; version: string }>;
automateUploadMedia: (options: { provider: ProviderId; filePath: string }) => Promise<{ url: string; provider: ProviderId }>;
};
}
}