Socket
Socket
Sign inDemoInstall

canvg

Package Overview
Dependencies
8
Maintainers
3
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.2 to 3.0.4

11

lib/Document/Document.d.ts

@@ -16,3 +16,3 @@ import Canvg from '../Canvg';

*/
export declare type CreateImage = (src: string) => Promise<CanvasImageSource>;
export declare type CreateImage = (src: string, anonymousCrossOrigin?: boolean) => Promise<CanvasImageSource>;
export interface IDocumentOptions {

@@ -35,2 +35,6 @@ /**

createImage?: CreateImage;
/**
* Load images anonymously.
*/
anonymousCrossOrigin?: boolean;
}

@@ -40,3 +44,3 @@ export declare type IViewBoxConfig = Omit<IScreenViewBoxConfig, 'document'>;

declare function createCanvas(width: number, height: number): HTMLCanvasElement;
declare function createImage(src: string): Promise<HTMLImageElement>;
declare function createImage(src: string, anonymousCrossOrigin?: boolean): Promise<HTMLImageElement>;
export default class Document {

@@ -101,3 +105,4 @@ readonly canvg: Canvg;

private uniqueId;
constructor(canvg: Canvg, { rootEmSize, emSize, createCanvas, createImage }?: IDocumentOptions);
constructor(canvg: Canvg, { rootEmSize, emSize, createCanvas, createImage, anonymousCrossOrigin }?: IDocumentOptions);
private bindCreateImage;
get window(): Window;

@@ -104,0 +109,0 @@ get fetch(): any;

{
"name": "canvg",
"version": "3.0.2",
"version": "3.0.4",
"description": "JavaScript SVG parser and renderer on Canvas.",

@@ -5,0 +5,0 @@ "authors": [

@@ -208,3 +208,3 @@ # canvg

```html
<script type="text/javascript" src="https://unpkg.com/canvg@3.0.2/lib/umd.js"></script>
<script type="text/javascript" src="https://unpkg.com/canvg@3.0.4/lib/umd.js"></script>
<script type="text/javascript">

@@ -301,3 +301,7 @@ window.onload = () => {

*/
createImage?: (src: string) => Promise<CanvasImageSource>;
createImage?: (src: string, anonymousCrossOrigin?: boolean) => Promise<CanvasImageSource>;
/**
* Load images anonymously.
*/
anonymousCrossOrigin?: boolean;
}

@@ -304,0 +308,0 @@ ```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc