UNPKG

861 BTypeScriptView Raw
1import { CancellablePromise } from '@theintern/common';
2import { RemoteEvents } from '../RemoteSuite';
3import BaseChannel, { ChannelOptions } from './Base';
4export 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}
14export interface HttpChannelOptions extends ChannelOptions {
15 maxPostSize?: number;
16}
17export interface MessageEntry {
18 message: string;
19 resolve: (value: any) => void;
20 reject: (error: Error) => void;
21}