NativeActionSheetManager.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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
  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. +showActionSheetWithOptions: (
  16. options: {|
  17. +title?: ?string,
  18. +message?: ?string,
  19. +options: ?Array<string>,
  20. +destructiveButtonIndices?: ?Array<number>,
  21. +cancelButtonIndex?: ?number,
  22. +anchor?: ?number,
  23. +tintColor?: ?number,
  24. +userInterfaceStyle?: ?string,
  25. |},
  26. callback: (buttonIndex: number) => void,
  27. ) => void;
  28. +showShareActionSheetWithOptions: (
  29. options: {|
  30. +message?: ?string,
  31. +url?: ?string,
  32. +subject?: ?string,
  33. +anchor?: ?number,
  34. +tintColor?: ?number,
  35. +excludedActivityTypes?: ?Array<string>,
  36. +userInterfaceStyle?: ?string,
  37. |},
  38. failureCallback: (error: {|
  39. +domain: string,
  40. +code: string,
  41. +userInfo?: ?Object,
  42. +message: string,
  43. |}) => void,
  44. successCallback: (completed: boolean, activityType: ?string) => void,
  45. ) => void;
  46. }
  47. export default (TurboModuleRegistry.get<Spec>('ActionSheetManager'): ?Spec);