import { Node } from '@tiptap/core'; import { GeneralOptions, VideoAlignment } from '../../types'; export * from './components/RichTextVideo'; export interface VideoUploadResult { /** Mux playback id returned by the consuming app after upload. */ playbackId: string; /** Optional Mux asset id or your own backend video id. */ videoId?: string | null; /** Optional poster image URL. */ poster?: string | null; /** Optional display title for player metadata. */ title?: string | null; /** Optional direct source fallback for non-Mux consumers. */ src?: string | null; } export interface MuxVideoOptions { /** * Use Mux Player for videos with a playbackId. * * @default true */ enabled?: boolean; /** * Optional browser script used by the package node view. Set to null if your * consumer app loads/registers mux-player itself. */ scriptUrl?: string | null; streamType?: 'on-demand' | 'live' | 'll-live'; accentColor?: string; playbackToken?: string; thumbnailToken?: string; storyboardToken?: string; metadata?: Record; } /** * Represents the interface for video options, extending GeneralOptions. */ export interface VideoOptions extends GeneralOptions { /** * Indicates whether fullscreen play is allowed * * @default true */ allowFullscreen: boolean; /** * Indicates whether to display the frameborder * * @default false */ frameborder: boolean; /** * Width of the video, can be a number or string * * @default VIDEO_SIZE['size-medium'] */ width: number | string; /** HTML attributes object for passing additional attributes */ HTMLAttributes: { [key: string]: any; }; /** Function for uploading files */ upload?: (file: File) => Promise; /** The source URL of the video */ resourceVideo: 'upload' | 'link' | 'both'; /** * List of allowed video hosting providers * Use ['.'] to allow any URL, or specify providers like ['youtube', 'vimeo'] * * @default ['.'] */ videoProviders?: string[]; mux?: MuxVideoOptions; } /** * Represents the type for setting video options */ interface SetVideoOptions { /** The source URL of the video */ src: string; /** Mux playback id */ playbackId: string; /** Mux asset id or consumer backend video id */ videoId: string; poster: string; title: string; /** The width of the video */ width: string | number; align: VideoAlignment; streamType: MuxVideoOptions['streamType']; } declare module '@tiptap/core' { interface Commands { video: { /** * Add an video */ setVideo: (options: Partial) => ReturnType; /** * Update an video */ updateVideo: (options: Partial) => ReturnType; }; } } export declare const Video: Node;