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

@types/qr-image

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/qr-image

TypeScript definitions for qr-image

  • 3.2.9
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Installation

npm install --save @types/qr-image

Summary

This package contains type definitions for qr-image (https://github.com/alexeyten/qr-image).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/qr-image.

index.d.ts

/// <reference types="node" />

/**
 * error correction level. One of L, M, Q, H. Default M.
 */
export type ec_level = "L" | "M" | "Q" | "H";

/** @default 'png' */
export type image_type = "png" | "svg" | "pdf" | "eps";

export interface Bitmap {
    /**
     * width (and height) of resulting image in pixels
     */
    size: number;
    /**
     * @summary
     * Buffer with image data. It's a linear representation
     * of image in format:
     *
     * @example
     * <00> <xx> <xx> ..        <xx>
     * <00> <xx> <xx> ..        <xx>
     * ..
     * <00> <xx> <xx> ..        <xx>
     * ^    | size number of bytes |
     * \ do not modify. Must be 00
     *
     * @description
     * Each `<xx>` is a pixel of image.
     * It's value `0` — black, `255` — white, everything between are shades of gray.
     */
    data: Buffer;
}

export interface SvgObject {
    size: number;
    path: string;
}

export interface Options {
    // error correction level. One of L, M, Q, H. Default M.
    ec_level?: ec_level | undefined;
    // image type. Possible values png(default), svg, pdf and eps.
    type?: image_type | undefined;
    // (png and svg only) for png and undefined for svg.-(png and svg only) — size of one module in pixels.
    size?: number | undefined;
    // (only png)for png and 1 for others.-white space around QR image in modules.
    margin?: number | undefined;
    // (experimental, default false) try to optimize QR-code for URLs.
    parse_url?: boolean | undefined;
    /**
     * (only png) — function to customize qr bitmap before encoding to PNG
     */
    customize?: ((bitmap: Bitmap) => void) | undefined;
}

export function image(text: string, level?: ec_level): NodeJS.ReadableStream;
export function image(text: string, options?: Options): NodeJS.ReadableStream;

export function imageSync(text: string, level?: ec_level): Buffer;
export function imageSync(text: string, options?: Options): string | Buffer;

export function svgObject(text: string, level?: ec_level): SvgObject;
export function svgObject(text: string, options?: Options): SvgObject;

export function matrix(text: string, level?: ec_level): any[][];

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/node

Credits

These definitions were written by taoqf.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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