mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
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:
@@ -1,7 +1,19 @@
|
||||
import { registerPlugin } from '@capacitor/core';
|
||||
import type { ProviderAttempt, ProviderId } from '../lib/media-hosting/types';
|
||||
|
||||
export interface PickAndUploadMediaOptions {
|
||||
providerOrder: ProviderId[];
|
||||
}
|
||||
|
||||
export interface PickAndUploadMediaResult {
|
||||
url: string;
|
||||
fileName: string;
|
||||
provider: ProviderId;
|
||||
attempts?: ProviderAttempt[];
|
||||
}
|
||||
|
||||
export interface FileUploaderPlugin {
|
||||
pickAndUploadMedia(): Promise<{ url: string; fileName: string }>;
|
||||
pickAndUploadMedia(options?: PickAndUploadMediaOptions): Promise<PickAndUploadMediaResult>;
|
||||
}
|
||||
|
||||
const FileUploader = registerPlugin<FileUploaderPlugin>('FileUploader');
|
||||
|
||||
Reference in New Issue
Block a user