@nuintun/qrcode
Version:
A pure JavaScript QRCode encode and decode library.
44 lines (43 loc) • 956 B
TypeScript
/**
* @module Encoder
*/
import { Hints, Segment } from './utils/encoder.js';
import { Encoded } from './Encoded.js';
import { Level } from '../common/ECLevel.js';
import { TextEncode } from '../common/encoding/index.js';
export interface Options {
/**
* @property hints
* @description Encode hints.
*/
hints?: Hints;
/**
* @property level
* @description Error correction level.
*/
level?: `${Level}`;
/**
* @property encode
* @description Text encode function.
*/
encode?: TextEncode;
/**
* @property version
* @description QR code version.
*/
version?: 'Auto' | number;
}
export declare class Encoder {
#private;
/**
* @constructor
* @param options The options of encoder.
*/
constructor({ hints, level, version, encode }?: Options);
/**
* @method encode
* @description Encode the segments.
* @param segments The segments.
*/
encode(...segments: Segment[]): Encoded;
}