-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.ts
46 lines (38 loc) · 776 Bytes
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import Stream from "xstream";
import { StateSource } from "@cycle/state";
export type GoalID = {
stamp: Date | number | string;
id: string;
};
export type Goal = {
goal_id: GoalID;
goal: any;
};
export enum Status {
ACTIVE = "ACTIVE",
PREEMPTED = "PREEMPTED",
SUCCEEDED = "SUCCEEDED",
ABORTED = "ABORTED"
}
export type GoalStatus = {
goal_id: GoalID;
status: Status;
};
export type Result = {
status: GoalStatus;
result: any;
};
export interface ActionSources {
state: StateSource<any>;
goal: Stream<Goal>;
cancel?: Stream<GoalID>;
}
export interface ActionSinks {
state: Stream<any>;
feedback?: Stream<any>;
status: Stream<GoalStatus>;
result: Stream<Result>;
}
export interface EventSource {
events(eventType: string): any;
}