1 | import { EventEmitter } from 'events';
|
2 |
|
3 | import { Connection } from './connection';
|
4 | import { Record } from './record';
|
5 | import { Channel } from './channel';
|
6 | import { Topic } from './topic';
|
7 |
|
8 | export interface StreamingMessage {
|
9 | event: {
|
10 | type: string;
|
11 | createdDate: string;
|
12 | replayId?: number | undefined;
|
13 | };
|
14 | sobject: Record;
|
15 | }
|
16 |
|
17 | export class Streaming extends EventEmitter {
|
18 | constructor(connection: Connection);
|
19 |
|
20 | channel(channelId: string): Channel;
|
21 | subscribe(name: string, listener: StreamingMessage): any; // Faye Subscription
|
22 | topic(name: string): Topic;
|
23 | unsubscribe(name: string, listener: StreamingMessage): Streaming;
|
24 | createClient(extensions?: Array<any>): any; // Faye Client
|
25 | }
|
26 |
|
27 | export namespace StreamingExtension {
|
28 | export class Replay {
|
29 | constructor(channel: string, replayId: number);
|
30 | }
|
31 | export class AuthFailure {
|
32 | constructor(failureCallback: () => any);
|
33 | }
|
34 | }
|