@pluv/client 0.11.1 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +254 -0
- package/dist/index.d.mts +31 -8
- package/dist/index.d.ts +31 -8
- package/dist/index.js +150 -36
- package/dist/index.mjs +150 -36
- package/package.json +7 -7
- package/src/AbstractRoom.ts +29 -10
- package/src/AbstractStorageStore.ts +0 -2
- package/src/CrdtManager.ts +33 -10
- package/src/CrdtNotifier.ts +14 -2
- package/src/EventNotifier.ts +3 -3
- package/src/MockedRoom.ts +85 -22
- package/src/OtherNotifier.ts +3 -3
- package/src/PluvClient.ts +6 -6
- package/src/PluvRoom.ts +121 -26
- package/src/StateNotifier.ts +6 -6
- package/src/UsersManager.ts +4 -4
- package/src/createClient.ts +1 -1
- package/src/index.ts +4 -1
- package/src/types.ts +1 -1
package/src/UsersManager.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type UsersManagerConfig<TPresence extends JsonObject = {}> = {
|
|
|
17
17
|
|
|
18
18
|
export class UsersManager<
|
|
19
19
|
TIO extends IOLike,
|
|
20
|
-
TPresence extends JsonObject = {}
|
|
20
|
+
TPresence extends JsonObject = {},
|
|
21
21
|
> {
|
|
22
22
|
private _initialPresence: TPresence;
|
|
23
23
|
/**
|
|
@@ -62,7 +62,7 @@ export class UsersManager<
|
|
|
62
62
|
|
|
63
63
|
public patchPresence(
|
|
64
64
|
connectionId: string,
|
|
65
|
-
patch: Partial<TPresence
|
|
65
|
+
patch: Partial<TPresence>,
|
|
66
66
|
): void {
|
|
67
67
|
if (this._myself?.connectionId === connectionId) {
|
|
68
68
|
const presence = {
|
|
@@ -100,7 +100,7 @@ export class UsersManager<
|
|
|
100
100
|
|
|
101
101
|
public setMyself(
|
|
102
102
|
connectionId: string,
|
|
103
|
-
user: Id<InferIOAuthorizeUser<InferIOAuthorize<TIO
|
|
103
|
+
user: Id<InferIOAuthorizeUser<InferIOAuthorize<TIO>>>,
|
|
104
104
|
): void {
|
|
105
105
|
this._myself = {
|
|
106
106
|
connectionId,
|
|
@@ -129,7 +129,7 @@ export class UsersManager<
|
|
|
129
129
|
public setUser(
|
|
130
130
|
connectionId: string,
|
|
131
131
|
user: Id<InferIOAuthorizeUser<InferIOAuthorize<TIO>>>,
|
|
132
|
-
presence?: TPresence
|
|
132
|
+
presence?: TPresence,
|
|
133
133
|
): void {
|
|
134
134
|
if (this._myself?.connectionId === connectionId) return;
|
|
135
135
|
|
package/src/createClient.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { PluvClientOptions } from "./PluvClient";
|
|
|
3
3
|
import { PluvClient } from "./PluvClient";
|
|
4
4
|
|
|
5
5
|
export const createClient = <TIO extends IOLike = IOLike>(
|
|
6
|
-
options: PluvClientOptions<TIO
|
|
6
|
+
options: PluvClientOptions<TIO>,
|
|
7
7
|
): PluvClient<TIO> => {
|
|
8
8
|
return new PluvClient<TIO>(options);
|
|
9
9
|
};
|
package/src/index.ts
CHANGED
package/src/types.ts
CHANGED