piclist 1.9.14 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/.github/workflows/docker.yml +5 -5
  2. package/CHANGELOG.md +19 -0
  3. package/License +22 -22
  4. package/README.md +1 -1
  5. package/README_cn.md +1 -1
  6. package/bin/picgo +9 -7
  7. package/bin/picgo-server +180 -161
  8. package/dist/core/Lifecycle.d.ts +35 -36
  9. package/dist/core/PicGo.d.ts +52 -52
  10. package/dist/i18n/en.d.ts +2 -2
  11. package/dist/i18n/index.d.ts +19 -17
  12. package/dist/i18n/zh-CN.d.ts +293 -289
  13. package/dist/i18n/zh-TW.d.ts +2 -2
  14. package/dist/index.d.ts +10 -10
  15. package/dist/index.js +2 -0
  16. package/dist/lib/Commander.d.ts +22 -22
  17. package/dist/lib/LifecyclePlugins.d.ts +26 -26
  18. package/dist/lib/Logger.d.ts +19 -19
  19. package/dist/lib/PluginHandler.d.ts +10 -10
  20. package/dist/lib/PluginLoader.d.ts +27 -27
  21. package/dist/lib/Request.d.ts +12 -12
  22. package/dist/plugins/beforetransformer/compress.d.ts +5 -5
  23. package/dist/plugins/beforetransformer/skipProcess.d.ts +5 -5
  24. package/dist/plugins/beforetransformer/watermark.d.ts +5 -5
  25. package/dist/plugins/beforeupload/buildInRename.d.ts +5 -5
  26. package/dist/plugins/commander/config.d.ts +3 -3
  27. package/dist/plugins/commander/i18n.d.ts +3 -3
  28. package/dist/plugins/commander/index.d.ts +3 -3
  29. package/dist/plugins/commander/pluginHandler.d.ts +3 -3
  30. package/dist/plugins/commander/proxy.d.ts +3 -3
  31. package/dist/plugins/commander/setting.d.ts +5 -5
  32. package/dist/plugins/commander/upload.d.ts +3 -3
  33. package/dist/plugins/commander/use.d.ts +3 -3
  34. package/dist/plugins/commander/utils.d.ts +2 -2
  35. package/dist/plugins/transformer/base64.d.ts +5 -5
  36. package/dist/plugins/transformer/index.d.ts +5 -5
  37. package/dist/plugins/transformer/path.d.ts +5 -5
  38. package/dist/plugins/uploader/advancedplist.d.ts +2 -2
  39. package/dist/plugins/uploader/alist.d.ts +2 -2
  40. package/dist/plugins/uploader/aliyun.d.ts +2 -2
  41. package/dist/plugins/uploader/awss3plist.d.ts +2 -2
  42. package/dist/plugins/uploader/github.d.ts +2 -2
  43. package/dist/plugins/uploader/imgur.d.ts +2 -2
  44. package/dist/plugins/uploader/index.d.ts +5 -5
  45. package/dist/plugins/uploader/local.d.ts +2 -2
  46. package/dist/plugins/uploader/lsky.d.ts +20 -21
  47. package/dist/plugins/uploader/piclist.d.ts +2 -2
  48. package/dist/plugins/uploader/qiniu.d.ts +2 -2
  49. package/dist/plugins/uploader/s3/uploader.d.ts +25 -24
  50. package/dist/plugins/uploader/s3/utils.d.ts +9 -10
  51. package/dist/plugins/uploader/sftp.d.ts +2 -2
  52. package/dist/plugins/uploader/smms.d.ts +2 -2
  53. package/dist/plugins/uploader/tcyun.d.ts +8 -8
  54. package/dist/plugins/uploader/upyun.d.ts +2 -2
  55. package/dist/plugins/uploader/utils.d.ts +26 -26
  56. package/dist/plugins/uploader/webdav.d.ts +2 -2
  57. package/dist/types/index.d.ts +572 -693
  58. package/dist/types/oldRequest.d.ts +15 -15
  59. package/dist/utils/common.d.ts +42 -119
  60. package/dist/utils/createContext.d.ts +6 -6
  61. package/dist/utils/db.d.ts +17 -15
  62. package/dist/utils/enum.d.ts +27 -27
  63. package/dist/utils/eventBus.d.ts +3 -4
  64. package/dist/utils/getClipboardImage.d.ts +4 -4
  65. package/dist/utils/sshClient.d.ts +16 -16
  66. package/dist/utils/static.d.ts +1 -1
  67. package/docker-compose.yaml +11 -11
  68. package/eslint.config.js +104 -0
  69. package/package.json +61 -78
  70. package/rollup.config.js +25 -42
  71. package/.eslintignore +0 -6
  72. package/.eslintrc.js +0 -50
  73. package/.github/workflows/alpha.yml +0 -22
  74. package/.github/workflows/main.yml +0 -22
  75. package/.github/workflows/manually.yml +0 -19
  76. package/dist/index.cjs.js +0 -2
  77. package/dist/index.esm.js +0 -2
  78. package/dist/plugins/commander/init.d.ts +0 -3
  79. package/dist/utils/initUtils.d.ts +0 -26
  80. package/dist/utils/interfaces.d.ts +0 -201
@@ -1,693 +1,572 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { Command } from 'commander';
4
- import { Inquirer } from 'inquirer';
5
- import { FormatEnum, GravityEnum } from 'sharp';
6
- import { IRequestPromiseOptions } from './oldRequest';
7
- export interface IPicGo extends NodeJS.EventEmitter {
8
- /**
9
- * picgo configPath
10
- *
11
- * if do not provide, then it will use default configPath
12
- */
13
- configPath: string;
14
- /**
15
- * the picgo configPath's baseDir
16
- */
17
- baseDir: string;
18
- /**
19
- * picgo logger factory
20
- */
21
- log: ILogger;
22
- /**
23
- * picgo commander, for cli
24
- */
25
- cmd: ICommander;
26
- /**
27
- * after transformer, the input will be output
28
- */
29
- output: IImgInfo[];
30
- /**
31
- * the processed input
32
- */
33
- input: any[];
34
- /**
35
- * the origin input
36
- */
37
- rawInput: any[];
38
- /**
39
- * processed input path
40
- */
41
- processedInput: any[];
42
- /**
43
- * register\unregister\get picgo's plugin
44
- */
45
- pluginLoader: IPluginLoader;
46
- /**
47
- * install\uninstall\update picgo's plugin via npm
48
- */
49
- pluginHandler: IPluginHandler;
50
- /**
51
- * @deprecated will be removed in v1.5.0+
52
- *
53
- * use request instead.
54
- *
55
- * http request tool
56
- */
57
- Request: IRequest;
58
- /**
59
- * plugin system core part transformer\uploader\beforeTransformPlugins...
60
- */
61
- helper: IHelper;
62
- /**
63
- * picgo-core version
64
- */
65
- VERSION: string;
66
- /**
67
- * electron picgo's version
68
- */
69
- GUI_VERSION?: string;
70
- /**
71
- * will be released in v1.5.0+
72
- *
73
- * replace old Request
74
- *
75
- * http request tool
76
- */
77
- request: IRequest['request'];
78
- rawInputPath?: string[];
79
- i18n: II18nManager;
80
- /**
81
- * get picgo config
82
- */
83
- getConfig: <T>(name?: string) => T;
84
- /**
85
- * save picgo config to configPath
86
- */
87
- saveConfig: (config: IStringKeyMap<any>) => void;
88
- /**
89
- * remove some [propName] in config[key] && save config to configPath
90
- */
91
- removeConfig: (key: string, propName: string) => void;
92
- /**
93
- * set picgo config to ctx && will not save to configPath
94
- */
95
- setConfig: (config: IStringKeyMap<any>) => void;
96
- /**
97
- * unset picgo config to ctx && will not save to configPath
98
- */
99
- unsetConfig: (key: string, propName: string) => void;
100
- /**
101
- * upload gogogo
102
- */
103
- upload: (input?: any[]) => Promise<IImgInfo[] | Error>;
104
- /**
105
- * transform gogogo
106
- */
107
- uploadReturnCtx: (input?: any[]) => Promise<IPicGo>;
108
- }
109
- /**
110
- * for plugin config
111
- */
112
- export interface IPluginConfig {
113
- name: string;
114
- type: string;
115
- required: boolean;
116
- default?: any;
117
- alias?: string;
118
- message?: string;
119
- prefix?: string;
120
- [propName: string]: any;
121
- }
122
- /**
123
- * for lifecycle plugins
124
- */
125
- export interface ILifecyclePlugins {
126
- register: (id: string, plugin: IPlugin) => void;
127
- unregister: (id: string) => void;
128
- getName: () => string;
129
- get: (id: string) => IPlugin | undefined;
130
- getList: () => IPlugin[];
131
- getIdList: () => string[];
132
- }
133
- export interface IHelper {
134
- transformer: ILifecyclePlugins;
135
- uploader: ILifecyclePlugins;
136
- beforeTransformPlugins: ILifecyclePlugins;
137
- beforeUploadPlugins: ILifecyclePlugins;
138
- afterUploadPlugins: ILifecyclePlugins;
139
- }
140
- export interface ICommander extends ILifecyclePlugins {
141
- program: Command;
142
- inquirer: Inquirer;
143
- }
144
- export interface IPluginLoader {
145
- /**
146
- * register [local plugin] or [provided plugin]
147
- *
148
- * if the second param (plugin) is provided
149
- *
150
- * then picgo will register this plugin and enable it by default
151
- *
152
- * but picgo won't write any config to config file
153
- *
154
- * you should use ctx.setConfig to change the config context
155
- */
156
- registerPlugin: (name: string, plugin?: IPicGoPlugin) => void;
157
- unregisterPlugin: (name: string) => void;
158
- getPlugin: (name: string) => IPicGoPluginInterface | undefined;
159
- /**
160
- * get enabled plugin list
161
- */
162
- getList: () => string[];
163
- /**
164
- * get all plugin list (enabled or not)
165
- */
166
- getFullList: () => string[];
167
- hasPlugin: (name: string) => boolean;
168
- }
169
- export interface IRequestOld {
170
- request: import('axios').AxiosInstance;
171
- }
172
- export type IOldReqOptions = Omit<IRequestPromiseOptions & {
173
- url: string;
174
- }, 'auth'>;
175
- export type IOldReqOptionsWithFullResponse = IOldReqOptions & {
176
- resolveWithFullResponse: true;
177
- };
178
- export type IOldReqOptionsWithJSON = IOldReqOptions & {
179
- json: true;
180
- };
181
- /**
182
- * for PicGo new request api, the response will be json format
183
- */
184
- export type IReqOptions<T = any> = AxiosRequestConfig<T> & {
185
- resolveWithFullResponse: true;
186
- };
187
- /**
188
- * for PicGo new request api, the response will be Buffer
189
- */
190
- export type IReqOptionsWithArrayBufferRes<T = any> = IReqOptions<T> & {
191
- responseType: 'arraybuffer';
192
- };
193
- /**
194
- * for PicGo new request api, the response will be just response data. (not statusCode, headers, etc.)
195
- */
196
- export type IReqOptionsWithBodyResOnly<T = any> = AxiosRequestConfig<T>;
197
- export type IFullResponse<T = any, U = any> = AxiosResponse<T, U> & {
198
- statusCode: number;
199
- body: T;
200
- };
201
- type AxiosResponse<T = any, U = any> = import('axios').AxiosResponse<T, U>;
202
- type AxiosRequestConfig<T = any> = import('axios').AxiosRequestConfig<T>;
203
- interface IRequestOptionsWithFullResponse {
204
- resolveWithFullResponse: true;
205
- }
206
- interface IRequestOptionsWithJSON {
207
- json: true;
208
- }
209
- interface IRequestOptionsWithResponseTypeArrayBuffer {
210
- responseType: 'arraybuffer';
211
- }
212
- /**
213
- * T is the response data type
214
- * U is the config type
215
- */
216
- export type IResponse<T, U> = U extends IRequestOptionsWithFullResponse ? IFullResponse<T, U> : U extends IRequestOptionsWithJSON ? T : U extends IRequestOptionsWithResponseTypeArrayBuffer ? Buffer : U extends IOldReqOptionsWithFullResponse ? IFullResponse<T, U> : U extends IOldReqOptionsWithJSON ? T : U extends IOldReqOptions ? string : U extends IReqOptionsWithBodyResOnly ? T : string;
217
- /**
218
- * the old request lib will be removed in v1.5.0+
219
- * the request options have the following properties
220
- */
221
- export interface IRequestLibOnlyOptions {
222
- proxy?: string;
223
- body?: any;
224
- formData?: Record<string, any> | undefined;
225
- form?: Record<string, any> | string | undefined;
226
- }
227
- export type IRequestConfig<T> = T extends IRequestLibOnlyOptions ? IOldReqOptions : AxiosRequestConfig;
228
- export interface IRequest {
229
- request: <T, U extends IRequestConfig<U> extends IOldReqOptions ? IOldReqOptions : IRequestConfig<U> extends AxiosRequestConfig ? AxiosRequestConfig : never>(config: U) => Promise<IResponse<T, U>>;
230
- }
231
- export type ILogColor = 'blue' | 'green' | 'yellow' | 'red';
232
- /**
233
- * for uploading image info
234
- */
235
- export interface IImgInfo {
236
- buffer?: Buffer;
237
- base64Image?: string;
238
- fileName?: string;
239
- width?: number;
240
- height?: number;
241
- extname?: string;
242
- imgUrl?: string;
243
- [propName: string]: any;
244
- }
245
- export interface IPathTransformedImgInfo extends IImgInfo {
246
- success: boolean;
247
- }
248
- export type IStringKeyMap<T> = Record<string, T extends T ? T : any>;
249
- export type ICLIConfigs = Record<string, IStringKeyMap<any>>;
250
- /**
251
- * Telegraph 图床配置项
252
- * @deprecated since v1.9.6
253
- */
254
- export interface ITelegraphConfig {
255
- proxy?: string;
256
- }
257
- /** SM.MS 图床配置项 */
258
- export interface ISmmsConfig {
259
- token: string;
260
- backupDomain?: string;
261
- }
262
- /** 内置高级自定义图床 */
263
- export interface IAdvancedPlistConfig {
264
- endpoint: string;
265
- method?: string;
266
- formDataKey?: string;
267
- headers?: string;
268
- body?: string;
269
- resDataPath?: string;
270
- customPrefix?: string;
271
- webPath?: string;
272
- }
273
- /** 内置alist 图床配置项 */
274
- export interface IAlistConfig {
275
- url: string;
276
- token?: string;
277
- username?: string;
278
- password?: string;
279
- uploadPath?: string;
280
- webPath?: string;
281
- customUrl?: string;
282
- }
283
- /** 本地图床配置项 */
284
- export interface ILocalConfig {
285
- path: string;
286
- customUrl?: string;
287
- webPath?: string;
288
- }
289
- /** 七牛云图床配置项 */
290
- export interface IQiniuConfig {
291
- accessKey: string;
292
- secretKey: string;
293
- /** 存储空间名 */
294
- bucket: string;
295
- /** 自定义域名 */
296
- url: string;
297
- /** 存储区域编号 */
298
- area: 'z0' | 'z1' | 'z2' | 'na0' | 'as0' | string;
299
- /** 网址后缀,比如使用 `?imageslim` 可进行[图片瘦身](https://developer.qiniu.com/dora/api/1271/image-thin-body-imageslim) */
300
- options: string;
301
- /** 自定义存储路径,比如 `img/` */
302
- path: string;
303
- }
304
- /** 又拍云图床配置项 */
305
- export interface IUpyunConfig {
306
- /** 存储空间名,及你的服务名 */
307
- bucket: string;
308
- /** 操作员 */
309
- operator: string;
310
- /** 密码 */
311
- password: string;
312
- /** 针对图片的一些后缀处理参数 */
313
- options: string;
314
- /** 自定义存储路径,比如 `img/` */
315
- path: string;
316
- /** 加速域名,注意要加 `http://` 或者 `https://` */
317
- url: string;
318
- /** 防盗链密钥 */
319
- antiLeechToken: string;
320
- /** 防盗链过期时间,单位为秒 */
321
- expireTime: number;
322
- /** 自定义API接入点 */
323
- endpoint: string;
324
- }
325
- /** 腾讯云图床配置项 */
326
- export interface ITcyunConfig {
327
- secretId: string;
328
- secretKey: string;
329
- /** 存储桶名,v4 和 v5 版本不一样 */
330
- bucket: string;
331
- appId: string;
332
- /** 存储区域,例如 ap-beijing-1 */
333
- area: string;
334
- /** 自定义存储路径,比如 img/ */
335
- /** endpoint: string */
336
- endpoint: string;
337
- path: string;
338
- /** 自定义域名,注意要加 `http://` 或者 `https://` */
339
- webPath: string;
340
- customUrl: string;
341
- /** COS 版本,v4 或者 v5 */
342
- version: 'v5' | 'v4';
343
- /** 针对图片的一些后缀处理参数 PicGo 2.4.0+ PicGo-Core 1.5.0+ */
344
- options: string;
345
- /** 是否支持极智压缩 */
346
- slim: boolean;
347
- }
348
- /** GitHub 图床配置项 */
349
- export interface IGithubConfig {
350
- /** 仓库名,格式是 `username/reponame` */
351
- repo: string;
352
- /** github token */
353
- token: string;
354
- /** 自定义存储路径,比如 `img/` */
355
- path: string;
356
- /** 自定义域名,注意要加 `http://` 或者 `https://` */
357
- customUrl: string;
358
- /** 分支名,默认是 `main` */
359
- branch: string;
360
- }
361
- /** 阿里云图床配置项 */
362
- export interface IAliyunConfig {
363
- accessKeyId: string;
364
- accessKeySecret: string;
365
- /** 存储空间名 */
366
- bucket: string;
367
- /** 存储区域代号 */
368
- area: string;
369
- /** 自定义存储路径 */
370
- path: string;
371
- /** 网站路径,用于拼接网址路径 */
372
- webPath: string;
373
- /** 自定义域名,注意要加 `http://` 或者 `https://` */
374
- customUrl: string;
375
- /** 针对图片的一些后缀处理参数 PicGo 2.2.0+ PicGo-Core 1.4.0+ */
376
- options: string;
377
- }
378
- /** Imgur 图床配置项 */
379
- export interface IImgurConfig {
380
- /** imgur 的 `clientId` */
381
- clientId: string;
382
- /** 代理地址,仅支持 http 代理 */
383
- proxy: string;
384
- /** imgur 用户名 */
385
- username: string;
386
- /** imgur access token */
387
- accessToken: string;
388
- /** imgur album name */
389
- album: string;
390
- }
391
- /** Webdav 图床配置项 */
392
- export interface IWebdavPlistConfig {
393
- /** webdav `host` */
394
- host: string;
395
- /** webdav `sslEnabled` */
396
- sslEnabled: boolean;
397
- /** webdav 的 `username` */
398
- username: string;
399
- /** webdav 的 `password` */
400
- password: string;
401
- /** webdav `path` */
402
- path: string;
403
- /** webdav 的 `webpath` */
404
- webpath: string;
405
- /** webdav 的 `customUrl` */
406
- customUrl: string;
407
- /** webdav `authType` */
408
- authType: string;
409
- /** webdav `options` */
410
- options: string;
411
- }
412
- /** 内置sftp 图床配置项 */
413
- export interface ISftpPlistConfig {
414
- host: string;
415
- port?: number;
416
- username: string;
417
- password?: string;
418
- privateKey?: string;
419
- passphrase?: string;
420
- uploadPath?: string;
421
- customUrl?: string;
422
- webPath?: string;
423
- fileUser?: string;
424
- fileMode?: string;
425
- dirMode?: string;
426
- }
427
- /** PicList 图床配置项 */
428
- export interface IPicListConfig {
429
- host: string;
430
- port?: number;
431
- picbed?: string;
432
- configName?: string;
433
- serverKey?: string;
434
- }
435
- /** 内置lsky 图床配置项 */
436
- export interface ILskyConfig {
437
- version: string;
438
- host: string;
439
- token: string;
440
- strategyId: string;
441
- albumId: string;
442
- permission: IStringKeyMap<string>;
443
- }
444
- /** 内置aws s3 图床配置项 */
445
- export interface IAwsS3PListUserConfig {
446
- accessKeyID: string;
447
- secretAccessKey: string;
448
- bucketName: string;
449
- uploadPath: string;
450
- region?: string;
451
- endpoint?: string;
452
- proxy?: string;
453
- urlPrefix?: string;
454
- pathStyleAccess?: boolean;
455
- rejectUnauthorized?: boolean;
456
- acl?: string;
457
- disableBucketPrefixToURL?: boolean | string;
458
- }
459
- /** PicGo 配置文件类型定义 */
460
- export interface IConfig {
461
- picBed: {
462
- uploader: string;
463
- current?: string;
464
- smms?: ISmmsConfig;
465
- qiniu?: IQiniuConfig;
466
- upyun?: IUpyunConfig;
467
- tcyun?: ITcyunConfig;
468
- github?: IGithubConfig;
469
- aliyun?: IAliyunConfig;
470
- imgur?: IImgurConfig;
471
- webdavplist?: IWebdavPlistConfig;
472
- local?: ILocalConfig;
473
- transformer?: string;
474
- /** for uploader */
475
- proxy?: string;
476
- [others: string]: any;
477
- };
478
- picgoPlugins: Record<string, boolean>;
479
- debug?: boolean;
480
- silent?: boolean;
481
- settings?: {
482
- logLevel?: string[];
483
- logPath?: string;
484
- /** for npm */
485
- registry?: string;
486
- /** for npm */
487
- proxy?: string;
488
- [others: string]: any;
489
- };
490
- [configOptions: string]: any;
491
- }
492
- /**
493
- * for an uploader/transformer/beforeTransformHandler/beforeUploadHandler/afterUploadHandler
494
- */
495
- export interface IPlugin {
496
- handle: ((ctx: IPicGo) => Promise<any>) | ((ctx: IPicGo) => void);
497
- /** The name of this handler */
498
- name?: string;
499
- /** The config of this handler */
500
- config?: (ctx: IPicGo) => IPluginConfig[];
501
- [propName: string]: any;
502
- }
503
- export type IPluginNameType = 'simple' | 'scope' | 'normal' | 'unknown';
504
- export interface IPluginProcessResult {
505
- success: boolean;
506
- /**
507
- * the package.json's name filed
508
- */
509
- pkgName: string;
510
- /**
511
- * the plugin name or the fs absolute path
512
- */
513
- fullName: string;
514
- }
515
- export interface IPluginHandler {
516
- install: (plugins: string[], options: IPluginHandlerOptions, env?: IProcessEnv) => Promise<IPluginHandlerResult<boolean>>;
517
- update: (plugins: string[], options: IPluginHandlerOptions, env?: IProcessEnv) => Promise<IPluginHandlerResult<boolean>>;
518
- uninstall: (plugins: string[]) => Promise<IPluginHandlerResult<boolean>>;
519
- }
520
- export interface IPluginHandlerResult<T> {
521
- success: T;
522
- body: T extends true ? string[] : string;
523
- }
524
- export interface IPluginHandlerOptions {
525
- proxy?: string;
526
- registry?: string;
527
- }
528
- /**
529
- * for picgo npm plugins
530
- */
531
- export type IPicGoPlugin = (ctx: IPicGo) => IPicGoPluginInterface;
532
- /**
533
- * interfaces for PicGo plugin
534
- */
535
- export interface IPicGoPluginInterface {
536
- /**
537
- * since PicGo-Core v1.5, register will inject ctx
538
- */
539
- register: (ctx: IPicGo) => void;
540
- /**
541
- * this plugin's config
542
- */
543
- config?: (ctx: IPicGo) => IPluginConfig[];
544
- /**
545
- * register uploader name
546
- */
547
- uploader?: string;
548
- /**
549
- * register transformer name
550
- */
551
- transformer?: string;
552
- /**
553
- * for picgo gui plugins
554
- */
555
- guiMenu?: (ctx: IPicGo) => IGuiMenuItem[];
556
- /**
557
- * for picgo gui plugins
558
- * short key -> command
559
- */
560
- commands?: (ctx: IPicGo) => ICommandItem[];
561
- [propName: string]: any;
562
- }
563
- export interface IGuiMenuItem {
564
- label: string;
565
- handle: (ctx: IPicGo, guiApi: any) => Promise<void>;
566
- }
567
- export interface ICommandItem {
568
- label: string;
569
- name: string;
570
- key: string;
571
- handle: (ctx: IPicGo, guiApi: any) => Promise<void>;
572
- }
573
- /**
574
- * for spawn output
575
- */
576
- export interface IResult {
577
- code: number;
578
- data: string;
579
- }
580
- /**
581
- * for transformer - path
582
- */
583
- export interface IImgSize {
584
- width: number;
585
- height: number;
586
- real?: boolean;
587
- extname?: string;
588
- }
589
- /**
590
- * for initUtils
591
- */
592
- export type IFileTree = Record<string, string | Buffer>;
593
- export interface IOptions {
594
- template: string;
595
- dest: string;
596
- hasSlash: boolean;
597
- inPlace: boolean;
598
- clone: boolean;
599
- offline: boolean;
600
- tmp: string;
601
- project: string;
602
- }
603
- /**
604
- * for clipboard image
605
- */
606
- export interface IClipboardImage {
607
- imgPath: string;
608
- /**
609
- * if the path is generate by picgo -> false
610
- * if the path is a real file path in system -> true
611
- */
612
- shouldKeepAfterUploading: boolean;
613
- }
614
- /**
615
- * for install command environment variable
616
- */
617
- export type IProcessEnv = Record<string, Undefinable<string>>;
618
- export type ILogArgvType = string | number;
619
- export type ILogArgvTypeWithError = ILogArgvType | Error;
620
- export type Nullable<T> = T | null;
621
- export type Undefinable<T> = T | undefined;
622
- export interface ILogger {
623
- success: (...msg: ILogArgvType[]) => void;
624
- info: (...msg: ILogArgvType[]) => void;
625
- error: (...msg: ILogArgvTypeWithError[]) => void;
626
- warn: (...msg: ILogArgvType[]) => void;
627
- debug: (...msg: ILogArgvType[]) => void;
628
- }
629
- export interface IConfigChangePayload<T> {
630
- configName: string;
631
- value: T;
632
- }
633
- export type ILocale = Record<string, any>;
634
- export interface II18nManager {
635
- /**
636
- * translate text
637
- */
638
- translate: <T extends string>(key: T, args?: IStringKeyMap<string>) => string;
639
- /**
640
- * add locale to current i18n language
641
- * default locale list
642
- * - zh-CN
643
- * - en
644
- */
645
- addLocale: (language: string, locales: ILocale) => boolean;
646
- /**
647
- * set current language
648
- */
649
- setLanguage: (language: string) => void;
650
- /**
651
- * dynamic add new language & locales
652
- */
653
- addLanguage: (language: string, locales: ILocale) => boolean;
654
- /**
655
- * get language list
656
- */
657
- getLanguageList: () => string[];
658
- }
659
- export type availableConvertFormat = keyof FormatEnum;
660
- export type availableWatermarkPosition = keyof GravityEnum;
661
- export interface IBuildInWaterMarkOptions {
662
- isAddWatermark?: boolean;
663
- watermarkType?: 'text' | 'image';
664
- isFullScreenWatermark?: boolean;
665
- watermarkDegree?: number;
666
- watermarkText?: string;
667
- watermarkFontPath?: string;
668
- watermarkScaleRatio?: number;
669
- watermarkColor?: string;
670
- watermarkImagePath?: string;
671
- watermarkPosition?: availableWatermarkPosition;
672
- }
673
- export interface IBuildInCompressOptions {
674
- quality?: number;
675
- isConvert?: boolean;
676
- convertFormat?: availableConvertFormat;
677
- isReSize?: boolean;
678
- reSizeWidth?: number;
679
- reSizeHeight?: number;
680
- skipReSizeOfSmallImg?: boolean;
681
- isReSizeByPercent?: boolean;
682
- reSizePercent?: number;
683
- isRotate?: boolean;
684
- rotateDegree?: number;
685
- isRemoveExif?: boolean;
686
- isFlip?: boolean;
687
- isFlop?: boolean;
688
- [propName: string]: any;
689
- }
690
- export interface IBuildInSkipProcessOptions {
691
- skipProcessExtList?: string;
692
- }
693
- export {};
1
+ import { Command } from 'commander';
2
+ import { Inquirer } from 'inquirer';
3
+ import { FormatEnum, GravityEnum } from 'sharp';
4
+ import { IRequestPromiseOptions } from './oldRequest';
5
+ export interface IPicGo extends NodeJS.EventEmitter {
6
+ configPath: string;
7
+ baseDir: string;
8
+ log: ILogger;
9
+ cmd: ICommander;
10
+ output: IImgInfo[];
11
+ input: any[];
12
+ rawInput: any[];
13
+ processedInput: any[];
14
+ pluginLoader: IPluginLoader;
15
+ pluginHandler: IPluginHandler;
16
+ /**
17
+ * @deprecated will be removed in v1.5.0+
18
+ */
19
+ Request: IRequest;
20
+ helper: IHelper;
21
+ VERSION: string;
22
+ GUI_VERSION?: string;
23
+ request: IRequest['request'];
24
+ rawInputPath?: string[];
25
+ i18n: II18nManager;
26
+ getConfig: <T>(name?: string) => T;
27
+ saveConfig: (config: IStringKeyMap<any>) => void;
28
+ removeConfig: (key: string, propName: string) => void;
29
+ setConfig: (config: IStringKeyMap<any>) => void;
30
+ unsetConfig: (key: string, propName: string) => void;
31
+ upload: (input?: any[]) => Promise<IImgInfo[] | Error>;
32
+ uploadReturnCtx: (input?: any[]) => Promise<IPicGo>;
33
+ }
34
+ export interface IPluginConfig {
35
+ name: string;
36
+ type: string;
37
+ required: boolean;
38
+ default?: any;
39
+ alias?: string;
40
+ message?: string;
41
+ prefix?: string;
42
+ [propName: string]: any;
43
+ }
44
+ export interface ILifecyclePlugins {
45
+ register: (id: string, plugin: IPlugin) => void;
46
+ unregister: (id: string) => void;
47
+ getName: () => string;
48
+ get: (id: string) => IPlugin | undefined;
49
+ getList: () => IPlugin[];
50
+ getIdList: () => string[];
51
+ }
52
+ export interface IHelper {
53
+ transformer: ILifecyclePlugins;
54
+ uploader: ILifecyclePlugins;
55
+ beforeTransformPlugins: ILifecyclePlugins;
56
+ beforeUploadPlugins: ILifecyclePlugins;
57
+ afterUploadPlugins: ILifecyclePlugins;
58
+ }
59
+ export interface ICommander extends ILifecyclePlugins {
60
+ program: Command;
61
+ inquirer: Inquirer;
62
+ }
63
+ export interface IPluginLoader {
64
+ registerPlugin: (name: string, plugin?: IPicGoPlugin) => Promise<void>;
65
+ unregisterPlugin: (name: string) => void;
66
+ getPlugin: (name: string) => Promise<IPicGoPluginInterface | undefined>;
67
+ getList: () => string[];
68
+ getFullList: () => string[];
69
+ hasPlugin: (name: string) => boolean;
70
+ }
71
+ export interface IRequestOld {
72
+ request: import('axios').AxiosInstance;
73
+ }
74
+ export type IOldReqOptions = Omit<IRequestPromiseOptions & {
75
+ url: string;
76
+ }, 'auth'>;
77
+ export type IOldReqOptionsWithFullResponse = IOldReqOptions & {
78
+ resolveWithFullResponse: true;
79
+ };
80
+ export type IOldReqOptionsWithJSON = IOldReqOptions & {
81
+ json: true;
82
+ };
83
+ /**
84
+ * for PicGo new request api, the response will be json format
85
+ */
86
+ export type IReqOptions<T = any> = AxiosRequestConfig<T> & {
87
+ resolveWithFullResponse: true;
88
+ };
89
+ /**
90
+ * for PicGo new request api, the response will be Buffer
91
+ */
92
+ export type IReqOptionsWithArrayBufferRes<T = any> = IReqOptions<T> & {
93
+ responseType: 'arraybuffer';
94
+ };
95
+ /**
96
+ * for PicGo new request api, the response will be just response data. (not statusCode, headers, etc.)
97
+ */
98
+ export type IReqOptionsWithBodyResOnly<T = any> = AxiosRequestConfig<T>;
99
+ export type IFullResponse<T = any, U = any> = AxiosResponse<T, U> & {
100
+ statusCode: number;
101
+ body: T;
102
+ };
103
+ type AxiosResponse<T = any, U = any> = import('axios').AxiosResponse<T, U>;
104
+ type AxiosRequestConfig<T = any> = import('axios').AxiosRequestConfig<T>;
105
+ interface IRequestOptionsWithFullResponse {
106
+ resolveWithFullResponse: true;
107
+ }
108
+ interface IRequestOptionsWithJSON {
109
+ json: true;
110
+ }
111
+ interface IRequestOptionsWithResponseTypeArrayBuffer {
112
+ responseType: 'arraybuffer';
113
+ }
114
+ /**
115
+ * T is the response data type
116
+ * U is the config type
117
+ */
118
+ export type IResponse<T, U> = U extends IRequestOptionsWithFullResponse ? IFullResponse<T, U> : U extends IRequestOptionsWithJSON ? T : U extends IRequestOptionsWithResponseTypeArrayBuffer ? Buffer : U extends IOldReqOptionsWithFullResponse ? IFullResponse<T, U> : U extends IOldReqOptionsWithJSON ? T : U extends IOldReqOptions ? string : U extends IReqOptionsWithBodyResOnly ? T : string;
119
+ /**
120
+ * the old request lib will be removed in v1.5.0+
121
+ * the request options have the following properties
122
+ */
123
+ export interface IRequestLibOnlyOptions {
124
+ proxy?: string;
125
+ body?: any;
126
+ formData?: Record<string, any> | undefined;
127
+ form?: Record<string, any> | string | undefined;
128
+ }
129
+ export type IRequestConfig<T> = T extends IRequestLibOnlyOptions ? IOldReqOptions : AxiosRequestConfig;
130
+ export interface IRequest {
131
+ request: <T, U extends IRequestConfig<U> extends IOldReqOptions ? IOldReqOptions : IRequestConfig<U> extends AxiosRequestConfig ? AxiosRequestConfig : never>(config: U) => Promise<IResponse<T, U>>;
132
+ }
133
+ export type ILogColor = 'blue' | 'green' | 'yellow' | 'red';
134
+ export interface IImgInfo {
135
+ buffer?: Buffer;
136
+ base64Image?: string;
137
+ fileName?: string;
138
+ width?: number;
139
+ height?: number;
140
+ extname?: string;
141
+ imgUrl?: string;
142
+ [propName: string]: any;
143
+ }
144
+ export interface IPathTransformedImgInfo extends IImgInfo {
145
+ success: boolean;
146
+ }
147
+ export type IStringKeyMap<T> = Record<string, T extends T ? T : any>;
148
+ export type ICLIConfigs = Record<string, IStringKeyMap<any>>;
149
+ /**
150
+ * Telegraph 图床配置项
151
+ * @deprecated since v1.9.6
152
+ */
153
+ export interface ITelegraphConfig {
154
+ proxy?: string;
155
+ }
156
+ /** SM.MS 图床配置项 */
157
+ export interface ISmmsConfig {
158
+ token: string;
159
+ backupDomain?: string;
160
+ }
161
+ /** 内置高级自定义图床 */
162
+ export interface IAdvancedPlistConfig {
163
+ endpoint: string;
164
+ method?: string;
165
+ formDataKey?: string;
166
+ headers?: string;
167
+ body?: string;
168
+ resDataPath?: string;
169
+ customPrefix?: string;
170
+ webPath?: string;
171
+ }
172
+ /** 内置alist 图床配置项 */
173
+ export interface IAlistConfig {
174
+ url: string;
175
+ token?: string;
176
+ username?: string;
177
+ password?: string;
178
+ uploadPath?: string;
179
+ webPath?: string;
180
+ customUrl?: string;
181
+ }
182
+ /** 本地图床配置项 */
183
+ export interface ILocalConfig {
184
+ path: string;
185
+ customUrl?: string;
186
+ webPath?: string;
187
+ }
188
+ /** 七牛云图床配置项 */
189
+ export interface IQiniuConfig {
190
+ accessKey: string;
191
+ secretKey: string;
192
+ /** 存储空间名 */
193
+ bucket: string;
194
+ /** 自定义域名 */
195
+ url: string;
196
+ /** 存储区域编号 */
197
+ area: 'z0' | 'z1' | 'z2' | 'na0' | 'as0' | string;
198
+ /** 网址后缀,比如使用 `?imageslim` 可进行[图片瘦身](https://developer.qiniu.com/dora/api/1271/image-thin-body-imageslim) */
199
+ options: string;
200
+ /** 自定义存储路径,比如 `img/` */
201
+ path: string;
202
+ }
203
+ /** 又拍云图床配置项 */
204
+ export interface IUpyunConfig {
205
+ /** 存储空间名,及你的服务名 */
206
+ bucket: string;
207
+ /** 操作员 */
208
+ operator: string;
209
+ /** 密码 */
210
+ password: string;
211
+ /** 针对图片的一些后缀处理参数 */
212
+ options: string;
213
+ /** 自定义存储路径,比如 `img/` */
214
+ path: string;
215
+ /** 加速域名,注意要加 `http://` 或者 `https://` */
216
+ url: string;
217
+ /** 防盗链密钥 */
218
+ antiLeechToken: string;
219
+ /** 防盗链过期时间,单位为秒 */
220
+ expireTime: number;
221
+ /** 自定义API接入点 */
222
+ endpoint: string;
223
+ }
224
+ /** 腾讯云图床配置项 */
225
+ export interface ITcyunConfig {
226
+ secretId: string;
227
+ secretKey: string;
228
+ /** 存储桶名,v4 v5 版本不一样 */
229
+ bucket: string;
230
+ appId: string;
231
+ /** 存储区域,例如 ap-beijing-1 */
232
+ area: string;
233
+ /** 自定义存储路径,比如 img/ */
234
+ /** endpoint: string */
235
+ endpoint: string;
236
+ path: string;
237
+ /** 自定义域名,注意要加 `http://` 或者 `https://` */
238
+ webPath: string;
239
+ customUrl: string;
240
+ /** COS 版本,v4 或者 v5 */
241
+ version: 'v5' | 'v4';
242
+ /** 针对图片的一些后缀处理参数 PicGo 2.4.0+ PicGo-Core 1.5.0+ */
243
+ options: string;
244
+ /** 是否支持极智压缩 */
245
+ slim: boolean;
246
+ }
247
+ /** GitHub 图床配置项 */
248
+ export interface IGithubConfig {
249
+ /** 仓库名,格式是 `username/reponame` */
250
+ repo: string;
251
+ /** github token */
252
+ token: string;
253
+ /** 自定义存储路径,比如 `img/` */
254
+ path: string;
255
+ /** 自定义域名,注意要加 `http://` 或者 `https://` */
256
+ customUrl: string;
257
+ /** 分支名,默认是 `main` */
258
+ branch: string;
259
+ }
260
+ /** 阿里云图床配置项 */
261
+ export interface IAliyunConfig {
262
+ accessKeyId: string;
263
+ accessKeySecret: string;
264
+ /** 存储空间名 */
265
+ bucket: string;
266
+ /** 存储区域代号 */
267
+ area: string;
268
+ /** 自定义存储路径 */
269
+ path: string;
270
+ /** 网站路径,用于拼接网址路径 */
271
+ webPath: string;
272
+ /** 自定义域名,注意要加 `http://` 或者 `https://` */
273
+ customUrl: string;
274
+ /** 针对图片的一些后缀处理参数 PicGo 2.2.0+ PicGo-Core 1.4.0+ */
275
+ options: string;
276
+ }
277
+ /** Imgur 图床配置项 */
278
+ export interface IImgurConfig {
279
+ /** imgur 的 `clientId` */
280
+ clientId: string;
281
+ /** 代理地址,仅支持 http 代理 */
282
+ proxy: string;
283
+ /** imgur 用户名 */
284
+ username: string;
285
+ /** imgur access token */
286
+ accessToken: string;
287
+ /** imgur album name */
288
+ album: string;
289
+ }
290
+ /** Webdav 图床配置项 */
291
+ export interface IWebdavPlistConfig {
292
+ /** webdav 的 `host` */
293
+ host: string;
294
+ /** webdav 的 `sslEnabled` */
295
+ sslEnabled: boolean;
296
+ /** webdav 的 `username` */
297
+ username: string;
298
+ /** webdav `password` */
299
+ password: string;
300
+ /** webdav 的 `path` */
301
+ path: string;
302
+ /** webdav 的 `webpath` */
303
+ webpath: string;
304
+ /** webdav 的 `customUrl` */
305
+ customUrl: string;
306
+ /** webdav 的 `authType` */
307
+ authType: string;
308
+ /** webdav 的 `options` */
309
+ options: string;
310
+ }
311
+ /** 内置sftp 图床配置项 */
312
+ export interface ISftpPlistConfig {
313
+ host: string;
314
+ port?: number;
315
+ username: string;
316
+ password?: string;
317
+ privateKey?: string;
318
+ passphrase?: string;
319
+ uploadPath?: string;
320
+ customUrl?: string;
321
+ webPath?: string;
322
+ fileUser?: string;
323
+ fileMode?: string;
324
+ dirMode?: string;
325
+ }
326
+ /** PicList 图床配置项 */
327
+ export interface IPicListConfig {
328
+ host: string;
329
+ port?: number;
330
+ picbed?: string;
331
+ configName?: string;
332
+ serverKey?: string;
333
+ }
334
+ /** 内置lsky 图床配置项 */
335
+ export interface ILskyConfig {
336
+ version: string;
337
+ host: string;
338
+ token: string;
339
+ strategyId: string;
340
+ albumId: string;
341
+ permission: IStringKeyMap<string>;
342
+ }
343
+ /** 内置aws s3 图床配置项 */
344
+ export interface IAwsS3PListUserConfig {
345
+ accessKeyID: string;
346
+ secretAccessKey: string;
347
+ bucketName: string;
348
+ uploadPath: string;
349
+ region?: string;
350
+ endpoint?: string;
351
+ proxy?: string;
352
+ urlPrefix?: string;
353
+ pathStyleAccess?: boolean;
354
+ rejectUnauthorized?: boolean;
355
+ acl?: string;
356
+ disableBucketPrefixToURL?: boolean | string;
357
+ options?: string;
358
+ }
359
+ /** PicGo 配置文件类型定义 */
360
+ export interface IConfig {
361
+ picBed: {
362
+ uploader: string;
363
+ current?: string;
364
+ smms?: ISmmsConfig;
365
+ qiniu?: IQiniuConfig;
366
+ upyun?: IUpyunConfig;
367
+ tcyun?: ITcyunConfig;
368
+ github?: IGithubConfig;
369
+ aliyun?: IAliyunConfig;
370
+ imgur?: IImgurConfig;
371
+ webdavplist?: IWebdavPlistConfig;
372
+ local?: ILocalConfig;
373
+ transformer?: string;
374
+ /** for uploader */
375
+ proxy?: string;
376
+ [others: string]: any;
377
+ };
378
+ picgoPlugins: Record<string, boolean>;
379
+ debug?: boolean;
380
+ silent?: boolean;
381
+ settings?: {
382
+ logLevel?: string[];
383
+ logPath?: string;
384
+ /** for npm */
385
+ registry?: string;
386
+ /** for npm */
387
+ proxy?: string;
388
+ [others: string]: any;
389
+ };
390
+ [configOptions: string]: any;
391
+ }
392
+ /**
393
+ * for an uploader/transformer/beforeTransformHandler/beforeUploadHandler/afterUploadHandler
394
+ */
395
+ export interface IPlugin {
396
+ handle: ((ctx: IPicGo) => Promise<any>) | ((ctx: IPicGo) => void);
397
+ name?: string;
398
+ config?: (ctx: IPicGo) => IPluginConfig[];
399
+ [propName: string]: any;
400
+ }
401
+ export type IPluginNameType = 'simple' | 'scope' | 'normal' | 'unknown';
402
+ export interface IPluginProcessResult {
403
+ success: boolean;
404
+ pkgName: string;
405
+ fullName: string;
406
+ }
407
+ export interface IPluginHandler {
408
+ install: (plugins: string[], options: IPluginHandlerOptions, env?: IProcessEnv) => Promise<IPluginHandlerResult<boolean>>;
409
+ update: (plugins: string[], options: IPluginHandlerOptions, env?: IProcessEnv) => Promise<IPluginHandlerResult<boolean>>;
410
+ uninstall: (plugins: string[]) => Promise<IPluginHandlerResult<boolean>>;
411
+ }
412
+ export interface IPluginHandlerResult<T> {
413
+ success: T;
414
+ body: T extends true ? string[] : string;
415
+ }
416
+ export interface IPluginHandlerOptions {
417
+ proxy?: string;
418
+ registry?: string;
419
+ }
420
+ /**
421
+ * for picgo npm plugins
422
+ */
423
+ export type IPicGoPlugin = (ctx: IPicGo) => IPicGoPluginInterface;
424
+ /**
425
+ * interfaces for PicGo plugin
426
+ */
427
+ export interface IPicGoPluginInterface {
428
+ /**
429
+ * since PicGo-Core v1.5, register will inject ctx
430
+ */
431
+ register: (ctx: IPicGo) => void;
432
+ /**
433
+ * this plugin's config
434
+ */
435
+ config?: (ctx: IPicGo) => IPluginConfig[];
436
+ /**
437
+ * register uploader name
438
+ */
439
+ uploader?: string;
440
+ /**
441
+ * register transformer name
442
+ */
443
+ transformer?: string;
444
+ /**
445
+ * for picgo gui plugins
446
+ */
447
+ guiMenu?: (ctx: IPicGo) => IGuiMenuItem[];
448
+ /**
449
+ * for picgo gui plugins
450
+ * short key -> command
451
+ */
452
+ commands?: (ctx: IPicGo) => ICommandItem[];
453
+ [propName: string]: any;
454
+ }
455
+ export interface IGuiMenuItem {
456
+ label: string;
457
+ handle: (ctx: IPicGo, guiApi: any) => Promise<void>;
458
+ }
459
+ export interface ICommandItem {
460
+ label: string;
461
+ name: string;
462
+ key: string;
463
+ handle: (ctx: IPicGo, guiApi: any) => Promise<void>;
464
+ }
465
+ /**
466
+ * for spawn output
467
+ */
468
+ export interface IResult {
469
+ code: number;
470
+ data: string;
471
+ }
472
+ /**
473
+ * for transformer - path
474
+ */
475
+ export interface IImgSize {
476
+ width: number;
477
+ height: number;
478
+ real?: boolean;
479
+ extname?: string;
480
+ }
481
+ /**
482
+ * for clipboard image
483
+ */
484
+ export interface IClipboardImage {
485
+ imgPath: string;
486
+ /**
487
+ * if the path is generate by picgo -> false
488
+ * if the path is a real file path in system -> true
489
+ */
490
+ shouldKeepAfterUploading: boolean;
491
+ }
492
+ /**
493
+ * for install command environment variable
494
+ */
495
+ export type IProcessEnv = Record<string, Undefinable<string>>;
496
+ export type ILogArgvType = string | number;
497
+ export type ILogArgvTypeWithError = ILogArgvType | Error;
498
+ export type Nullable<T> = T | null;
499
+ export type Undefinable<T> = T | undefined;
500
+ export interface ILogger {
501
+ success: (...msg: ILogArgvType[]) => void;
502
+ info: (...msg: ILogArgvType[]) => void;
503
+ error: (...msg: ILogArgvTypeWithError[]) => void;
504
+ warn: (...msg: ILogArgvType[]) => void;
505
+ debug: (...msg: ILogArgvType[]) => void;
506
+ }
507
+ export interface IConfigChangePayload<T> {
508
+ configName: string;
509
+ value: T;
510
+ }
511
+ export type ILocale = Record<string, any>;
512
+ export interface II18nManager {
513
+ /**
514
+ * translate text
515
+ */
516
+ translate: <T extends string>(key: T, args?: IStringKeyMap<string>) => string;
517
+ /**
518
+ * add locale to current i18n language
519
+ * default locale list
520
+ * - zh-CN
521
+ * - en
522
+ */
523
+ addLocale: (language: string, locales: ILocale) => boolean;
524
+ /**
525
+ * set current language
526
+ */
527
+ setLanguage: (language: string) => void;
528
+ /**
529
+ * dynamic add new language & locales
530
+ */
531
+ addLanguage: (language: string, locales: ILocale) => boolean;
532
+ /**
533
+ * get language list
534
+ */
535
+ getLanguageList: () => string[];
536
+ }
537
+ export type availableConvertFormat = keyof FormatEnum;
538
+ export type availableWatermarkPosition = keyof GravityEnum;
539
+ export interface IBuildInWaterMarkOptions {
540
+ isAddWatermark?: boolean;
541
+ watermarkType?: 'text' | 'image';
542
+ isFullScreenWatermark?: boolean;
543
+ watermarkDegree?: number;
544
+ watermarkText?: string;
545
+ watermarkFontPath?: string;
546
+ watermarkScaleRatio?: number;
547
+ watermarkColor?: string;
548
+ watermarkImagePath?: string;
549
+ watermarkPosition?: availableWatermarkPosition;
550
+ watermarkImageOpacity?: number;
551
+ }
552
+ export interface IBuildInCompressOptions {
553
+ quality?: number;
554
+ isConvert?: boolean;
555
+ convertFormat?: availableConvertFormat;
556
+ isReSize?: boolean;
557
+ reSizeWidth?: number;
558
+ reSizeHeight?: number;
559
+ skipReSizeOfSmallImg?: boolean;
560
+ isReSizeByPercent?: boolean;
561
+ reSizePercent?: number;
562
+ isRotate?: boolean;
563
+ rotateDegree?: number;
564
+ isRemoveExif?: boolean;
565
+ isFlip?: boolean;
566
+ isFlop?: boolean;
567
+ [propName: string]: any;
568
+ }
569
+ export interface IBuildInSkipProcessOptions {
570
+ skipProcessExtList?: string;
571
+ }
572
+ export {};