import * as DODP from './DODPTypes'; import * as DAISY from '@nota/daisyparserjs'; export declare abstract class DODPCaching { protected abstract getGeneralJSONResource(contentID: string, name: string): Promise; protected abstract getUserJSONResource(contentID: string, name: string): Promise; protected abstract storeGeneralJSONResource(contentID: string, name: string, content: T): Promise; protected abstract storeUserJSONResource(contentID: string, name: string, content: T): Promise; protected abstract remvoeGeneralJSONResource(contentID: string, name: string): Promise; protected abstract remvoeUserJSONResource(contentID: string, name: string): Promise; /** * Get cached resource content. * This is meant for image-, SMIL-, NCC-image and HTML-files NOT mp3-files * * @param contentID ID of the book this file belong to * @param localUri localUri for the resource, should be lowercased. * * @return Stored resource resource, if not store resolves with null, should only reject on error. */ abstract getResource(contentID: string, localUri: string): Promise; /** * Store resource content in the cache * * @param contentID ID of the book this file belong to * @param localUri localUri for the resource, should be lowercased. * @param content file content * * @return Promise for when the file is stored */ abstract storeResource(contentID: string, localUri: string, content: Buffer): Promise; protected getContentResourcesName: string; /** * Get the cached result of DODP.getContentResources() * Note: Result of this is generally user specific and should therefor be cached per user * Result can have an expiry dare so you should check for that. * * @param contentID ID of the book this file belong to */ getContentResources(contentID: string): Promise; /** * Store result of DODP.getContentResources() * Note: Result of this is generally user specific and should therefor be cached per user * Result can have an expiry dare so you should check for that. * * @param contentID ID of the book this file belong to * @param resources Result of DODP.getContentResources() * @return Promise for when cache has been stored */ storeContentResources(contentID: string, resources: DODP.Resources): Promise; /** * Remove stored result of DODP.getContentResources() * * @param contentID ID of the book this file belong to * @return Promise for when cache has been removed */ removeContentResources(contentID: string): Promise; private getContentMetadataName; getContentMetadata(contentID: string): Promise; storeContentMetadata(contentID: string, metadata: DODP.ContentMetadata): Promise; private getBookExportStructureName; getBookExportStructure(contentID: string): Promise; storeBookExportStructure(contentID: string, structure: DAISY.BookExport): Promise; private getResourceMetadataFilename(localUri); getResourceMetadata(contentID: string, localUri: string): Promise; storeResourceMetadata(contentID: string, localUri: string, data: DAISY.DaisyResourceMetadata): Promise; }