itty-sockets 0.6.0 → 0.6.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.
Files changed (2) hide show
  1. package/connect.d.ts +9 -6
  2. package/package.json +2 -2
package/connect.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  type IttySocketEvent<BaseFormat> = BaseFormat extends UseItty ? 'open' | 'close' | 'message' | 'join' | 'leave' : 'open' | 'close' | 'message';
2
- type Date = {
3
- date: Date;
2
+ type Timestamp = {
3
+ date: number;
4
4
  };
5
5
  type UserDetails = {
6
6
  uid: string;
@@ -12,19 +12,22 @@ type OptionalUserDetails = {
12
12
  };
13
13
  export type UseItty<MessageType = any> = {
14
14
  message: MessageType;
15
- } & UserDetails & Date;
15
+ } & UserDetails & Timestamp;
16
+ export type MessageEvent<MessageType = any> = {
17
+ message: MessageType;
18
+ } & Timestamp & OptionalUserDetails;
16
19
  export type JoinEvent = {
17
20
  type: 'join';
18
21
  users: number;
19
- } & Date & OptionalUserDetails;
22
+ } & Timestamp & OptionalUserDetails;
20
23
  export type LeaveEvent = {
21
24
  type: 'leave';
22
25
  users: number;
23
- } & Date & OptionalUserDetails;
26
+ } & Timestamp & OptionalUserDetails;
24
27
  export type ErrorEvent = {
25
28
  type: 'error';
26
29
  message: string;
27
- } & Date;
30
+ } & Timestamp;
28
31
  export type IttySocketOptions = {
29
32
  as?: string;
30
33
  alias?: string;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "itty-sockets",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "WebSockets : simplified and minified.",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
8
8
  "import": "./connect.mjs",
9
9
  "types": "./connect.d.ts",
10
- "require": "./connect.cjs"
10
+ "require": "./connect.js"
11
11
  }
12
12
  },
13
13
  "scripts": {