1 | import { CancellablePromise } from '@theintern/common';
|
2 | import { RemoteEvents } from '../RemoteSuite';
|
3 | import BaseChannel, { ChannelOptions } from './Base';
|
4 | export default class HttpChannel extends BaseChannel {
|
5 | protected _lastRequest: CancellablePromise<void>;
|
6 | protected _messageBuffer: MessageEntry[];
|
7 | protected _sequence: number;
|
8 | protected _maxPostSize: number;
|
9 | protected _activeRequest: CancellablePromise<any> | undefined;
|
10 | constructor(options: HttpChannelOptions);
|
11 | protected _sendData(name: keyof RemoteEvents, data: any): CancellablePromise;
|
12 | protected _sendMessages(): CancellablePromise<any> | undefined;
|
13 | }
|
14 | export interface HttpChannelOptions extends ChannelOptions {
|
15 | maxPostSize?: number;
|
16 | }
|
17 | export interface MessageEntry {
|
18 | message: string;
|
19 | resolve: (value: any) => void;
|
20 | reject: (error: Error) => void;
|
21 | }
|