Skip to content

Commit

Permalink
Merge pull request deepstreamIO#338 from benjaminVadon/Typescript-Add…
Browse files Browse the repository at this point in the history
…-presence

Add presence to d.ts
  • Loading branch information
yasserf authored Feb 25, 2017
2 parents 666e4a1 + 8568742 commit 1c0fb91
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@ declare namespace deepstreamIO {
make(name: string, data: any, callback: Function): void;
}

interface Presence {
/**Subscribes to presence events. Callback will receive the username of the newly added client*/
subscribe(callback: Function): void;
/**Removes a previously registered presence callback*/
unsubscribe(callback: Function): void;
/**Queries for currently connected clients*/
getAll(callback: Function): void;
}

interface EventEmitter {
/**Subscribe to an event. */
on(type: string, callback: Function): void;
Expand Down Expand Up @@ -271,6 +280,8 @@ declare namespace deepstreamIO {
record: RecordStatic;

event: EventStatic;

presence: Presence;

rpc: RPCStatic;
}
Expand All @@ -291,4 +302,4 @@ declare namespace deepstreamIO {
declare module 'deepstream.io-client-js' {
var deepstream: deepstreamIO.deepstreamStatic;
export = deepstream;
}
}

0 comments on commit 1c0fb91

Please sign in to comment.