type role = { all?: boolean; read?: boolean; create?: boolean; update?: boolean; delete?: boolean; publish?: boolean; sub_acl: { read?: boolean; create?: boolean; update?: boolean; delete?: boolean; publish?: boolean; }; }; export declare interface Asset { ACL: { roles: role[]; [key: string]: any; }; url: string; filename: string; uid: string; [k: string]: any; } /** * AssetType map, the AssetPicker component expects the "only" * prop to be one of the keys. The API uses the corresponding value */ export declare const AssetType: { readonly image: "images"; readonly video: "videos"; readonly audio: "audio"; readonly document: "documents"; readonly pdfs: "pdfs"; readonly presentations: "presentations"; readonly spreadsheets: "spreadsheets"; readonly 'plain-text': "plain-text"; readonly code: "code"; readonly executable: "executable"; readonly archive: "archive"; }; export type GetUsers = () => Promise>; export type GetAssets = (args: GetAssetsOptions) => Promise<{ assets?: any[]; count?: number; [k: string]: any; }>; export type GetAssetsOptions = { folderUid: string; limit?: number; skip?: number; query?: string; sort?: { id: string; order: 'asc' | 'desc'; }; excludeAssetUids?: string[]; types?: (keyof typeof AssetType)[]; [key: string]: any; }; export type GetFolders = (args: GetFoldersOptions) => Promise<{ assets?: any[]; count?: number; [k: string]: any; }>; export type GetFoldersOptions = Omit; export type CreateFolder = (args: { folderName: string; parentUid: string; }) => Promise; export type UploadFiles = (args: { files: any[]; options: { parentFolderUid: string; }; }) => Promise; export interface AssetModalProps { /** * Function called when the user closes the modal * @returns void */ onCancel?: () => void; /** * Function called to close the modal * @returns void */ closeModal?: () => void; /** * Determines if multiple selections are allowed */ multiple?: boolean | { /** * Determines the maximum number of selections allowed */ max: number; }; /** * Determines the type of assets allowed. * This is passed to `getAssets` as `types` property which is in an array. * * Note - CS Assets API accepts the asset `types` property as an array. * Asset picker always accepted one type, so `only` prop remains a string * for backward compatibility */ only?: keyof typeof AssetType; /** * Comma-separated string which determines file extensions allowed */ fileTypes?: string; /** * Determines the minimum and maximum fle size */ size?: { min?: number; max?: number; }; /** * Determines the display mode for assets within the modal. * Can be either a 'list' or 'grid' view. */ displayType?: DisplayType; /** * Callback function triggered when the display type is changed. * @param displayType - The new display type selected by the user */ onDisplayTypeChange?: (displayType: DisplayType) => void; } export type DisplayType = 'list' | 'grid'; export {};