-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4134d18
commit 42e9ffb
Showing
5 changed files
with
406 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
--- /tmp/tmp-status-mobile-8a12ad351/tmp.SnIPZikasU/CameraRoll.ts 2024-04-16 12:22:28.722553000 +0200 | ||
+++ ./node_modules/@react-native-camera-roll/camera-roll/src/CameraRoll.ts 2024-04-16 12:22:40.347610946 +0200 | ||
@@ -24,32 +24,32 @@ | ||
}; | ||
|
||
export type GroupTypes = | ||
- | 'Album' | ||
- | 'All' | ||
- | 'Event' | ||
- | 'Faces' | ||
- | 'Library' | ||
- | 'PhotoStream' | ||
- | 'SavedPhotos'; | ||
+ | 'Album' | ||
+ | 'All' | ||
+ | 'Event' | ||
+ | 'Faces' | ||
+ | 'Library' | ||
+ | 'PhotoStream' | ||
+ | 'SavedPhotos'; | ||
|
||
export type SubTypes = | ||
- | 'PhotoPanorama' | ||
- | 'PhotoHDR' | ||
- | 'PhotoScreenshot' | ||
- | 'PhotoLive' | ||
- | 'PhotoDepthEffect' | ||
- | 'VideoStreamed' | ||
- | 'VideoHighFrameRate' | ||
- | 'VideoTimelapse'; | ||
+ | 'PhotoPanorama' | ||
+ | 'PhotoHDR' | ||
+ | 'PhotoScreenshot' | ||
+ | 'PhotoLive' | ||
+ | 'PhotoDepthEffect' | ||
+ | 'VideoStreamed' | ||
+ | 'VideoHighFrameRate' | ||
+ | 'VideoTimelapse'; | ||
|
||
export type Include = | ||
- | 'filename' | ||
- | 'fileSize' | ||
- | 'fileExtension' | ||
- | 'location' | ||
- | 'imageSize' | ||
- | 'playableDuration' | ||
- | 'orientation'; | ||
+ | 'filename' | ||
+ | 'fileSize' | ||
+ | 'fileExtension' | ||
+ | 'location' | ||
+ | 'imageSize' | ||
+ | 'playableDuration' | ||
+ | 'orientation'; | ||
|
||
export type AssetType = 'All' | 'Videos' | 'Photos'; | ||
|
||
@@ -164,14 +164,14 @@ | ||
}; | ||
|
||
export type AlbumSubType = | ||
- | 'AlbumRegular' | ||
- | 'AlbumSyncedEvent' | ||
- | 'AlbumSyncedFaces' | ||
- | 'AlbumSyncedAlbum' | ||
- | 'AlbumImported' | ||
- | 'AlbumMyPhotoStream' | ||
- | 'AlbumCloudShared' | ||
- | 'Unknown'; | ||
+ | 'AlbumRegular' | ||
+ | 'AlbumSyncedEvent' | ||
+ | 'AlbumSyncedFaces' | ||
+ | 'AlbumSyncedAlbum' | ||
+ | 'AlbumImported' | ||
+ | 'AlbumMyPhotoStream' | ||
+ | 'AlbumCloudShared' | ||
+ | 'Unknown'; | ||
|
||
export type Album = { | ||
title: string; | ||
@@ -180,18 +180,18 @@ | ||
}; | ||
|
||
export type ThumbnailSize = { | ||
- height: number, | ||
- width: number | ||
+ height: number; | ||
+ width: number; | ||
}; | ||
|
||
export type PhotoThumbnailOptions = { | ||
- allowNetworkAccess: boolean, //iOS only | ||
- targetSize: ThumbnailSize, | ||
- quality: number | ||
+ allowNetworkAccess: boolean; //iOS only | ||
+ targetSize: ThumbnailSize; | ||
+ quality: number; | ||
}; | ||
|
||
export type PhotoThumbnail = { | ||
- thumbnailBase64: string, | ||
+ thumbnailBase64: string; | ||
}; | ||
|
||
/** | ||
@@ -213,12 +213,25 @@ | ||
} | ||
|
||
/** | ||
+ * Returns total iOS image count | ||
+ */ | ||
+ static getPhotosCountiOS(): Promise<number> { | ||
+ return RNCCameraRoll.getPhotosCountiOS(''); | ||
+ } | ||
+ /** | ||
+ * Returns favorites and their count iOS | ||
+ */ | ||
+ static getFavoritesiOS(): Promise<Album> { | ||
+ return RNCCameraRoll.getFavoritesiOS(''); | ||
+ } | ||
+ | ||
+ /** | ||
* Saves the photo or video to the camera roll or photo library. | ||
* | ||
*/ | ||
static save( | ||
- tag: string, | ||
- options: SaveToCameraRollOptions = {}, | ||
+ tag: string, | ||
+ options: SaveToCameraRollOptions = {}, | ||
): Promise<string> { | ||
let {type = 'auto'} = options; | ||
const {album = ''} = options; | ||
@@ -234,17 +247,17 @@ | ||
} | ||
|
||
static saveToCameraRoll( | ||
- tag: string, | ||
- type?: 'photo' | 'video' | 'auto', | ||
+ tag: string, | ||
+ type?: 'photo' | 'video' | 'auto', | ||
): Promise<string> { | ||
console.warn( | ||
- 'CameraRoll.saveToCameraRoll(tag, type) is deprecated. Use the save function instead', | ||
+ 'CameraRoll.saveToCameraRoll(tag, type) is deprecated. Use the save function instead', | ||
); | ||
return CameraRoll.save(tag, {type}); | ||
} | ||
|
||
static getAlbums( | ||
- params: GetAlbumsParams = {assetType: 'All'}, | ||
+ params: GetAlbumsParams = {assetType: 'All'}, | ||
): Promise<Album[]> { | ||
return RNCCameraRoll.getAlbums(params); | ||
} | ||
@@ -279,8 +292,8 @@ | ||
* @returns Promise<PhotoIdentifier> | ||
*/ | ||
static iosGetImageDataById( | ||
- internalID: string, | ||
- convertHeicImages = false, | ||
+ internalID: string, | ||
+ convertHeicImages = false, | ||
): Promise<PhotoIdentifier> { | ||
const conversionOption: PhotoConvertionOptions = { | ||
convertHeicImages: convertHeicImages, | ||
@@ -288,14 +301,17 @@ | ||
return RNCCameraRoll.getPhotoByInternalID(internalID, conversionOption); | ||
} | ||
|
||
- /** | ||
+ /** | ||
* Returns a Promise with thumbnail photo. | ||
* | ||
* @param internalID - PH photo internal ID. | ||
* @param options - thumbnail photo options. | ||
* @returns Promise<PhotoThumbnail> | ||
*/ | ||
- static getPhotoThumbnail(internalID: string, options: PhotoThumbnailOptions): Promise<PhotoThumbnail> { | ||
- return RNCCameraRoll.getPhotoThumbnail(internalID, options); | ||
- } | ||
+ static getPhotoThumbnail( | ||
+ internalID: string, | ||
+ options: PhotoThumbnailOptions, | ||
+ ): Promise<PhotoThumbnail> { | ||
+ return RNCCameraRoll.getPhotoThumbnail(internalID, options); | ||
+ } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- /tmp/tmp-status-mobile-8a12ad351/tmp.v1Aju1hKVG/NativeCameraRollModule.ts 2024-04-16 12:14:39.262541000 +0200 | ||
+++ ./node_modules/@react-native-camera-roll/camera-roll/src/NativeCameraRollModule.ts 2024-04-16 12:21:34.905876910 +0200 | ||
@@ -2,17 +2,17 @@ | ||
// we use Object type because methods on the native side use NSDictionary and ReadableMap | ||
// and we want to stay compatible with those | ||
import {TurboModuleRegistry, TurboModule} from 'react-native'; | ||
-import type { PhotoThumbnail } from './CameraRoll'; | ||
+import type {PhotoThumbnail} from './CameraRoll'; | ||
|
||
export type AlbumSubType = | ||
- | 'AlbumRegular' | ||
- | 'AlbumSyncedEvent' | ||
- | 'AlbumSyncedFaces' | ||
- | 'AlbumSyncedAlbum' | ||
- | 'AlbumImported' | ||
- | 'AlbumMyPhotoStream' | ||
- | 'AlbumCloudShared' | ||
- | 'Unknown'; | ||
+ | 'AlbumRegular' | ||
+ | 'AlbumSyncedEvent' | ||
+ | 'AlbumSyncedFaces' | ||
+ | 'AlbumSyncedAlbum' | ||
+ | 'AlbumImported' | ||
+ | 'AlbumMyPhotoStream' | ||
+ | 'AlbumCloudShared' | ||
+ | 'Unknown'; | ||
|
||
type Album = { | ||
title: string; | ||
@@ -21,14 +21,14 @@ | ||
}; | ||
|
||
type SubTypes = | ||
- | 'PhotoPanorama' | ||
- | 'PhotoHDR' | ||
- | 'PhotoScreenshot' | ||
- | 'PhotoLive' | ||
- | 'PhotoDepthEffect' | ||
- | 'VideoStreamed' | ||
- | 'VideoHighFrameRate' | ||
- | 'VideoTimelapse'; | ||
+ | 'PhotoPanorama' | ||
+ | 'PhotoHDR' | ||
+ | 'PhotoScreenshot' | ||
+ | 'PhotoLive' | ||
+ | 'PhotoDepthEffect' | ||
+ | 'VideoStreamed' | ||
+ | 'VideoHighFrameRate' | ||
+ | 'VideoTimelapse'; | ||
|
||
type PhotoIdentifier = { | ||
node: { | ||
@@ -73,14 +73,16 @@ | ||
getPhotos(params: Object): Promise<PhotoIdentifiersPage>; | ||
getAlbums(params: Object): Promise<Album[]>; | ||
deletePhotos(photoUris: Array<string>): Promise<void>; | ||
+ getPhotosCountiOS(arg: string): Promise<number>; | ||
+ getFavoritesiOS(arg: string): Promise<Album>; | ||
getPhotoByInternalID( | ||
- internalID: string, | ||
- options: Object, | ||
+ internalID: string, | ||
+ options: Object, | ||
): Promise<PhotoIdentifier>; | ||
getPhotoThumbnail( | ||
- internalID: string, | ||
- options: Object | ||
- ): Promise<PhotoThumbnail> | ||
+ internalID: string, | ||
+ options: Object, | ||
+ ): Promise<PhotoThumbnail>; | ||
} | ||
|
||
export default TurboModuleRegistry.getEnforcing<Spec>('RNCCameraRoll'); |
Oops, something went wrong.