Skip to content

Commit

Permalink
chore: build project
Browse files Browse the repository at this point in the history
  • Loading branch information
dimadk24 committed Jan 8, 2024
1 parent 93684a0 commit 8ebf117
Show file tree
Hide file tree
Showing 16 changed files with 254 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ build/Release
# Dependency directories
node_modules/
jspm_packages/
dist/

# TypeScript v1 declaration files
typings/
Expand Down Expand Up @@ -82,7 +81,6 @@ typings/

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
Expand Down
10 changes: 10 additions & 0 deletions dist/components/QR25D.d.ts
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;
7 changes: 7 additions & 0 deletions dist/components/QRBubble.d.ts
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;
13 changes: 13 additions & 0 deletions dist/components/QRDsj.d.ts
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;
21 changes: 21 additions & 0 deletions dist/components/QRFunc.d.ts
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;
22 changes: 22 additions & 0 deletions dist/components/QRImage.d.ts
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;
26 changes: 26 additions & 0 deletions dist/components/QRLine.d.ts
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;
22 changes: 22 additions & 0 deletions dist/components/QRNormal.d.ts
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;
5 changes: 5 additions & 0 deletions dist/components/QRRandRect.d.ts
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;
17 changes: 17 additions & 0 deletions dist/components/QRResImage.d.ts
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;
21 changes: 21 additions & 0 deletions dist/components/RendererWrapper.d.ts
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;
13 changes: 13 additions & 0 deletions dist/index.d.ts
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";
1 change: 1 addition & 0 deletions dist/index.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/utils/helper.d.ts
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;
53 changes: 53 additions & 0 deletions dist/utils/qrcode.d.ts
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;
19 changes: 19 additions & 0 deletions dist/utils/qrcodeHandler.d.ts
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[][];

0 comments on commit 8ebf117

Please sign in to comment.