wexa-chat 0.2.9 → 0.2.10
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/README.md +25 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +82 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +82 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/client/index.d.ts +0 -49
package/dist/client/index.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
type ChatEvent = {
|
|
4
|
-
type: 'message:created';
|
|
5
|
-
[k: string]: any;
|
|
6
|
-
} | {
|
|
7
|
-
type: 'conversation:read';
|
|
8
|
-
[k: string]: any;
|
|
9
|
-
} | {
|
|
10
|
-
type: 'typing';
|
|
11
|
-
[k: string]: any;
|
|
12
|
-
} | {
|
|
13
|
-
type: 'presence:join';
|
|
14
|
-
[k: string]: any;
|
|
15
|
-
} | {
|
|
16
|
-
type: 'presence:leave';
|
|
17
|
-
[k: string]: any;
|
|
18
|
-
};
|
|
19
|
-
type Listener<T> = (v: T) => void;
|
|
20
|
-
declare class SocketManager {
|
|
21
|
-
private ws;
|
|
22
|
-
private reconnectTimer;
|
|
23
|
-
private manualClose;
|
|
24
|
-
private attempt;
|
|
25
|
-
private warmedUp;
|
|
26
|
-
private connecting;
|
|
27
|
-
private connListeners;
|
|
28
|
-
private eventListeners;
|
|
29
|
-
private getUserId;
|
|
30
|
-
constructor(getUserId?: () => string | undefined);
|
|
31
|
-
setGetUserId: (fn: () => string | undefined) => void;
|
|
32
|
-
private notifyConn;
|
|
33
|
-
private notifyEvent;
|
|
34
|
-
addConnListener(l: Listener<boolean>): () => boolean;
|
|
35
|
-
addEventListener(l: Listener<ChatEvent>): () => boolean;
|
|
36
|
-
connect: () => Promise<void>;
|
|
37
|
-
send: (payload: unknown) => boolean;
|
|
38
|
-
close: () => void;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
declare function getSocketManager(getUserId?: () => string | undefined): SocketManager;
|
|
42
|
-
|
|
43
|
-
declare function SocketProvider({ children, getUserId, }: {
|
|
44
|
-
children: ReactNode;
|
|
45
|
-
getUserId: () => string | undefined;
|
|
46
|
-
}): JSX.Element;
|
|
47
|
-
declare function useSocket(): {};
|
|
48
|
-
|
|
49
|
-
export { type ChatEvent, SocketProvider, getSocketManager, useSocket };
|