NativeNetworkingIOS.js 1007 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. +sendRequest: (
  15. query: {|
  16. method: string,
  17. url: string,
  18. data: Object,
  19. headers: Object,
  20. responseType: string,
  21. incrementalUpdates: boolean,
  22. timeout: number,
  23. withCredentials: boolean,
  24. |},
  25. callback: (requestId: number) => void,
  26. ) => void;
  27. +abortRequest: (requestId: number) => void;
  28. +clearCookies: (callback: (result: boolean) => void) => void;
  29. // RCTEventEmitter
  30. +addListener: (eventName: string) => void;
  31. +removeListeners: (count: number) => void;
  32. }
  33. export default (TurboModuleRegistry.getEnforcing<Spec>('Networking'): Spec);