import { type SlateElement } from '@yoopta/editor'; export type VideoSizes = { width: number | string; height: number | string; }; export type VideoElementSettings = { controls?: boolean; loop?: boolean; muted?: boolean; autoPlay?: boolean; }; export type VideoProviderTypes = 'youtube' | 'vimeo' | 'dailymotion' | 'loom' | 'wistia' | 'custom' | string | null; export type VideoProvider = { type: VideoProviderTypes; id: string; url?: string; }; export type VideoElementProps = { id?: string | null; src?: string | null; srcSet?: string | null; bgColor?: string | null; settings?: VideoElementSettings; alignment?: 'left' | 'center' | 'right' | null; sizes?: VideoSizes; provider?: VideoProvider | null; fit?: 'contain' | 'cover' | 'fill' | null; poster?: string | null; }; export type VideoPluginElements = 'video'; export type VideoElement = SlateElement<'video', VideoElementProps>; export type VideoElementMap = { video: VideoElement; }; export type VideoUploadResponse = { id?: string; src: string; poster?: string; sizes?: VideoSizes; provider?: VideoProvider; }; export type VideoUploadProgress = { loaded: number; total: number; percentage: number; }; export type VideoUploadError = { message: string; code?: string; status?: number; }; export type VideoUploadResult = { id: string; url: string; poster?: string; width?: number; height?: number; duration?: number; size?: number; format?: string; provider?: VideoProvider; [key: string]: any; }; export type VideoUploadState = { loading: boolean; progress: VideoUploadProgress | null; error: VideoUploadError | null; result: VideoUploadResult | null; }; export type VideoUploadFn = (file: File, onProgress?: (progress: VideoUploadProgress) => void) => Promise; export type VideoDeleteFn = (element: VideoElement) => Promise; export type VideoPosterUploadFn = (file: File, onProgress?: (progress: VideoUploadProgress) => void) => Promise; export type VideoUploadEndpointOptions = { endpoint: string; method?: 'POST' | 'PUT' | 'PATCH'; headers?: Record; fieldName?: string; maxSize?: number; accept?: string; onProgress?: (progress: VideoUploadProgress) => void; onSuccess?: (result: VideoUploadResult) => void; onError?: (error: VideoUploadError) => void; }; export type VideoDeleteEndpointOptions = { endpoint: string; method?: 'DELETE' | 'PATCH'; headers?: Record; fieldName?: string; onProgress?: (progress: VideoUploadProgress) => void; onSuccess?: (result: VideoUploadResult) => void; onError?: (error: VideoUploadError) => void; }; export type VideoPosterUploadEndpointOptions = { endpoint: string; method?: 'POST' | 'PUT' | 'PATCH'; headers?: Record; fieldName?: string; maxSize?: number; accept?: string; onProgress?: (progress: VideoUploadProgress) => void; onSuccess?: (result: VideoUploadResult) => void; onError?: (error: VideoUploadError) => void; }; export type VideoUploadOptions = VideoUploadEndpointOptions | VideoUploadFn; export type VideoDeleteOptions = VideoDeleteEndpointOptions | VideoDeleteFn; export type VideoPosterUploadOptions = VideoPosterUploadEndpointOptions | VideoPosterUploadFn; export type UseVideoUploadReturn = { upload: (file: File) => Promise; cancel: () => void; reset: () => void; } & VideoUploadState; export type UseVideoDeleteReturn = { deleteVideo: (element: VideoElement) => Promise; cancel: () => void; reset: () => void; } & VideoUploadState; export type UseVideoPosterUploadReturn = { uploadPoster: (file: File) => Promise; cancel: () => void; reset: () => void; } & VideoUploadState; export type VideoUploadPreview = { url: string; width?: number; height?: number; duration?: number; }; export type ParsedVideoUrl = { provider: VideoProviderTypes; id: string; originalUrl: string; embedUrl: string; thumbnailUrl?: string; isValid: boolean; }; export type VideoProviderConfig = { name: string; patterns: RegExp[]; getVideoId: (url: string) => string | null; getEmbedUrl: (id: string) => string; getThumbnailUrl?: (id: string) => string; }; export type VideoPluginOptions = { upload?: VideoUploadOptions; delete?: VideoDeleteOptions; uploadPoster?: VideoPosterUploadOptions; onError?: (error: VideoUploadError) => void; accept?: string; maxFileSize?: number; maxSizes?: { maxWidth?: number | string; maxHeight?: number | string; } | null; defaultSettings?: VideoElementSettings; allowedProviders?: VideoProviderTypes[]; }; export type XHRRequestOptions = { endpoint: string; method?: 'POST' | 'PUT' | 'PATCH' | 'DELETE'; headers?: Record; fieldName?: string; maxSize?: number; accept?: string; onProgress?: (progress: VideoUploadProgress) => void; onSuccess?: (result: VideoUploadResult) => void; onError?: (error: VideoUploadError) => void; }; //# sourceMappingURL=types.d.ts.map