pwi-plata-type 0.4.107 → 0.4.108
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/package.json
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
|
+
interface PlataProcess extends Cluster.PlataEvents {}
|
|
2
|
+
|
|
1
3
|
declare namespace Cluster {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
type GetActionsObject<T extends Dictionary<any>> = {
|
|
5
|
+
[K in keyof T]: { action: K, msg: T[K] }
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
type GetActions<T extends Dictionary<any>> = GetActionsObject<T>[keyof T]
|
|
9
|
+
|
|
10
|
+
type GetEmitFuncionsArgs<T extends Dictionary<any>> = {
|
|
11
|
+
[K in keyof T]: [event: K, response: T[K]]
|
|
12
|
+
}[keyof T]
|
|
13
|
+
|
|
14
|
+
type GetOnFuncionsArgs<T extends Dictionary<any>> = {
|
|
15
|
+
[K in keyof T]: [event: K, listener: (r: T[K]) => void | Promise<void>]
|
|
16
|
+
}[keyof T]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
interface PlataEvents {
|
|
20
|
+
emit(...args: GetEmitFuncionsArgs<PlataClusterActions> | GetActions<UserClusterActions>)
|
|
21
|
+
on(...args: GetOnFuncionsArgs<PlataClusterActions> | GetOnFuncionsArgs<UserClusterActions>)
|
|
22
|
+
once(...args: GetOnFuncionsArgs<PlataClusterActions> | GetOnFuncionsArgs<UserClusterActions>)
|
|
23
|
+
}
|
|
5
24
|
|
|
6
25
|
type Actions = GetActions<PlataClusterActions> | GetActions<UserClusterActions>
|
|
7
26
|
}
|
package/src/@types/global.d.ts
CHANGED
|
@@ -47,6 +47,10 @@ type RemovePlataResultOnPromiseAll<T> =
|
|
|
47
47
|
|
|
48
48
|
interface PlataRuntime {}
|
|
49
49
|
|
|
50
|
+
interface PlataProcess {
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
50
54
|
interface Plata extends PlataRuntime {
|
|
51
55
|
cluster: {
|
|
52
56
|
isPrimary: true,
|
|
@@ -66,6 +70,8 @@ interface Plata extends PlataRuntime {
|
|
|
66
70
|
|
|
67
71
|
declare const Plata: Plata
|
|
68
72
|
|
|
73
|
+
declare const process: NodeJS.Process & PlataProcess
|
|
74
|
+
|
|
69
75
|
interface EnvConfig {
|
|
70
76
|
env: PlataEnv
|
|
71
77
|
}
|