@pluv/client 0.17.2 → 0.18.0
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 +159 -0
- package/README.md +2 -5
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +59 -129
- package/dist/index.mjs +59 -129
- package/package.json +5 -5
- package/src/AbstractRoom.ts +8 -33
- package/src/CrdtManager.ts +9 -33
- package/src/CrdtNotifier.ts +5 -11
- package/src/EventNotifier.ts +5 -11
- package/src/MockedRoom.ts +14 -57
- package/src/PluvClient.ts +4 -17
- package/src/PluvRoom.ts +87 -203
- package/src/StateNotifier.ts +4 -17
- package/src/UsersManager.ts +4 -20
- package/src/createClient.ts +1 -3
- package/src/index.ts +2 -12
- package/src/types.ts +2 -11
package/src/createClient.ts
CHANGED
|
@@ -2,8 +2,6 @@ import type { IOLike } from "@pluv/types";
|
|
|
2
2
|
import type { PluvClientOptions } from "./PluvClient";
|
|
3
3
|
import { PluvClient } from "./PluvClient";
|
|
4
4
|
|
|
5
|
-
export const createClient = <TIO extends IOLike = IOLike>(
|
|
6
|
-
options: PluvClientOptions<TIO>,
|
|
7
|
-
): PluvClient<TIO> => {
|
|
5
|
+
export const createClient = <TIO extends IOLike = IOLike>(options: PluvClientOptions<TIO>): PluvClient<TIO> => {
|
|
8
6
|
return new PluvClient<TIO>(options);
|
|
9
7
|
};
|
package/src/index.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
export type { AbstractCrdtType, InferCrdtStorageJson } from "@pluv/crdt";
|
|
2
|
-
export type {
|
|
3
|
-
BaseUser,
|
|
4
|
-
EventMessage,
|
|
5
|
-
EventRecord,
|
|
6
|
-
IOEventMessage,
|
|
7
|
-
} from "@pluv/types";
|
|
2
|
+
export type { BaseUser, EventMessage, EventRecord, IOEventMessage } from "@pluv/types";
|
|
8
3
|
export { AbstractRoom } from "./AbstractRoom";
|
|
9
4
|
export { AbstractStorageStore } from "./AbstractStorageStore";
|
|
10
5
|
export { MockedRoom } from "./MockedRoom";
|
|
@@ -12,12 +7,7 @@ export type { MockedRoomConfig, MockedRoomEvents } from "./MockedRoom";
|
|
|
12
7
|
export { PluvClient } from "./PluvClient";
|
|
13
8
|
export type { PluvClientOptions } from "./PluvClient";
|
|
14
9
|
export { PluvRoom } from "./PluvRoom";
|
|
15
|
-
export type {
|
|
16
|
-
PluvRoomAddon,
|
|
17
|
-
PluvRoomAddonInput,
|
|
18
|
-
PluvRoomAddonResult,
|
|
19
|
-
PluvRoomDebug,
|
|
20
|
-
} from "./PluvRoom";
|
|
10
|
+
export type { PluvRoomAddon, PluvRoomAddonInput, PluvRoomAddonResult, PluvRoomDebug } from "./PluvRoom";
|
|
21
11
|
export { createClient } from "./createClient";
|
|
22
12
|
export { ConnectionState } from "./types";
|
|
23
13
|
export type { UserInfo, WebSocketConnection, WebSocketState } from "./types";
|
package/src/types.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Id,
|
|
3
|
-
InferIOAuthorize,
|
|
4
|
-
InferIOAuthorizeUser,
|
|
5
|
-
IOLike,
|
|
6
|
-
JsonObject,
|
|
7
|
-
} from "@pluv/types";
|
|
1
|
+
import type { Id, InferIOAuthorize, InferIOAuthorizeUser, IOLike, JsonObject } from "@pluv/types";
|
|
8
2
|
|
|
9
3
|
export interface AuthorizationState<TIO extends IOLike> {
|
|
10
4
|
token: string | null;
|
|
@@ -35,10 +29,7 @@ export interface WebSocketState<TIO extends IOLike> {
|
|
|
35
29
|
webSocket: WebSocket | null;
|
|
36
30
|
}
|
|
37
31
|
|
|
38
|
-
export interface UserInfo<
|
|
39
|
-
TIO extends IOLike,
|
|
40
|
-
TPresence extends JsonObject = {},
|
|
41
|
-
> {
|
|
32
|
+
export interface UserInfo<TIO extends IOLike, TPresence extends JsonObject = {}> {
|
|
42
33
|
connectionId: string;
|
|
43
34
|
presence: TPresence;
|
|
44
35
|
user: Id<InferIOAuthorizeUser<InferIOAuthorize<TIO>>>;
|