Skip to content

Proper typesafe version of QRCode Options #46

Description

@amos-gabriel

// Enums pour les niveaux de correction et formats
export enum QRCodeCorrectLevel {
L = 'L',
M = 'M',
Q = 'Q',
H = 'H'
}

export enum ImageFormat {
PNG = 'PNG',
JPG = 'JPG'
}

// Interface principale des options
export interface QRCodeOptions {
// ====== Basic
text: string;
width?: number;
height?: number;
colorDark?: string;
colorLight?: string;
correctLevel?: QRCodeCorrectLevel;

// ====== dotScale
dotScale?: number;
dotScaleTiming?: number;
dotScaleTiming_H?: number;
dotScaleTiming_V?: number;
dotScaleA?: number;
dotScaleAO?: number;
dotScaleAI?: number;

// ====== Quiet Zone
quietZone?: number;
quietZoneColor?: string;

// ====== Logo
logo?: string;
logoWidth?: number;
logoHeight?: number;
logoMaxWidth?: number;
logoMaxHeight?: number;
logoBackgroundColor?: string;
logoBackgroundTransparent?: boolean;

// ====== Background Image
backgroundImage?: string;
backgroundImageAlpha?: number;
autoColor?: boolean;
autoColorDark?: string;
autoColorLight?: string;

// ====== Colorful - Position Pattern (Eye) Color
PO?: string;
PI?: string;
PO_TL?: string;
PI_TL?: string;
PO_TR?: string;
PI_TR?: string;
PO_BL?: string;
PI_BL?: string;

// ====== Alignment Color
AO?: string;
AI?: string;

// ====== Timing Pattern Color
timing?: string;
timing_H?: string;
timing_V?: string;

// ====== Title
title?: string;
titleFont?: string;
titleColor?: string;
titleBackgroundColor?: string;
titleHeight?: number;
titleTop?: number;

// ====== SubTitle
subTitle?: string;
subTitleFont?: string;
subTitleColor?: string;
subTitleTop?: number;

// ====== Event Handler
onRenderingStart?: () => void;

// ====== Images format
format?: ImageFormat;
compressionLevel?: number;
quality?: number;

// ====== Versions
version?: number;

// ====== Binary(hex) data mode
binary?: boolean;

// ====== UTF-8 without BOM
utf8WithoutBOM?: boolean;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions