NativeJSDevSupport.js 682 B

12345678910111213141516171819202122232425
  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. ERROR_CODE_EXCEPTION: number,
  16. ERROR_CODE_VIEW_NOT_FOUND: number,
  17. |};
  18. +onSuccess: (data: string) => void;
  19. +onFailure: (errorCode: number, error: string) => void;
  20. }
  21. export default (TurboModuleRegistry.get<Spec>('JSDevSupport'): ?Spec);