Import source: src/types
Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
This commit is contained in:
@@ -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 };
|
||||||
Reference in New Issue
Block a user