Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/html2canvas

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/html2canvas - npm Package Compare versions

Comparing version 0.0.35 to 0.0.36

164

html2canvas/index.d.ts
// Type definitions for html2canvas.js 1.0-alpha
// Project: https://github.com/niklasvh/html2canvas
// Definitions by: Richard Hepburn <https://github.com/rwhepburn>, Pei-Tang Huang <https://github.com/tan9>, Sebastian Schocke <https://github.com/sschocke>, Rickard Staaf <https://github.com/Ristaaf>
// Definitions by: Richard Hepburn <https://github.com/rwhepburn>
// Pei-Tang Huang <https://github.com/tan9>
// Sebastian Schocke <https://github.com/sschocke>
// Rickard Staaf <https://github.com/Ristaaf>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="jquery"/>
interface Html2CanvasOptions {
/** Whether to parse and render the element asynchronously */
async?: boolean;
/** Whether to allow cross-origin images to taint the canvas */
allowTaint?: boolean;
/** Canvas background color, if none is specified in DOM. Set null for transparent */
backgroundColor?: string | null;
/** Existing canvas element to use as a base for drawing on */
canvas?: any;
/** Whether to use ForeignObject rendering if the browser supports it */
foreignObjectRendering?: boolean;
/** Predicate function which removes the matching elements from the render. */
ignoreElements?: (element: HTMLElement) => boolean;
/** Timeout for loading images, in milliseconds. Setting it to 0 will result in no timeout. */
imageTimeout?: number;
/** Whether to render each letter seperately. Necessary if letter-spacing is used. */
letterRendering?: boolean;
/** Whether to log events in the console. */
logging?: boolean;
/** Callback function which is called when the Document has been cloned for rendering, can be used to modify the contents that will be rendered without affecting the original source document. */
onclone?: { (doc: HTMLDocument): void };
/** Url to the proxy which is to be used for loading cross-origin images. If left empty, cross-origin images won't be loaded. */
proxy?: string;
/** Whether to cleanup the cloned DOM elements html2canvas creates temporarily */
removeContainer?: boolean;
/** The scale to use for rendering. Defaults to the browsers device pixel ratio. */
scale?: number;
/** Use svg powered rendering where available (FF11+). */
svgRendering?: boolean;
/** Whether to test each image if it taints the canvas before drawing them */
taintTest?: boolean;
/** Whether to attempt to load cross-origin images as CORS served, before reverting back to proxy. */
useCORS?: boolean;
/** Define the width of the canvas in pixels. If null, renders with full width of the window. */
width?: number;
/** Define the heigt of the canvas in pixels. If null, renders with full height of the window. */
height?: number;
/** Crop canvas x-coordinate */
x?: number;
/** Crop canvas y-coordinate */
y?: number;
/** The x-scroll position to used when rendering element, (for example if the Element uses position: fixed ) */
scrollX?: number;
/** The y-scroll position to used when rendering element, (for example if the Element uses position: fixed ) */
scrollY?: number;
/** Window width to use when rendering Element, which may affect things like Media queries */
windowWidth?: number;
/** Window height to use when rendering Element, which may affect things like Media queries */
windowHeight?: number;
}
declare namespace Html2Canvas {
interface Html2CanvasOptions {
/** Whether to parse and render the element asynchronously */
async?: boolean;
/** Whether to allow cross-origin images to taint the canvas */
allowTaint?: boolean;
/** Canvas background color, if none is specified in DOM. Set null for transparent */
backgroundColor?: string | null;
/** Existing canvas element to use as a base for drawing on */
canvas?: any;
/** Whether to use ForeignObject rendering if the browser supports it */
foreignObjectRendering?: boolean;
/** Predicate function which removes the matching elements from the render. */
ignoreElements?: (element: HTMLElement) => boolean;
/** Timeout for loading images, in milliseconds. Setting it to 0 will result in no timeout. */
imageTimeout?: number;
/** Whether to render each letter seperately. Necessary if letter-spacing is used. */
letterRendering?: boolean;
/** Whether to log events in the console. */
logging?: boolean;
/** Callback function which is called when the Document has been cloned for rendering, can be used to modify the contents that will be rendered without affecting the original source document. */
onclone?: { (doc: HTMLDocument): void };
/** Url to the proxy which is to be used for loading cross-origin images. If left empty, cross-origin images won't be loaded. */
proxy?: string;
/** Whether to cleanup the cloned DOM elements html2canvas creates temporarily */
removeContainer?: boolean;
/** The scale to use for rendering. Defaults to the browsers device pixel ratio. */
scale?: number;
/** Use svg powered rendering where available (FF11+). */
svgRendering?: boolean;
/** Whether to test each image if it taints the canvas before drawing them */
taintTest?: boolean;
/** Whether to attempt to load cross-origin images as CORS served, before reverting back to proxy. */
useCORS?: boolean;
/** Define the width of the canvas in pixels. If null, renders with full width of the window. */
width?: number;
/** Define the heigt of the canvas in pixels. If null, renders with full height of the window. */
height?: number;
/** Crop canvas x-coordinate */
x?: number;
/** Crop canvas y-coordinate */
y?: number;
/** The x-scroll position to used when rendering element, (for example if the Element uses position: fixed ) */
scrollX?: number;
/** The y-scroll position to used when rendering element, (for example if the Element uses position: fixed ) */
scrollY?: number;
/** Window width to use when rendering Element, which may affect things like Media queries */
windowWidth?: number;
/** Window height to use when rendering Element, which may affect things like Media queries */
windowHeight?: number;
}
}
interface Html2CanvasStatic {
/**
* Renders an HTML element to a canvas so that a screenshot can be generated.
*
* The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot,
* but builds the screenshot based on the information available on the page.
*
* @param {HTMLElement} element The HTML element which will be rendered to the canvas. Use the root element to render the entire window.
* @param {Html2CanvasOptions} options The options object that controls how the element will be rendered.
*/
(element: HTMLElement, options?: Html2Canvas.Html2CanvasOptions): Html2CanvasPromise<HTMLCanvasElement>;
* Renders an HTML element to a canvas so that a screenshot can be generated.
*
* The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot,
* but builds the screenshot based on the information available on the page.
*
* @param {HTMLElement} element The HTML element which will be rendered to the canvas. Use the root element to render the entire window.
* @param {Html2CanvasOptions} options The options object that controls how the element will be rendered.
*/
(element: HTMLElement, options?: Html2CanvasOptions): Promise<HTMLCanvasElement>;
}
// FIXME:
// Find out a way to dependent on real Promise interface.
// And remove following custome Promise interface.
interface Html2CanvasThenable<R> {
then<U>(onFulfilled?: (value: R) => U | Html2CanvasThenable<U>, onRejected?: (error: any) => U | Html2CanvasThenable<U>): Html2CanvasThenable<U>;
then<U>(onFulfilled?: (value: R) => U | Html2CanvasThenable<U>, onRejected?: (error: any) => void): Html2CanvasThenable<U>;
}
interface Html2CanvasPromise<R> extends Html2CanvasThenable<R> {
then<U>(onFulfilled?: (value: R) => U | Html2CanvasThenable<U>, onRejected?: (error: any) => U | Html2CanvasThenable<U>): Html2CanvasPromise<U>;
then<U>(onFulfilled?: (value: R) => U | Html2CanvasThenable<U>, onRejected?: (error: any) => void): Html2CanvasPromise<U>;
catch<U>(onRejected?: (error: any) => U | Html2CanvasThenable<U>): Html2CanvasPromise<U>;
}
declare module 'html2canvas' {

@@ -114,0 +76,0 @@ export = html2canvas;

{
"name": "@types/html2canvas",
"version": "0.0.35",
"version": "0.0.36",
"description": "TypeScript definitions for html2canvas.js 1.0-alpha",

@@ -29,12 +29,12 @@ "license": "MIT",

"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/html2canvas"
},
"scripts": {},
"dependencies": {
"@types/jquery": "*"
},
"typesPublisherContentHash": "b10eda25d6d8ea7b400c0970955f40b5db750eb0009a7b514c58c3bb0d207ed3",
"typeScriptVersion": "2.3"
"dependencies": {},
"typesPublisherContentHash": "14d8d604c9506df935bebf07c8b7de066108bf029a12c7bcbe656166dd53df06",
"typeScriptVersion": "3.2"
}

@@ -8,10 +8,10 @@ # Installation

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/html2canvas
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/html2canvas.
Additional Details
* Last updated: Tue, 09 Oct 2018 19:01:50 GMT
* Dependencies: jquery
* Global values: html2canvas
### Additional Details
* Last updated: Tue, 20 Oct 2020 02:03:19 GMT
* Dependencies: none
* Global values: `html2canvas`
# Credits
These definitions were written by Richard Hepburn <https://github.com/rwhepburn>, Pei-Tang Huang <https://github.com/tan9>, Sebastian Schocke <https://github.com/sschocke>, Rickard Staaf <https://github.com/Ristaaf>.
These definitions were written by [Richard Hepburn](https://github.com/rwhepburn), [Pei-Tang Huang](https://github.com/tan9), [Sebastian Schocke](https://github.com/sschocke), and [Rickard Staaf](https://github.com/Ristaaf).

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc