import { Executor, Store, CoreModel, Context } from "../index"; /** * This is a map used to retrieve binary * * @class BinaryMap */ declare class BinaryMap { constructor(obj: any); } /** * This is an abstract service to represent a storage of files * The binary allow you to expose this service as HTTP ( therefore is an executor ) * It needs an object to attach the binary too * * The Binary storage should store only once a binary and reference every object that are used by this binary, so it can be cleaned. * * * @see FileBinary * @see S3Binary * * @exports * @abstract * @class Binary */ declare class Binary extends Executor { constructor(webda: any, name: any, params?: any); _lowercaseMaps: any; _url: string; /** * When you store a binary to be able to retrieve it you need to store the information into another object * * If you have a User object define like this : User = {'name': 'Remi', 'uuid': 'Loopingz'} * You will call the store(userStore, 'Loopingz', 'images', filedata, {'type':'profile'}) * After a successful call the object will look like User = {'name': 'Remi', 'uuid': 'Loopingz', 'images': [{'type':'profile','hash':'a12545...','size':1245,'mime':'application/octet'}]} * * * @param {Store} targetStore The store that handles the object to attach binary to * @param {String} object The object uuid to get from the store * @param {String} property The object property to add the file to * @param {Object} file The file by itself * @param {Object} metadatas to add to the binary object * @emits 'binaryCreate' */ store(targetStore: any, object: any, property: any, file: any, metadatas: any, index?: string): Promise; /** * The store can retrieve how many time a binary has been used */ getUsageCount(hash: any): Promise; /** * Update a binary * * * @param {Store} targetStore The store that handles the object to attach binary to * @param {String} object The object uuid to get from the store * @param {String} property The object property to add the file to * @param {Number} index The index of the file to change in the property * @param {Object} file The file by itself * @param {Object} metadatas to add to the binary object * @emits 'binaryUpdate' */ update(targetStore: any, object: any, property: any, index: any, file: any, metadatas: any): Promise; /** * Update a binary * * * @param {Store} targetStore The store that handles the object to attach binary to * @param {String} object The object uuid to get from the store * @param {String} property The object property to add the file to * @param {Number} index The index of the file to change in the property * @emits 'binaryDelete' */ delete(targetStore: any, object: any, property: any, index: any): Promise; /** * Get a binary * * @param {Object} info The reference stored in your target object * @emits 'binaryGet' */ get(info: any): Promise>; /** * Download a binary to a file * * @param {Object} info The reference stored in your target object * @param {String} filepath to save the binary to */ downloadTo(info: any, filename: any): Promise; /** @ignore */ init(): Promise; _getUrl(info: any, ctx: Context): void; _get(info: any): ReadableStream; initMap(map: any): void; initModel(obj: any): BinaryMap; _getHashes(buffer: any): any; _prepareInput(file: any): void; _checkMap(name: any, property: any): void; _validChallenge(challenge: any): boolean; challenge(hash: any, challenge: any): boolean; updateSuccess(targetStore: any, object: any, property: any, index: any, file: any, metadatas: any): Promise; cascadeDelete(info: any, uuid: any): void; deleteSuccess(targetStore: any, object: any, property: any, index: any): any; _getFile(req: any): any; initRoutes(): void; _initRoutes(): boolean; httpPost(ctx: Context): Promise; _verifyMapAndStore(ctx: Context): Store; putRedirectUrl(ctx: Context): Promise; storeBinary(ctx: Context): Promise; httpChallenge(ctx: Context): Promise; httpRoute(ctx: Context): Promise; } export { Binary, BinaryMap };