Skip to content

Commit 985a331

Browse files
authored
Fix comments in types.ts #340
2 parents 015f361 + c8b2b50 commit 985a331

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

src/types.ts

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ export interface Options {
108108
/** allows setting function to get/renew connection data (called upon reconnects).
109109
* In many cases you may prefer using setData method of Centrifuge Client instead. */
110110
getData: null | (() => Promise<any>);
111-
/** name of client - it's not a unique name of each connection, it's sth to identify
112-
* from where client connected */
111+
/** name of client - it's not a unique name for each connection, it's something to identify
112+
* where the client connected from */
113113
name: string;
114114
/** version of client */
115115
version: string;
@@ -134,9 +134,9 @@ export interface Options {
134134
sockjs: any | null;
135135
/** allows modifying options passed to SockJS constructor */
136136
sockjsOptions: SockjsOptions;
137-
/** which emulation endpoint to use */
137+
/** emulation endpoint to use */
138138
emulationEndpoint: string;
139-
/** EventTarget for network online/offline events, in browser environment
139+
/** EventTarget for network online/offline events. In a browser environment,
140140
* Centrifuge uses global window online/offline events automatically
141141
* by default. */
142142
networkEventTarget: EventTarget | null;
@@ -188,21 +188,21 @@ export interface PublicationContext {
188188
channel: string;
189189
// data contains publication payload.
190190
data: any;
191-
// info is an optional ClientInfo object. It's appended to publication only if publication was
192-
// sent using client SDK's publish method. If publication was sent over server publish API
193-
// this info object is missing as we don't have publisher client context in that case.
191+
// info is an optional ClientInfo object. It's appended to a publication only if the publication was
192+
// sent using the client SDK's publish method. If the publication was sent over the server publish API,
193+
// this info object is missing as we don't have the publisher client context in that case.
194194
info?: ClientInfo;
195-
// offset may be set for channels where history Centrifugo feature is on. In this case it's an
196-
// incremental number assigned to publication by server broker (upon adding to history stream).
195+
// offset may be set for channels where the history Centrifugo feature is enabled. In this case, it's an
196+
// incremental number assigned to the publication by the server broker (upon adding to the history stream).
197197
offset?: number;
198-
// tags is an extra key-value attached to publication, tags may be set when calling server publish API.
198+
// tags is an extra key-value map attached to a publication. Tags may be set when calling the server publish API.
199199
tags?: Record<string, string>;
200200
}
201201

202202
export interface ClientInfo {
203-
// client is a globally unique identifier which server allocates for every connection.
203+
// client is a globally unique identifier that the server allocates for every connection.
204204
client: string;
205-
// user contains ID of authenticated user. Empty user means anonymous user. One user can have
205+
// user contains the ID of the authenticated user. An empty user means an anonymous user. One user can have
206206
// many client connections.
207207
user: string;
208208
// connInfo is optional information attached to connection (during connection authentication).
@@ -234,15 +234,15 @@ export interface ServerSubscribedContext {
234234
recoverable: boolean;
235235
/** subscription is positioned – i.e. server tracks message loss on the way from PUB/SUB broker */
236236
positioned: boolean;
237-
/** streamPosition set when Subscription is recoverable or positioned. */
237+
/** streamPosition is set when Subscription is recoverable or positioned. */
238238
streamPosition?: StreamPosition;
239-
/** wasRecovering is true when recovery was used in subscribe request. */
239+
/** wasRecovering is true when recovery was used in the subscribe request. */
240240
wasRecovering: boolean;
241-
/** whether or not missed publications may be successfully recovered. */
241+
/** whether or not missed publications were successfully recovered. */
242242
recovered: boolean;
243-
/** whether or not successfully recovered subscription has received missed publications.
243+
/** whether or not a successfully recovered subscription has received missed publications.
244244
Warning: must be used for metrics/logs purposes only.
245-
Recovered publications are processed after 'subscribed' event. **/
245+
Recovered publications are processed after the 'subscribed' event. **/
246246
hasRecoveredPublications: boolean;
247247
/** custom data for Subscription returned from server. */
248248
data?: any;
@@ -257,13 +257,13 @@ export interface SubscribedContext {
257257
positioned: boolean;
258258
/** streamPosition is set when Subscription is recoverable or positioned. */
259259
streamPosition?: StreamPosition;
260-
/** wasRecovering is true when recovery was used in subscribe request. */
260+
/** wasRecovering is true when recovery was used in the subscribe request. */
261261
wasRecovering: boolean;
262-
/** whether or not missed publications may be successfully recovered. */
262+
/** whether or not missed publications were successfully recovered. */
263263
recovered: boolean;
264-
/** whether or not successfully recovered subscription has received missed publications.
264+
/** whether or not a successfully recovered subscription has received missed publications.
265265
Warning: must be used for metrics/logs purposes only.
266-
Recovered publications are processed after 'subscribed' event. **/
266+
Recovered publications are processed after the 'subscribed' event. **/
267267
hasRecoveredPublications: boolean;
268268
/** custom data for Subscription returned from server. */
269269
data?: any;
@@ -286,14 +286,14 @@ export interface ServerPublicationContext {
286286
channel: string;
287287
// data contains publication payload.
288288
data: any;
289-
// info is an optional ClientInfo object. It's appended to publication only if publication was
290-
// sent using client SDK's publish method. If publication was sent over server publish API
291-
// this info object is missing as we don't have publisher client context in that case.
289+
// info is an optional ClientInfo object. It's appended to a publication only if the publication was
290+
// sent using the client SDK's publish method. If the publication was sent over the server publish API,
291+
// this info object is missing as we don't have the publisher client context in that case.
292292
info?: ClientInfo;
293-
// offset may be set for channels where history Centrifugo feature is on. In this case it's an
294-
// incremental number assigned to publication by server broker (upon adding to history stream).
293+
// offset may be set for channels where the history Centrifugo feature is enabled. In this case, it's an
294+
// incremental number assigned to the publication by the server broker (upon adding to the history stream).
295295
offset?: number;
296-
// tags is an extra key-value attached to publication, tags may be set when calling server publish API.
296+
// tags is an extra key-value map attached to a publication. Tags may be set when calling the server publish API.
297297
tags?: Record<string, string>;
298298
}
299299

@@ -482,13 +482,13 @@ export interface SubscriptionOptions {
482482
recoverable: boolean;
483483
/** ask server to send join/leave messages. */
484484
joinLeave: boolean;
485-
/** delta format to be used. Delta usage must be allowed on server-side. */
485+
/** delta format to be used. Delta usage must be allowed on the server side. */
486486
delta: 'fossil';
487-
/** server-side tagsFilter to apply for publications in channel. Tags filter support must be allowed on server-side. */
487+
/** server-side tagsFilter to apply for publications in channel. Tags filter support must be allowed on the server side. */
488488
tagsFilter: FilterNode | null;
489489
}
490490

491-
/** Stream postion describes position of publication inside a stream. */
491+
/** Stream position describes the position of a publication inside a stream. */
492492
export interface StreamPosition {
493493
offset: number;
494494
epoch: string;

0 commit comments

Comments
 (0)