@syncot/presence
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -12,5 +12,5 @@ import { EmitterInterface, SyncOtEmitter, Validator } from '@syncot/util'; | ||
export interface PresenceClientEvents { | ||
localPresence: void; | ||
online: void; | ||
offline: void; | ||
presence: void; | ||
active: void; | ||
inactive: void; | ||
error: Error; | ||
@@ -26,5 +26,5 @@ } | ||
* | ||
* @event localPresence When the local presence has changed. | ||
* @event online The PresenceClient has connected to PresenceService. | ||
* @event offline The PresenceClient has disconnected from PresenceService. | ||
* @event presence When the local presence has changed. | ||
* @event active The PresenceClient starts to synchronize presence with the PresenceService. | ||
* @event inactive The PresenceClient stops to synchronize presence with the PresenceService. | ||
* @event error A presence-related error has occurred. | ||
@@ -34,8 +34,30 @@ * @event destroy The PresenceClient has been destroyed. | ||
export interface PresenceClient extends EmitterInterface<SyncOtEmitter<PresenceClientEvents>> { | ||
/** | ||
* The read-only local presence `sessionId`. | ||
* It is `undefined` if, and only if, `active` is `false`. | ||
*/ | ||
readonly sessionId: string | undefined; | ||
/** | ||
* The read-only local presence `userId`. | ||
* It is `undefined` if, and only if, `active` is `false`. | ||
*/ | ||
readonly userId: string | undefined; | ||
/** | ||
* The read-write local presence `locationId`. | ||
*/ | ||
locationId: string | undefined; | ||
/** | ||
* The read-write local presence `data`. | ||
*/ | ||
data: any; | ||
readonly localPresence: Presence | undefined; | ||
readonly online: boolean; | ||
/** | ||
* The read-only local presence. | ||
* It is `undefined` if, and only if, | ||
* either `sessionId`, `userId` or `locationId` is `undefined`. | ||
*/ | ||
readonly presence: Presence | undefined; | ||
/** | ||
* If `true`, `presence` is synchronized with the PresenceService, otherwise `false`. | ||
*/ | ||
readonly active: boolean; | ||
getPresenceBySessionId(sessionId: string): Promise<Presence | null>; | ||
@@ -42,0 +64,0 @@ getPresenceByUserId(userId: string): Promise<Presence[]>; |
{ | ||
"name": "@syncot/presence", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "Interfaces and type definitions related to global presence management.", | ||
@@ -31,3 +31,3 @@ "keywords": [ | ||
"@syncot/error": "^0.0.6", | ||
"@syncot/util": "^0.0.7", | ||
"@syncot/util": "^0.0.8", | ||
"@types/readable-stream": "^2.3.1", | ||
@@ -37,3 +37,3 @@ "readable-stream": "^3.3.0", | ||
}, | ||
"gitHead": "f42e7403c10d1236587af99fc13d35b2a27a55ad" | ||
"gitHead": "888dd1570ed3023173b3b5bbafad0f29271b246f" | ||
} |
7020
129
+ Added@syncot/util@0.0.8(transitive)
+ Added@types/node@12.20.55(transitive)
- Removed@syncot/util@0.0.7(transitive)
- Removed@types/node@10.17.60(transitive)
Updated@syncot/util@^0.0.8