@umituz/react-native-design-system 2.8.7 → 2.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -6
- package/src/device/infrastructure/repositories/LegacyDeviceIdRepository.ts +1 -1
- package/src/device/infrastructure/services/DeviceFeatureService.ts +1 -1
- package/src/exception/infrastructure/services/ExceptionLogger.ts +1 -1
- package/src/exception/infrastructure/storage/ExceptionStore.ts +1 -1
- package/src/exports/filesystem.ts +1 -0
- package/src/exports/media.ts +1 -0
- package/src/exports/storage.ts +1 -0
- package/src/filesystem/domain/constants/FileConstants.ts +20 -0
- package/src/filesystem/domain/entities/File.ts +20 -0
- package/src/filesystem/domain/types/FileTypes.ts +43 -0
- package/src/filesystem/domain/utils/FileUtils.ts +86 -0
- package/src/filesystem/index.ts +23 -0
- package/src/filesystem/infrastructure/services/FileSystemService.ts +45 -0
- package/src/filesystem/infrastructure/services/cache.service.ts +48 -0
- package/src/filesystem/infrastructure/services/directory.service.ts +66 -0
- package/src/filesystem/infrastructure/services/download.constants.ts +6 -0
- package/src/filesystem/infrastructure/services/download.service.ts +74 -0
- package/src/filesystem/infrastructure/services/download.types.ts +7 -0
- package/src/filesystem/infrastructure/services/encoding.service.ts +25 -0
- package/src/filesystem/infrastructure/services/file-info.service.ts +52 -0
- package/src/filesystem/infrastructure/services/file-manager.service.ts +81 -0
- package/src/filesystem/infrastructure/services/file-path.service.ts +22 -0
- package/src/filesystem/infrastructure/services/file-reader.service.ts +52 -0
- package/src/filesystem/infrastructure/services/file-writer.service.ts +32 -0
- package/src/filesystem/infrastructure/utils/blob.utils.ts +20 -0
- package/src/image/infrastructure/services/ImageStorageService.ts +1 -1
- package/src/index.ts +14 -0
- package/src/media/domain/entities/CardMultimedia.types.README.md +129 -0
- package/src/media/domain/entities/CardMultimedia.types.ts +105 -0
- package/src/media/domain/entities/Media.README.md +80 -0
- package/src/media/domain/entities/Media.ts +139 -0
- package/src/media/domain/entities/MultimediaFlashcardTypes.README.md +144 -0
- package/src/media/domain/entities/MultimediaFlashcardTypes.ts +105 -0
- package/src/media/domain/utils/MediaUtils.README.md +178 -0
- package/src/media/domain/utils/MediaUtils.ts +82 -0
- package/src/media/index.ts +70 -0
- package/src/media/index.ts.README.md +191 -0
- package/src/media/infrastructure/services/CardMediaGenerationService.README.md +99 -0
- package/src/media/infrastructure/services/CardMediaGenerationService.ts +101 -0
- package/src/media/infrastructure/services/CardMediaOptimizerService.README.md +167 -0
- package/src/media/infrastructure/services/CardMediaOptimizerService.ts +36 -0
- package/src/media/infrastructure/services/CardMediaUploadService.README.md +123 -0
- package/src/media/infrastructure/services/CardMediaUploadService.ts +67 -0
- package/src/media/infrastructure/services/CardMediaValidationService.README.md +134 -0
- package/src/media/infrastructure/services/CardMediaValidationService.ts +81 -0
- package/src/media/infrastructure/services/CardMultimediaService.README.md +176 -0
- package/src/media/infrastructure/services/CardMultimediaService.ts +97 -0
- package/src/media/infrastructure/services/MediaGenerationService.README.md +142 -0
- package/src/media/infrastructure/services/MediaGenerationService.ts +80 -0
- package/src/media/infrastructure/services/MediaOptimizerService.README.md +145 -0
- package/src/media/infrastructure/services/MediaOptimizerService.ts +32 -0
- package/src/media/infrastructure/services/MediaPickerService.README.md +106 -0
- package/src/media/infrastructure/services/MediaPickerService.ts +173 -0
- package/src/media/infrastructure/services/MediaSaveService.README.md +120 -0
- package/src/media/infrastructure/services/MediaSaveService.ts +154 -0
- package/src/media/infrastructure/services/MediaUploadService.README.md +135 -0
- package/src/media/infrastructure/services/MediaUploadService.ts +62 -0
- package/src/media/infrastructure/services/MediaValidationService.README.md +135 -0
- package/src/media/infrastructure/services/MediaValidationService.ts +61 -0
- package/src/media/infrastructure/services/MultimediaFlashcardService.README.md +142 -0
- package/src/media/infrastructure/services/MultimediaFlashcardService.ts +95 -0
- package/src/media/infrastructure/utils/mediaHelpers.README.md +96 -0
- package/src/media/infrastructure/utils/mediaHelpers.ts +82 -0
- package/src/media/infrastructure/utils/mediaPickerMappers.README.md +129 -0
- package/src/media/infrastructure/utils/mediaPickerMappers.ts +76 -0
- package/src/media/presentation/hooks/card-multimedia.types.README.md +177 -0
- package/src/media/presentation/hooks/card-multimedia.types.ts +51 -0
- package/src/media/presentation/hooks/multimedia.types.README.md +201 -0
- package/src/media/presentation/hooks/multimedia.types.ts +51 -0
- package/src/media/presentation/hooks/useCardMediaGeneration.README.md +164 -0
- package/src/media/presentation/hooks/useCardMediaGeneration.ts +124 -0
- package/src/media/presentation/hooks/useCardMediaUpload.README.md +153 -0
- package/src/media/presentation/hooks/useCardMediaUpload.ts +86 -0
- package/src/media/presentation/hooks/useCardMediaValidation.README.md +176 -0
- package/src/media/presentation/hooks/useCardMediaValidation.ts +101 -0
- package/src/media/presentation/hooks/useCardMultimediaFlashcard.README.md +158 -0
- package/src/media/presentation/hooks/useCardMultimediaFlashcard.ts +104 -0
- package/src/media/presentation/hooks/useMedia.README.md +94 -0
- package/src/media/presentation/hooks/useMedia.ts +186 -0
- package/src/media/presentation/hooks/useMediaGeneration.README.md +118 -0
- package/src/media/presentation/hooks/useMediaGeneration.ts +101 -0
- package/src/media/presentation/hooks/useMediaUpload.README.md +108 -0
- package/src/media/presentation/hooks/useMediaUpload.ts +86 -0
- package/src/media/presentation/hooks/useMediaValidation.README.md +134 -0
- package/src/media/presentation/hooks/useMediaValidation.ts +93 -0
- package/src/media/presentation/hooks/useMultimediaFlashcard.README.md +141 -0
- package/src/media/presentation/hooks/useMultimediaFlashcard.ts +103 -0
- package/src/molecules/alerts/AlertStore.ts +1 -1
- package/src/molecules/calendar/infrastructure/storage/EventActions.ts +1 -1
- package/src/molecules/calendar/infrastructure/stores/storageAdapter.ts +1 -1
- package/src/offline/infrastructure/storage/OfflineStore.ts +1 -1
- package/src/onboarding/infrastructure/storage/OnboardingStore.ts +2 -2
- package/src/onboarding/infrastructure/storage/__tests__/OnboardingStore.test.ts +1 -1
- package/src/onboarding/infrastructure/storage/actions/answerActions.ts +1 -1
- package/src/onboarding/infrastructure/storage/actions/storageHelpers.ts +1 -1
- package/src/storage/README.md +185 -0
- package/src/storage/__tests__/integration.test.ts +391 -0
- package/src/storage/__tests__/mocks/asyncStorage.mock.ts +52 -0
- package/src/storage/__tests__/performance.test.tsx +352 -0
- package/src/storage/__tests__/setup.ts +63 -0
- package/src/storage/application/README.md +158 -0
- package/src/storage/application/ports/IStorageRepository.ts +61 -0
- package/src/storage/application/ports/README.md +127 -0
- package/src/storage/cache/README.md +154 -0
- package/src/storage/cache/__tests__/PerformanceAndMemory.test.ts +387 -0
- package/src/storage/cache/__tests__/setup.ts +19 -0
- package/src/storage/cache/domain/Cache.ts +146 -0
- package/src/storage/cache/domain/CacheManager.md +83 -0
- package/src/storage/cache/domain/CacheManager.ts +48 -0
- package/src/storage/cache/domain/CacheStatsTracker.md +169 -0
- package/src/storage/cache/domain/CacheStatsTracker.ts +49 -0
- package/src/storage/cache/domain/CachedValue.md +97 -0
- package/src/storage/cache/domain/ErrorHandler.md +99 -0
- package/src/storage/cache/domain/ErrorHandler.ts +42 -0
- package/src/storage/cache/domain/PatternMatcher.md +122 -0
- package/src/storage/cache/domain/PatternMatcher.ts +30 -0
- package/src/storage/cache/domain/README.md +118 -0
- package/src/storage/cache/domain/__tests__/Cache.test.ts +293 -0
- package/src/storage/cache/domain/__tests__/CacheManager.test.ts +276 -0
- package/src/storage/cache/domain/__tests__/ErrorHandler.test.ts +303 -0
- package/src/storage/cache/domain/__tests__/PatternMatcher.test.ts +261 -0
- package/src/storage/cache/domain/strategies/EvictionStrategy.ts +9 -0
- package/src/storage/cache/domain/strategies/FIFOStrategy.ts +12 -0
- package/src/storage/cache/domain/strategies/LFUStrategy.ts +22 -0
- package/src/storage/cache/domain/strategies/LRUStrategy.ts +22 -0
- package/src/storage/cache/domain/strategies/README.md +117 -0
- package/src/storage/cache/domain/strategies/TTLStrategy.ts +23 -0
- package/src/storage/cache/domain/strategies/__tests__/EvictionStrategies.test.ts +293 -0
- package/src/storage/cache/domain/types/Cache.ts +28 -0
- package/src/storage/cache/domain/types/README.md +107 -0
- package/src/storage/cache/index.ts +28 -0
- package/src/storage/cache/infrastructure/README.md +126 -0
- package/src/storage/cache/infrastructure/TTLCache.ts +103 -0
- package/src/storage/cache/infrastructure/__tests__/TTLCache.test.ts +303 -0
- package/src/storage/cache/presentation/README.md +123 -0
- package/src/storage/cache/presentation/__tests__/ReactHooks.test.ts +514 -0
- package/src/storage/cache/presentation/useCache.ts +76 -0
- package/src/storage/cache/presentation/useCachedValue.ts +88 -0
- package/src/storage/cache/types.d.ts +3 -0
- package/src/storage/domain/README.md +128 -0
- package/src/storage/domain/constants/CacheDefaults.ts +64 -0
- package/src/storage/domain/constants/README.md +105 -0
- package/src/storage/domain/entities/CachedValue.ts +86 -0
- package/src/storage/domain/entities/README.md +109 -0
- package/src/storage/domain/entities/StorageResult.ts +75 -0
- package/src/storage/domain/entities/__tests__/CachedValue.test.ts +149 -0
- package/src/storage/domain/entities/__tests__/StorageResult.test.ts +122 -0
- package/src/storage/domain/errors/README.md +126 -0
- package/src/storage/domain/errors/StorageError.ts +81 -0
- package/src/storage/domain/errors/__tests__/StorageError.test.ts +127 -0
- package/src/storage/domain/factories/README.md +138 -0
- package/src/storage/domain/factories/StoreFactory.ts +59 -0
- package/src/storage/domain/types/README.md +522 -0
- package/src/storage/domain/types/Store.ts +44 -0
- package/src/storage/domain/utils/CacheKeyGenerator.ts +66 -0
- package/src/storage/domain/utils/README.md +127 -0
- package/src/storage/domain/utils/__tests__/devUtils.test.ts +97 -0
- package/src/storage/domain/utils/devUtils.ts +37 -0
- package/src/storage/domain/value-objects/README.md +120 -0
- package/src/storage/domain/value-objects/StorageKey.ts +60 -0
- package/src/storage/index.ts +175 -0
- package/src/storage/infrastructure/README.md +165 -0
- package/src/storage/infrastructure/adapters/README.md +175 -0
- package/src/storage/infrastructure/adapters/StorageService.md +103 -0
- package/src/storage/infrastructure/adapters/StorageService.ts +49 -0
- package/src/storage/infrastructure/repositories/AsyncStorageRepository.ts +98 -0
- package/src/storage/infrastructure/repositories/BaseStorageOperations.ts +100 -0
- package/src/storage/infrastructure/repositories/BatchStorageOperations.ts +42 -0
- package/src/storage/infrastructure/repositories/README.md +121 -0
- package/src/storage/infrastructure/repositories/StringStorageOperations.ts +44 -0
- package/src/storage/infrastructure/repositories/__tests__/AsyncStorageRepository.test.ts +170 -0
- package/src/storage/infrastructure/repositories/__tests__/BaseStorageOperations.test.ts +201 -0
- package/src/storage/presentation/README.md +181 -0
- package/src/storage/presentation/hooks/CacheStorageOperations.ts +94 -0
- package/src/storage/presentation/hooks/README.md +128 -0
- package/src/storage/presentation/hooks/__tests__/usePersistentCache.test.ts +405 -0
- package/src/storage/presentation/hooks/__tests__/useStorage.test.ts +247 -0
- package/src/storage/presentation/hooks/__tests__/useStorageState.test.ts +293 -0
- package/src/storage/presentation/hooks/useCacheState.ts +53 -0
- package/src/storage/presentation/hooks/usePersistentCache.ts +154 -0
- package/src/storage/presentation/hooks/useStorage.ts +102 -0
- package/src/storage/presentation/hooks/useStorageState.ts +71 -0
- package/src/storage/presentation/hooks/useStore.ts +15 -0
- package/src/storage/types/README.md +103 -0
- package/src/theme/infrastructure/globalThemeStore.ts +1 -1
- package/src/theme/infrastructure/storage/ThemeStorage.ts +1 -1
- package/src/theme/infrastructure/stores/themeStore.ts +1 -1
- package/src/utilities/sharing/infrastructure/services/SharingService.ts +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Manager Service
|
|
3
|
+
* Single Responsibility: Manage file operations (delete, copy, move)
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { File, Directory } from "expo-file-system";
|
|
7
|
+
import type { FileOperationResult } from "../../domain/entities/File";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Delete file or directory
|
|
11
|
+
*/
|
|
12
|
+
export async function deleteFile(uri: string): Promise<boolean> {
|
|
13
|
+
try {
|
|
14
|
+
// Try as file first
|
|
15
|
+
try {
|
|
16
|
+
const file = new File(uri);
|
|
17
|
+
if (file.exists) {
|
|
18
|
+
file.delete();
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
} catch {
|
|
22
|
+
// Not a file, try as directory
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Try as directory
|
|
26
|
+
try {
|
|
27
|
+
const dir = new Directory(uri);
|
|
28
|
+
if (dir.exists) {
|
|
29
|
+
dir.delete();
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
} catch {
|
|
33
|
+
// Not a directory either
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return false;
|
|
37
|
+
} catch {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Copy file
|
|
44
|
+
*/
|
|
45
|
+
export async function copyFile(
|
|
46
|
+
sourceUri: string,
|
|
47
|
+
destinationUri: string,
|
|
48
|
+
): Promise<FileOperationResult> {
|
|
49
|
+
try {
|
|
50
|
+
const sourceFile = new File(sourceUri);
|
|
51
|
+
const destination = new File(destinationUri);
|
|
52
|
+
sourceFile.copy(destination);
|
|
53
|
+
return { success: true, uri: destinationUri };
|
|
54
|
+
} catch (error) {
|
|
55
|
+
return {
|
|
56
|
+
success: false,
|
|
57
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Move file
|
|
64
|
+
*/
|
|
65
|
+
export async function moveFile(
|
|
66
|
+
sourceUri: string,
|
|
67
|
+
destinationUri: string,
|
|
68
|
+
): Promise<FileOperationResult> {
|
|
69
|
+
try {
|
|
70
|
+
const sourceFile = new File(sourceUri);
|
|
71
|
+
const destination = new File(destinationUri);
|
|
72
|
+
sourceFile.move(destination);
|
|
73
|
+
return { success: true, uri: destinationUri };
|
|
74
|
+
} catch (error) {
|
|
75
|
+
return {
|
|
76
|
+
success: false,
|
|
77
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Path Service
|
|
3
|
+
* Single Responsibility: Generate and manage file paths
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { DirectoryType } from "../../domain/entities/File";
|
|
7
|
+
import { getDirectoryPath } from "./directory.service";
|
|
8
|
+
import { FileUtils } from "../../domain/entities/File";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Generate unique file path in specified directory
|
|
12
|
+
*/
|
|
13
|
+
export function generateFilePath(
|
|
14
|
+
filename: string,
|
|
15
|
+
directory: DirectoryType = "documentDirectory",
|
|
16
|
+
): string {
|
|
17
|
+
const dirPath = getDirectoryPath(directory);
|
|
18
|
+
const uniqueFilename = FileUtils.generateUniqueFilename(filename);
|
|
19
|
+
return FileUtils.joinPaths(dirPath, uniqueFilename);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Reader Service
|
|
3
|
+
* Single Responsibility: Read files from device storage
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { File } from "expo-file-system";
|
|
7
|
+
import type { FileEncoding } from "../../domain/entities/File";
|
|
8
|
+
import { blobToBase64 } from "../utils/blob.utils";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Read file as string with encoding
|
|
12
|
+
*/
|
|
13
|
+
export async function readFile(
|
|
14
|
+
uri: string,
|
|
15
|
+
encoding: FileEncoding = "utf8",
|
|
16
|
+
): Promise<string | null> {
|
|
17
|
+
try {
|
|
18
|
+
// For file:// URLs, try fetch first (works in React Native)
|
|
19
|
+
if (uri.startsWith("file://")) {
|
|
20
|
+
try {
|
|
21
|
+
const response = await fetch(uri);
|
|
22
|
+
if (response.ok) {
|
|
23
|
+
if (encoding === "base64") {
|
|
24
|
+
const blob = await response.blob();
|
|
25
|
+
return await blobToBase64(blob);
|
|
26
|
+
}
|
|
27
|
+
return await response.text();
|
|
28
|
+
}
|
|
29
|
+
} catch {
|
|
30
|
+
// Fall through to FileSystem API
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Use FileSystem API as fallback
|
|
35
|
+
const file = new File(uri);
|
|
36
|
+
if (encoding === "base64") {
|
|
37
|
+
const content = await file.base64();
|
|
38
|
+
return content;
|
|
39
|
+
}
|
|
40
|
+
const content = await file.text();
|
|
41
|
+
return content;
|
|
42
|
+
} catch {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Read file as base64 string
|
|
49
|
+
*/
|
|
50
|
+
export async function readFileAsBase64(uri: string): Promise<string | null> {
|
|
51
|
+
return readFile(uri, "base64");
|
|
52
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Writer Service
|
|
3
|
+
* Single Responsibility: Write files to device storage
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { File } from "expo-file-system";
|
|
7
|
+
import type { FileEncoding, FileOperationResult } from "../../domain/entities/File";
|
|
8
|
+
import { getEncodingType, type ExpoEncodingType } from "./encoding.service";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Write string to file
|
|
12
|
+
*/
|
|
13
|
+
export async function writeFile(
|
|
14
|
+
uri: string,
|
|
15
|
+
content: string,
|
|
16
|
+
encoding: FileEncoding = "utf8",
|
|
17
|
+
): Promise<FileOperationResult> {
|
|
18
|
+
try {
|
|
19
|
+
const encodingType = getEncodingType(encoding);
|
|
20
|
+
const file = new File(uri);
|
|
21
|
+
file.write(content, {
|
|
22
|
+
encoding: encodingType as ExpoEncodingType,
|
|
23
|
+
});
|
|
24
|
+
return { success: true, uri };
|
|
25
|
+
} catch (error) {
|
|
26
|
+
const writeError = error as Error;
|
|
27
|
+
return {
|
|
28
|
+
success: false,
|
|
29
|
+
error: writeError.message || "Unknown error",
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blob Utils
|
|
3
|
+
* Blob utility functions for file operations
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Convert blob to base64 string
|
|
8
|
+
*/
|
|
9
|
+
export function blobToBase64(blob: Blob): Promise<string> {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
const reader = new FileReader();
|
|
12
|
+
reader.onloadend = () => {
|
|
13
|
+
const result = reader.result as string;
|
|
14
|
+
const base64 = result.includes(",") ? result.split(",")[1] ?? result : result;
|
|
15
|
+
resolve(base64);
|
|
16
|
+
};
|
|
17
|
+
reader.onerror = reject;
|
|
18
|
+
reader.readAsDataURL(blob);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Handles saving images to the device filesystem
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { FileSystemService } from '@
|
|
7
|
+
import { FileSystemService } from '@filesystem';
|
|
8
8
|
import { ImageValidator } from '../utils/ImageValidator';
|
|
9
9
|
import { ImageErrorHandler, IMAGE_ERROR_CODES } from '../utils/ImageErrorHandler';
|
|
10
10
|
|
package/src/index.ts
CHANGED
|
@@ -102,7 +102,21 @@ export * from './exports/variants';
|
|
|
102
102
|
// =============================================================================
|
|
103
103
|
export * from './exports/utilities';
|
|
104
104
|
|
|
105
|
+
// =============================================================================
|
|
106
|
+
// STORAGE EXPORTS
|
|
107
|
+
// =============================================================================
|
|
108
|
+
export * from './exports/storage';
|
|
109
|
+
|
|
105
110
|
// =============================================================================
|
|
106
111
|
// ONBOARDING EXPORTS
|
|
107
112
|
// =============================================================================
|
|
108
113
|
export * from './exports/onboarding';
|
|
114
|
+
// =============================================================================
|
|
115
|
+
// FILESYSTEM EXPORTS
|
|
116
|
+
// =============================================================================
|
|
117
|
+
export * from './exports/filesystem';
|
|
118
|
+
|
|
119
|
+
// =============================================================================
|
|
120
|
+
// MEDIA EXPORTS
|
|
121
|
+
// =============================================================================
|
|
122
|
+
export * from './exports/media';
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# CardMultimedia Types
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Type definitions for flashcard-specific media operations. These types define the contract for media attachment, generation, and management within the card-based learning system.
|
|
5
|
+
|
|
6
|
+
## File Location
|
|
7
|
+
`src/domain/entities/CardMultimedia.types.ts`
|
|
8
|
+
|
|
9
|
+
## Strategy
|
|
10
|
+
- Define the contract for card-specific media operations
|
|
11
|
+
- Provide type-safe interfaces for flashcard media attachments
|
|
12
|
+
- Support AI-powered media generation for educational content
|
|
13
|
+
- Enable comprehensive media validation and optimization
|
|
14
|
+
- Maintain clear separation between card media and general media types
|
|
15
|
+
- Support upload progress tracking and compression
|
|
16
|
+
- Facilitate media download management for offline learning
|
|
17
|
+
|
|
18
|
+
## Forbidden
|
|
19
|
+
- **DO NOT** use these types for general-purpose media operations (use Multimedia types instead)
|
|
20
|
+
- **DO NOT** include UI components or presentation logic in type definitions
|
|
21
|
+
- **DO NOT** add business logic or implementation details to interfaces
|
|
22
|
+
- **DO NOT** create circular dependencies with other domain types
|
|
23
|
+
- **DO NOT** use `any` type or loose type definitions
|
|
24
|
+
- **DO NOT** modify existing type properties - extend interfaces for new features
|
|
25
|
+
- **DO NOT** assume specific storage backend or cloud provider
|
|
26
|
+
- **DO NOT** hardcode validation limits in type definitions
|
|
27
|
+
- **DO NOT** mix card media types with general multimedia types
|
|
28
|
+
|
|
29
|
+
## Rules
|
|
30
|
+
1. All card media types must be exported from this file
|
|
31
|
+
2. Type definitions must be framework-agnostic
|
|
32
|
+
3. Card media IDs must use "card_media_" prefix for uniqueness
|
|
33
|
+
4. Position types must explicitly define front/back/both placement
|
|
34
|
+
5. File size fields must use bytes as unit
|
|
35
|
+
6. Duration fields must use seconds as unit
|
|
36
|
+
7. Date fields must use ISO 8601 format
|
|
37
|
+
8. All generation requests must include input validation
|
|
38
|
+
9. Compression quality must be between 0.1 and 1.0
|
|
39
|
+
10. Upload progress must be tracked from 0-100
|
|
40
|
+
11. Validation results must separate errors, warnings, and recommendations
|
|
41
|
+
12. Service interfaces must return Promises for all async operations
|
|
42
|
+
13. Media type arrays must be automatically calculated, not manually set
|
|
43
|
+
14. Download status must be tracked per attachment
|
|
44
|
+
15. Estimated size must represent total of all attachments
|
|
45
|
+
|
|
46
|
+
## AI Agent Guidelines
|
|
47
|
+
|
|
48
|
+
When working with CardMultimedia types:
|
|
49
|
+
|
|
50
|
+
1. **Type Selection**: Use CardMediaAttachment for flashcard-specific media operations
|
|
51
|
+
2. **Generation Requests**: Always specify input parameters and options explicitly
|
|
52
|
+
3. **Validation**: Validate media files before upload and after generation
|
|
53
|
+
4. **Progress Tracking**: Monitor upload progress for user feedback
|
|
54
|
+
5. **Compression**: Apply compression options before upload to reduce bandwidth
|
|
55
|
+
6. **Download Management**: Check isDownloaded status before displaying media
|
|
56
|
+
7. **Position Logic**: Respect position field for front/back/both placement
|
|
57
|
+
8. **Size Estimation**: Calculate total size for all media before batch operations
|
|
58
|
+
9. **Error Handling**: Parse validation errors and warnings for user feedback
|
|
59
|
+
10. **Cost Tracking**: Monitor creditsUsed for AI generation operations
|
|
60
|
+
|
|
61
|
+
### Key Types Reference
|
|
62
|
+
|
|
63
|
+
- **CardMediaType**: "image" | "audio" | "video" - Media type classification for cards
|
|
64
|
+
- **CardMediaPosition**: "front" | "back" | "both" - Display placement on card faces
|
|
65
|
+
- **CardMediaAttachment**: Core interface for individual media items with metadata
|
|
66
|
+
- **CardMultimediaFlashcard**: Card entity with computed media properties
|
|
67
|
+
- **CardMediaGenerationRequest**: Input specification for AI media generation
|
|
68
|
+
- **CardMediaGenerationResult**: Output with cost tracking and performance metrics
|
|
69
|
+
- **CardMediaUploadProgress**: Real-time upload status tracking
|
|
70
|
+
- **CardMediaCompressionOptions**: Quality and size optimization settings
|
|
71
|
+
- **CardMediaValidation**: Comprehensive validation with recommendations
|
|
72
|
+
- **CardMultimediaFlashcardService**: Service interface for media operations
|
|
73
|
+
|
|
74
|
+
### Type Usage Patterns
|
|
75
|
+
|
|
76
|
+
1. **CardMediaAttachment**: Individual media item with position, URL, and metadata
|
|
77
|
+
2. **CardMultimediaFlashcard**: Card with computed properties (hasMedia, mediaType, isDownloaded)
|
|
78
|
+
3. **CardMediaGenerationRequest**: Three generation types (text_to_image, text_to_audio, image_search)
|
|
79
|
+
4. **CardMediaValidation**: Separate errors (blocking) from warnings and recommendations
|
|
80
|
+
|
|
81
|
+
### Validation Rules
|
|
82
|
+
|
|
83
|
+
1. Validate file size against upload limits before processing
|
|
84
|
+
2. Check MIME type matches CardMediaType
|
|
85
|
+
3. Ensure dimensions are within supported ranges
|
|
86
|
+
4. Verify URIs are properly formatted and accessible
|
|
87
|
+
5. Validate duration for audio/video files
|
|
88
|
+
6. Check compression quality is within 0.1-1.0 range
|
|
89
|
+
7. Ensure generation prompts are non-empty strings
|
|
90
|
+
8. Validate language codes for audio generation (e.g., "tr-TR", "en-US")
|
|
91
|
+
|
|
92
|
+
### Service Interface Guidelines
|
|
93
|
+
|
|
94
|
+
When implementing CardMultimediaFlashcardService:
|
|
95
|
+
|
|
96
|
+
1. **uploadMedia**: Accept file with optional compression, return attachment with URL
|
|
97
|
+
2. **generateMedia**: Process AI generation request, track credits and timing
|
|
98
|
+
3. **validateMedia**: Return comprehensive validation with errors, warnings, recommendations
|
|
99
|
+
4. **optimizeMedia**: Apply compression to existing attachment, preserve metadata
|
|
100
|
+
5. **deleteMedia**: Remove attachment and update card associations
|
|
101
|
+
6. **getMediaUrl**: Return accessible URL for downloaded or remote media
|
|
102
|
+
7. **downloadMedia**: Fetch remote media to local storage, update isDownloaded status
|
|
103
|
+
|
|
104
|
+
### Generation Type Specifics
|
|
105
|
+
|
|
106
|
+
1. **text_to_image**: Requires prompt, style (realistic/cartoon/artistic), quality, format
|
|
107
|
+
2. **text_to_audio**: Requires text, language, voice (male/female/neutral), format
|
|
108
|
+
3. **image_search**: Requires prompt, maxResults (no quality/format options)
|
|
109
|
+
|
|
110
|
+
### Position Logic
|
|
111
|
+
|
|
112
|
+
1. **front**: Media displayed only on card front face
|
|
113
|
+
2. **back**: Media displayed only on card back face
|
|
114
|
+
3. **both**: Media displayed on both card faces (e.g., background image)
|
|
115
|
+
|
|
116
|
+
### Download Management
|
|
117
|
+
|
|
118
|
+
1. Check isDownloaded before displaying media offline
|
|
119
|
+
2. Use localPath for offline access when available
|
|
120
|
+
3. Fall back to URL when media not downloaded
|
|
121
|
+
4. Track estimatedSize for storage management
|
|
122
|
+
5. Implement downloadMedia for offline caching
|
|
123
|
+
|
|
124
|
+
## Dependencies
|
|
125
|
+
|
|
126
|
+
- No external dependencies
|
|
127
|
+
- References domain types from Media.ts for base media concepts
|
|
128
|
+
- Must be usable by infrastructure and presentation layers without additional dependencies
|
|
129
|
+
- Service interfaces require async operation support
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Card Multimedia Types
|
|
3
|
+
* Multimedia support for flashcard functionality
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export type CardMediaType = "image" | "audio" | "video";
|
|
7
|
+
export type CardMediaPosition = "front" | "back" | "both";
|
|
8
|
+
|
|
9
|
+
export interface CardMediaAttachment {
|
|
10
|
+
id: string;
|
|
11
|
+
type: CardMediaType;
|
|
12
|
+
position: CardMediaPosition;
|
|
13
|
+
url: string;
|
|
14
|
+
localPath?: string;
|
|
15
|
+
filename: string;
|
|
16
|
+
fileSize: number;
|
|
17
|
+
mimeType: string;
|
|
18
|
+
duration?: number; // For audio/video in seconds
|
|
19
|
+
thumbnailUrl?: string; // For videos
|
|
20
|
+
caption?: string;
|
|
21
|
+
isDownloaded: boolean;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface CardMultimediaFlashcard {
|
|
26
|
+
id: string;
|
|
27
|
+
front: string;
|
|
28
|
+
back: string;
|
|
29
|
+
difficulty: "easy" | "medium" | "hard";
|
|
30
|
+
tags: string[];
|
|
31
|
+
createdAt?: string;
|
|
32
|
+
updatedAt?: string;
|
|
33
|
+
// Extended properties for multimedia support
|
|
34
|
+
media: CardMediaAttachment[];
|
|
35
|
+
hasMedia: boolean; // Computed property
|
|
36
|
+
mediaType: CardMediaType[]; // Array of media types present
|
|
37
|
+
isDownloaded: boolean; // All media downloaded?
|
|
38
|
+
estimatedSize: number; // Total size in bytes
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface CardMediaGenerationRequest {
|
|
42
|
+
type: "text_to_image" | "text_to_audio" | "image_search";
|
|
43
|
+
input: {
|
|
44
|
+
text?: string;
|
|
45
|
+
prompt?: string;
|
|
46
|
+
language?: string;
|
|
47
|
+
voice?: "male" | "female" | "neutral";
|
|
48
|
+
style?: "realistic" | "cartoon" | "artistic";
|
|
49
|
+
};
|
|
50
|
+
options: {
|
|
51
|
+
maxResults?: number;
|
|
52
|
+
quality?: "low" | "medium" | "high";
|
|
53
|
+
format?: "jpeg" | "png" | "mp3" | "wav";
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface CardMediaGenerationResult {
|
|
58
|
+
success: boolean;
|
|
59
|
+
attachments: CardMediaAttachment[];
|
|
60
|
+
creditsUsed: number;
|
|
61
|
+
processingTime: number;
|
|
62
|
+
error?: string;
|
|
63
|
+
requestId: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface CardMediaUploadProgress {
|
|
67
|
+
fileId: string;
|
|
68
|
+
progress: number; // 0-100
|
|
69
|
+
status: "uploading" | "processing" | "completed" | "error";
|
|
70
|
+
error?: string;
|
|
71
|
+
url?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface CardMediaCompressionOptions {
|
|
75
|
+
quality: number; // 0.1 - 1.0
|
|
76
|
+
maxWidth?: number;
|
|
77
|
+
maxHeight?: number;
|
|
78
|
+
maxFileSize?: number; // bytes
|
|
79
|
+
format?: "jpeg" | "png" | "webp";
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface CardMediaValidation {
|
|
83
|
+
isValid: boolean;
|
|
84
|
+
errors: string[];
|
|
85
|
+
warnings: string[];
|
|
86
|
+
recommendations: string[];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface CardMultimediaFlashcardService {
|
|
90
|
+
uploadMedia(
|
|
91
|
+
file: any,
|
|
92
|
+
options?: CardMediaCompressionOptions,
|
|
93
|
+
): Promise<CardMediaAttachment>;
|
|
94
|
+
generateMedia(
|
|
95
|
+
request: CardMediaGenerationRequest,
|
|
96
|
+
): Promise<CardMediaGenerationResult>;
|
|
97
|
+
validateMedia(file: any): Promise<CardMediaValidation>;
|
|
98
|
+
optimizeMedia(
|
|
99
|
+
attachment: CardMediaAttachment,
|
|
100
|
+
options: CardMediaCompressionOptions,
|
|
101
|
+
): Promise<CardMediaAttachment>;
|
|
102
|
+
deleteMedia(attachmentId: string): Promise<void>;
|
|
103
|
+
getMediaUrl(attachmentId: string): Promise<string>;
|
|
104
|
+
downloadMedia(attachmentId: string): Promise<string>; // Returns local path
|
|
105
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Media Types and Interfaces
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Core type definitions and interfaces for media handling throughout the application.
|
|
5
|
+
|
|
6
|
+
## File Location
|
|
7
|
+
`src/domain/entities/Media.ts`
|
|
8
|
+
|
|
9
|
+
## Strategy
|
|
10
|
+
- Define the contract for media operations across all layers
|
|
11
|
+
- Provide type-safe interfaces for media assets, picker options, and operations
|
|
12
|
+
- Serve as the single source of truth for media-related types
|
|
13
|
+
- Enable compile-time validation of media operations
|
|
14
|
+
- Maintain separation between domain logic and implementation
|
|
15
|
+
|
|
16
|
+
## Forbidden
|
|
17
|
+
- **DO NOT** import external libraries (expo, react-native) in domain types
|
|
18
|
+
- **DO NOT** include implementation details in type definitions
|
|
19
|
+
- **DO NOT** add business logic to type definitions
|
|
20
|
+
- **DO NOT** create circular dependencies between types
|
|
21
|
+
- **DO NOT** export types that are not used by other layers
|
|
22
|
+
- **DO NOT** use `any` type or loose type definitions
|
|
23
|
+
- **DO NOT** modify existing types - extend them instead
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
1. All media types must be exported from this file
|
|
27
|
+
2. Type definitions must be framework-agnostic
|
|
28
|
+
3. Enums must have explicit string values
|
|
29
|
+
4. Interfaces must extend appropriate base types
|
|
30
|
+
5. Optional fields must be clearly marked with `?`
|
|
31
|
+
6. File size fields must use bytes as unit
|
|
32
|
+
7. Dimensions must be in pixels
|
|
33
|
+
8. MIME type validation must use standard MIME types
|
|
34
|
+
9. All new properties must be added with backward compatibility in mind
|
|
35
|
+
10. Type exports must be re-exported from main index
|
|
36
|
+
|
|
37
|
+
## AI Agent Guidelines
|
|
38
|
+
|
|
39
|
+
When working with Media types:
|
|
40
|
+
|
|
41
|
+
1. **Type Import**: Always import types from `@umituz/react-native-media` domain layer
|
|
42
|
+
2. **Type Safety**: Use provided types instead of `any` or loose types
|
|
43
|
+
3. **Validation**: Validate media assets against these types before processing
|
|
44
|
+
4. **Extensibility**: Extend interfaces when adding new properties, don't modify core types
|
|
45
|
+
5. **Consistency**: Maintain naming conventions (PascalCase for types, camelCase for properties)
|
|
46
|
+
|
|
47
|
+
### Key Enums Reference
|
|
48
|
+
|
|
49
|
+
- `MediaType`: IMAGE, VIDEO, ALL - Use for media type filtering
|
|
50
|
+
- `ImageFormat`: PNG, JPEG, WEBP - Use for format specification
|
|
51
|
+
- `MediaQuality`: LOW (0.3), MEDIUM (0.7), HIGH (1.0) - Use for compression quality
|
|
52
|
+
- `MediaLibraryPermission`: GRANTED, DENIED, LIMITED - Use for permission states
|
|
53
|
+
|
|
54
|
+
### Type Usage Guidelines
|
|
55
|
+
|
|
56
|
+
1. **MediaAsset**: Primary type for all media files with uri, dimensions, type, size
|
|
57
|
+
2. **MediaPickerResult**: Return type for all picker operations with canceled flag
|
|
58
|
+
3. **MediaPickerOptions**: Configuration for library picker with mediaTypes, quality, limits
|
|
59
|
+
4. **CameraOptions**: Configuration for camera operations with quality, duration, editing
|
|
60
|
+
|
|
61
|
+
### Validation Rules
|
|
62
|
+
|
|
63
|
+
1. Check file size against `MediaAsset.fileSize` (in bytes)
|
|
64
|
+
2. Validate dimensions using `width` and `height` properties (in pixels)
|
|
65
|
+
3. Verify MIME type matches expected `MediaType`
|
|
66
|
+
4. Ensure URIs are properly formatted strings
|
|
67
|
+
5. Validate aspect ratio format as [width, height] tuple
|
|
68
|
+
|
|
69
|
+
### Constants Reference
|
|
70
|
+
|
|
71
|
+
Use `MEDIA_CONSTANTS` for:
|
|
72
|
+
- Maximum file sizes (MAX_IMAGE_SIZE, MAX_VIDEO_SIZE)
|
|
73
|
+
- Default values (DEFAULT_QUALITY, DEFAULT_FORMAT, DEFAULT_ASPECT_RATIO)
|
|
74
|
+
- Supported format lists (SUPPORTED_IMAGE_FORMATS, SUPPORTED_VIDEO_FORMATS)
|
|
75
|
+
|
|
76
|
+
## Dependencies
|
|
77
|
+
|
|
78
|
+
- No external dependencies
|
|
79
|
+
- May reference other domain types within the domain layer
|
|
80
|
+
- Must be usable by infrastructure and presentation layers without additional dependencies
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Media Domain - Core Entities
|
|
3
|
+
*
|
|
4
|
+
* Core types and interfaces for media operations.
|
|
5
|
+
* Handles images, videos, and media library interactions.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Media type enumeration
|
|
11
|
+
*/
|
|
12
|
+
export enum MediaType {
|
|
13
|
+
IMAGE = "image",
|
|
14
|
+
VIDEO = "video",
|
|
15
|
+
ALL = "all",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Image format enumeration
|
|
20
|
+
*/
|
|
21
|
+
export enum ImageFormat {
|
|
22
|
+
PNG = "png",
|
|
23
|
+
JPEG = "jpeg",
|
|
24
|
+
WEBP = "webp",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Media quality enumeration
|
|
29
|
+
*/
|
|
30
|
+
export enum MediaQuality {
|
|
31
|
+
LOW = 0.3,
|
|
32
|
+
MEDIUM = 0.7,
|
|
33
|
+
HIGH = 1.0,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Media library permissions
|
|
38
|
+
*/
|
|
39
|
+
export enum MediaLibraryPermission {
|
|
40
|
+
GRANTED = "granted",
|
|
41
|
+
DENIED = "denied",
|
|
42
|
+
LIMITED = "limited",
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Image dimensions interface
|
|
47
|
+
*/
|
|
48
|
+
export interface ImageDimensions {
|
|
49
|
+
width: number;
|
|
50
|
+
height: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Image manipulation actions
|
|
55
|
+
*/
|
|
56
|
+
export interface ImageManipulationActions {
|
|
57
|
+
resize?: ImageDimensions;
|
|
58
|
+
crop?: {
|
|
59
|
+
originX: number;
|
|
60
|
+
originY: number;
|
|
61
|
+
width: number;
|
|
62
|
+
height: number;
|
|
63
|
+
};
|
|
64
|
+
rotate?: number;
|
|
65
|
+
flip?: {
|
|
66
|
+
horizontal?: boolean;
|
|
67
|
+
vertical?: boolean;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Image save options
|
|
73
|
+
*/
|
|
74
|
+
export interface ImageSaveOptions {
|
|
75
|
+
quality?: MediaQuality;
|
|
76
|
+
format?: ImageFormat;
|
|
77
|
+
base64?: boolean;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Media picker options
|
|
82
|
+
*/
|
|
83
|
+
export interface MediaPickerOptions {
|
|
84
|
+
mediaTypes?: MediaType;
|
|
85
|
+
allowsEditing?: boolean;
|
|
86
|
+
allowsMultipleSelection?: boolean;
|
|
87
|
+
aspect?: [number, number];
|
|
88
|
+
quality?: MediaQuality;
|
|
89
|
+
selectionLimit?: number;
|
|
90
|
+
base64?: boolean;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Media asset interface
|
|
95
|
+
*/
|
|
96
|
+
export interface MediaAsset {
|
|
97
|
+
uri: string;
|
|
98
|
+
width: number;
|
|
99
|
+
height: number;
|
|
100
|
+
type: MediaType;
|
|
101
|
+
fileSize?: number;
|
|
102
|
+
fileName?: string;
|
|
103
|
+
duration?: number;
|
|
104
|
+
base64?: string;
|
|
105
|
+
mimeType?: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Media picker result
|
|
110
|
+
*/
|
|
111
|
+
export interface MediaPickerResult {
|
|
112
|
+
canceled: boolean;
|
|
113
|
+
assets?: MediaAsset[];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Camera options
|
|
118
|
+
*/
|
|
119
|
+
export interface CameraOptions {
|
|
120
|
+
quality?: MediaQuality;
|
|
121
|
+
allowsEditing?: boolean;
|
|
122
|
+
aspect?: [number, number];
|
|
123
|
+
base64?: boolean;
|
|
124
|
+
videoMaxDuration?: number;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Media constants
|
|
129
|
+
*/
|
|
130
|
+
export const MEDIA_CONSTANTS = {
|
|
131
|
+
MAX_IMAGE_SIZE: 10 * 1024 * 1024,
|
|
132
|
+
MAX_VIDEO_SIZE: 100 * 1024 * 1024,
|
|
133
|
+
DEFAULT_QUALITY: MediaQuality.HIGH,
|
|
134
|
+
DEFAULT_FORMAT: ImageFormat.JPEG,
|
|
135
|
+
DEFAULT_ASPECT_RATIO: [4, 3] as [number, number],
|
|
136
|
+
DEFAULT_SELECTION_LIMIT: 10,
|
|
137
|
+
SUPPORTED_IMAGE_FORMATS: [".jpg", ".jpeg", ".png", ".gif", ".webp"],
|
|
138
|
+
SUPPORTED_VIDEO_FORMATS: [".mp4", ".mov"],
|
|
139
|
+
} as const;
|