]>
Commit | Line | Data |
---|---|---|
7663e55a | 1 | // Data from API hooks: {hookType}:api.{location}.{elementType}.{actionType}.{target} |
93cae479 | 2 | |
7663e55a | 3 | export const clientFilterHookObject = { |
5f189c9c | 4 | // Filter params/result of the function that fetch videos of the trending page |
7663e55a C |
5 | 'filter:api.trending-videos.videos.list.params': true, |
6 | 'filter:api.trending-videos.videos.list.result': true, | |
93cae479 | 7 | |
c07eb946 JM |
8 | // Filter params/result of the function that fetch videos of the trending page |
9 | 'filter:api.most-liked-videos.videos.list.params': true, | |
10 | 'filter:api.most-liked-videos.videos.list.result': true, | |
11 | ||
5f189c9c | 12 | // Filter params/result of the function that fetch videos of the local page |
7663e55a C |
13 | 'filter:api.local-videos.videos.list.params': true, |
14 | 'filter:api.local-videos.videos.list.result': true, | |
93cae479 | 15 | |
5f189c9c | 16 | // Filter params/result of the function that fetch videos of the recently-added page |
7663e55a C |
17 | 'filter:api.recently-added-videos.videos.list.params': true, |
18 | 'filter:api.recently-added-videos.videos.list.result': true, | |
93cae479 | 19 | |
5f189c9c | 20 | // Filter params/result of the function that fetch videos of the user subscription page |
7663e55a C |
21 | 'filter:api.user-subscriptions-videos.videos.list.params': true, |
22 | 'filter:api.user-subscriptions-videos.videos.list.result': true, | |
93cae479 | 23 | |
5f189c9c | 24 | // Filter params/result of the function that fetch the video of the video-watch page |
7663e55a C |
25 | 'filter:api.video-watch.video.get.params': true, |
26 | 'filter:api.video-watch.video.get.result': true, | |
93cae479 | 27 | |
5f189c9c | 28 | // Filter params/result of the function that fetch the threads of the video-watch page |
7663e55a C |
29 | 'filter:api.video-watch.video-threads.list.params': true, |
30 | 'filter:api.video-watch.video-threads.list.result': true, | |
93cae479 | 31 | |
5f189c9c | 32 | // Filter params/result of the function that fetch the replies of a thread in the video-watch page |
7663e55a C |
33 | 'filter:api.video-watch.video-thread-replies.list.params': true, |
34 | 'filter:api.video-watch.video-thread-replies.list.result': true, | |
93cae479 | 35 | |
5f189c9c | 36 | // Filter params/result of the function that fetch videos according to the user search |
7663e55a C |
37 | 'filter:api.search.videos.list.params': true, |
38 | 'filter:api.search.videos.list.result': true, | |
5f189c9c | 39 | // Filter params/result of the function that fetch video-channels according to the user search |
7663e55a C |
40 | 'filter:api.search.video-channels.list.params': true, |
41 | 'filter:api.search.video-channels.list.result': true | |
42 | } | |
43 | ||
44 | export type ClientFilterHookName = keyof typeof clientFilterHookObject | |
45 | ||
46 | export const clientActionHookObject = { | |
5f189c9c | 47 | // Fired when the application is being initialized |
7663e55a | 48 | 'action:application.init': true, |
93cae479 | 49 | |
5f189c9c | 50 | // Fired when the video watch page is being initialized |
7663e55a | 51 | 'action:video-watch.init': true, |
5f189c9c | 52 | // Fired when the video watch page loaded the video |
7663e55a C |
53 | 'action:video-watch.video.loaded': true, |
54 | ||
5f189c9c | 55 | // Fired when the search page is being initialized |
23bdacf8 C |
56 | 'action:search.init': true, |
57 | ||
58 | // Fired every time Angular URL changes | |
59 | 'action:router.navigation-end': true | |
7663e55a | 60 | } |
93cae479 | 61 | |
7663e55a | 62 | export type ClientActionHookName = keyof typeof clientActionHookObject |
93cae479 | 63 | |
7663e55a C |
64 | export const clientHookObject = Object.assign({}, clientFilterHookObject, clientActionHookObject) |
65 | export type ClientHookName = keyof typeof clientHookObject | |
93cae479 C |
66 | |
67 | export interface ClientHook { | |
68 | runHook <T> (hookName: ClientHookName, result?: T, params?: any): Promise<T> | |
69 | } |