45 lines
1.2 KiB
Plaintext
45 lines
1.2 KiB
Plaintext
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow strict-local
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import type {EventSubscription} from '../vendor/emitter/EventEmitter';
|
|
import type {RequestBody} from './convertRequestBody';
|
|
import type {RCTNetworkingEventDefinitions} from './RCTNetworkingEventDefinitions.flow';
|
|
import type {NativeResponseType} from './XMLHttpRequest';
|
|
|
|
declare const RCTNetworking: interface {
|
|
addListener<K: $Keys<RCTNetworkingEventDefinitions>>(
|
|
eventType: K,
|
|
// $FlowFixMe[invalid-computed-prop]
|
|
listener: (...RCTNetworkingEventDefinitions[K]) => mixed,
|
|
context?: mixed,
|
|
): EventSubscription,
|
|
|
|
sendRequest(
|
|
method: string,
|
|
trackingName: string | void,
|
|
url: string,
|
|
headers: {...},
|
|
data: RequestBody,
|
|
responseType: NativeResponseType,
|
|
incrementalUpdates: boolean,
|
|
timeout: number,
|
|
callback: (requestId: number) => void,
|
|
withCredentials: boolean,
|
|
): void,
|
|
|
|
abortRequest(requestId: number): void,
|
|
|
|
clearCookies(callback: (result: boolean) => void): void,
|
|
};
|
|
|
|
export default RCTNetworking;
|