import { Asset, Folder } from '../types'; /** * Web-app appStore action methods (from appstore.js) */ export interface WebAppStoreActions { requestPublicUrl?: (resourceId: string) => void; requestDownloadUrl?: (resourceId: string, presetId?: string) => void; openFolder?: (folderId: string) => void; setCurrentFolder?: (folderId: string) => void; prepareDrag?: (resourceId: string) => void; selectResource?: (resourceId: string) => void; deselectResource?: (resourceId: string) => void; toggleResourceSelection?: (resourceId: string) => void; } /** * Web-app authStore action methods */ export interface WebAppAuthActions { checkPermission?: (action: string, resourceId?: string) => boolean; } /** * Asset card action handlers */ export interface AssetCardActions { onDownload: () => void; onInsertLink: () => void; onDragReady: () => void; onClick?: () => void; } /** * Folder card action handlers */ export interface FolderCardActions { onClick: () => void; } /** * Create action handlers for AssetCard component * * @param appStore - MobX appStore instance with action methods * @param _authStore - MobX authStore instance (reserved for permission checking) * @param asset - The asset to create actions for * @returns Object with action handlers compatible with AssetCard props * * @example * ```typescript * import { appStore, authStore } from '../stores'; * import { createAssetCardActions, adaptResource } from '@intelligencebank/integration-components/adapters'; * * const ImageCard = observer(({ resource }) => { * const asset = adaptResource(resource); * const actions = createAssetCardActions(appStore, authStore, asset); * * return ( * * ); * }); * ``` */ export declare function createAssetCardActions(appStore: WebAppStoreActions, _authStore?: WebAppAuthActions, asset?: Asset): AssetCardActions; /** * Create action handlers for FolderCard component * * @param appStore - MobX appStore instance with action methods * @param folder - The folder to create actions for * @returns Object with action handlers compatible with FolderCard props * * @example * ```typescript * import { appStore } from '../stores'; * import { createFolderCardActions, adaptFolder } from '@intelligencebank/integration-components/adapters'; * * const FolderCardWrapper = observer(({ webAppFolder }) => { * const folder = adaptFolder(webAppFolder); * const actions = createFolderCardActions(appStore, folder); * * return ( * * ); * }); * ``` */ export declare function createFolderCardActions(appStore: WebAppStoreActions, folder?: Folder): FolderCardActions; /** * Create a handler for folder tree item clicks * * @param appStore - MobX appStore instance * @returns A callback function for folder tree selection */ export declare function createFolderTreeSelectHandler(appStore: WebAppStoreActions): (folderId: string) => void; /** * Create handlers for asset selection * * @param appStore - MobX appStore instance * @returns Selection handlers */ export declare function createSelectionHandlers(appStore: WebAppStoreActions): { onSelect: (assetId: string) => void; onDeselect: (assetId: string) => void; onToggle: (assetId: string) => void; }; /** * Create a handler for download with preset selection * * @param appStore - MobX appStore instance * @param assetId - The asset ID to download * @returns A callback that accepts a preset ID */ export declare function createDownloadWithPresetHandler(appStore: WebAppStoreActions, assetId: string): (presetId?: string) => void; //# sourceMappingURL=action-adapter.d.ts.map