@sec-ant/qr-code-generator
Version:
A QR Code generator in Typescript
32 lines (31 loc) • 1.19 kB
TypeScript
import { bit, byte, int } from "./utils.js";
export declare class QrSegment {
readonly mode: Mode;
readonly numChars: int;
private readonly bitData;
static makeBytes(data: Readonly<byte[]>): QrSegment;
static makeNumeric(digits: string): QrSegment;
static makeAlphanumeric(text: string): QrSegment;
static makeSegments(text: string): QrSegment[];
static makeEci(assignVal: int): QrSegment;
static isNumeric(text: string): boolean;
static isAlphanumeric(text: string): boolean;
constructor(mode: Mode, numChars: int, bitData: bit[]);
getData(): bit[];
static getTotalBits(segs: Readonly<QrSegment[]>, version: int): number;
private static toUtf8ByteArray;
private static readonly NUMERIC_REGEX;
private static readonly ALPHANUMERIC_REGEX;
private static readonly ALPHANUMERIC_CHARSET;
}
export declare class Mode {
readonly modeBits: int;
private readonly numBitsCharCount;
static readonly NUMERIC: Mode;
static readonly ALPHANUMERIC: Mode;
static readonly BYTE: Mode;
static readonly KANJI: Mode;
static readonly ECI: Mode;
private constructor();
numCharCountBits(ver: int): int;
}