Skip to content

Commit

Permalink
Build code with correct capitalization
Browse files Browse the repository at this point in the history
  • Loading branch information
cozmo committed Feb 28, 2018
1 parent 6d4f674 commit 82bfa5c
Show file tree
Hide file tree
Showing 14 changed files with 10,097 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dist/BitMatrix.d.ts
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;
}
2 changes: 2 additions & 0 deletions dist/binarizer/index.d.ts
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;
8 changes: 8 additions & 0 deletions dist/decoder/decodeData/BitStream.d.ts
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;
}
21 changes: 21 additions & 0 deletions dist/decoder/decodeData/index.d.ts
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;
3 changes: 3 additions & 0 deletions dist/decoder/decodeData/shiftJISTable.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export declare const shiftJISTable: {
[key: number]: number;
};
3 changes: 3 additions & 0 deletions dist/decoder/decoder.d.ts
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;
17 changes: 17 additions & 0 deletions dist/decoder/reedsolomon/GenericGF.d.ts
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;
}
14 changes: 14 additions & 0 deletions dist/decoder/reedsolomon/GenericGFPoly.d.ts
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;
}
1 change: 1 addition & 0 deletions dist/decoder/reedsolomon/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function decode(bytes: number[], twoS: number): Uint8ClampedArray;
13 changes: 13 additions & 0 deletions dist/decoder/version.d.ts
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[];
9 changes: 9 additions & 0 deletions dist/extractor/index.d.ts
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;
};
};
18 changes: 18 additions & 0 deletions dist/index.d.ts
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;
Loading

0 comments on commit 82bfa5c

Please sign in to comment.