cleanstrategytypes 1.0.6 → 1.0.7
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/dist/bundle.esm.js.map +1 -1
- package/dist/index.d.ts +26 -9
- package/package.json +1 -1
- package/src/index.ts +29 -8
package/dist/bundle.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.esm.js","sources":["../src/index.ts"],"sourcesContent":["export interface IVote {\r\n id: string;\r\n
|
|
1
|
+
{"version":3,"file":"bundle.esm.js","sources":["../src/index.ts"],"sourcesContent":["export interface IVote {\r\n id: string;\r\n periodId: string;\r\n userId: string;\r\n taskId: string;\r\n count?: number;\r\n}\r\n\r\nexport type ITask = {\r\n id: string;\r\n title: string;\r\n value: number;\r\n};\r\n\r\nexport interface ICurrentUser {\r\n id: string;\r\n displayName: string;\r\n email: string;\r\n}\r\n\r\nexport interface IUser {\r\n id: string;\r\n displayName: string;\r\n color: string;\r\n}\r\n\r\nexport interface IPeriod {\r\n id: string;\r\n order: number;\r\n spaceId: string;\r\n startDate: string;\r\n endDate: string;\r\n}\r\n\r\nexport enum SpaceEventTypes {\r\n CONNECT = \"CONNECT\",\r\n DISCONNECT = \"DISCONNECT\",\r\n START_PERIOD = \"START_PERIOD\",\r\n END_PERIOD = \"END_PERIOD\",\r\n VOTE = \"VOTE\",\r\n DELETE_VOTE = \"DELETE_VOTE\",\r\n}\r\n\r\nexport type VoteMessageBody = {\r\n type: \"minus\" | \"plus\";\r\n taskId: string;\r\n currentUserId: string;\r\n};\r\n\r\nexport type ConnectMessageBody = {\r\n votes: IVote[];\r\n tasks: ITask[];\r\n users: IUser[];\r\n currentPeriod: IPeriod;\r\n};\r\n\r\nexport type VoteDeleteMessageBody = {\r\n voteId: string;\r\n};\r\n\r\nexport interface GameServerToClientEvents {\r\n [SpaceEventTypes.CONNECT]: (message: ConnectMessageBody) => void;\r\n [SpaceEventTypes.DISCONNECT]: (message: any) => void;\r\n [SpaceEventTypes.END_PERIOD]: (message: any) => void;\r\n [SpaceEventTypes.START_PERIOD]: (message: any) => void;\r\n [SpaceEventTypes.VOTE]: (message: VoteMessageBody) => void;\r\n [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;\r\n}\r\n\r\nexport interface GameClientToServerEvents {\r\n [SpaceEventTypes.CONNECT]: (message: any) => void;\r\n [SpaceEventTypes.START_PERIOD]: (message: any) => void;\r\n [SpaceEventTypes.VOTE]: (message: VoteMessageBody) => void;\r\n [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;\r\n [SpaceEventTypes.END_PERIOD]: (message: any) => void;\r\n [SpaceEventTypes.START_PERIOD]: (message: any) => void;\r\n}\r\n"],"names":[],"mappings":"IAkCY,gBAOX;AAPD,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,eAAA,CAAA,YAAA,CAAA,GAAA,YAAyB,CAAA;AACzB,IAAA,eAAA,CAAA,cAAA,CAAA,GAAA,cAA6B,CAAA;AAC7B,IAAA,eAAA,CAAA,YAAA,CAAA,GAAA,YAAyB,CAAA;AACzB,IAAA,eAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,eAAA,CAAA,aAAA,CAAA,GAAA,aAA2B,CAAA;AAC7B,CAAC,EAPW,eAAe,KAAf,eAAe,GAO1B,EAAA,CAAA,CAAA;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export interface IVote {
|
|
2
2
|
id: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
periodId: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
taskId: string;
|
|
6
6
|
count?: number;
|
|
7
7
|
}
|
|
8
8
|
export type ITask = {
|
|
@@ -20,6 +20,13 @@ export interface IUser {
|
|
|
20
20
|
displayName: string;
|
|
21
21
|
color: string;
|
|
22
22
|
}
|
|
23
|
+
export interface IPeriod {
|
|
24
|
+
id: string;
|
|
25
|
+
order: number;
|
|
26
|
+
spaceId: string;
|
|
27
|
+
startDate: string;
|
|
28
|
+
endDate: string;
|
|
29
|
+
}
|
|
23
30
|
export declare enum SpaceEventTypes {
|
|
24
31
|
CONNECT = "CONNECT",
|
|
25
32
|
DISCONNECT = "DISCONNECT",
|
|
@@ -28,23 +35,33 @@ export declare enum SpaceEventTypes {
|
|
|
28
35
|
VOTE = "VOTE",
|
|
29
36
|
DELETE_VOTE = "DELETE_VOTE"
|
|
30
37
|
}
|
|
31
|
-
type
|
|
38
|
+
export type VoteMessageBody = {
|
|
32
39
|
type: "minus" | "plus";
|
|
33
40
|
taskId: string;
|
|
41
|
+
currentUserId: string;
|
|
42
|
+
};
|
|
43
|
+
export type ConnectMessageBody = {
|
|
44
|
+
votes: IVote[];
|
|
45
|
+
tasks: ITask[];
|
|
46
|
+
users: IUser[];
|
|
47
|
+
currentPeriod: IPeriod;
|
|
48
|
+
};
|
|
49
|
+
export type VoteDeleteMessageBody = {
|
|
50
|
+
voteId: string;
|
|
34
51
|
};
|
|
35
52
|
export interface GameServerToClientEvents {
|
|
36
|
-
[SpaceEventTypes.CONNECT]: (message:
|
|
53
|
+
[SpaceEventTypes.CONNECT]: (message: ConnectMessageBody) => void;
|
|
37
54
|
[SpaceEventTypes.DISCONNECT]: (message: any) => void;
|
|
38
55
|
[SpaceEventTypes.END_PERIOD]: (message: any) => void;
|
|
39
56
|
[SpaceEventTypes.START_PERIOD]: (message: any) => void;
|
|
40
|
-
[SpaceEventTypes.VOTE]: (message:
|
|
57
|
+
[SpaceEventTypes.VOTE]: (message: VoteMessageBody) => void;
|
|
58
|
+
[SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;
|
|
41
59
|
}
|
|
42
60
|
export interface GameClientToServerEvents {
|
|
43
61
|
[SpaceEventTypes.CONNECT]: (message: any) => void;
|
|
44
62
|
[SpaceEventTypes.START_PERIOD]: (message: any) => void;
|
|
45
|
-
[SpaceEventTypes.VOTE]: (message:
|
|
46
|
-
[SpaceEventTypes.DELETE_VOTE]: (message:
|
|
63
|
+
[SpaceEventTypes.VOTE]: (message: VoteMessageBody) => void;
|
|
64
|
+
[SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;
|
|
47
65
|
[SpaceEventTypes.END_PERIOD]: (message: any) => void;
|
|
48
66
|
[SpaceEventTypes.START_PERIOD]: (message: any) => void;
|
|
49
67
|
}
|
|
50
|
-
export {};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export interface IVote {
|
|
2
2
|
id: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
periodId: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
taskId: string;
|
|
6
6
|
count?: number;
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -24,6 +24,14 @@ export interface IUser {
|
|
|
24
24
|
color: string;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
export interface IPeriod {
|
|
28
|
+
id: string;
|
|
29
|
+
order: number;
|
|
30
|
+
spaceId: string;
|
|
31
|
+
startDate: string;
|
|
32
|
+
endDate: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
27
35
|
export enum SpaceEventTypes {
|
|
28
36
|
CONNECT = "CONNECT",
|
|
29
37
|
DISCONNECT = "DISCONNECT",
|
|
@@ -33,24 +41,37 @@ export enum SpaceEventTypes {
|
|
|
33
41
|
DELETE_VOTE = "DELETE_VOTE",
|
|
34
42
|
}
|
|
35
43
|
|
|
36
|
-
type
|
|
44
|
+
export type VoteMessageBody = {
|
|
37
45
|
type: "minus" | "plus";
|
|
38
46
|
taskId: string;
|
|
47
|
+
currentUserId: string;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export type ConnectMessageBody = {
|
|
51
|
+
votes: IVote[];
|
|
52
|
+
tasks: ITask[];
|
|
53
|
+
users: IUser[];
|
|
54
|
+
currentPeriod: IPeriod;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type VoteDeleteMessageBody = {
|
|
58
|
+
voteId: string;
|
|
39
59
|
};
|
|
40
60
|
|
|
41
61
|
export interface GameServerToClientEvents {
|
|
42
|
-
[SpaceEventTypes.CONNECT]: (message:
|
|
62
|
+
[SpaceEventTypes.CONNECT]: (message: ConnectMessageBody) => void;
|
|
43
63
|
[SpaceEventTypes.DISCONNECT]: (message: any) => void;
|
|
44
64
|
[SpaceEventTypes.END_PERIOD]: (message: any) => void;
|
|
45
65
|
[SpaceEventTypes.START_PERIOD]: (message: any) => void;
|
|
46
|
-
[SpaceEventTypes.VOTE]: (message:
|
|
66
|
+
[SpaceEventTypes.VOTE]: (message: VoteMessageBody) => void;
|
|
67
|
+
[SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;
|
|
47
68
|
}
|
|
48
69
|
|
|
49
70
|
export interface GameClientToServerEvents {
|
|
50
71
|
[SpaceEventTypes.CONNECT]: (message: any) => void;
|
|
51
72
|
[SpaceEventTypes.START_PERIOD]: (message: any) => void;
|
|
52
|
-
[SpaceEventTypes.VOTE]: (message:
|
|
53
|
-
[SpaceEventTypes.DELETE_VOTE]: (message:
|
|
73
|
+
[SpaceEventTypes.VOTE]: (message: VoteMessageBody) => void;
|
|
74
|
+
[SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;
|
|
54
75
|
[SpaceEventTypes.END_PERIOD]: (message: any) => void;
|
|
55
76
|
[SpaceEventTypes.START_PERIOD]: (message: any) => void;
|
|
56
77
|
}
|