1 // Copyright 2022-present 650 Industries. All rights reserved.
2 
3 // swiftlint:disable redundant_optional_initialization
4 // Unfortunately, property wrappers must be initialized in those records, otherwise the memberwise initializer
5 // would require `Field<FieldType?>` as an argument instead of `FieldType?`.
6 // TODO: (@tsapeta) Figure out if we can fix that
7 
8 import ABI49_0_0ExpoModulesCore
9 
10 internal typealias ImagePickerResult = Result<ImagePickerResponse, Exception>
11 
12 internal typealias SelectedMediaResult = Result<AssetInfo, Exception>
13 
14 /**
15  Convenience alias, a dictionary representing ABI49_0_0EXIF data
16  */
17 internal typealias ExifInfo = [String: Any]
18 
19 /**
20  Represents a picker response.
21  */
22 internal struct ImagePickerResponse: Record {
23   @Field var assets: [AssetInfo]? = nil
24   @Field var canceled: Bool = true
25 }
26 
27 /**
28  Represents a single asset (image or video).
29  */
30 internal struct AssetInfo: Record {
31   @Field var assetId: String? = nil
32   @Field var type: String = "image"
33   @Field var uri: String = ""
34   @Field var width: Double = 0
35   @Field var height: Double = 0
36   @Field var fileName: String? = nil
37   @Field var fileSize: Int? = nil
38   @Field var base64: String? = nil
39   @Field var exif: ExifInfo? = nil
40   @Field var duration: Double? = nil
41 }
42