# @types/qr-image

> TypeScript definitions for qr-image

Latest version **3.2.11** (published 2026-04-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/qr-image
pnpm add @types/qr-image
yarn add @types/qr-image
bun add @types/qr-image
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 3.2.11 |
| Published | 2026-04-07 |
| First published | 2017-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/qr-image
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/qr-image
- npm.io page: https://npm.io/package/@types/qr-image

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 3.2.11 (latest) — 2026-04-07
- 3.2.10 (ts5.2) — 2026-03-08
- 3.2.9 (ts4.9) — 2023-11-07
- 3.2.7 (ts4.4) — 2023-08-30
- 3.2.5 (ts4.1) — 2021-11-30
- 3.2.4 (ts3.6) — 2021-07-08
- 3.2.3 (ts3.5) — 2020-07-17
- 3.2.1 (ts2.0) — 2017-10-25
- 3.2.8 — 2023-10-18
- 3.2.6 — 2023-07-27
- 3.2.2 — 2020-05-15
- 3.2.0 — 2017-04-21

## README

# 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/qr-image/index.d.ts)
````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 type encodable = string | number | Buffer | ReadonlyArray<number>;

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(data: encodable, level?: ec_level): NodeJS.ReadableStream;
export function image(data: encodable, options?: Options): NodeJS.ReadableStream;

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

export function svgObject(data: encodable, level?: ec_level): SvgObject;
export function svgObject(data: encodable, options?: Options): SvgObject;

export function matrix(data: encodable, level?: ec_level): any[][];

````

### Additional Details
 * Last updated: Tue, 07 Apr 2026 03:01:11 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [taoqf](https://github.com/taoqf).

---
_Source: https://npm.io/package/@types/qr-image · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
