UNPKG

@shopify/hydrogen-react

Version:

React components, hooks, and utilities for creating custom Shopify storefronts

21 lines (20 loc) 1.1 kB
import { type HTMLAttributes } from 'react'; import { shopifyImageLoader } from './image-size.js'; import type { Video as VideoType } from './storefront-api-types.js'; import type { PartialDeep } from 'type-fest'; export interface VideoProps { /** An object with fields that correspond to the Storefront API's [Video object](https://shopify.dev/api/storefront/latest/objects/video). */ data: PartialDeep<VideoType, { recurseIntoArrays: true; }>; /** An object of image size options for the video's `previewImage`. Uses `shopifyImageLoader` to generate the `poster` URL. */ previewImageOptions?: Parameters<typeof shopifyImageLoader>[0]; /** Props that will be passed to the `video` element's `source` children elements. */ sourceProps?: HTMLAttributes<HTMLSourceElement> & { 'data-testid'?: string; }; } /** * The `Video` component renders a `video` for the Storefront API's [Video object](https://shopify.dev/api/storefront/reference/products/video). */ export declare function Video(props: JSX.IntrinsicElements['video'] & VideoProps): JSX.Element;