From 0da0e977416bd0f35787b8aa76481f983f1e7d6f Mon Sep 17 00:00:00 2001 From: Molunerfinn Date: Sun, 12 May 2019 11:22:41 +0800 Subject: [PATCH] :hammer: Refactor: update interfaces note --- src/utils/interfaces.ts | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/src/utils/interfaces.ts b/src/utils/interfaces.ts index 8190dc4..d31d081 100644 --- a/src/utils/interfaces.ts +++ b/src/utils/interfaces.ts @@ -1,6 +1,9 @@ import PicGo from '../core/PicGo' import LifecyclePlugins from '../lib/LifecyclePlugins' +/** + * for plugin config + */ interface PluginConfig { name: string type: string @@ -9,6 +12,9 @@ interface PluginConfig { [propName: string]: any } +/** + * for lifecycle plugins + */ interface Helper { transformer: LifecyclePlugins uploader: LifecyclePlugins @@ -17,6 +23,9 @@ interface Helper { afterUploadPlugins: LifecyclePlugins } +/** + * for uploading image info + */ interface ImgInfo { buffer?: Buffer base64Image?: string @@ -27,28 +36,40 @@ interface ImgInfo { [propName: string]: any } +/** + * for config options + */ interface Config { [propName: string]: any } +/** + * for plugin + */ interface Plugin { handle (ctx: PicGo): void | Promise [propName: string]: any } -// for spawn output +/** + * for spawn output + */ interface Result { code: string | number data: string } -// for transformer - path +/** + * for transformer - path + */ interface ImgSize { width: number height: number } -// for initUtils +/** + * for initUtils + */ interface Options { template: string // template name dest: string // destination for template to generate @@ -60,6 +81,14 @@ interface Options { project: string // project name } +/** + * for clipboard image + */ +interface ClipboardImage { + imgPath: string + isExistFile: boolean +} + export { PluginConfig, ImgInfo, @@ -68,5 +97,6 @@ export { Plugin, Result, ImgSize, - Options + Options, + ClipboardImage }