-
Notifications
You must be signed in to change notification settings - Fork 0
/
interviews.ts
39 lines (33 loc) · 1.09 KB
/
interviews.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
interface IEvent {
id: number;
}
interface IEventInfo extends IEvent {
name: string;
/** Event execution timestamp. */
time: number;
}
interface IEventsList {
/** Total pages count. */
pagesCount: number;
/** Events ordered by time (most recent in the beginning) */
events: IEvent[];
}
/** Returns Promise with page events (only shortened info) */
declare function getAllEvents(page: number): Promise<IEventsList>;
/** Returns Promise with favorite page events (only shortened info) */
declare function getFavoriteEvents(page: number): Promise<IEventsList>;
/** Returns Promise with full event info by id */
declare function getEventById(id: number): Promise<IEventInfo>;
/**
* Create two event lists with full info from all pages:
* 1. Favorite events list (favorites)
* - in order from getFavoriteEvents()
* 2. Non-favorite events list (other)
* - in order from getAllEvents() excluding favorite events
*
* To get full event info use getEventById()
*
* Requirements:
* 1. Load data in fastest way possible (using concurrency)
* 2. Filter events in O(n), n - events count
*/