From 32afd5495647acdbdf8f9dd4e2f844c3ab0b5608 Mon Sep 17 00:00:00 2001 From: Piter Date: Fri, 23 Aug 2019 10:24:21 +0200 Subject: [PATCH] feat(transforms): Update enhance preset definition (#275) --- src/lib/filelink.ts | 19 +++++++++++++++++-- src/schema/transforms.schema.ts | 15 +++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/lib/filelink.ts b/src/lib/filelink.ts index 7ba1e596..e6532bab 100644 --- a/src/lib/filelink.ts +++ b/src/lib/filelink.ts @@ -415,6 +415,21 @@ export interface URLScreenshotParams { device?: string; } +export enum EnhancePreset { + auto = 'auto', + vivid = 'vivid', + beautify = 'beautify', + beautifyPlus = 'beautify_plus', + fixDark = 'fix_dark', + fixNoise = 'fix_noise', + fixTint = 'fix_tint', + outdor = 'outdoor', + fireworks = 'fireworks', +} +export interface EnhanceParams { + preset?: EnhancePreset; +} + export interface PdfInfoParams { colorinfo?: boolean; } @@ -750,8 +765,8 @@ export class Filelink { * @returns this * @memberof Filelink */ - enhance() { - return this.addTask('enhance', true); + enhance(params?: EnhanceParams) { + return this.addTask('enhance', params || true); } /** diff --git a/src/schema/transforms.schema.ts b/src/schema/transforms.schema.ts index ed384ab4..8149d204 100644 --- a/src/schema/transforms.schema.ts +++ b/src/schema/transforms.schema.ts @@ -48,8 +48,19 @@ export const TransformSchema = { additionalProperties: false, }, enhance: { - type: 'boolean', - additionalProperties: false, + default: true, + oneOf: [{ + type: 'boolean', + }, { + type: 'object', + additionalProperties: false, + properties: { + preset: { + type: 'string', + enum: ['auto', 'vivid', 'beautify', 'beautify_plus', 'fix_dark', 'fix_noise', 'fix_tint', 'outdoor', 'fireworks'], + }, + }, + }], }, redeye: { type: 'boolean',