@types/qrcode
Advanced tools
Comparing version 1.3.5 to 1.4.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for qrcode 1.3 | ||
// Type definitions for qrcode 1.4 | ||
// Project: http://github.com/soldair/node-qrcode | ||
@@ -11,5 +11,5 @@ // Definitions by: York Yao <https://github.com/plantain-00> | ||
import * as stream from "stream"; | ||
import * as stream from 'stream'; | ||
export type QRCodeErrorCorrectionLevel = "low" | "medium" | "quartile" | "high" | "L" | "M" | "Q" | "H"; | ||
export type QRCodeErrorCorrectionLevel = 'low' | 'medium' | 'quartile' | 'high' | 'L' | 'M' | 'Q' | 'H'; | ||
@@ -39,3 +39,3 @@ export interface QRCodeOptions { | ||
*/ | ||
type?: "image/png" | "image/jpeg" | "image/webp"; | ||
type?: 'image/png' | 'image/jpeg' | 'image/webp'; | ||
rendererOpts?: { | ||
@@ -55,3 +55,3 @@ /** | ||
*/ | ||
type?: "utf8" | "svg" | "terminal"; | ||
type?: 'utf8' | 'svg' | 'terminal'; | ||
} | ||
@@ -64,3 +64,3 @@ | ||
*/ | ||
type?: "png" | "svg" | "utf8"; | ||
type?: 'png' | 'svg' | 'utf8'; | ||
rendererOpts?: { | ||
@@ -84,3 +84,3 @@ /** | ||
*/ | ||
type?: "png"; | ||
type?: 'png'; | ||
rendererOpts?: { | ||
@@ -104,3 +104,3 @@ /** | ||
*/ | ||
type?: "png"; | ||
type?: 'png'; | ||
rendererOpts?: { | ||
@@ -153,3 +153,3 @@ /** | ||
export interface QRCodeSegment { | ||
data: string; | ||
data: string | Buffer | Uint8ClampedArray; | ||
mode: 'alphanumeric' | 'numeric' | 'kanji' | 'byte'; | ||
@@ -189,15 +189,31 @@ } | ||
*/ | ||
export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], callback: (error: Error) => void): void; | ||
export function toCanvas( | ||
canvasElement: HTMLCanvasElement, | ||
text: string | QRCodeSegment[], | ||
callback: (error: Error) => void, | ||
): void; | ||
/** | ||
* Draws qr code symbol to canvas. | ||
*/ | ||
export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options?: QRCodeRenderersOptions): Promise<any>; | ||
export function toCanvas( | ||
canvasElement: HTMLCanvasElement, | ||
text: string | QRCodeSegment[], | ||
options?: QRCodeRenderersOptions, | ||
): Promise<any>; | ||
/** | ||
* Draws qr code symbol to canvas. | ||
*/ | ||
export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeRenderersOptions, callback: (error: Error) => void): void; | ||
export function toCanvas( | ||
canvasElement: HTMLCanvasElement, | ||
text: string | QRCodeSegment[], | ||
options: QRCodeRenderersOptions, | ||
callback: (error: Error) => void, | ||
): void; | ||
/** | ||
* Draws qr code symbol to canvas. | ||
*/ | ||
export function toCanvas(text: string | QRCodeSegment[], callback: (error: Error, canvas: HTMLCanvasElement) => void): void; | ||
export function toCanvas( | ||
text: string | QRCodeSegment[], | ||
callback: (error: Error, canvas: HTMLCanvasElement) => void, | ||
): void; | ||
/** | ||
@@ -210,3 +226,7 @@ * Draws qr code symbol to canvas. | ||
*/ | ||
export function toCanvas(text: string | QRCodeSegment[], options: QRCodeRenderersOptions, callback: (error: Error, canvas: HTMLCanvasElement) => void): void; | ||
export function toCanvas( | ||
text: string | QRCodeSegment[], | ||
options: QRCodeRenderersOptions, | ||
callback: (error: Error, canvas: HTMLCanvasElement) => void, | ||
): void; | ||
/** | ||
@@ -223,3 +243,8 @@ * Draws qr code symbol to node canvas. | ||
*/ | ||
export function toCanvas(canvas: any, text: string | QRCodeSegment[], options: QRCodeRenderersOptions, callback: (error: Error) => void): void; | ||
export function toCanvas( | ||
canvas: any, | ||
text: string | QRCodeSegment[], | ||
options: QRCodeRenderersOptions, | ||
callback: (error: Error) => void, | ||
): void; | ||
@@ -229,11 +254,24 @@ /** | ||
*/ | ||
export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], callback: (error: Error, url: string) => void): void; | ||
export function toDataURL( | ||
canvasElement: HTMLCanvasElement, | ||
text: string | QRCodeSegment[], | ||
callback: (error: Error, url: string) => void, | ||
): void; | ||
/** | ||
* Returns a Data URI containing a representation of the QR Code image. | ||
*/ | ||
export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options?: QRCodeToDataURLOptions): Promise<string>; | ||
export function toDataURL( | ||
canvasElement: HTMLCanvasElement, | ||
text: string | QRCodeSegment[], | ||
options?: QRCodeToDataURLOptions, | ||
): Promise<string>; | ||
/** | ||
* Returns a Data URI containing a representation of the QR Code image. | ||
*/ | ||
export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeToDataURLOptions, callback: (error: Error, url: string) => void): void; | ||
export function toDataURL( | ||
canvasElement: HTMLCanvasElement, | ||
text: string | QRCodeSegment[], | ||
options: QRCodeToDataURLOptions, | ||
callback: (error: Error, url: string) => void, | ||
): void; | ||
@@ -251,3 +289,7 @@ /** | ||
*/ | ||
export function toDataURL(text: string | QRCodeSegment[], options: QRCodeToDataURLOptions, callback: (error: Error, url: string) => void): void; | ||
export function toDataURL( | ||
text: string | QRCodeSegment[], | ||
options: QRCodeToDataURLOptions, | ||
callback: (error: Error, url: string) => void, | ||
): void; | ||
@@ -268,3 +310,7 @@ /** | ||
*/ | ||
export function toString(text: string | QRCodeSegment[], options: QRCodeToStringOptions, callback: (error: Error, string: string) => void): void; | ||
export function toString( | ||
text: string | QRCodeSegment[], | ||
options: QRCodeToStringOptions, | ||
callback: (error: Error, string: string) => void, | ||
): void; | ||
@@ -288,3 +334,8 @@ /** | ||
*/ | ||
export function toFile(path: string, text: string | QRCodeSegment[], options: QRCodeToFileOptions, callback: (error: Error) => void): void; | ||
export function toFile( | ||
path: string, | ||
text: string | QRCodeSegment[], | ||
options: QRCodeToFileOptions, | ||
callback: (error: Error) => void, | ||
): void; | ||
@@ -294,11 +345,24 @@ /** | ||
*/ | ||
export function toFileStream(stream: stream.Writable, text: string | QRCodeSegment[], callback: (error: Error) => void): void; | ||
export function toFileStream( | ||
stream: stream.Writable, | ||
text: string | QRCodeSegment[], | ||
callback: (error: Error) => void, | ||
): void; | ||
/** | ||
* Writes QR Code image to stream. Only works with png format for now. | ||
*/ | ||
export function toFileStream(stream: stream.Writable, text: string | QRCodeSegment[], options?: QRCodeToFileStreamOptions): Promise<any>; | ||
export function toFileStream( | ||
stream: stream.Writable, | ||
text: string | QRCodeSegment[], | ||
options?: QRCodeToFileStreamOptions, | ||
): Promise<any>; | ||
/** | ||
* Writes QR Code image to stream. Only works with png format for now. | ||
*/ | ||
export function toFileStream(stream: stream.Writable, text: string | QRCodeSegment[], options: QRCodeToFileStreamOptions, callback: (error: Error) => void): void; | ||
export function toFileStream( | ||
stream: stream.Writable, | ||
text: string | QRCodeSegment[], | ||
options: QRCodeToFileStreamOptions, | ||
callback: (error: Error) => void, | ||
): void; | ||
@@ -316,2 +380,6 @@ /** | ||
*/ | ||
export function toBuffer(text: string | QRCodeSegment[], options: QRCodeToBufferOptions, callback: (error: Error, buffer: Buffer) => void): void; | ||
export function toBuffer( | ||
text: string | QRCodeSegment[], | ||
options: QRCodeToBufferOptions, | ||
callback: (error: Error, buffer: Buffer) => void, | ||
): void; |
{ | ||
"name": "@types/qrcode", | ||
"version": "1.3.5", | ||
"version": "1.4.0", | ||
"description": "TypeScript definitions for qrcode", | ||
@@ -34,4 +34,4 @@ "license": "MIT", | ||
}, | ||
"typesPublisherContentHash": "1d75b8e5ad30ae16dc5933689d113267faf407d99d3e9054d85c3ea3fc3aa01b", | ||
"typeScriptVersion": "3.0" | ||
"typesPublisherContentHash": "fb9bb4a115028ac1ed8901f5e025cd84951b1c82442f0f9c0e434d1a45f660ad", | ||
"typeScriptVersion": "3.4" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Thu, 30 Jul 2020 13:40:21 GMT | ||
* Last updated: Fri, 05 Feb 2021 11:57:45 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node) | ||
@@ -14,0 +14,0 @@ * Global values: none |
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
13579
349