-
Notifications
You must be signed in to change notification settings - Fork 607
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build code with correct capitalization
- Loading branch information
Showing
14 changed files
with
10,097 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export declare class BitMatrix { | ||
static createEmpty(width: number, height: number): BitMatrix; | ||
width: number; | ||
height: number; | ||
private data; | ||
constructor(data: Uint8ClampedArray, width: number); | ||
get(x: number, y: number): boolean; | ||
set(x: number, y: number, v: boolean): void; | ||
setRegion(left: number, top: number, width: number, height: number, v: boolean): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { BitMatrix } from "../BitMatrix"; | ||
export declare function binarize(data: Uint8ClampedArray, width: number, height: number): BitMatrix; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export declare class BitStream { | ||
private bytes; | ||
private byteOffset; | ||
private bitOffset; | ||
constructor(bytes: Uint8ClampedArray); | ||
readBits(numBits: number): number; | ||
available(): number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export interface Chunk { | ||
type: Mode; | ||
text: string; | ||
} | ||
export interface ByteChunk { | ||
type: Mode.Byte | Mode.Kanji; | ||
bytes: number[]; | ||
} | ||
export declare type Chunks = Array<Chunk | ByteChunk>; | ||
export interface DecodedQR { | ||
text: string; | ||
bytes: number[]; | ||
chunks: Chunks; | ||
} | ||
export declare enum Mode { | ||
Numeric = "numeric", | ||
Alphanumeric = "alphanumeric", | ||
Byte = "byte", | ||
Kanji = "kanji", | ||
} | ||
export declare function decode(data: Uint8ClampedArray, version: number): DecodedQR; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export declare const shiftJISTable: { | ||
[key: number]: number; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { BitMatrix } from "../BitMatrix"; | ||
import { DecodedQR } from "./decodeData"; | ||
export declare function decode(matrix: BitMatrix): DecodedQR; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import GenericGFPoly from "./GenericGFPoly"; | ||
export declare function addOrSubtractGF(a: number, b: number): number; | ||
export default class GenericGF { | ||
primitive: number; | ||
size: number; | ||
generatorBase: number; | ||
zero: GenericGFPoly; | ||
one: GenericGFPoly; | ||
private expTable; | ||
private logTable; | ||
constructor(primitive: number, size: number, genBase: number); | ||
multiply(a: number, b: number): number; | ||
inverse(a: number): number; | ||
buildMonomial(degree: number, coefficient: number): GenericGFPoly; | ||
log(a: number): number; | ||
exp(a: number): number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import GenericGF from "./GenericGF"; | ||
export default class GenericGFPoly { | ||
private field; | ||
private coefficients; | ||
constructor(field: GenericGF, coefficients: Uint8ClampedArray); | ||
degree(): number; | ||
isZero(): boolean; | ||
getCoefficient(degree: number): number; | ||
addOrSubtract(other: GenericGFPoly): GenericGFPoly; | ||
multiply(scalar: number): GenericGFPoly; | ||
multiplyPoly(other: GenericGFPoly): GenericGFPoly; | ||
multiplyByMonomial(degree: number, coefficient: number): GenericGFPoly; | ||
evaluateAt(a: number): number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare function decode(bytes: number[], twoS: number): Uint8ClampedArray; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export interface Version { | ||
infoBits: number; | ||
versionNumber: number; | ||
alignmentPatternCenters: number[]; | ||
errorCorrectionLevels: Array<{ | ||
ecCodewordsPerBlock: number; | ||
ecBlocks: Array<{ | ||
numBlocks: number; | ||
dataCodewordsPerBlock: number; | ||
}>; | ||
}>; | ||
} | ||
export declare const VERSIONS: Version[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { BitMatrix } from "../BitMatrix"; | ||
import { QRLocation } from "../locator"; | ||
export declare function extract(image: BitMatrix, location: QRLocation): { | ||
matrix: BitMatrix; | ||
mappingFunction: (x: number, y: number) => { | ||
x: number; | ||
y: number; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Chunks } from "./decoder/decodeData"; | ||
import { Point } from "./locator"; | ||
export interface QRCode { | ||
binaryData: number[]; | ||
data: string; | ||
chunks: Chunks; | ||
location: { | ||
topRightCorner: Point; | ||
topLeftCorner: Point; | ||
bottomRightCorner: Point; | ||
bottomLeftCorner: Point; | ||
topRightFinderPattern: Point; | ||
topLeftFinderPattern: Point; | ||
bottomLeftFinderPattern: Point; | ||
bottomRightAlignmentPattern?: Point; | ||
}; | ||
} | ||
export default function x(data: Uint8ClampedArray, width: number, height: number): QRCode | null; |
Oops, something went wrong.