UNPKG

better-qiniu-cli

Version:

更好的 Node.js 七牛云命令行工具。

28 lines (27 loc) 758 B
import * as modules from './modules'; import { auth } from 'qiniu'; import { OneOrMore, ValueOf } from 'vtils'; declare type Modules = typeof modules; declare type ModuleName = keyof Modules; export interface ModulePayload<Options> { mac: auth.digest.Mac; options: Options; } export interface ModuleFunction<Options, Result = any> { (options: ModulePayload<Options>): Promise<Result>; } export interface QiniuHttpResponseInfo { statusCode: number; } export interface Config { accessKey: string; secretKey: string; tasks: Array<ValueOf<{ [K in ModuleName]: { type: K; options: Parameters<Modules[K]>[0]['options']; }; }>>; } export declare type CliConfig = OneOrMore<Config>; export {};