/// declare type ResourceKeepType = 'databse' | 'file'; interface ifResourceUnit { name: string; md5: string; data: string | Buffer; } export declare class ResourceService { private _local_; private _cache; /** * 注册资源地址,可以是数据库或者本地目录 * @param type * @param path */ init(type: ResourceKeepType, path: string, ...args: string[]): Promise; /** * 注册资源 * @param type * @param name * @param path */ setResource(pack: string, name: string, data: string): Promise; getResource(pack: string, name: string): Promise; /** * 对应 check 请求 * @param file * @param md5 */ checkResource(pack: string, file: string, md5: string): Promise<{ code: number; }>; /** * 对应download请求 * @param file */ download(pack: string, file: string): Promise<{ code: number; text: string | Buffer; } | { code: number; text?: undefined; }>; clear(): void; list(pack: string): Promise<{ file: string; md5: string; }[]>; } export {};