dev-classes 1.3.29 → 1.3.30

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,6 +1,15 @@
1
+ import { WsApi_Events } from './deps/WsApi/WsApi.types';
1
2
  import { WsApi_Options_P } from './deps/WsApi';
2
3
  import { SocketApi_Options_P, SocketApi_StateProps_P } from './SocketApi.types';
3
4
 
5
+ interface SocketApi_Events {
6
+ timeOffReConnect(info: {
7
+ status: boolean;
8
+ msg: string;
9
+ }): void;
10
+ reConnect(status: boolean): void;
11
+ }
12
+ type CommonEvents = SocketApi_Events & WsApi_Events;
4
13
  export declare class SocketApi {
5
14
  #private;
6
15
  private static state;
@@ -21,7 +30,7 @@ export declare class SocketApi {
21
30
  private static offline;
22
31
  private static splitOptions;
23
32
  static getState: () => SocketApi_StateProps_P;
24
- static on: typeof SocketApi.wsApi.on & typeof SocketApi.events.subscribe;
33
+ static on: <K extends keyof CommonEvents>(name: K, cb: CommonEvents[K]) => void;
25
34
  static off: typeof SocketApi.wsApi.on & typeof SocketApi.events.subscribe;
26
35
  static getRequestSave: () => {
27
36
  payload: {
@@ -40,3 +49,4 @@ export declare class SocketApi {
40
49
  static stopReConnect(status?: boolean): void;
41
50
  static socketReConnect: () => void;
42
51
  }
52
+ export {};
@@ -5,8 +5,8 @@ export interface WsApi_Options_P {
5
5
  }
6
6
  export type WsApiE_StatusConnect_OR = "pending" | "ready" | "error" | "close" | "disconnect";
7
7
  export interface WsApi_Events {
8
- status: (status: WsApiE_StatusConnect_OR) => void;
9
- msg: (message: any) => void;
8
+ status(status: WsApiE_StatusConnect_OR): void;
9
+ msg(message: any): void;
10
10
  }
11
11
  export interface WsApi_StateProps {
12
12
  statusConnect: WsApiE_StatusConnect_OR;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "url": "git+https://github.com/SinGlEBW/dev-classes.git"
12
12
  },
13
13
  "license": "MIT",
14
- "version": "1.3.29",
14
+ "version": "1.3.30",
15
15
  "type": "module",
16
16
  "module": "./dist/index.js",
17
17
  "main": "./dist/index.js",
@@ -39,7 +39,7 @@
39
39
  "start": "vite",
40
40
  "build": "tsc && vite build",
41
41
  "preview": "vite preview",
42
- "publish": "node publishVersion.js"
42
+ "send": "node publishVersion.js"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/js-cookie": "^3.0.6",