1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export var EventType: {COMPLETE: string;};
|
14 |
|
15 | export namespace WebChannel {
|
16 | export var EventType:
|
17 | {OPEN: string; CLOSE: string; ERROR: string; MESSAGE: string;};
|
18 | }
|
19 |
|
20 | export var Event: {STAT_EVENT: string;};
|
21 |
|
22 | export var Stat: {PROXY: number; NOPROXY: number;};
|
23 |
|
24 | export var ErrorCode: {NO_ERROR: number; HTTP_ERROR: number; TIMEOUT: number;};
|
25 |
|
26 | export interface Headers {
|
27 | [name: string]: string|number;
|
28 | }
|
29 |
|
30 | export interface WebChannelError {
|
31 | error?: {status: string; message: string};
|
32 | }
|
33 |
|
34 | export class XhrIo {
|
35 | send(
|
36 | url: string, method?: string, body?: string, headers?: Headers,
|
37 | timeoutInterval?: number): void;
|
38 | getLastErrorCode(): number;
|
39 | getLastError(): string;
|
40 | getStatus(): number;
|
41 | getResponseText(): string;
|
42 | getResponseJson(): WebChannelError|object;
|
43 | listenOnce(type: string, cb: (param: unknown) => void): void;
|
44 | setWithCredentials(withCredentials: boolean): void;
|
45 | }
|
46 |
|
47 | export interface WebChannelOptions {
|
48 | messageHeaders?: {
|
49 |
|
50 |
|
51 | [k: string]: never;
|
52 | };
|
53 | initMessageHeaders?: {
|
54 |
|
55 |
|
56 | [k: string]: never;
|
57 | };
|
58 | messageContentType?: string;
|
59 | messageUrlParams?: {database?: string;};
|
60 | clientProtocolHeaderRequired?: boolean;
|
61 | concurrentRequestLimit?: number;
|
62 | supportsCrossDomainXhr?: boolean;
|
63 | sendRawJson?: boolean;
|
64 | httpSessionIdParam?: string;
|
65 | encodeInitMessageHeaders?: boolean;
|
66 | forceLongPolling?: boolean;
|
67 | detectBufferingProxy?: boolean;
|
68 | longPollingTimeout?: number;
|
69 | fastHandshake?: boolean;
|
70 | disableRedac?: boolean;
|
71 | clientProfile?: string;
|
72 | internalChannelParams?: {forwardChannelRequestTimeoutMs?: number;};
|
73 | useFetchStreams?: boolean;
|
74 | xmlHttpFactory?: unknown;
|
75 | requestRefreshThresholds?: {[key: string]: number};
|
76 | }
|
77 |
|
78 | export interface EventTarget {
|
79 | listen(type: string|number, cb: (param: unknown) => void): void;
|
80 | }
|
81 |
|
82 | export interface WebChannel extends EventTarget {
|
83 | open(): void;
|
84 | close(): void;
|
85 | send(msg: unknown): void;
|
86 | }
|
87 |
|
88 | export interface StatEvent {
|
89 | stat: number;
|
90 | }
|
91 |
|
92 | export interface WebChannelTransport {
|
93 | createWebChannel(url: string, options: WebChannelOptions): WebChannel;
|
94 | }
|
95 |
|
96 | export function createWebChannelTransport(): WebChannelTransport;
|
97 |
|
98 | export function getStatEventTarget(): EventTarget;
|
99 |
|
100 | export class FetchXmlHttpFactory {
|
101 | constructor(options: {});
|
102 | }
|