Skip to content

Commit

Permalink
feat(transforms): Update enhance preset definition (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcholuj authored Aug 23, 2019
1 parent 747e3b1 commit 32afd54
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
19 changes: 17 additions & 2 deletions src/lib/filelink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}

/**
Expand Down
15 changes: 13 additions & 2 deletions src/schema/transforms.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 32afd54

Please sign in to comment.