forked from jsnbuchanan/crowd-funder-for-time-pwa
**refactor(PhotoDialog, PlatformService): Implement cross-platform photo capture and encapsulated image processing**
- Replace direct camera library with platform-agnostic `PlatformService` - Move platform-specific image processing logic to respective platform implementations - Introduce `ImageResult` interface for consistent image handling across platforms - Add support for native camera and image picker across all platforms - Simplify `PhotoDialog` by removing platform-specific logic - Maintain existing cropping and upload functionality - Improve error handling and logging throughout - Clean up UI for better user experience - Add comprehensive documentation for usage and architecture **BREAKING CHANGE:** Removes direct camera library dependency in favor of `PlatformService` This change improves separation of concerns, enhances maintainability, and standardizes cross-platform image handling.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
export interface ImageResult {
|
||||
blob: Blob;
|
||||
fileName: string;
|
||||
}
|
||||
|
||||
export interface PlatformService {
|
||||
// File system operations
|
||||
readFile(path: string): Promise<string>;
|
||||
@@ -6,8 +11,8 @@ export interface PlatformService {
|
||||
listFiles(directory: string): Promise<string[]>;
|
||||
|
||||
// Camera operations
|
||||
takePicture(): Promise<string>;
|
||||
pickImage(): Promise<string>;
|
||||
takePicture(): Promise<ImageResult>;
|
||||
pickImage(): Promise<ImageResult>;
|
||||
|
||||
// Platform specific features
|
||||
isCapacitor(): boolean;
|
||||
|
||||
Reference in New Issue
Block a user