lens-chainable
Small that allows me to chain multiple lens filters and apply them to a existing image or append a new image to the dom.
Install
npm install lens-chainable --save
API Reference
Chainable(options)
Initialize the chainable instance.
options
- Objectfrom
- String - dom selector to the imageurl
- String - url to the imagedata
- Array - image data
;const chainable = url: 'dummy.jpg ' ;
< filter >(options): Chainable Instance
Apply a filter to the current chainable instance. Check here the available filters: lens filters
options
- Object - the options object to be sent to the selected filter
;const chainable = url: 'dummy.jpg ' ;
append(selector): Promise
Creates a new image element and appends the result of the chainable operations to a given selector.
selector
- String - DOM selector
; url: 'dummy.jpg ' ;
applyFilters(): Promise< ImageData >
Applies the filters and returns a promise with the new image data.
; url: 'dummy.jpg ' ;
getDataURL(): ImageData
Returns the data url of the applied filters.
;const dataURL = url: 'dummy.jpg ' ;
update(selector): Promise
Updates a image element with the result of the chainable operations.
selector
- String - DOM selector
; url: 'dummy.jpg ' ;