-
Notifications
You must be signed in to change notification settings - Fork 3
/
types.ts
88 lines (77 loc) · 1.51 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/**
* _____ __
* / ___// /_ _____
* \__ \/ / / / / _ \
* ___/ / / /_/ / __/
* /____/_/\__, /\___/
* /____/
* Copyright 2018 Parsa Ghadimi. All Rights Reserved.
* Licence: MIT License
*/
export interface Vec3 {
x: number;
y: number;
z: number;
}
export interface Step {
text: string;
position: Vec3;
orientation: Vec3;
}
export interface Presentation {
owner: User;
steps: {
[key: string]: Step
};
created: Date;
updated: Date;
order: string[];
}
export type Axis = "x" | "y" | "z";
export type StepVec3Props = "position" | "orientation";
export interface User {
displayName: string;
photoURL: string;
uid: string;
}
export interface SlyeRenderer {
canvas: HTMLCanvasElement;
active: string;
init(): Promise<void>;
setSize(width: number, height: number): void;
render(time: number): void;
goTo(id: string, duration?: number): void;
dispose(): void;
}
export interface PresentationInfo {
id: string;
data: Presentation;
}
export interface Actions {
Auth: {
login(): void;
logout(): void;
};
Presentations: {
create(): void;
// TODO(qti3e)
// queryProfile(uid: string): void;
// queryLatest(): void;
};
}
export interface Values {
Auth: {
isLoggedIn: boolean,
currentUser?: User
};
Presentations: {
// TODO(qti3e)
// isLoading: boolean;
// lastQueryType: "profile" | "latest";
// lastQueryResult: PresentationInfo[];
};
}
export interface Context {
actions: Actions;
values: Values;
}