UNPKG

@lcap/cli

Version:

utils for lcap

35 lines 1.12 kB
/// <reference types="node" /> import { ClientOptions } from 'minio'; /** 资源数据 */ export interface AssetData { /** 本地文件夹 */ from: string; /** 线上文件夹 */ to: string; /** 资源数据 */ content: Buffer; } export type LcapClientOptions = ClientOptions & { bucketName: string; }; /** * 操作进度 * * @description 当前操作的进度 * @param {string} file 当前文件 * @param {number} fileIndex 当前文件是输入文件列表的第几个 * @param {number} [progress] 当前文件的进度 */ export type FileProgress = (file: string, fileIndex: number) => void; export declare class LcapClient { /** 桶名称 */ private bucketName; /** 原始客户端 */ private client; constructor({ bucketName, ...restOpt }: LcapClientOptions); listFiles(basePath: string): Promise<string[]>; readFile(fileName: string): Promise<Buffer>; putFiles(files: AssetData[], metaData?: Record<string, string>, progress?: FileProgress): Promise<void>; deleteFiles(...fileNames: string[]): Promise<void>; } //# sourceMappingURL=client.d.ts.map