blob: 5308a352e2fa7a52b4ff9cc004e297eb715bac21 [file] [log] [blame]
Adrià Vilanova Martínez58cc67c2024-04-21 16:43:01 +02001import DependenciesProviderSingleton, {
2 AutoRefreshDependency,
3} from '../../../common/architecture/dependenciesProvider/DependenciesProvider';
4import {
5 ScriptEnvironment,
6 ScriptPage,
7 ScriptRunPhase,
8} from '../../../common/architecture/scripts/Script';
9import NodeWatcherScript from '../../../common/architecture/scripts/nodeWatcher/NodeWatcherScript';
10import AutoRefresh from '../core/autoRefresh';
11import AutoRefreshThreadListHideHandler from '../nodeWatcherHandlers/threadListHide.handler';
12import AutoRefreshThreadListSetUpHandler from '../nodeWatcherHandlers/threadListSetUp.handler';
13
14export interface AutoRefreshNodeWatcherDependencies {
15 autoRefresh: AutoRefresh;
16}
17
18export default class AutoRefreshNodeWatcherScript extends NodeWatcherScript<AutoRefreshNodeWatcherDependencies> {
19 public page = ScriptPage.CommunityConsole;
20 public environment = ScriptEnvironment.ContentScript;
21 public runPhase = ScriptRunPhase.Main;
22 public handlers = new Map([
23 ['autoRefreshThreadListSetUp', AutoRefreshThreadListSetUpHandler],
24 ['autoRefreshThreadListHide', AutoRefreshThreadListHideHandler],
25 ]);
26
27 protected optionsFactory(): AutoRefreshNodeWatcherDependencies {
28 const dependenciesProvider = DependenciesProviderSingleton.getInstance();
29 return {
30 autoRefresh: dependenciesProvider.getDependency(AutoRefreshDependency),
31 };
32 }
33}