mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-29 00:51:29 +08:00
* add weixin-app * add wx * add new line at end of file * tslint wx and wx-app * fixed test error * change project name weixin * rename * weixin-app Add param this * change discription of jweixin * add some Event declaration * change tslint config extends dtslint/dt.json * add defination of ccap, qr-image * remove redundant jsdoc * remove doc * allow overloads * inline some types * fix tslint error
41 lines
1.5 KiB
TypeScript
41 lines
1.5 KiB
TypeScript
// Type definitions for qr-image 3.2
|
|
// Project: https://github.com/alexeyten/qr-image
|
|
// Definitions by: taoqf <https://github.com/taoqf>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
/// <reference types="node" />
|
|
|
|
/**
|
|
* error correction level. One of L, M, Q, H. Default M.
|
|
*/
|
|
export type ec_level = 'L' | 'M' | 'Q' | 'H';
|
|
|
|
/**
|
|
* image type. Possible values png (default), svg, pdf and eps.
|
|
*/
|
|
export type image_type = 'png' | 'svg' | 'pdf' | 'eps';
|
|
|
|
/**
|
|
* image options object:
|
|
*
|
|
* @interface IOptions
|
|
*/
|
|
export interface Options {
|
|
ec_level?: ec_level; // error correction level. One of L, M, Q, H. Default M.
|
|
type?: image_type; // image type. Possible values png(default), svg, pdf and eps.
|
|
size?: number; // (png and svg only) for png and undefined for svg.-(png and svg only) — size of one module in pixels.
|
|
margin?: number; // (only png)for png and 1 for others.-white space around QR image in modules.
|
|
parse_url?: boolean; // (experimental, default false) try to optimize QR-code for URLs.
|
|
}
|
|
|
|
export function image(text: string, level?: ec_level): NodeJS.ReadableStream;
|
|
export function image(text: string, optoins?: Options): NodeJS.ReadableStream;
|
|
|
|
export function imageSync(text: string, level?: ec_level): Buffer;
|
|
export function imageSync(text: string, optoins?: Options): string | Buffer;
|
|
|
|
export function svgObject(text: string, level?: ec_level): any;
|
|
export function svgObject(text: string, optoins?: Options): any;
|
|
|
|
export function matrix(text: string, level?: ec_level): any[][];
|