@pluv/client 0.8.0 → 0.8.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @pluv/client@0.8.0 build /home/runner/work/pluv/pluv/packages/client
2
+ > @pluv/client@0.8.1 build /home/runner/work/pluv/pluv/packages/client
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,10 +8,10 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- ESM dist/index.mjs 35.24 KB
12
- ESM ⚡️ Build success in 95ms
13
- CJS dist/index.js 36.38 KB
14
- CJS ⚡️ Build success in 96ms
11
+ ESM dist/index.mjs 35.08 KB
12
+ ESM ⚡️ Build success in 90ms
13
+ CJS dist/index.js 36.22 KB
14
+ CJS ⚡️ Build success in 92ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 4360ms
17
- DTS dist/index.d.ts 11.75 KB
16
+ DTS ⚡️ Build success in 3816ms
17
+ DTS dist/index.d.ts 11.73 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @pluv/client
2
2
 
3
+ ## 0.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 2c9c5c3: changed my-presence to be non-nullable
8
+
3
9
  ## 0.8.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -53,7 +53,7 @@ declare abstract class AbstractRoom<TIO extends IOLike, TPresence extends JsonOb
53
53
  abstract broadcast<TEvent extends keyof InferIOInput<TIO>>(event: TEvent, data: Id<InferIOInput<TIO>[TEvent]>): void;
54
54
  abstract event<TEvent extends keyof InferIOOutput<TIO>>(event: TEvent, callback: EventNotifierSubscriptionCallback<TIO, TEvent>): () => void;
55
55
  abstract getConnection(): WebSocketConnection;
56
- abstract getMyPresence(): TPresence | null;
56
+ abstract getMyPresence(): TPresence;
57
57
  abstract getMyself(): Id<UserInfo<TIO, TPresence>> | null;
58
58
  abstract getOther(connectionId: string): Id<UserInfo<TIO, TPresence>> | null;
59
59
  abstract getOthers(): readonly Id<UserInfo<TIO, TPresence>>[];
@@ -127,7 +127,7 @@ declare class PluvRoom<TIO extends IOLike, TPresence extends JsonObject = {}, TS
127
127
  disconnect(): void;
128
128
  event: <TEvent extends keyof InferIOOutput<TIO>>(event: TEvent, callback: EventNotifierSubscriptionCallback<TIO, TEvent>) => (() => void);
129
129
  getConnection(): WebSocketConnection;
130
- getMyPresence: () => TPresence | null;
130
+ getMyPresence: () => TPresence;
131
131
  getMyself: () => Id<UserInfo<TIO, TPresence>> | null;
132
132
  getOther: (connectionId: string) => Id<UserInfo<TIO, TPresence>> | null;
133
133
  getOthers: () => readonly Id<UserInfo<TIO, TPresence>>[];
@@ -221,7 +221,7 @@ declare class MockedRoom<TIO extends IOLike, TPresence extends JsonObject = {},
221
221
  broadcast<TEvent extends keyof InferIOInput<TIO>>(event: TEvent, data: Id<InferIOInput<TIO>[TEvent]>): void;
222
222
  event: <TEvent extends keyof InferIOOutput<TIO>>(event: TEvent, callback: EventNotifierSubscriptionCallback<TIO, TEvent>) => (() => void);
223
223
  getConnection(): WebSocketConnection;
224
- getMyPresence: () => TPresence | null;
224
+ getMyPresence: () => TPresence;
225
225
  getMyself: () => Id<UserInfo<TIO, TPresence>> | null;
226
226
  getOther: (connectionId: string) => Id<UserInfo<TIO, TPresence>> | null;
227
227
  getOthers: () => readonly Id<UserInfo<TIO, TPresence>>[];
package/dist/index.js CHANGED
@@ -331,8 +331,7 @@ var PluvRoom = class extends AbstractRoom {
331
331
  return this._eventNotifier.subscribe(event, callback);
332
332
  };
333
333
  this.getMyPresence = () => {
334
- var _a, _b;
335
- return (_b = (_a = this._usersManager.myself) == null ? void 0 : _a.presence) != null ? _b : null;
334
+ return this._usersManager.myPresence;
336
335
  };
337
336
  this.getMyself = () => {
338
337
  return this._usersManager.myself;
@@ -1106,8 +1105,7 @@ var MockedRoom = class extends AbstractRoom {
1106
1105
  return this._eventNotifier.subscribe(event, callback);
1107
1106
  };
1108
1107
  this.getMyPresence = () => {
1109
- var _a, _b;
1110
- return (_b = (_a = this._usersManager.myself) == null ? void 0 : _a.presence) != null ? _b : null;
1108
+ return this._usersManager.myPresence;
1111
1109
  };
1112
1110
  this.getMyself = () => {
1113
1111
  return this._usersManager.myself;
package/dist/index.mjs CHANGED
@@ -306,8 +306,7 @@ var PluvRoom = class extends AbstractRoom {
306
306
  return this._eventNotifier.subscribe(event, callback);
307
307
  };
308
308
  this.getMyPresence = () => {
309
- var _a, _b;
310
- return (_b = (_a = this._usersManager.myself) == null ? void 0 : _a.presence) != null ? _b : null;
309
+ return this._usersManager.myPresence;
311
310
  };
312
311
  this.getMyself = () => {
313
312
  return this._usersManager.myself;
@@ -1081,8 +1080,7 @@ var MockedRoom = class extends AbstractRoom {
1081
1080
  return this._eventNotifier.subscribe(event, callback);
1082
1081
  };
1083
1082
  this.getMyPresence = () => {
1084
- var _a, _b;
1085
- return (_b = (_a = this._usersManager.myself) == null ? void 0 : _a.presence) != null ? _b : null;
1083
+ return this._usersManager.myPresence;
1086
1084
  };
1087
1085
  this.getMyself = () => {
1088
1086
  return this._usersManager.myself;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/client",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "@pluv/io frontend client",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -38,7 +38,7 @@ export abstract class AbstractRoom<
38
38
 
39
39
  public abstract getConnection(): WebSocketConnection;
40
40
 
41
- public abstract getMyPresence(): TPresence | null;
41
+ public abstract getMyPresence(): TPresence;
42
42
 
43
43
  public abstract getMyself(): Id<UserInfo<TIO, TPresence>> | null;
44
44
 
package/src/MockedRoom.ts CHANGED
@@ -131,8 +131,8 @@ export class MockedRoom<
131
131
  );
132
132
  }
133
133
 
134
- public getMyPresence = (): TPresence | null => {
135
- return this._usersManager.myself?.presence ?? null;
134
+ public getMyPresence = (): TPresence => {
135
+ return this._usersManager.myPresence;
136
136
  };
137
137
 
138
138
  public getMyself = (): Id<UserInfo<TIO, TPresence>> | null => {
package/src/PluvRoom.ts CHANGED
@@ -303,8 +303,8 @@ export class PluvRoom<
303
303
  );
304
304
  }
305
305
 
306
- public getMyPresence = (): TPresence | null => {
307
- return this._usersManager.myself?.presence ?? null;
306
+ public getMyPresence = (): TPresence => {
307
+ return this._usersManager.myPresence;
308
308
  };
309
309
 
310
310
  public getMyself = (): Id<UserInfo<TIO, TPresence>> | null => {