From 2316f5ca55685950bf478a2ef6c3a651aa43f1a1 Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:17:49 +0330 Subject: [PATCH] Import source: src/types Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- src/types.ts | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/types.ts diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..7b31045 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,58 @@ +export type QRType = 'url' | 'text' | 'wifi' | 'email' | 'sms' | 'image' | 'pdf' | 'mp3' | 'app' | 'vcard'; +export type Theme = 'paper' | 'midnight' | 'pastel'; +export type Pattern = 'square' | 'dots' | 'rounded' | 'classy' | 'classy-rounded'; +export type DownloadSize = 'social' | 'card' | 'print'; +export type WifiEncryption = 'WPA' | 'WEP' | 'None'; +export type CornerSquareStyle = 'square' | 'dot' | 'extra-rounded'; +export type CornerDotStyle = 'square' | 'dot'; + +export interface URLFormData { websiteUrl: string } +export interface TextFormData { text: string } +export interface WiFiFormData { networkName: string; encryption: WifiEncryption; password: string } +export interface EmailFormData { emailAddress: string; subject: string; message: string } +export interface SMSFormData { phoneNumber: string; message: string } +export interface ImageFormData { imageUrl: string } +export interface PDFFormData { pdfUrl: string } +export interface MP3FormData { mp3Url: string } +export interface AppFormData { appStoreLink: string } +export interface VCardFormData { + firstName: string; lastName: string; phone: string; + email: string; company: string; jobTitle: string; website: string; address: string; +} + +export interface FormData { + url: URLFormData; text: TextFormData; wifi: WiFiFormData; + email: EmailFormData; sms: SMSFormData; image: ImageFormData; + pdf: PDFFormData; mp3: MP3FormData; app: AppFormData; vcard: VCardFormData; +} + +export interface QRState { + selectedType: QRType; + formData: FormData; + theme: Theme; + pattern: Pattern; + qrColor: string; + bgColor: string | null; + downloadSize: DownloadSize; + logoDataUrl: string | null; + cornerSquareStyle: CornerSquareStyle; + cornerDotStyle: CornerDotStyle; + gradientEnabled: boolean; + gradientColor2: string; + frameLabel: string; +} + +export type QRAction = + | { type: 'SET_TYPE'; payload: QRType } + | { type: 'SET_FORM_FIELD'; qrType: QRType; field: string; value: string } + | { type: 'SET_THEME'; payload: Theme } + | { type: 'SET_PATTERN'; payload: Pattern } + | { type: 'SET_QR_COLOR'; payload: string } + | { type: 'SET_BG_COLOR'; payload: string | null } + | { type: 'SET_DOWNLOAD_SIZE'; payload: DownloadSize } + | { type: 'SET_LOGO'; payload: string | null } + | { type: 'SET_CORNER_SQUARE'; payload: CornerSquareStyle } + | { type: 'SET_CORNER_DOT'; payload: CornerDotStyle } + | { type: 'SET_GRADIENT'; payload: boolean } + | { type: 'SET_GRADIENT_COLOR2'; payload: string } + | { type: 'SET_FRAME_LABEL'; payload: string };