Skip to content

Commit 3723ab9

Browse files
committed
[types] Switch send and receive
1 parent 96b02df commit 3723ab9

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

src/@types/synchronizers/docs.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,22 @@
7171
*/
7272
/// Message.GetValueDiff
7373
}
74+
/**
75+
* The Send type describes a function that knows how to dispatch a message as
76+
* part of the synchronization protocol.
77+
* @param toClientId The optional Id of the other client (in other words, the
78+
* other system) to which the message should be sent. If omitted, this is to be
79+
* a broadcast.
80+
* @param requestId The optional Id of the message, which should be awaited in
81+
* the response (if requested) to constitute a matched request/response
82+
* transaction.
83+
* @param message A number that indicates the type of the message, according to
84+
* the Message enum.
85+
* @param body A message-specific payload.
86+
* @category Synchronization
87+
* @since v5.0.0
88+
*/
89+
/// Send
7490
/**
7591
* The Receive type describes a function that knows how to handle the arrival of
7692
* a message as part of the synchronization protocol.
@@ -90,22 +106,6 @@
90106
* @since v5.0.0
91107
*/
92108
/// Receive
93-
/**
94-
* The Send type describes a function that knows how to dispatch a message as
95-
* part of the synchronization protocol.
96-
* @param toClientId The optional Id of the other client (in other words, the
97-
* other system) to which the message should be sent. If omitted, this is to be
98-
* a broadcast.
99-
* @param requestId The optional Id of the message, which should be awaited in
100-
* the response (if requested) to constitute a matched request/response
101-
* transaction.
102-
* @param message A number that indicates the type of the message, according to
103-
* the Message enum.
104-
* @param body A message-specific payload.
105-
* @category Synchronization
106-
* @since v5.0.0
107-
*/
108-
/// Send
109109
/**
110110
* The SynchronizerStats type describes the number of times a Synchronizer
111111
* object has sent or received data.

src/@types/synchronizers/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ export const enum Message {
2525
GetValueDiff = 7,
2626
}
2727

28-
/// Receive
29-
export type Receive = (
30-
fromClientId: Id,
28+
/// Send
29+
export type Send = (
30+
toClientId: IdOrNull,
3131
requestId: IdOrNull,
3232
message: Message,
3333
body: any,
3434
) => void;
3535

36-
/// Send
37-
export type Send = (
38-
toClientId: IdOrNull,
36+
/// Receive
37+
export type Receive = (
38+
fromClientId: Id,
3939
requestId: IdOrNull,
4040
message: Message,
4141
body: any,

src/@types/synchronizers/with-schemas/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ export const enum Message {
3131
GetValueDiff = 7,
3232
}
3333

34-
/// Receive
35-
export type Receive = (
36-
fromClientId: Id,
34+
/// Send
35+
export type Send = (
36+
toClientId: IdOrNull,
3737
requestId: Id,
3838
message: Message,
3939
body: any,
4040
) => void;
4141

42-
/// Send
43-
export type Send = (
44-
toClientId: IdOrNull,
42+
/// Receive
43+
export type Receive = (
44+
fromClientId: Id,
4545
requestId: Id,
4646
message: Message,
4747
body: any,

0 commit comments

Comments
 (0)