microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
1.8.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/extension/networkInspector/networkMessageData.ts

81lines · modeblame

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