import { Asset } from '../types'; /** * Web-app resource structure (from appstore.js) */ export interface WebAppResource { _id: string; name: string; thumbnail: string; file?: { name?: string; size?: number; type?: string; }; width?: number; height?: number; type?: string; fancyFileType?: string; isPublic?: boolean; allowedActions?: string[]; versionNumber?: number; description?: string; } /** * Convert a single web-app resource object to the new Asset interface * * @param resource - Web-app resource object * @returns Asset object compatible with new components * * @example * ```typescript * const resource = { * _id: 'abc123', * name: 'My Image', * thumbnail: 'https://...', * file: { name: 'image.jpg', size: 1024000 }, * type: 'jpg', * isPublic: true, * allowedActions: ['view', 'download'] * }; * * const asset = adaptResource(resource); * // Returns: { id: 'abc123', name: 'My Image', fileType: 'jpg', ... } * ``` */ export declare function adaptResource(resource: WebAppResource): Asset; /** * Convert an array of web-app resource objects to Asset array * * @param resources - Array of web-app resource objects * @returns Array of Asset objects compatible with new components * * @example * ```typescript * const resources = appStore.gridData.resource[0] || []; * const assets = adaptResources(resources); * ``` */ export declare function adaptResources(resources: WebAppResource[]): Asset[]; /** * Type guard to check if an object is a valid WebAppResource */ export declare function isWebAppResource(obj: unknown): obj is WebAppResource; //# sourceMappingURL=asset-adapter.d.ts.map