IFileInfo.ts
1 /** 2 * Info about a file. 3 */ 4 export interface IFileInfo { 5 /** 6 * CID of the file. 7 */ 8 cid: string; 9 10 /** 11 * Name of the file. 12 */ 13 name: string; 14 15 /** 16 * Absolute path in library. 17 */ 18 path?: string; 19 20 /** 21 * Type of the file. 22 */ 23 type: 'dir' | 'file'; 24 } 25 26 export function isIFileInfo(item: any): item is IFileInfo { 27 return ( 28 typeof item === 'object' && 29 typeof item.cid == 'string' && 30 typeof item.name == 'string' 31 ); 32 }