import { type MediaAssetType } from "@prismicio/editor-ui"; import { type PropsWithChildren } from "react"; import { type MediaAsset, type MediaLibraryFilters } from "../hooks/mediaLibraryData"; import { type UploadFile } from "../hooks/useMediaLibraryUpload"; interface MediaLibraryContextValue { onScrollToBottom: () => void; isFetchingMedia: boolean; media: MediaAsset[]; mediaTotal: number; /** Remove media assets from the media library and the cache. */ deleteMedia: (ids: string[]) => void; /** Update a media asset in the cache. */ updateMedia: (id: string, update: Partial) => void; /** * A container in which the actions (search bar & upload button) are rendered. * If not provided, the actions will be rendered inside the media library. */ actionContainer?: Element | null; onFilesUpload: (files: File[]) => void; isUploading: boolean; uploadingFiles: UploadFile[]; isMediaCacheInvalid: boolean; isMediaRevalidationInProgress: boolean; revalidateMedia: () => void; keyword: string; /** * The type of assets to search for. * Possible to change using a filter in the media library. */ assetType: MediaAssetType; /** * The type of assets this media library is restricted to. * Possible to change using an `assetType` prop in MediaLibrary */ initialAssetType: MediaAssetType; uploaderId?: string; tagIds: string[]; onFilterChange: (filters: Partial) => void; isSearchingMedia: boolean; tagManagerOpen: boolean; setTagManagerOpen: (open: boolean) => void; openMediaSection: MediaSection | undefined; setOpenMediaSection: (section: MediaSection | undefined) => void; } type MediaSection = "tags"; interface MediaLibraryProviderProps extends PropsWithChildren { /** * The type of media to allow in the media library. * @default all */ assetType?: MediaAssetType; /** * A container in which the actions (search bar & upload button) are rendered. * If not provided, the actions will be rendered inside the media library. */ actionContainer?: Element | null; onSelectedChange?: (ids: Set) => void; } export declare function MediaLibraryProvider(props: MediaLibraryProviderProps): JSX.Element; export declare function useMediaLibrary(): MediaLibraryContextValue; export {};