microsoft/vscode-react-native
Publicmirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable
src/extension/networkInspector/networkMessageData.ts
84lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. |
| 3 | |
| 4 | /* eslint-disable */ |
| 5 | /* eslint-enable prettier/prettier*/ |
| 6 | |
| 7 | /** |
| 8 | * @preserve |
| 9 | * Start region: the code is borrowed from https://github.com/facebook/flipper/blob/v0.79.1/desktop/plugins/network/types.tsx |
| 10 | * |
| 11 | * Copyright (c) Facebook, Inc. and its affiliates. |
| 12 | * |
| 13 | * This source code is licensed under the MIT license found in the |
| 14 | * LICENSE file in the root directory of this source tree. |
| 15 | * |
| 16 | * @format |
| 17 | */ |
| 18 | |
| 19 | export type ResponseFollowupChunk = { |
| 20 | id: string; |
| 21 | totalChunks: number; |
| 22 | index: number; |
| 23 | data: string; |
| 24 | }; |
| 25 | |
| 26 | export type RequestId = string; |
| 27 | |
| 28 | export type Header = { |
| 29 | key: string; |
| 30 | value: string; |
| 31 | }; |
| 32 | |
| 33 | export type Insights = { |
| 34 | dnsLookupTime: number | null | undefined; |
| 35 | connectTime: number | null | undefined; |
| 36 | sslHandshakeTime: number | null | undefined; |
| 37 | preTransferTime: number | null | undefined; |
| 38 | redirectsTime: number | null | undefined; |
| 39 | timeToFirstByte: number | null | undefined; |
| 40 | transferTime: number | null | undefined; |
| 41 | postProcessingTime: number | null | undefined; |
| 42 | // Amount of transferred data can be different from total size of payload. |
| 43 | bytesTransfered: number | null | undefined; |
| 44 | transferSpeed: number | null | undefined; |
| 45 | retries: RetryInsights | null | undefined; |
| 46 | }; |
| 47 | |
| 48 | export type RetryInsights = { |
| 49 | count: number; |
| 50 | limit: number; |
| 51 | timeSpent: number; |
| 52 | }; |
| 53 | |
| 54 | export type Request = { |
| 55 | id: RequestId; |
| 56 | timestamp: number; |
| 57 | method: string; |
| 58 | url: string; |
| 59 | headers: Array<Header>; |
| 60 | data?: string | null; |
| 61 | }; |
| 62 | |
| 63 | export type Response = { |
| 64 | id: RequestId; |
| 65 | timestamp: number; |
| 66 | status: number; |
| 67 | reason: string; |
| 68 | headers: Array<Header>; |
| 69 | data?: string | null; |
| 70 | isMock: boolean; |
| 71 | insights?: Insights | null; |
| 72 | totalChunks?: number; |
| 73 | index?: number; |
| 74 | }; |
| 75 | |
| 76 | export type PartialResponse = { |
| 77 | initialResponse?: Response; |
| 78 | followupChunks: { [id: number]: string }; |
| 79 | }; |
| 80 | |
| 81 | /** |
| 82 | * @preserve |
| 83 | * End region: https://github.com/facebook/flipper/blob/v0.79.1/desktop/plugins/network/types.tsx |
| 84 | */ |
| 85 | |