/ types.ts
types.ts
1 2 export type LanguageCode = 'en' | 'zh' | 'ru' | 'fa' | 'ar' | 'tr' | 'ko'; 3 export type MediaType = 'image' | 'video'; 4 5 export interface Translation { 6 title: string; 7 subtitle: string; 8 openButton: string; 9 grayLabel: string; 10 noiseLabel: string; 11 blurTool: string; 12 reset: string; 13 save: string; 14 saveVideo: string; 15 placeholder: string; 16 statusNoImage: string; 17 statusReady: string; 18 statusProcessing: string; 19 statusRecording: string; 20 helpTitle: string; 21 helpContent: string; 22 privacyNote: string; 23 download: string; 24 // New Glitch labels 25 glitchSection: string; 26 scanlineLabel: string; 27 rgbShiftLabel: string; 28 glitchIntensityLabel: string; 29 videoControls: string; 30 // Additional UI labels 31 statusLabel: string; 32 uploadPrompt: string; 33 anonymizeSection: string; 34 areasBlurred: string; 35 globalFiltersSection: string; 36 useControlsAbove: string; 37 playPause: string; 38 stopRec: string; 39 record: string; 40 audioOff: string; 41 audioOn: string; 42 privacyTitle: string; 43 privacyMessage: string; 44 radicleLink: string; 45 noUploads: string; 46 exifStripped: string; 47 runsOffline: string; 48 install: string; 49 } 50 51 export interface BlurRegion { 52 x: number; 53 y: number; 54 w: number; 55 h: number; 56 } 57 58 export interface MediaState { 59 type: MediaType; 60 file: File | null; 61 source: ImageBitmap | HTMLVideoElement | null; // Source for drawing 62 url: string | null; // For video element src 63 width: number; 64 height: number; 65 duration: number; // 0 for images 66 loaded: boolean; 67 isPlaying?: boolean; // Video specific 68 isRecording?: boolean; // Video specific 69 } 70 71 export interface FilterState { 72 grayscale: number; // 0-100 73 noise: number; // 0-100 74 blurRegions: BlurRegion[]; 75 // Glitch specific 76 scanlines: number; // 0-100 (opacity/intensity) 77 rgbShift: number; // 0-100 (pixel offset) 78 glitchIntensity: number; // 0-100 (probability/severity of displacement) 79 }