Skip to content

Commit 497ca66

Browse files
leethreejanicduplessis
authored andcommitted
Fix Flow type for optional parameter (react-native-image-picker#679)
Per documentation: > The first arg is the options object for customization (it can also be null or omitted for default options) Therefore the first parameter should be allow to be null or omitted in type definition. Also it's not necessary to specify `callback` return type as `void`.
1 parent 862a6c8 commit 497ca66

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

index.js.flow

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ export type StorageOptions = {
5050
waitUntilSaved?: boolean;
5151
}
5252

53-
declare export function showImagePicker(options: Options, callback: (response: Response) => void): void;
54-
declare export function launchCamera(options: Options, callback: (response: Response) => void): void;
55-
declare export function launchImageLibrary(options: Options, callback: (response: Response) => void): void;
53+
declare export function showImagePicker(options: ?Options, callback: (response: Response) => any): void;
54+
declare export function showImagePicker(callback: (response: Response) => any): void;
5655

56+
declare export function launchCamera(options: ?Options, callback: (response: Response) => any): void;
57+
declare export function launchCamera(callback: (response: Response) => any): void;
58+
59+
declare export function launchImageLibrary(options: ?Options, callback: (response: Response) => any): void;
60+
declare export function launchImageLibrary(callback: (response: Response) => any): void;

0 commit comments

Comments
 (0)