@vkontakte/vk-qr 2.1.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +0,0 @@
1
- import { QrOptions } from './types';
2
- /**
3
- * Generates SVG QR code by a text
4
- * @param text String to encode
5
- * @param options QR code options
6
- */
7
- declare function createQR(text: string, options?: QrOptions): string;
8
- /**
9
- * Legacy interface
10
- * @deprecated
11
- * @param text String to encode
12
- * @param qrSize Size of QR code
13
- * @param className SVG element class name
14
- * @param options Options of the QR code
15
- */
16
- declare function createQR(text: string, qrSize: number, className: string, options?: QrOptions): string;
17
- declare const _default: {
18
- createQR: typeof createQR;
19
- };
20
- export default _default;
@@ -1,87 +0,0 @@
1
- declare type bit = number;
2
- declare type byte = number;
3
- declare type int = number;
4
- export declare class QrCode {
5
- readonly version: int;
6
- readonly errorCorrectionLevel: QrCode.Ecc;
7
- readonly mask: int;
8
- static encodeText(text: string, ecl: QrCode.Ecc): QrCode;
9
- static encodeBinary(data: Array<byte>, ecl: QrCode.Ecc): QrCode;
10
- static encodeSegments(segs: Array<QrSegment>, ecl: QrCode.Ecc, minVersion?: int, maxVersion?: int, mask?: int, boostEcl?: boolean): QrCode;
11
- readonly size: int;
12
- readonly modules: Array<Array<boolean>>;
13
- private readonly isFunction;
14
- constructor(version: int, errorCorrectionLevel: QrCode.Ecc, dataCodewords: Array<byte>, mask: int);
15
- getModule(x: int, y: int): boolean;
16
- drawCanvas(scale: int, border: int, canvas: HTMLCanvasElement): void;
17
- toSvgString(border: int): string;
18
- private drawFunctionPatterns;
19
- private drawFormatBits;
20
- private drawVersion;
21
- private drawFinderPattern;
22
- private drawAlignmentPattern;
23
- private setFunctionModule;
24
- private addEccAndInterleave;
25
- private drawCodewords;
26
- private applyMask;
27
- private getPenaltyScore;
28
- private getAlignmentPatternPositions;
29
- private static getNumRawDataModules;
30
- private static getNumDataCodewords;
31
- private static addRunToHistory;
32
- private static hasFinderLikePattern;
33
- static readonly MIN_VERSION: int;
34
- static readonly MAX_VERSION: int;
35
- private static readonly PENALTY_N1;
36
- private static readonly PENALTY_N2;
37
- private static readonly PENALTY_N3;
38
- private static readonly PENALTY_N4;
39
- private static readonly ECC_CODEWORDS_PER_BLOCK;
40
- private static readonly NUM_ERROR_CORRECTION_BLOCKS;
41
- }
42
- export declare class QrSegment {
43
- readonly mode: QrSegment.Mode;
44
- readonly numChars: int;
45
- private readonly bitData;
46
- static makeBytes(data: Array<byte>): QrSegment;
47
- static makeNumeric(digits: string): QrSegment;
48
- static makeAlphanumeric(text: string): QrSegment;
49
- static makeSegments(text: string): Array<QrSegment>;
50
- static makeEci(assignVal: int): QrSegment;
51
- constructor(mode: QrSegment.Mode, numChars: int, bitData: Array<bit>);
52
- getData(): Array<bit>;
53
- static getTotalBits(segs: Array<QrSegment>, version: int): number;
54
- private static toUtf8ByteArray;
55
- static readonly NUMERIC_REGEX: RegExp;
56
- static readonly ALPHANUMERIC_REGEX: RegExp;
57
- private static readonly ALPHANUMERIC_CHARSET;
58
- }
59
- export declare namespace QrCode {
60
- type int = number;
61
- export class Ecc {
62
- readonly ordinal: int;
63
- readonly formatBits: int;
64
- static readonly LOW: Ecc;
65
- static readonly MEDIUM: Ecc;
66
- static readonly QUARTILE: Ecc;
67
- static readonly HIGH: Ecc;
68
- private constructor();
69
- }
70
- export {};
71
- }
72
- export declare namespace QrSegment {
73
- type int = number;
74
- export class Mode {
75
- readonly modeBits: int;
76
- private readonly numBitsCharCount;
77
- static readonly NUMERIC: Mode;
78
- static readonly ALPHANUMERIC: Mode;
79
- static readonly BYTE: Mode;
80
- static readonly KANJI: Mode;
81
- static readonly ECI: Mode;
82
- private constructor();
83
- numCharCountBits(ver: int): int;
84
- }
85
- export {};
86
- }
87
- export {};
@@ -1,9 +0,0 @@
1
- import { QrCode } from './qr';
2
- import { QrOptions } from './types';
3
- export declare const INC_TILE_SIZE: number;
4
- /**
5
- * Converts QrCode instance to SVG code
6
- * @param qrCode QrCode instance
7
- * @param options Convertation options
8
- */
9
- export declare const convertSegmentsToSvgString: (qrCode: QrCode, options: Required<QrOptions>) => string;
@@ -1,51 +0,0 @@
1
- export declare type QrOptions = {
2
- /**
3
- * Size of QR code
4
- * @default 128
5
- */
6
- qrSize?: number;
7
- /**
8
- * Class name of root SVG element
9
- */
10
- className?: string;
11
- /**
12
- * Show VK logo in center of QR code
13
- * @default false
14
- */
15
- isShowLogo?: boolean;
16
- /**
17
- * Show QR background
18
- * @default false
19
- */
20
- isShowBackground?: boolean;
21
- /**
22
- * QR code background HEX color. Works if `isShowBackground` is enabled.
23
- * @default "#ffffff"
24
- */
25
- backgroundColor?: string;
26
- /**
27
- * QR code HEX color
28
- */
29
- foregroundColor?: string;
30
- /**
31
- * Color of logo
32
- * @default "#000000"
33
- */
34
- logoColor?: string;
35
- /**
36
- * Reference to logo as a reference IRI
37
- */
38
- logoData?: string | null;
39
- /**
40
- * SVG elements id postfix
41
- */
42
- suffix?: string;
43
- /**
44
- * ECC Level
45
- */
46
- ecc?: number;
47
- /**
48
- * Custom INC_TILE_SIZE
49
- */
50
- incTileSize?: number;
51
- };