@types/merge-images
Advanced tools
Comparing version 1.1.3 to 1.2.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for merge-images 1.1 | ||
// Type definitions for merge-images 1.2 | ||
// Project: https://github.com/lukechilds/merge-images | ||
@@ -14,6 +14,13 @@ // Definitions by: BendingBender <https://github.com/BendingBender> | ||
declare function mergeImages( | ||
sources: mergeImages.ImageSource[], | ||
options?: mergeImages.Options | ||
): Promise<string>; | ||
/** | ||
* @returns A Promise which resolves to a base64 data URI. | ||
* | ||
* @example | ||
* import mergeImages = require('merge-images'); | ||
* | ||
* mergeImages(['/body.png', '/eyes.png', '/mouth.png']) | ||
* .then(b64 => document.querySelector('img').src = b64); | ||
* // data:image/png;base64,iVBORw0KGgoAA... | ||
*/ | ||
declare function mergeImages(sources: mergeImages.ImageSource[], options?: mergeImages.Options): Promise<string>; | ||
@@ -26,9 +33,89 @@ declare namespace mergeImages { | ||
interface Options { | ||
/** | ||
* A DOMString indicating the image format. | ||
* | ||
* @default 'image/png' | ||
*/ | ||
format?: string; | ||
/** | ||
* A number between `0` and `1` indicating image quality if the requested format is `'image/jpeg'` or `'image/webp'`. | ||
* | ||
* @default 0.92 | ||
*/ | ||
quality?: number; | ||
/** | ||
* The width in pixels the rendered image should be. Defaults to the width of the widest source image. | ||
* | ||
* @default undefined | ||
* | ||
* @example | ||
* mergeImages(['/body.png', '/eyes.png', '/mouth.png'], { | ||
* width: 128, | ||
* }) | ||
* .then(b64 => ...); | ||
* // data:image/png;base64,iVBORw0KGgoAA... | ||
*/ | ||
width?: number; | ||
/** | ||
* The height in pixels the rendered image should be. Defaults to the height of the tallest source image. | ||
* | ||
* @default undefined | ||
* | ||
* @example | ||
* mergeImages(['/body.png', '/eyes.png', '/mouth.png'], { | ||
* height: 128, | ||
* }) | ||
* .then(b64 => ...); | ||
* // data:image/png;base64,iVBORw0KGgoAA... | ||
*/ | ||
height?: number; | ||
/** | ||
* `Canvas` implementation to be used to allow usage outside of the browser. e.g Node.js with [node-canvas](https://github.com/Automattic/node-canvas). | ||
* | ||
* @default undefined | ||
* | ||
* @example | ||
* import mergeImages = require('merge-images'); | ||
* import { Canvas, Image } from 'canvas'; | ||
* | ||
* mergeImages(['./body.png', './eyes.png', './mouth.png'], { | ||
* Canvas: Canvas, | ||
* Image: Image | ||
* }) | ||
* .then(b64 => ...); | ||
* // data:image/png;base64,iVBORw0KGgoAA... | ||
*/ | ||
Canvas?: any; | ||
/** | ||
* `Image` implementation to be used to allow usage outside of the browser. e.g Node.js with node-canvas. | ||
* This should be a valid image source for the node-canvas `Image` rather than a DOM `Image`. | ||
* Check the [node-canvas](https://github.com/Automattic/node-canvas) docs for more information on valid Image sources. | ||
* | ||
* @default undefined | ||
* | ||
* @example | ||
* import mergeImages = require('merge-images'); | ||
* import { Canvas, Image } from 'canvas'; | ||
* | ||
* mergeImages(['./body.png', './eyes.png', './mouth.png'], { | ||
* Canvas: Canvas, | ||
* Image: Image | ||
* }) | ||
* .then(b64 => ...); | ||
* // data:image/png;base64,iVBORw0KGgoAA... | ||
*/ | ||
Image?: any; | ||
/** | ||
* The `crossOrigin` attribute that `Image` instances should use. e.g `anonymous` to [support CORS-enabled images](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image). | ||
* | ||
* @default undefined | ||
*/ | ||
crossOrigin?: "anonymous" | "use-credentials" | ""; | ||
} | ||
} |
{ | ||
"name": "@types/merge-images", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"description": "TypeScript definitions for merge-images", | ||
@@ -34,4 +34,4 @@ "license": "MIT", | ||
}, | ||
"typesPublisherContentHash": "a5d7bfb58a2ccb73d7a7222e899af58956a2d3f1eb10339c1c79ba336acb538c", | ||
"typeScriptVersion": "3.4" | ||
"typesPublisherContentHash": "a2a7578801eed96c4bb78f9846dcd7555eeffe34b4df164d97003ff1e120d88a", | ||
"typeScriptVersion": "3.5" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Sat, 20 Feb 2021 19:13:59 GMT | ||
* Last updated: Mon, 05 Apr 2021 11:01:34 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node) | ||
@@ -14,0 +14,0 @@ * Global values: `mergeImages` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6833
106