Skip to content

Commit

Permalink
Publish a plain JS module but also type defs
Browse files Browse the repository at this point in the history
  • Loading branch information
cozmo committed Dec 13, 2017
1 parent 76f8157 commit d114237
Show file tree
Hide file tree
Showing 12 changed files with 1,066 additions and 1,065 deletions.
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*

!dist
!package.json
!LICENSE
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;
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;
}
8 changes: 8 additions & 0 deletions dist/decoder/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: Uint32Array);
readBits(numBits: number): number;
available(): number;
}
1 change: 1 addition & 0 deletions dist/decoder/decodeqrdata.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function decodeQRdata(data: Uint8ClampedArray, version: number, ecl: string): number[];
2 changes: 2 additions & 0 deletions dist/decoder/decoder.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { BitMatrix } from "../bitmatrix";
export declare function decode(matrix: BitMatrix): number[];
3 changes: 3 additions & 0 deletions dist/extractor/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { BitMatrix } from "../bitmatrix";
import { QRLocation } from "../locator";
export declare function extract(image: BitMatrix, location: QRLocation): BitMatrix;
21 changes: 21 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export interface Point {
x: number;
y: number;
}
export interface QRCode {
binaryData: Uint8ClampedArray;
text: string;
encodingType: "numeric" | "alphanumeric" | "byte" | "structured_append" | "eci" | "kanji";
location: {
topRightCorner: Point;
topLeftCorner: Point;
bottomRightCorner: Point;
bottomLeftCorner: Point;
topRightFinderPattern: Point;
topLeftFinderPattern: Point;
bottomLeftFinderPattern: Point;
bottomRightAlignmentPattern?: Point;
};
errorRate: number;
}
export default function readQR(data: Uint8ClampedArray, width: number, height: number): QRCode | null;
Loading

0 comments on commit d114237

Please sign in to comment.