-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathStack.ts
More file actions
56 lines (51 loc) · 1.32 KB
/
Stack.ts
File metadata and controls
56 lines (51 loc) · 1.32 KB
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
47
48
49
50
51
52
53
54
55
56
import type {
DomainEvent,
PoppedEvent,
PushedEvent,
ReplacedEvent,
StepPoppedEvent,
StepPushedEvent,
StepReplacedEvent,
} from "./event-types";
export type ActivityTransition = "enter" | "exit";
export type ActivityTransitionProgress = "active" | "done";
export type ActivityTransitionState =
`${ActivityTransition}-${ActivityTransitionProgress}`;
export type ActivityStep = {
id: string;
params: {
[key: string]: string | undefined;
};
enteredBy: PushedEvent | ReplacedEvent | StepPushedEvent | StepReplacedEvent;
exitedBy?: ReplacedEvent | PoppedEvent | StepReplacedEvent | StepPoppedEvent;
zIndex: number;
hasZIndex?: boolean;
};
export type Activity = {
id: string;
name: string;
transitionState: ActivityTransitionState;
params: {
[key: string]: string | undefined;
};
context?: {};
enteredBy: PushedEvent | ReplacedEvent;
exitedBy?: ReplacedEvent | PoppedEvent;
steps: ActivityStep[];
isTop: boolean;
isActive: boolean;
isRoot: boolean;
zIndex: number;
};
export type RegisteredActivity = {
name: string;
paramsSchema?: {};
};
export type Stack = {
activities: Activity[];
registeredActivities: RegisteredActivity[];
transitionDuration: number;
globalTransitionState: "idle" | "loading" | "paused";
pausedEvents?: DomainEvent[];
events: DomainEvent[];
};