@hortemo/expo-photos 11.0.0 → 13.0.0

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/README.md CHANGED
@@ -18,7 +18,7 @@ npm install @hortemo/expo-photos
18
18
  - `pickAssets(options: PickAssetsOptions): Promise<PHAsset[]>`
19
19
  - `authorizationStatus(accessLevel: PHAccessLevel): Promise<PHAuthorizationStatus>`
20
20
  - `requestAuthorization(accessLevel: PHAccessLevel): Promise<PHAuthorizationStatus>`
21
- - `presentLimitedLibraryPicker(): Promise<void>`
21
+ - `presentLimitedLibraryPicker(): Promise<string[]>`
22
22
 
23
23
  ### Components
24
24
 
@@ -1,8 +1,10 @@
1
1
  export interface PHAsset {
2
2
  localIdentifier: string;
3
+ /** Milliseconds since 1970. */
3
4
  creationDate: number;
4
5
  mediaType: PHAssetMediaType;
5
6
  mediaSubtypes: PHAssetMediaSubtype;
7
+ /** Milliseconds. */
6
8
  duration: number;
7
9
  pixelWidth: number;
8
10
  pixelHeight: number;
@@ -101,7 +103,9 @@ export interface PHVideoRequestOptions {
101
103
  deliveryMode?: PHVideoRequestOptionsDeliveryMode;
102
104
  }
103
105
  export interface CMTimeRange {
106
+ /** Milliseconds. */
104
107
  start: number;
108
+ /** Milliseconds. */
105
109
  duration: number;
106
110
  }
107
111
  export declare enum AVFileType {
@@ -171,6 +175,7 @@ export interface RequestImageOptions extends PHImageRequestOptions, SDImageCoder
171
175
  targetSize: RequestImageTargetSize;
172
176
  contentMode: PHImageContentMode;
173
177
  outputURL?: string;
178
+ /** Milliseconds until the request is cancelled. */
174
179
  timeout?: number;
175
180
  }
176
181
  export interface RequestImageResult {
@@ -181,6 +186,7 @@ export interface RequestImageResult {
181
186
  export interface RequestVideoOptions extends PHVideoRequestOptions, AVAssetExportSessionOptions {
182
187
  localIdentifier: string;
183
188
  exportPreset: AVAssetExportPreset;
189
+ /** Milliseconds until the request is cancelled. */
184
190
  timeout?: number;
185
191
  }
186
192
  export declare enum PHPickerFilter {
@@ -193,6 +199,7 @@ export interface PickAssetsOptions {
193
199
  selectionLimit?: number;
194
200
  }
195
201
  export interface PHVideoLoadEvent {
202
+ /** Milliseconds. */
196
203
  duration: number;
197
204
  naturalSize: {
198
205
  width: number;
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoPhotos.types.d.ts","sourceRoot":"","sources":["../src/ExpoPhotos.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,aAAa,EAAE,mBAAmB,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,oBAAY,qBAAqB;IAC/B,aAAa,IAAI;IACjB,UAAU,IAAI;IACd,MAAM,IAAI;IACV,UAAU,IAAI;IACd,OAAO,IAAI;CACZ;AAED,oBAAY,aAAa;IACvB,OAAO,IAAI;IACX,SAAS,IAAI;CACd;AAED,oBAAY,gBAAgB;IAC1B,OAAO,IAAI;IACX,KAAK,IAAI;IACT,KAAK,IAAI;IACT,KAAK,IAAI;CACV;AAED,oBAAY,mBAAmB;IAC7B,IAAI,IAAI;IACR,aAAa,IAAS;IACtB,QAAQ,IAAS;IACjB,eAAe,IAAS;IACxB,SAAS,IAAS;IAClB,gBAAgB,KAAS;IACzB,aAAa,QAAU;IACvB,kBAAkB,SAAU;IAC5B,cAAc,SAAU;IACxB,cAAc,SAAU;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC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D,CAAA;IACpD,6EAAsD,CAAA;IACtD,uEAAgD,CAAA;IAChD,6EAAsD,CAAA;IACtD,+EAAwD,CAAA;IACxD,uEAAgD,CAAA;IAChD,mFAA4D,CAAA;IAC5D,qFAA8D,CAAA;IAC9D,qEAA8C,CAAA;IAC9C,+DAAwC,CAAA;AAC1C,CAAC,EA7BW,mBAAmB,KAAnB,mBAAmB,QA6B9B;AA+BD,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,6BAAW,CAAA;AACb,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB","sourcesContent":["export interface PHAsset {\n localIdentifier: string;\n creationDate: number;\n mediaType: PHAssetMediaType;\n mediaSubtypes: PHAssetMediaSubtype;\n duration: number;\n pixelWidth: number;\n pixelHeight: number;\n}\n\nexport enum PHAuthorizationStatus {\n notDetermined = 0,\n restricted = 1,\n denied = 2,\n authorized = 3,\n limited = 4,\n}\n\nexport enum PHAccessLevel {\n addOnly = 1,\n readWrite = 2,\n}\n\nexport enum PHAssetMediaType {\n unknown = 0,\n image = 1,\n video = 2,\n audio = 3,\n}\n\nexport enum PHAssetMediaSubtype {\n none = 0,\n photoPanorama = 1 << 0,\n photoHDR = 1 << 1,\n photoScreenshot = 1 << 2,\n photoLive = 1 << 3,\n photoDepthEffect = 1 << 4,\n videoStreamed = 1 << 16,\n videoHighFrameRate = 1 << 17,\n videoTimelapse = 1 << 18,\n videoCinematic = 1 << 19,\n}\n\nexport interface NSSortDescriptor {\n key: string;\n ascending: boolean;\n}\n\nexport interface PHFetchOptions {\n predicate?: string;\n fetchLimit?: number;\n sortDescriptors?: NSSortDescriptor[];\n}\n\nexport type FetchAssetsOptions = PHFetchOptions;\n\nexport interface CGSize {\n width: number;\n height: number;\n}\n\nexport type PHImageManagerMaximumSize = \"PHImageManagerMaximumSize\";\n\nexport type RequestImageTargetSize = CGSize | PHImageManagerMaximumSize;\n\nexport enum PHImageRequestOptionsResizeMode {\n none = 0,\n fast = 1,\n exact = 2,\n}\n\nexport enum PHImageRequestOptionsDeliveryMode {\n opportunistic = 0,\n highQualityFormat = 1,\n fastFormat = 2,\n}\n\nexport enum PHImageContentMode {\n aspectFit = 0,\n aspectFill = 1,\n}\n\nexport enum UIViewContentMode {\n scaleToFill = 0,\n scaleAspectFit = 1,\n scaleAspectFill = 2,\n redraw = 3,\n center = 4,\n top = 5,\n bottom = 6,\n left = 7,\n right = 8,\n topLeft = 9,\n topRight = 10,\n bottomLeft = 11,\n bottomRight = 12,\n}\nexport interface PHImageRequestOptions {\n isNetworkAccessAllowed?: boolean;\n resizeMode?: PHImageRequestOptionsResizeMode;\n deliveryMode?: PHImageRequestOptionsDeliveryMode;\n}\n\nexport interface SDImageCoderOptions {\n encodeCompressionQuality?: number;\n encodeMaxFileSize?: number;\n}\n\nexport enum PHVideoRequestOptionsDeliveryMode {\n automatic = 0,\n highQualityFormat = 1,\n mediumQualityFormat = 2,\n fastFormat = 3,\n}\n\nexport interface PHVideoRequestOptions {\n isNetworkAccessAllowed?: boolean;\n deliveryMode?: PHVideoRequestOptionsDeliveryMode;\n}\n\nexport interface CMTimeRange {\n start: number;\n duration: number;\n}\n\nexport enum AVFileType {\n ac3 = \"public.ac3-audio\",\n aifc = \"public.aifc-audio\",\n aiff = \"public.aiff-audio\",\n AHAP = \"com.apple.itt\",\n amr = \"org.3gpp.adaptive-multi-rate-audio\",\n appleiTT = \"com.apple.itt\",\n au = \"public.au-audio\",\n avci = \"public.avci\",\n caf = \"com.apple.coreaudio-format\",\n dng = \"com.adobe.raw-image\",\n eac3 = \"public.eac3-audio\",\n heic = \"public.heic\",\n heif = \"public.heif\",\n jpg = \"public.jpeg\",\n m4a = \"com.apple.m4a-audio\",\n m4v = \"com.apple.m4v-video\",\n mobile3GPP = \"public.3gpp\",\n mobile3GPP2 = \"public.3gpp2\",\n mov = \"com.apple.quicktime-movie\",\n mp3 = \"public.mp3\",\n mp4 = \"public.mpeg-4\",\n SCC = \"com.scenarist.cc\",\n tif = \"public.tiff\",\n wav = \"com.microsoft.waveform-audio\",\n}\n\nexport enum AVAssetExportPreset {\n LowQuality = \"AVAssetExportPresetLowQuality\",\n MediumQuality = \"AVAssetExportPresetMediumQuality\",\n HighestQuality = \"AVAssetExportPresetHighestQuality\",\n HEVCHighestQuality = \"AVAssetExportPresetHEVCHighestQuality\",\n HEVCHighestQualityWithAlpha = \"AVAssetExportPresetHEVCHighestQualityWithAlpha\",\n AVC640x480 = \"AVAssetExportPreset640x480\",\n AVC960x540 = \"AVAssetExportPreset960x540\",\n AVC1280x720 = \"AVAssetExportPreset1280x720\",\n AVC1920x1080 = \"AVAssetExportPreset1920x1080\",\n AVC3840x2160 = \"AVAssetExportPreset3840x2160\",\n HEVC1920x1080 = \"AVAssetExportPresetHEVC1920x1080\",\n HEVC3840x2160 = \"AVAssetExportPresetHEVC3840x2160\",\n HEVC1920x1080WithAlpha = \"AVAssetExportPresetHEVC1920x1080WithAlpha\",\n HEVC3840x2160WithAlpha = \"AVAssetExportPresetHEVC3840x2160WithAlpha\",\n HEVC7680x4320 = \"AVAssetExportPresetHEVC7680x4320\",\n MVHEVC960x960 = \"AVAssetExportPresetMVHEVC960x960\",\n MVHEVC1440x1440 = \"AVAssetExportPresetMVHEVC1440x1440\",\n AppleM4V480pSD = \"AVAssetExportPresetAppleM4V480pSD\",\n AppleM4V720pHD = \"AVAssetExportPresetAppleM4V720pHD\",\n AppleM4V1080pHD = \"AVAssetExportPresetAppleM4V1080pHD\",\n AppleM4ViPod = \"AVAssetExportPresetAppleM4ViPod\",\n AppleM4VAppleTV = \"AVAssetExportPresetAppleM4VAppleTV\",\n AppleM4VCellular = \"AVAssetExportPresetAppleM4VCellular\",\n AppleM4VWiFi = \"AVAssetExportPresetAppleM4VWiFi\",\n AppleProRes422LPCM = \"AVAssetExportPresetAppleProRes422LPCM\",\n AppleProRes4444LPCM = \"AVAssetExportPresetAppleProRes4444LPCM\",\n Passthrough = \"AVAssetExportPresetPassthrough\",\n AppleM4A = \"AVAssetExportPresetAppleM4A\",\n}\n\nexport interface AVAssetExportSessionOptions {\n outputURL: string;\n outputFileType?: AVFileType;\n fileLengthLimit?: number;\n timeRange?: CMTimeRange;\n}\n\nexport interface RequestImageOptions\n extends PHImageRequestOptions, SDImageCoderOptions {\n localIdentifier: string;\n targetSize: RequestImageTargetSize;\n contentMode: PHImageContentMode;\n outputURL?: string;\n timeout?: number;\n}\n\nexport interface RequestImageResult {\n size: CGSize;\n scale: number;\n imageOrientation: number;\n}\n\nexport interface RequestVideoOptions\n extends PHVideoRequestOptions, AVAssetExportSessionOptions {\n localIdentifier: string;\n exportPreset: AVAssetExportPreset;\n timeout?: number;\n}\n\nexport enum PHPickerFilter {\n images = \"images\",\n videos = \"videos\",\n any = \"any\",\n}\n\nexport interface PickAssetsOptions {\n filter?: PHPickerFilter;\n selectionLimit?: number;\n}\n\nexport interface PHVideoLoadEvent {\n duration: number;\n naturalSize: { width: number; height: number };\n}\n\nexport interface PHVideoErrorEvent {\n message: string;\n}\n"]}
1
+ {"version":3,"file":"ExpoPhotos.types.js","sourceRoot":"","sources":["../src/ExpoPhotos.types.ts"],"names":[],"mappings":"AAYA,MAAM,CAAN,IAAY,qBAMX;AAND,WAAY,qBAAqB;IAC/B,mFAAiB,CAAA;IACjB,6EAAc,CAAA;IACd,qEAAU,CAAA;IACV,6EAAc,CAAA;IACd,uEAAW,CAAA;AACb,CAAC,EANW,qBAAqB,KAArB,qBAAqB,QAMhC;AAED,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,uDAAW,CAAA;IACX,2DAAa,CAAA;AACf,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,6DAAW,CAAA;IACX,yDAAS,CAAA;IACT,yDAAS,CAAA;IACT,yDAAS,CAAA;AACX,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QA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IAC5D,qFAA8D,CAAA;IAC9D,qEAA8C,CAAA;IAC9C,+DAAwC,CAAA;AAC1C,CAAC,EA7BW,mBAAmB,KAAnB,mBAAmB,QA6B9B;AAiCD,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,6BAAW,CAAA;AACb,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB","sourcesContent":["export interface PHAsset {\n localIdentifier: string;\n /** Milliseconds since 1970. */\n creationDate: number;\n mediaType: PHAssetMediaType;\n mediaSubtypes: PHAssetMediaSubtype;\n /** Milliseconds. */\n duration: number;\n pixelWidth: number;\n pixelHeight: number;\n}\n\nexport enum PHAuthorizationStatus {\n notDetermined = 0,\n restricted = 1,\n denied = 2,\n authorized = 3,\n limited = 4,\n}\n\nexport enum PHAccessLevel {\n addOnly = 1,\n readWrite = 2,\n}\n\nexport enum PHAssetMediaType {\n unknown = 0,\n image = 1,\n video = 2,\n audio = 3,\n}\n\nexport enum PHAssetMediaSubtype {\n none = 0,\n photoPanorama = 1 << 0,\n photoHDR = 1 << 1,\n photoScreenshot = 1 << 2,\n photoLive = 1 << 3,\n photoDepthEffect = 1 << 4,\n videoStreamed = 1 << 16,\n videoHighFrameRate = 1 << 17,\n videoTimelapse = 1 << 18,\n videoCinematic = 1 << 19,\n}\n\nexport interface NSSortDescriptor {\n key: string;\n ascending: boolean;\n}\n\nexport interface PHFetchOptions {\n predicate?: string;\n fetchLimit?: number;\n sortDescriptors?: NSSortDescriptor[];\n}\n\nexport type FetchAssetsOptions = PHFetchOptions;\n\nexport interface CGSize {\n width: number;\n height: number;\n}\n\nexport type PHImageManagerMaximumSize = \"PHImageManagerMaximumSize\";\n\nexport type RequestImageTargetSize = CGSize | PHImageManagerMaximumSize;\n\nexport enum PHImageRequestOptionsResizeMode {\n none = 0,\n fast = 1,\n exact = 2,\n}\n\nexport enum PHImageRequestOptionsDeliveryMode {\n opportunistic = 0,\n highQualityFormat = 1,\n fastFormat = 2,\n}\n\nexport enum PHImageContentMode {\n aspectFit = 0,\n aspectFill = 1,\n}\n\nexport enum UIViewContentMode {\n scaleToFill = 0,\n scaleAspectFit = 1,\n scaleAspectFill = 2,\n redraw = 3,\n center = 4,\n top = 5,\n bottom = 6,\n left = 7,\n right = 8,\n topLeft = 9,\n topRight = 10,\n bottomLeft = 11,\n bottomRight = 12,\n}\nexport interface PHImageRequestOptions {\n isNetworkAccessAllowed?: boolean;\n resizeMode?: PHImageRequestOptionsResizeMode;\n deliveryMode?: PHImageRequestOptionsDeliveryMode;\n}\n\nexport interface SDImageCoderOptions {\n encodeCompressionQuality?: number;\n encodeMaxFileSize?: number;\n}\n\nexport enum PHVideoRequestOptionsDeliveryMode {\n automatic = 0,\n highQualityFormat = 1,\n mediumQualityFormat = 2,\n fastFormat = 3,\n}\n\nexport interface PHVideoRequestOptions {\n isNetworkAccessAllowed?: boolean;\n deliveryMode?: PHVideoRequestOptionsDeliveryMode;\n}\n\nexport interface CMTimeRange {\n /** Milliseconds. */\n start: number;\n /** Milliseconds. */\n duration: number;\n}\n\nexport enum AVFileType {\n ac3 = \"public.ac3-audio\",\n aifc = \"public.aifc-audio\",\n aiff = \"public.aiff-audio\",\n AHAP = \"com.apple.itt\",\n amr = \"org.3gpp.adaptive-multi-rate-audio\",\n appleiTT = \"com.apple.itt\",\n au = \"public.au-audio\",\n avci = \"public.avci\",\n caf = \"com.apple.coreaudio-format\",\n dng = \"com.adobe.raw-image\",\n eac3 = \"public.eac3-audio\",\n heic = \"public.heic\",\n heif = \"public.heif\",\n jpg = \"public.jpeg\",\n m4a = \"com.apple.m4a-audio\",\n m4v = \"com.apple.m4v-video\",\n mobile3GPP = \"public.3gpp\",\n mobile3GPP2 = \"public.3gpp2\",\n mov = \"com.apple.quicktime-movie\",\n mp3 = \"public.mp3\",\n mp4 = \"public.mpeg-4\",\n SCC = \"com.scenarist.cc\",\n tif = \"public.tiff\",\n wav = \"com.microsoft.waveform-audio\",\n}\n\nexport enum AVAssetExportPreset {\n LowQuality = \"AVAssetExportPresetLowQuality\",\n MediumQuality = \"AVAssetExportPresetMediumQuality\",\n HighestQuality = \"AVAssetExportPresetHighestQuality\",\n HEVCHighestQuality = \"AVAssetExportPresetHEVCHighestQuality\",\n HEVCHighestQualityWithAlpha = \"AVAssetExportPresetHEVCHighestQualityWithAlpha\",\n AVC640x480 = \"AVAssetExportPreset640x480\",\n AVC960x540 = \"AVAssetExportPreset960x540\",\n AVC1280x720 = \"AVAssetExportPreset1280x720\",\n AVC1920x1080 = \"AVAssetExportPreset1920x1080\",\n AVC3840x2160 = \"AVAssetExportPreset3840x2160\",\n HEVC1920x1080 = \"AVAssetExportPresetHEVC1920x1080\",\n HEVC3840x2160 = \"AVAssetExportPresetHEVC3840x2160\",\n HEVC1920x1080WithAlpha = \"AVAssetExportPresetHEVC1920x1080WithAlpha\",\n HEVC3840x2160WithAlpha = \"AVAssetExportPresetHEVC3840x2160WithAlpha\",\n HEVC7680x4320 = \"AVAssetExportPresetHEVC7680x4320\",\n MVHEVC960x960 = \"AVAssetExportPresetMVHEVC960x960\",\n MVHEVC1440x1440 = \"AVAssetExportPresetMVHEVC1440x1440\",\n AppleM4V480pSD = \"AVAssetExportPresetAppleM4V480pSD\",\n AppleM4V720pHD = \"AVAssetExportPresetAppleM4V720pHD\",\n AppleM4V1080pHD = \"AVAssetExportPresetAppleM4V1080pHD\",\n AppleM4ViPod = \"AVAssetExportPresetAppleM4ViPod\",\n AppleM4VAppleTV = \"AVAssetExportPresetAppleM4VAppleTV\",\n AppleM4VCellular = \"AVAssetExportPresetAppleM4VCellular\",\n AppleM4VWiFi = \"AVAssetExportPresetAppleM4VWiFi\",\n AppleProRes422LPCM = \"AVAssetExportPresetAppleProRes422LPCM\",\n AppleProRes4444LPCM = \"AVAssetExportPresetAppleProRes4444LPCM\",\n Passthrough = \"AVAssetExportPresetPassthrough\",\n AppleM4A = \"AVAssetExportPresetAppleM4A\",\n}\n\nexport interface AVAssetExportSessionOptions {\n outputURL: string;\n outputFileType?: AVFileType;\n fileLengthLimit?: number;\n timeRange?: CMTimeRange;\n}\n\nexport interface RequestImageOptions\n extends PHImageRequestOptions, SDImageCoderOptions {\n localIdentifier: string;\n targetSize: RequestImageTargetSize;\n contentMode: PHImageContentMode;\n outputURL?: string;\n /** Milliseconds until the request is cancelled. */\n timeout?: number;\n}\n\nexport interface RequestImageResult {\n size: CGSize;\n scale: number;\n imageOrientation: number;\n}\n\nexport interface RequestVideoOptions\n extends PHVideoRequestOptions, AVAssetExportSessionOptions {\n localIdentifier: string;\n exportPreset: AVAssetExportPreset;\n /** Milliseconds until the request is cancelled. */\n timeout?: number;\n}\n\nexport enum PHPickerFilter {\n images = \"images\",\n videos = \"videos\",\n any = \"any\",\n}\n\nexport interface PickAssetsOptions {\n filter?: PHPickerFilter;\n selectionLimit?: number;\n}\n\nexport interface PHVideoLoadEvent {\n /** Milliseconds. */\n duration: number;\n naturalSize: { width: number; height: number };\n}\n\nexport interface PHVideoErrorEvent {\n message: string;\n}\n"]}
@@ -7,7 +7,8 @@ export declare class ExpoPhotosModule extends NativeModule {
7
7
  pickAssets(options: PickAssetsOptions): Promise<PHAsset[]>;
8
8
  authorizationStatus(accessLevel: PHAccessLevel): Promise<PHAuthorizationStatus>;
9
9
  requestAuthorization(accessLevel: PHAccessLevel): Promise<PHAuthorizationStatus>;
10
- presentLimitedLibraryPicker(): Promise<void>;
10
+ /** Resolves with newly selected local identifiers once the picker closes. */
11
+ presentLimitedLibraryPicker(): Promise<string[]>;
11
12
  }
12
13
  declare const _default: ExpoPhotosModule;
13
14
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoPhotosModule.d.ts","sourceRoot":"","sources":["../src/ExpoPhotosModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,OAAO,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iB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1D,mBAAmB,CAAC,WAAW,EAAE,aAAa,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAC/E,oBAAoB,CAAC,WAAW,EAAE,aAAa,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAChF,6EAA6E;IAC7E,2BAA2B,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CACjD;;AAED,wBAAmE"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoPhotosModule.js","sourceRoot":"","sources":["../src/ExpoPhotosModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAsBtE,eAAe,mBAAmB,CAAmB,YAAY,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from \"expo-modules-core\";\nimport type {\n FetchAssetsOptions,\n PHAuthorizationStatus,\n PHAccessLevel,\n PHAsset,\n PickAssetsOptions,\n RequestImageOptions,\n RequestVideoOptions,\n RequestImageResult,\n} from \"./ExpoPhotos.types\";\n\nexport declare class ExpoPhotosModule extends NativeModule {\n fetchAssets(options: FetchAssetsOptions): Promise<PHAsset[]>;\n requestImage(options: RequestImageOptions): Promise<RequestImageResult>;\n requestVideo(options: RequestVideoOptions): Promise<void>;\n pickAssets(options: PickAssetsOptions): Promise<PHAsset[]>;\n authorizationStatus(accessLevel: PHAccessLevel): Promise<PHAuthorizationStatus>;\n requestAuthorization(accessLevel: PHAccessLevel): Promise<PHAuthorizationStatus>;\n presentLimitedLibraryPicker(): Promise<void>;\n}\n\nexport default requireNativeModule<ExpoPhotosModule>(\"ExpoPhotos\");\n"]}
1
+ {"version":3,"file":"ExpoPhotosModule.js","sourceRoot":"","sources":["../src/ExpoPhotosModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAuBtE,eAAe,mBAAmB,CAAmB,YAAY,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from \"expo-modules-core\";\nimport type {\n FetchAssetsOptions,\n PHAuthorizationStatus,\n PHAccessLevel,\n PHAsset,\n PickAssetsOptions,\n RequestImageOptions,\n RequestVideoOptions,\n RequestImageResult,\n} from \"./ExpoPhotos.types\";\n\nexport declare class ExpoPhotosModule extends NativeModule {\n fetchAssets(options: FetchAssetsOptions): Promise<PHAsset[]>;\n requestImage(options: RequestImageOptions): Promise<RequestImageResult>;\n requestVideo(options: RequestVideoOptions): Promise<void>;\n pickAssets(options: PickAssetsOptions): Promise<PHAsset[]>;\n authorizationStatus(accessLevel: PHAccessLevel): Promise<PHAuthorizationStatus>;\n requestAuthorization(accessLevel: PHAccessLevel): Promise<PHAuthorizationStatus>;\n /** Resolves with newly selected local identifiers once the picker closes. */\n presentLimitedLibraryPicker(): Promise<string[]>;\n}\n\nexport default requireNativeModule<ExpoPhotosModule>(\"ExpoPhotos\");\n"]}
@@ -21,7 +21,7 @@ struct RequestImageOptions: Record {
21
21
  @Field var outputURL: URL?
22
22
  @Field var encodeCompressionQuality: Double?
23
23
  @Field var encodeMaxFileSize: Int?
24
- @Field var timeout: TimeInterval?
24
+ @Field var timeout: Milliseconds?
25
25
  }
26
26
 
27
27
  protocol AVAssetExportSessionOptions {
@@ -40,7 +40,7 @@ struct RequestVideoOptions: Record, AVAssetExportSessionOptions {
40
40
  @Field var outputFileType: AVFileType?
41
41
  @Field var fileLengthLimit: Int64?
42
42
  @Field var timeRange: CMTimeRange?
43
- @Field var timeout: TimeInterval?
43
+ @Field var timeout: Milliseconds?
44
44
  }
45
45
 
46
46
  struct PickAssetsOptions: Record {
@@ -123,7 +123,7 @@ public final class ExpoPhotos: Module {
123
123
  imageRequestOptions.resizeMode = resizeMode
124
124
  }
125
125
 
126
- let deadline = options.timeout.map { DispatchTime.now() + $0 }
126
+ let deadline = options.timeout.map { DispatchTime.now() + $0.seconds }
127
127
 
128
128
  let image = try await withCheckedThrowingContinuation {
129
129
  (continuation: CheckedContinuation<UIImage, Error>) in
@@ -202,7 +202,7 @@ public final class ExpoPhotos: Module {
202
202
  videoRequestOptions.deliveryMode = deliveryMode
203
203
  }
204
204
 
205
- let deadline = options.timeout.map { DispatchTime.now() + $0 }
205
+ let deadline = options.timeout.map { DispatchTime.now() + $0.seconds }
206
206
 
207
207
  let exportSession = try await withCheckedThrowingContinuation {
208
208
  (continuation: CheckedContinuation<AVAssetExportSession, Error>) in
@@ -263,12 +263,22 @@ public final class ExpoPhotos: Module {
263
263
  }
264
264
  }
265
265
 
266
- AsyncFunction("presentLimitedLibraryPicker") { () async throws -> Void in
267
- try await MainActor.run {
268
- guard let viewController = self.appContext?.utilities?.currentViewController() else {
269
- throw ExpoPhotosError.noViewController
266
+ AsyncFunction("presentLimitedLibraryPicker") { () async throws -> [String] in
267
+ // Without limited access, the picker neither shows nor completes
268
+ guard PHPhotoLibrary.authorizationStatus(for: .readWrite) == .limited else {
269
+ return []
270
+ }
271
+
272
+ return try await withCheckedThrowingContinuation { (continuation: CheckedContinuation<[String], Error>) in
273
+ Task { @MainActor in
274
+ guard let viewController = self.appContext?.utilities?.currentViewController() else {
275
+ continuation.resume(throwing: ExpoPhotosError.noViewController)
276
+ return
277
+ }
278
+ PHPhotoLibrary.shared().presentLimitedLibraryPicker(from: viewController) { localIdentifiers in
279
+ continuation.resume(returning: localIdentifiers)
280
+ }
270
281
  }
271
- PHPhotoLibrary.shared().presentLimitedLibraryPicker(from: viewController)
272
282
  }
273
283
  }
274
284
 
@@ -377,22 +387,19 @@ extension PHPickerViewController {
377
387
  }
378
388
  }
379
389
 
380
- extension TimeInterval: @retroactive Convertible {
381
- public static func convert(from value: Any?, appContext: AppContext) throws -> Self {
382
- guard let milliseconds = value as? Int else {
390
+ /// A duration or timestamp that JS represents in milliseconds.
391
+ struct Milliseconds: Convertible {
392
+ let seconds: TimeInterval
393
+
394
+ static func convert(from value: Any?, appContext: AppContext) throws -> Self {
395
+ guard let milliseconds = value as? Double, milliseconds.isFinite else {
383
396
  throw Conversions.ConvertingException<Self>(value)
384
397
  }
385
- return Double(milliseconds) / 1000
386
- }
387
-
388
- func toJS() -> Int {
389
- return Int(self * 1000)
398
+ return Self(seconds: milliseconds / 1000)
390
399
  }
391
- }
392
400
 
393
- extension CMTime {
394
- func toJS() -> Int {
395
- return Int(self.seconds * 1000)
401
+ static func toJS(_ seconds: TimeInterval) -> Int {
402
+ seconds.isFinite ? Int((seconds * 1000).rounded()) : 0
396
403
  }
397
404
  }
398
405
 
@@ -404,10 +411,10 @@ extension PHAsset {
404
411
  func toJS() -> [String: Any] {
405
412
  return [
406
413
  "localIdentifier": localIdentifier,
407
- "creationDate": creationDate?.timeIntervalSince1970.toJS() ?? NSNull(),
414
+ "creationDate": creationDate.map { Milliseconds.toJS($0.timeIntervalSince1970) } ?? NSNull(),
408
415
  "mediaType": mediaType.rawValue,
409
416
  "mediaSubtypes": mediaSubtypes.rawValue,
410
- "duration": duration.toJS(),
417
+ "duration": Milliseconds.toJS(duration),
411
418
  "pixelWidth": pixelWidth,
412
419
  "pixelHeight": pixelHeight,
413
420
  ]
@@ -441,16 +448,14 @@ extension NSPredicate: @retroactive Convertible {
441
448
 
442
449
  extension CMTimeRange: @retroactive Convertible {
443
450
  public static func convert(from value: Any?, appContext: AppContext) throws -> Self {
444
- guard let dict = value as? [String: Any],
445
- let startMs = dict["start"] as? Int,
446
- let durationMs = dict["duration"] as? Int
447
- else {
448
- throw Conversions.ConvertingException<CMTimeRange>(value)
451
+ guard let dict = value as? [String: Any] else {
452
+ throw Conversions.ConvertingException<Self>(value)
449
453
  }
450
-
454
+ let start = try Milliseconds.convert(from: dict["start"], appContext: appContext)
455
+ let duration = try Milliseconds.convert(from: dict["duration"], appContext: appContext)
451
456
  return Self(
452
- start: CMTimeMakeWithSeconds(Double(startMs) / 1000, preferredTimescale: 600),
453
- duration: CMTimeMakeWithSeconds(Double(durationMs) / 1000, preferredTimescale: 600)
457
+ start: CMTime(seconds: start.seconds, preferredTimescale: 600),
458
+ duration: CMTime(seconds: duration.seconds, preferredTimescale: 600)
454
459
  )
455
460
  }
456
461
  }
@@ -122,11 +122,10 @@ public final class PHVideoView: ExpoView {
122
122
  case .readyToPlay:
123
123
  if !self.didSendLoadEvent {
124
124
  self.didSendLoadEvent = true
125
- let duration = playerItem.asset.duration.seconds.isFinite ? playerItem.asset.duration.seconds * 1000 : 0
126
125
  let tracks = playerItem.asset.tracks(withMediaType: .video)
127
126
  let size = tracks.first?.naturalSize ?? .zero
128
127
  self.onLoad([
129
- "duration": duration,
128
+ "duration": Milliseconds.toJS(playerItem.asset.duration.seconds),
130
129
  "naturalSize": [
131
130
  "width": size.width,
132
131
  "height": size.height
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hortemo/expo-photos",
3
- "version": "11.0.0",
3
+ "version": "13.0.0",
4
4
  "description": "Expo module exposing advanced iOS Photos APIs.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1,8 +1,10 @@
1
1
  export interface PHAsset {
2
2
  localIdentifier: string;
3
+ /** Milliseconds since 1970. */
3
4
  creationDate: number;
4
5
  mediaType: PHAssetMediaType;
5
6
  mediaSubtypes: PHAssetMediaSubtype;
7
+ /** Milliseconds. */
6
8
  duration: number;
7
9
  pixelWidth: number;
8
10
  pixelHeight: number;
@@ -119,7 +121,9 @@ export interface PHVideoRequestOptions {
119
121
  }
120
122
 
121
123
  export interface CMTimeRange {
124
+ /** Milliseconds. */
122
125
  start: number;
126
+ /** Milliseconds. */
123
127
  duration: number;
124
128
  }
125
129
 
@@ -194,6 +198,7 @@ export interface RequestImageOptions
194
198
  targetSize: RequestImageTargetSize;
195
199
  contentMode: PHImageContentMode;
196
200
  outputURL?: string;
201
+ /** Milliseconds until the request is cancelled. */
197
202
  timeout?: number;
198
203
  }
199
204
 
@@ -207,6 +212,7 @@ export interface RequestVideoOptions
207
212
  extends PHVideoRequestOptions, AVAssetExportSessionOptions {
208
213
  localIdentifier: string;
209
214
  exportPreset: AVAssetExportPreset;
215
+ /** Milliseconds until the request is cancelled. */
210
216
  timeout?: number;
211
217
  }
212
218
 
@@ -222,6 +228,7 @@ export interface PickAssetsOptions {
222
228
  }
223
229
 
224
230
  export interface PHVideoLoadEvent {
231
+ /** Milliseconds. */
225
232
  duration: number;
226
233
  naturalSize: { width: number; height: number };
227
234
  }
@@ -17,7 +17,8 @@ export declare class ExpoPhotosModule extends NativeModule {
17
17
  pickAssets(options: PickAssetsOptions): Promise<PHAsset[]>;
18
18
  authorizationStatus(accessLevel: PHAccessLevel): Promise<PHAuthorizationStatus>;
19
19
  requestAuthorization(accessLevel: PHAccessLevel): Promise<PHAuthorizationStatus>;
20
- presentLimitedLibraryPicker(): Promise<void>;
20
+ /** Resolves with newly selected local identifiers once the picker closes. */
21
+ presentLimitedLibraryPicker(): Promise<string[]>;
21
22
  }
22
23
 
23
24
  export default requireNativeModule<ExpoPhotosModule>("ExpoPhotos");