forked from CPunisher/react-qrbtf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
254 additions
and
2 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
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 @@ | ||
import { RendererProps, SFC } from './RendererWrapper'; | ||
interface QR25DProps extends RendererProps { | ||
height?: number; | ||
posHeight?: number; | ||
topColor?: string; | ||
leftColor?: string; | ||
rightColor?: string; | ||
} | ||
declare const _default: SFC<QR25DProps>; | ||
export default _default; |
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,7 @@ | ||
import { RendererProps, SFC } from './RendererWrapper'; | ||
interface QRBubbleProps extends RendererProps { | ||
circleColor?: string; | ||
posColor?: string; | ||
} | ||
declare const _default: SFC<QRBubbleProps>; | ||
export default _default; |
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 @@ | ||
import { RendererProps, SFC } from './RendererWrapper'; | ||
declare enum Type { | ||
Rect = "rect", | ||
Dsj = "dsj" | ||
} | ||
interface QRDsjProps extends RendererProps { | ||
scale?: number; | ||
crossWidth?: number; | ||
posWidth?: number; | ||
posType?: Type | string; | ||
} | ||
declare const _default: SFC<QRDsjProps>; | ||
export default _default; |
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 @@ | ||
import { RendererProps, SFC } from './RendererWrapper'; | ||
declare enum Type { | ||
Rect = "rect", | ||
Round = "round" | ||
} | ||
declare enum PosType { | ||
Rect = "rect", | ||
Round = "round", | ||
Planet = "planet", | ||
RoundRect = "roundRect" | ||
} | ||
interface QRFuncProps extends RendererProps { | ||
funcType?: string; | ||
type?: Type | string; | ||
posType?: PosType | string; | ||
otherColor1?: string; | ||
otherColor2?: string; | ||
posColor?: string; | ||
} | ||
declare const _default: SFC<QRFuncProps>; | ||
export default _default; |
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,22 @@ | ||
import { RendererProps, SFC } from './RendererWrapper'; | ||
declare enum Type { | ||
Rect = "rect", | ||
Round = "round" | ||
} | ||
declare enum PosType { | ||
Rect = "rect", | ||
Round = "round", | ||
Planet = "planet" | ||
} | ||
interface QRImageProps extends RendererProps { | ||
image?: string; | ||
type?: Type | string; | ||
size?: number; | ||
opacity?: number; | ||
darkColor?: string; | ||
lightColor?: string; | ||
posType?: PosType | string; | ||
posColor?: string; | ||
} | ||
declare const _default: SFC<QRImageProps>; | ||
export default _default; |
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,26 @@ | ||
import { RendererProps, SFC } from './RendererWrapper'; | ||
declare enum PosType { | ||
Rect = "rect", | ||
Round = "round", | ||
Planet = "planet", | ||
RoundRect = "roundRect" | ||
} | ||
declare enum LineDirection { | ||
LeftToRight = "left-right", | ||
UpToDown = "up-down", | ||
HAndV = "h-v", | ||
Loop = "loop", | ||
TopLeftToBottomRight = "topLeft-bottomRight", | ||
TopRightToBottomLeft = "topRight-bottomLeft", | ||
Cross = "cross" | ||
} | ||
interface QRLineProps extends RendererProps { | ||
direction?: LineDirection | string; | ||
lineWidth?: number; | ||
lineOpacity?: number; | ||
lineColor?: string; | ||
posType?: PosType | string; | ||
posColor?: string; | ||
} | ||
declare const _default: SFC<QRLineProps>; | ||
export default _default; |
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,22 @@ | ||
import { RendererProps, SFC } from './RendererWrapper'; | ||
declare enum Type { | ||
Rect = "rect", | ||
Round = "round", | ||
Rand = "rand" | ||
} | ||
declare enum PosType { | ||
Rect = "rect", | ||
Round = "round", | ||
Planet = "planet", | ||
RoundRect = "roundRect" | ||
} | ||
interface QRNormalProps extends RendererProps { | ||
type?: Type | string; | ||
posType?: PosType | string; | ||
size?: number; | ||
opacity?: number; | ||
otherColor?: string; | ||
posColor?: string; | ||
} | ||
declare const _default: SFC<QRNormalProps>; | ||
export default _default; |
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,5 @@ | ||
import { RendererProps, SFC } from './RendererWrapper'; | ||
interface QRRandRectProps extends RendererProps { | ||
} | ||
declare const _default: SFC<QRRandRectProps>; | ||
export default _default; |
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 { RendererProps, SFC } from './RendererWrapper'; | ||
declare enum Type { | ||
None = "none", | ||
White = "white", | ||
Bw = "bw" | ||
} | ||
interface QRResImageProps extends RendererProps { | ||
image?: string; | ||
contrast?: number; | ||
exposure?: number; | ||
alignType?: Type | string; | ||
timingType?: Type | string; | ||
otherColor?: string; | ||
posColor?: string; | ||
} | ||
declare const _default: SFC<QRResImageProps>; | ||
export default _default; |
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 @@ | ||
import React from 'react'; | ||
import QRCode from "../utils/qrcode"; | ||
export interface RendererProps { | ||
qrcode?: QRCode; | ||
className?: string; | ||
value?: string; | ||
level?: string; | ||
styles?: any; | ||
title?: string; | ||
titleSize?: number; | ||
titleColor?: string; | ||
titleAlign?: string; | ||
icon?: string; | ||
iconScale?: number; | ||
} | ||
export declare type SFC<P = {}> = StyledFunctionComponent<P>; | ||
export interface StyledFunctionComponent<P = {}> extends React.FunctionComponent<P> { | ||
defaultCSS?: any; | ||
} | ||
export declare const RendererWrapper: <T extends RendererProps>(renderer: SFC<T>) => SFC<T>; | ||
export declare function drawIcon({ qrcode, title, titleSize, titleColor, titleAlign, icon, iconScale, styles }: RendererProps): JSX.Element[] | null; |
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 { default as QRNormal } from "./components/QRNormal"; | ||
export { default as QR25D } from "./components/QR25D"; | ||
export { default as QRDsj } from "./components/QRDsj"; | ||
export { default as QRRandRect } from "./components/QRRandRect"; | ||
export { default as QRImage } from "./components/QRImage"; | ||
export { default as QRResImage } from "./components/QRResImage"; | ||
export { default as QRBubble } from "./components/QRBubble"; | ||
export { default as QRFunc } from "./components/QRFunc"; | ||
export { default as QRLine } from "./components/QRLine"; | ||
export { default as QRCode } from "./utils/qrcode"; | ||
export * from "./utils/helper"; | ||
export * from "./utils/qrcodeHandler"; | ||
export * from "./components/RendererWrapper"; |
Large diffs are not rendered by default.
Oops, something went wrong.
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,4 @@ | ||
import QRCode from "./qrcode"; | ||
export declare function rand(min: number, max: number): number; | ||
export declare function defaultViewBox(qrcode: QRCode | undefined): string; | ||
export declare function gamma(r: number, g: number, b: 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,53 @@ | ||
declare class QR8BitByte { | ||
mode: number; | ||
data: string; | ||
parsedData: number[]; | ||
constructor(data: string); | ||
getLength(): number; | ||
write(buffer: QRBitBuffer): void; | ||
} | ||
declare class QRCode { | ||
typeNumber: number; | ||
errorCorrectLevel: number; | ||
modules: Array<Array<boolean | null>>; | ||
moduleCount: number; | ||
position: number[][]; | ||
dataCache: number[] | null; | ||
dataList: QR8BitByte[]; | ||
static PAD0: number; | ||
static PAD1: number; | ||
constructor(typeNumber: number, errorCorrectLevel: number); | ||
addData(data: string): void; | ||
isDark(row: number, col: number): boolean | null; | ||
getModuleCount(): number; | ||
getPositionTable(): number[][]; | ||
make(): void; | ||
makeImpl(test: boolean, maskPattern: number): void; | ||
setupPositionProbePattern(row: number, col: number): void; | ||
getBestMaskPattern(): number; | ||
setupTimingPattern(): void; | ||
setupPositionAdjustPattern(): void; | ||
setupTypeNumber(test: boolean): void; | ||
setupTypeInfo(test: boolean, maskPattern: number): void; | ||
mapData(data: number[], maskPattern: number): void; | ||
static createData(typeNumber: number, errorCorrectLevel: number, dataList: QR8BitByte[]): any[]; | ||
static createBytes(buffer: QRBitBuffer, rsBlocks: QRRSBlock[]): any[]; | ||
} | ||
declare class QRRSBlock { | ||
totalCount: number; | ||
dataCount: number; | ||
constructor(totalCount: number, dataCount: number); | ||
static RS_BLOCK_TABLE: number[][]; | ||
static getRSBlocks(typeNumber: number, errorCorrectLevel: number): QRRSBlock[]; | ||
static getRsBlockTable(typeNumber: number, errorCorrectLevel: number): Array<number>; | ||
} | ||
declare class QRBitBuffer { | ||
buffer: number[]; | ||
length: number; | ||
constructor(); | ||
get(index: number): boolean; | ||
put(num: number, length: number): void; | ||
getLengthInBits(): number; | ||
putBit(bit: boolean): void; | ||
} | ||
export default QRCode; |
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,19 @@ | ||
import QRCode from "./qrcode"; | ||
export declare const QRPointType: { | ||
DATA: number; | ||
POS_CENTER: number; | ||
POS_OTHER: number; | ||
ALIGN_CENTER: number; | ||
ALIGN_OTHER: number; | ||
TIMING: number; | ||
FORMAT: number; | ||
VERSION: number; | ||
}; | ||
export interface IOptions { | ||
text: string; | ||
typeNumber?: number; | ||
correctLevel?: string; | ||
} | ||
export declare function getLevelNumber(level: string): 2 | 1 | 0 | 3; | ||
export declare function encodeData(options: IOptions): QRCode | undefined; | ||
export declare function getTypeTable(qrcode: QRCode): number[][]; |