File tree Expand file tree Collapse file tree 4 files changed +194
-0
lines changed
Expand file tree Collapse file tree 4 files changed +194
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
3+ *
4+ * @flow strict-local
5+ * @format
6+ */
7+
8+ 'use strict' ;
9+
10+ import type { TurboModule } from '../TurboModule/RCTExport' ;
11+ import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry' ;
12+
13+ export type PhotoIdentifier = { |
14+ node : { |
15+ image : PhotoIdentifierImage ,
16+ type : string ,
17+ group_name : string ,
18+ timestamp : number ,
19+ location : { |
20+ longitude : number ,
21+ latitude : number ,
22+
23+ // iOS Only
24+ altitude : ?number ,
25+ heading : ?number ,
26+ speed : ?number ,
27+ | } ,
28+ | } ,
29+ | } ;
30+
31+ export type PhotoIdentifierImage = { |
32+ uri : string ,
33+ playableDuration : number ,
34+ width : number ,
35+ height : number ,
36+ isStored : ?boolean ,
37+ filename : ?string ,
38+ | } ;
39+
40+ export type PhotoIdentifiersPage = { |
41+ edges : Array < PhotoIdentifier > ,
42+ page_info : { |
43+ has_next_page : boolean ,
44+ start_cursor ?: ?string ,
45+ end_cursor ?: ?string ,
46+ | } ,
47+ | } ;
48+
49+ export type GetPhotosParams = { |
50+ first : number ,
51+ after ?: ?string ,
52+ groupName ?: ?string ,
53+ groupTypes ?: ?string ,
54+ assetType ?: ?string ,
55+ maxSize ?: ?number ,
56+ mimeTypes ?: ?Array < string > ,
57+ | } ;
58+
59+ export interface Spec extends TurboModule {
60+ + getConstants : ( ) = > { || } ;
61+ // eslint-disable-next-line lint/react-native-modules
62+ + getPhotos : ( params : GetPhotosParams ) = > Promise < PhotoIdentifiersPage > ;
63+ + saveToCameraRoll : ( uri : string , type : string ) = > Promise < string > ;
64+
65+ // iOS Only
66+ + deletePhotos : ( assets : Array < string > ) => Promise < boolean > ;
67+ }
68+
69+ export default ( TurboModuleRegistry . getEnforcing < Spec > (
70+ 'CameraRollManager' ,
71+ ) : Spec ) ;
Original file line number Diff line number Diff line change 1+ /**
2+ * (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
3+ *
4+ * @flow strict-local
5+ * @format
6+ */
7+
8+ 'use strict' ;
9+
10+ import type { TurboModule } from '../TurboModule/RCTExport' ;
11+ import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry' ;
12+
13+ type Options = { |
14+ + offset : { |
15+ + x : number ,
16+ + y : number ,
17+ | } ,
18+ + size : { |
19+ + width : number ,
20+ + height : number ,
21+ | } ,
22+ + displaySize ?: ?{ |
23+ + width : number ,
24+ + height : number ,
25+ | } ,
26+ /**
27+ * Enum with potential values:
28+ * - cover
29+ * - contain
30+ * - stretch
31+ * - center
32+ * - repeat
33+ */
34+ + resizeMode ?: ?string ,
35+ + allowExternalStorage ?: boolean ,
36+ | } ;
37+
38+ export interface Spec extends TurboModule {
39+ + getConstants : ( ) = > { || } ;
40+ + cropImage : (
41+ uri : string ,
42+ // eslint-disable-next-line lint/react-native-modules
43+ cropData : Options ,
44+ successCallback : ( uri : string ) = > void ,
45+ errorCallback : ( error : string ) = > void ,
46+ ) = > void ;
47+ }
48+
49+ export default ( TurboModuleRegistry . getEnforcing < Spec > (
50+ 'ImageEditingManager' ,
51+ ) : Spec ) ;
Original file line number Diff line number Diff line change 1+ /**
2+ * (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
3+ *
4+ * @flow strict-local
5+ * @format
6+ */
7+
8+ 'use strict' ;
9+
10+ import type { TurboModule } from '../TurboModule/RCTExport' ;
11+ import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry' ;
12+
13+ export interface Spec extends TurboModule {
14+ + getConstants : ( ) = > { || } ;
15+ // Common
16+ + getBase64ForTag : (
17+ uri : string ,
18+ successCallback : ( base64ImageData : string ) = > void ,
19+
20+ /**
21+ * On Android, the failure callback is called with a string.
22+ * On iOS, the failure callback is called with an error object.
23+ *
24+ * TODO(T47527939) Unify this inconsistency
25+ */
26+ errorCallback : ( error : { | message : string | } | string ) = > void ,
27+ ) = > void ;
28+
29+ // iOS-only
30+ + hasImageForTag : ( uri : string , callback : ( hasImage : boolean ) = > void ) => void ;
31+ + removeImageForTag : ( uri : string ) = > void ;
32+ + addImageFromBase64 : (
33+ base64ImageData : string ,
34+ successCallback : ( uri : string ) = > void ,
35+ errorCallback : ( error : { | message : string | } ) = > void ,
36+ ) = > void ;
37+ }
38+
39+ export default ( TurboModuleRegistry . getEnforcing < Spec > (
40+ 'ImageStoreManager' ,
41+ ) : Spec ) ;
Original file line number Diff line number Diff line change 1+ /**
2+ * (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
3+ *
4+ * @flow strict-local
5+ * @format
6+ */
7+
8+ 'use strict' ;
9+
10+ import type { TurboModule } from '../TurboModule/RCTExport' ;
11+ import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry' ;
12+
13+ export type TimePickerOptions = { |
14+ hour ? : number ,
15+ minute ? : number ,
16+ is24Hour ? : boolean ,
17+ mode ? : string ,
18+ | } ;
19+
20+ export type TimePickerResult = { |
21+ action : string ,
22+ hour : number ,
23+ minute : number ,
24+ | } ;
25+
26+ export interface Spec extends TurboModule {
27+ // eslint-disable-next-line lint/react-native-modules
28+ + open : ( options : TimePickerOptions ) = > Promise < TimePickerResult > ;
29+ }
30+
31+ export default ( TurboModuleRegistry . get < Spec > ( 'TimePickerAndroid' ) : ?Spec ) ;
You can’t perform that action at this time.
0 commit comments