@@ -10,9 +10,16 @@ import contrast, { ContrastOptions } from './transformers/contrast';
1010import crop , { CropOptions } from './transformers/crop' ;
1111import dpr , { DprOptions } from './transformers/dpr' ;
1212import enlarge from './transformers/enlarge' ;
13+ import expires , { ExpiresOptions } from './transformers/expires' ;
1314import extend from './transformers/extend' ;
15+ import fallbackImageUrl , {
16+ FallbackImageUrlOptions ,
17+ } from './transformers/fallback-image-url' ;
1418import fileName , { FileNameOptions } from './transformers/filename' ;
1519import format , { FormatOptions } from './transformers/format' ;
20+ import formatQuality , {
21+ FormatQualityOptions ,
22+ } from './transformers/format-quality' ;
1623import gifOptions , { GifOptions } from './transformers/gif-options' ;
1724import gravity , { GravityOptions } from './transformers/gravity' ;
1825import jpegOptions , { JpegOptions } from './transformers/jpeg-options' ;
@@ -30,17 +37,28 @@ import resizingAlgorithm, {
3037import rotate , { RotationOptions } from './transformers/rotate' ;
3138import saturation , { SaturationOptions } from './transformers/saturation' ;
3239import sharpen , { SharpenOptions } from './transformers/sharpen' ;
40+ import skipProcessing , {
41+ SkipProcessingOptions ,
42+ } from './transformers/skip-processing' ;
3343import stripColorProfile from './transformers/strip-color-profile' ;
3444import stripMetadata from './transformers/strip-metadata' ;
45+ import style , { StyleOptions } from './transformers/style' ;
3546import trim , { TrimOptions } from './transformers/trim' ;
3647import unsharpen , { UnsharpeningOptions } from './transformers/unsharpen' ;
3748import videoThumbnailSecond , {
3849 VideoThumbnailSecondOptions ,
3950} from './transformers/video-thumbnail-second' ;
4051import watermark , { WatermarkOptions } from './transformers/watermark' ;
52+ import watermarkSize , {
53+ WatermarkSizeOptions ,
54+ } from './transformers/watermark-size' ;
55+ import watermarkText , {
56+ WatermarkTextOptions ,
57+ } from './transformers/watermark-text' ;
4158import watermarkUrl , {
4259 WatermarkUrlOptions ,
4360} from './transformers/watermark-url' ;
61+ import zoom , { ZoomOptions } from './transformers/zoom' ;
4462
4563import { encodeFilePath , generateSignature } from './utils' ;
4664
@@ -200,6 +218,16 @@ class ParamBuilder {
200218 return this ;
201219 }
202220
221+ /**
222+ * Returns a 404 if the provided timestamp expired
223+ *
224+ * @param options The expiration date / timestamp
225+ */
226+ public expires ( this : this, options : ExpiresOptions ) : this {
227+ this . modifiers . set ( 'expires' , expires ( options ) ) ;
228+ return this ;
229+ }
230+
203231 /**
204232 * Extends the image of it is smaller than the given size
205233 */
@@ -208,6 +236,16 @@ class ParamBuilder {
208236 return this ;
209237 }
210238
239+ /**
240+ * Sets the fallback image url
241+ *
242+ * @param options The image URL
243+ */
244+ public fallbackImageUrl ( this : this, options : FallbackImageUrlOptions ) : this {
245+ this . modifiers . set ( 'fallbackImageUrl' , fallbackImageUrl ( options ) ) ;
246+ return this ;
247+ }
248+
211249 /**
212250 * Sets the filename for the Content-Disposition header
213251 *
@@ -228,6 +266,16 @@ class ParamBuilder {
228266 return this ;
229267 }
230268
269+ /**
270+ * Specifies the format quality
271+ *
272+ * @param options The format quality options
273+ */
274+ public formatQuality ( this : this, options : FormatQualityOptions ) : this {
275+ this . modifiers . set ( 'formatQuality' , formatQuality ( options ) ) ;
276+ return this ;
277+ }
278+
231279 /**
232280 * Allows redefining GIF saving options
233281 *
@@ -389,6 +437,16 @@ class ParamBuilder {
389437 return this ;
390438 }
391439
440+ /**
441+ * Skips the processing for the specified extensions
442+ *
443+ * @param options The list of formats / extensions
444+ */
445+ public skipProcessing ( this : this, options : SkipProcessingOptions ) : this {
446+ this . modifiers . set ( 'skipProcessing' , skipProcessing ( options ) ) ;
447+ return this ;
448+ }
449+
392450 /**
393451 * Strips the color profile from the image
394452 */
@@ -405,6 +463,16 @@ class ParamBuilder {
405463 return this ;
406464 }
407465
466+ /**
467+ * Applies the specified CSS styles to an SVG source image
468+ *
469+ * @param options The CSS styles
470+ */
471+ public style ( this : this, options : StyleOptions ) : this {
472+ this . modifiers . set ( 'style' , style ( options ) ) ;
473+ return this ;
474+ }
475+
408476 /**
409477 * Trims the image background
410478 *
@@ -449,6 +517,26 @@ class ParamBuilder {
449517 return this ;
450518 }
451519
520+ /**
521+ * Sets the watermark size
522+ *
523+ * @param options The watermark size
524+ */
525+ public watermarkSize ( this : this, options : WatermarkSizeOptions ) : this {
526+ this . modifiers . set ( 'watermarkSize' , watermarkSize ( options ) ) ;
527+ return this ;
528+ }
529+
530+ /**
531+ * Sets the watermark Text
532+ *
533+ * @param options The watermark text
534+ */
535+ public watermarkText ( this : this, options : WatermarkTextOptions ) : this {
536+ this . modifiers . set ( 'watermarkText' , watermarkText ( options ) ) ;
537+ return this ;
538+ }
539+
452540 /**
453541 * Sets the watermark URL
454542 *
@@ -458,6 +546,17 @@ class ParamBuilder {
458546 this . modifiers . set ( 'watermarkUrl' , watermarkUrl ( options ) ) ;
459547 return this ;
460548 }
549+
550+ /**
551+ * Multiplies the image according to the specified factors.
552+ * The values must be greater than 0.
553+ *
554+ * @param options The zoom options
555+ */
556+ public zoom ( this : this, options : ZoomOptions ) : this {
557+ this . modifiers . set ( 'zoom' , zoom ( options ) ) ;
558+ return this ;
559+ }
461560}
462561
463562const pb = ( ) : ParamBuilder => new ParamBuilder ( ) ;
0 commit comments