mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Docs/types: add Promise<T> and Array<T> #472
Changelog updates and version bump of devDeps
This commit is contained in:
@@ -16,7 +16,7 @@ const sharp = require('../build/Release/sharp.node');
|
||||
* @param {String} fileOut - the path to write the image data to.
|
||||
* @param {Function} [callback] - called on completion with two arguments `(err, info)`.
|
||||
* `info` contains the output image `format`, `size` (bytes), `width`, `height` and `channels`.
|
||||
* @returns {Promise} - when no callback is provided
|
||||
* @returns {Promise<Object>} - when no callback is provided
|
||||
* @throws {Error} Invalid parameters
|
||||
*/
|
||||
const toFile = function toFile (fileOut, callback) {
|
||||
@@ -53,7 +53,7 @@ const toFile = function toFile (fileOut, callback) {
|
||||
* A Promises/A+ promise is returned when `callback` is not provided.
|
||||
*
|
||||
* @param {Function} [callback]
|
||||
* @returns {Promise} - when no callback is provided
|
||||
* @returns {Promise<Buffer>} - when no callback is provided
|
||||
*/
|
||||
const toBuffer = function toBuffer (callback) {
|
||||
return this._pipeline(callback);
|
||||
|
||||
Reference in New Issue
Block a user