NativeImagePickerIOS.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @flow strict-local
  8. * @format
  9. */
  10. 'use strict';
  11. import type {TurboModule} from '../TurboModule/RCTExport';
  12. import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
  13. export interface Spec extends TurboModule {
  14. +getConstants: () => {||};
  15. +canRecordVideos: (callback: (result: boolean) => void) => void;
  16. +canUseCamera: (callback: (result: boolean) => void) => void;
  17. +openCameraDialog: (
  18. config: {|
  19. unmirrorFrontFacingCamera: boolean,
  20. videoMode: boolean,
  21. |},
  22. successCallback: (imageURL: string, height: number, width: number) => void,
  23. cancelCallback: () => void,
  24. ) => void;
  25. +openSelectDialog: (
  26. config: {|
  27. showImages: boolean,
  28. showVideos: boolean,
  29. |},
  30. successCallback: (imageURL: string, height: number, width: number) => void,
  31. cancelCallback: () => void,
  32. ) => void;
  33. +clearAllPendingVideos: () => void;
  34. +removePendingVideo: (url: string) => void;
  35. }
  36. export default (TurboModuleRegistry.get<Spec>('ImagePickerIOS'): ?Spec);