UNPKG

2.67 kBTypeScriptView Raw
1export declare namespace domains {
2 namespace network {
3 interface NetworkDomainDebugger {
4 create(): domains.network.NetworkRequest;
5 }
6 interface Headers {
7 }
8 interface Request {
9 url: string;
10 method: string;
11 headers: domains.network.Headers;
12 postData?: string;
13 }
14 interface Response {
15 url: string;
16 status: number;
17 statusText: string;
18 headers: Headers;
19 headersText?: string;
20 mimeType: string;
21 requestHeaders?: domains.network.Headers;
22 requestHeadersText?: string;
23 fromDiskCache?: boolean;
24 }
25 interface NetworkRequest {
26 mimeType: string;
27 data: any;
28 responseReceived(response: domains.network.Response): any;
29 loadingFinished(): any;
30 requestWillBeSent(request: domains.network.Request): any;
31 }
32 }
33}
34export declare function getNetwork(): domains.network.NetworkDomainDebugger;
35export declare function setNetwork(newNetwork: domains.network.NetworkDomainDebugger): void;
36export declare function getDOM(): any;
37export declare function setDOM(newDOM: any): void;
38export declare function getCSS(): any;
39export declare function setCSS(newCSS: any): void;
40export declare namespace NetworkAgent {
41 interface Request {
42 url: string;
43 method: string;
44 headers: any;
45 initialPriority: string;
46 referrerPolicy: string;
47 postData?: string;
48 }
49 interface RequestData {
50 requestId: string;
51 url: string;
52 request: Request;
53 timestamp: number;
54 type: string;
55 wallTime: number;
56 }
57 interface Response {
58 url: string;
59 status: number;
60 statusText: string;
61 headers: any;
62 headersText?: string;
63 mimeType: string;
64 connectionReused: boolean;
65 connectionId: number;
66 encodedDataLength: number;
67 securityState: string;
68 fromDiskCache?: boolean;
69 }
70 interface ResponseData {
71 requestId: string;
72 type: string;
73 response: Response;
74 timestamp: number;
75 }
76 interface SuccessfulRequestData {
77 requestId: string;
78 data: string;
79 hasTextContent: boolean;
80 }
81 interface LoadingFinishedData {
82 requestId: string;
83 timestamp: number;
84 }
85 function responseReceived(requestId: number, result: org.nativescript.widgets.Async.Http.RequestResult, headers: any): void;
86 function requestWillBeSent(requestId: number, options: any): void;
87}