UNPKG

jsx-slack

Version:

Build JSON object for Slack Block Kit surfaces from JSX

52 lines (51 loc) 2.15 kB
import { LayoutBlockProps } from './utils'; interface VideoPropsInternal extends LayoutBlockProps { children?: never; /** * The URL to be embedded video. * * _URL must be compatible with an embeddable iframe._ * * In addition, it has a lot of requirements by Slack for putting video * correctly. [See also requirements for `video_url` field in Slack API documentation.](https://api.slack.com/reference/block-kit/blocks#video_requirements) */ videoUrl?: string; /** An alias to `videoUrl` prop. */ src?: string; /** A tooltip text for the video. It is required for accessibility. */ alt: string; /** URL for the thumbnail image of the video. */ thumbnailUrl?: string; /** An alias to `thumbnailUrl` prop. */ poster?: string; /** A video title, in 200 or less characters. */ title: string; /** * HTTPS URL for the hyperlink of the title text. * * It must correspond to the non-embeddable URL for the video. */ titleUrl?: string; /** The author name of the video to be displayed, in 50 or less characters. */ authorName?: string; /** The originating application name or domain of the video. (ex. YouTube) */ providerName?: string; /** An image URL for the video provider icon. */ providerIconUrl?: string; /** Description for the video. */ description?: string; } type SelectiveRequired<T, K extends keyof T> = T & Required<Pick<T, K>>; type RequiredOneOf<T, K extends keyof T> = K extends never ? never : SelectiveRequired<T, K>; export type VideoProps = RequiredOneOf<RequiredOneOf<VideoPropsInternal, 'src' | 'videoUrl'>, 'poster' | 'thumbnailUrl'>; /** * [The `video` layout block](https://api.slack.com/reference/messaging/blocks#video) * to embed a video. * * Recommend to learn about [requirements and constraints](https://api.slack.com/reference/block-kit/blocks#video_requirements) * of the video layout block in Slack API documentation. * * @return The partial JSON for `video` layout block */ export declare const Video: import("../../jsx-internals").BuiltInComponent<VideoProps>; export {};