wenay-common2 1.0.15 → 1.0.17
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/lib/Common/events/Listen.d.ts +3 -3
- package/lib/Common/events/SocketBuffer.d.ts +1 -1
- package/lib/Common/events/SocketServerHook.d.ts +2 -2
- package/lib/Common/rcp/rpc-client.d.ts +6 -5
- package/lib/Common/rcp/rpc-clientHub.d.ts +1 -25
- package/lib/Common/rcp/rpc-index.d.ts +1 -0
- package/lib/Common/rcp/rpc-index.js +1 -0
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ export declare function funcListenCallbackFast<T>(a: (e: (Listener<NormalizeTupl
|
|
|
25
25
|
addListen: (cb: Listener<NormalizeTuple<T>>, cbClose?: (() => void) | undefined) => () => void;
|
|
26
26
|
removeListen: (cb: Listener<NormalizeTuple<T>> | null) => void;
|
|
27
27
|
count: () => number;
|
|
28
|
-
readonly getAllKeys: Listener<NormalizeTuple<
|
|
28
|
+
readonly getAllKeys: Listener<NormalizeTuple<T>>[];
|
|
29
29
|
};
|
|
30
30
|
export declare function funcListenCallback<T>(a: (e: (Listener<NormalizeTuple<T>> | null)) => (void | (() => void)), event?: (type: "add" | "remove", count: number, api: ReturnType<typeof funcListenCallbackBase<T>>) => void, fast?: boolean): {
|
|
31
31
|
func: Listener<NormalizeTuple<T>>;
|
|
@@ -37,7 +37,7 @@ export declare function funcListenCallback<T>(a: (e: (Listener<NormalizeTuple<T>
|
|
|
37
37
|
addListen: (cb: Listener<NormalizeTuple<T>>, cbClose?: (() => void) | undefined) => () => void;
|
|
38
38
|
removeListen: (cb: Listener<NormalizeTuple<T>> | null) => void;
|
|
39
39
|
count: () => number;
|
|
40
|
-
readonly getAllKeys: Listener<NormalizeTuple<
|
|
40
|
+
readonly getAllKeys: Listener<NormalizeTuple<T>>[];
|
|
41
41
|
};
|
|
42
42
|
export declare function UseListen<T>(data?: Parameters<typeof funcListenCallbackBase<T>>[1]): readonly [(...a: NormalizeTuple<T>) => void, {
|
|
43
43
|
func: Listener<NormalizeTuple<T>>;
|
|
@@ -49,7 +49,7 @@ export declare function UseListen<T>(data?: Parameters<typeof funcListenCallback
|
|
|
49
49
|
addListen: (cb: Listener<NormalizeTuple<T>>, cbClose?: (() => void) | undefined) => () => void;
|
|
50
50
|
removeListen: (cb: Listener<NormalizeTuple<T>> | null) => void;
|
|
51
51
|
count: () => number;
|
|
52
|
-
readonly getAllKeys: Listener<NormalizeTuple<
|
|
52
|
+
readonly getAllKeys: Listener<NormalizeTuple<T>>[];
|
|
53
53
|
}];
|
|
54
54
|
export declare function isListenCallback(obj: any): obj is ReturnType<typeof funcListenCallbackBase>;
|
|
55
55
|
export {};
|
|
@@ -31,7 +31,7 @@ export declare function funcListenCallbackSnapshot<T extends realSocket2<any | a
|
|
|
31
31
|
addListen: (cb: import("./Listen").Listener<[data: getTypeCallback<T>, memo: T3]>, cbClose?: (() => void) | undefined) => () => void;
|
|
32
32
|
removeListen: (cb: import("./Listen").Listener<[data: getTypeCallback<T>, memo: T3]> | null) => void;
|
|
33
33
|
count: () => number;
|
|
34
|
-
readonly getAllKeys: import("./Listen").Listener<
|
|
34
|
+
readonly getAllKeys: import("./Listen").Listener<[data: getTypeCallback<T>, memo: T3]>[];
|
|
35
35
|
};
|
|
36
36
|
connect: () => void;
|
|
37
37
|
readonly disconnect: ((a: Omit<Parameters<T>[0], "callback"> & {
|
|
@@ -14,7 +14,7 @@ export declare function SocketServerHook(opt?: {
|
|
|
14
14
|
addListen: (cb: import("./Listen").Listener<[unknown]>, cbClose?: (() => void) | undefined) => () => void;
|
|
15
15
|
removeListen: (cb: import("./Listen").Listener<[unknown]> | null) => void;
|
|
16
16
|
count: () => number;
|
|
17
|
-
readonly getAllKeys: import("./Listen").Listener<
|
|
17
|
+
readonly getAllKeys: import("./Listen").Listener<[unknown]>[];
|
|
18
18
|
}];
|
|
19
19
|
};
|
|
20
20
|
get(tag: string): readonly [(a_0: unknown) => void, {
|
|
@@ -27,7 +27,7 @@ export declare function SocketServerHook(opt?: {
|
|
|
27
27
|
addListen: (cb: import("./Listen").Listener<[unknown]>, cbClose?: (() => void) | undefined) => () => void;
|
|
28
28
|
removeListen: (cb: import("./Listen").Listener<[unknown]> | null) => void;
|
|
29
29
|
count: () => number;
|
|
30
|
-
readonly getAllKeys: import("./Listen").Listener<
|
|
30
|
+
readonly getAllKeys: import("./Listen").Listener<[unknown]>[];
|
|
31
31
|
}];
|
|
32
32
|
provider: (tag: string, data: any) => void;
|
|
33
33
|
};
|
|
@@ -21,11 +21,7 @@ type ClientApiHandle = {
|
|
|
21
21
|
remove: (fn: Function) => void;
|
|
22
22
|
end: (fn: Function) => void;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
25
|
-
socket: SocketTmpl;
|
|
26
|
-
socketKey: string;
|
|
27
|
-
limit?: number;
|
|
28
|
-
}): {
|
|
24
|
+
export type RpcClientReturn<T extends object> = {
|
|
29
25
|
func: ClientAPI<T>;
|
|
30
26
|
pipe: PipeAPI<T>;
|
|
31
27
|
pipeStrict: PipeAPI<T>;
|
|
@@ -38,4 +34,9 @@ export declare function createRpcClient<T extends object>({ socket, socketKey: k
|
|
|
38
34
|
readyStrict: () => Promise<void>;
|
|
39
35
|
initStrict: (obj?: object) => Promise<void>;
|
|
40
36
|
};
|
|
37
|
+
export declare function createRpcClient<T extends object>({ socket, socketKey: key, limit }: {
|
|
38
|
+
socket: SocketTmpl;
|
|
39
|
+
socketKey: string;
|
|
40
|
+
limit?: number;
|
|
41
|
+
}): RpcClientReturn<T>;
|
|
41
42
|
export type { ClientApiHandle };
|
|
@@ -9,31 +9,7 @@ export type RpcDescriptor<T extends object> = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare function rpc<T extends object>(socketKey?: string): RpcDescriptor<T>;
|
|
11
11
|
export declare function createRpcClientHub<T extends Record<string, RpcDescriptor<any>>>(createSocket: (token: string | null) => RpcHubSocket, schemaBuilder: (helper: typeof rpc) => T): {
|
|
12
|
-
facade: { [K_1 in keyof { [K in keyof T]: T[K] extends RpcDescriptor<infer U extends object> ? {
|
|
13
|
-
func: import("./rpc-client").ClientAPI<DeepSocketListenSmart<U>>;
|
|
14
|
-
pipe: import("./rpc-client").PipeAPI<DeepSocketListenSmart<U>>;
|
|
15
|
-
pipeStrict: import("./rpc-client").PipeAPI<DeepSocketListenSmart<U>>;
|
|
16
|
-
space: import("./rpc-client").ClientAPI<DeepSocketListenSmart<U>>;
|
|
17
|
-
all: import("./rpc-client").ClientAPI<DeepSocketListenSmart<U>>;
|
|
18
|
-
strict: import("./rpc-client").ClientAPI<DeepSocketListenSmart<U>>;
|
|
19
|
-
api: import("./rpc-client").ClientApiHandle;
|
|
20
|
-
abortAll: (reason: string) => void;
|
|
21
|
-
schema: () => any;
|
|
22
|
-
readyStrict: () => Promise<void>;
|
|
23
|
-
initStrict: (obj?: object) => Promise<void>;
|
|
24
|
-
} : never; }]: { [K in keyof T]: T[K] extends RpcDescriptor<infer U extends object> ? {
|
|
25
|
-
func: import("./rpc-client").ClientAPI<DeepSocketListenSmart<U>>;
|
|
26
|
-
pipe: import("./rpc-client").PipeAPI<DeepSocketListenSmart<U>>;
|
|
27
|
-
pipeStrict: import("./rpc-client").PipeAPI<DeepSocketListenSmart<U>>;
|
|
28
|
-
space: import("./rpc-client").ClientAPI<DeepSocketListenSmart<U>>;
|
|
29
|
-
all: import("./rpc-client").ClientAPI<DeepSocketListenSmart<U>>;
|
|
30
|
-
strict: import("./rpc-client").ClientAPI<DeepSocketListenSmart<U>>;
|
|
31
|
-
api: import("./rpc-client").ClientApiHandle;
|
|
32
|
-
abortAll: (reason: string) => void;
|
|
33
|
-
schema: () => any;
|
|
34
|
-
readyStrict: () => Promise<void>;
|
|
35
|
-
initStrict: (obj?: object) => Promise<void>;
|
|
36
|
-
} : never; }[K_1] | null; };
|
|
12
|
+
facade: { [K_1 in keyof { [K in keyof T]: T[K] extends RpcDescriptor<infer U extends object> ? import("./rpc-client").RpcClientReturn<DeepSocketListenSmart<U>> : never; }]: { [K in keyof T]: T[K] extends RpcDescriptor<infer U extends object> ? import("./rpc-client").RpcClientReturn<DeepSocketListenSmart<U>> : never; }[K_1] | null; };
|
|
37
13
|
setToken: (token: string | null) => void;
|
|
38
14
|
onConnect: (func?: ((count: number) => void) | null) => void;
|
|
39
15
|
connectCount: () => number;
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./listen-socket"), exports);
|
|
18
|
+
__exportStar(require("./listen-deep"), exports);
|
|
18
19
|
__exportStar(require("./rpc-dynamic"), exports);
|
|
19
20
|
__exportStar(require("./rpc-protocol"), exports);
|
|
20
21
|
__exportStar(require("./rpc-limits"), exports);
|