UNPKG

828 BTypeScriptView Raw
1import { CancellablePromise } from '@theintern/common';
2import { RemoteEvents } from '../RemoteSuite';
3export default abstract class BaseChannel {
4 readonly url: string;
5 readonly sessionId: string;
6 constructor(options: ChannelOptions);
7 sendMessage(name: keyof RemoteEvents, data: any): CancellablePromise<any>;
8 protected abstract _sendData(name: keyof RemoteEvents, data: any): CancellablePromise<any>;
9}
10export interface ChannelOptions {
11 sessionId: string;
12 url: string;
13 port?: number;
14 timeout?: number;
15}
16export declare function isChannel(value: any): value is BaseChannel;
17export interface ChannelOptions {
18 sessionId: string;
19 url: string;
20 port?: number;
21 timeout?: number;
22}
23export interface Message {
24 sessionId: string;
25 id: string;
26 name: string;
27 data: any;
28}