Skip to content

Commit

Permalink
🔨 Refactor: update interfaces note
Browse files Browse the repository at this point in the history
  • Loading branch information
Molunerfinn committed May 12, 2019
1 parent 904804d commit 0da0e97
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions src/utils/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import PicGo from '../core/PicGo'
import LifecyclePlugins from '../lib/LifecyclePlugins'

/**
* for plugin config
*/
interface PluginConfig {
name: string
type: string
Expand All @@ -9,6 +12,9 @@ interface PluginConfig {
[propName: string]: any
}

/**
* for lifecycle plugins
*/
interface Helper {
transformer: LifecyclePlugins
uploader: LifecyclePlugins
Expand All @@ -17,6 +23,9 @@ interface Helper {
afterUploadPlugins: LifecyclePlugins
}

/**
* for uploading image info
*/
interface ImgInfo {
buffer?: Buffer
base64Image?: string
Expand All @@ -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<any>
[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
Expand All @@ -60,6 +81,14 @@ interface Options {
project: string // project name
}

/**
* for clipboard image
*/
interface ClipboardImage {
imgPath: string
isExistFile: boolean
}

export {
PluginConfig,
ImgInfo,
Expand All @@ -68,5 +97,6 @@ export {
Plugin,
Result,
ImgSize,
Options
Options,
ClipboardImage
}

0 comments on commit 0da0e97

Please sign in to comment.