blob: be9c2d3249f28e6c345eee7157fee5df0ba9ab91 [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';
Adrià Vilanova Martínez8b591d92024-10-19 15:55:15 +02009import LegacyNodeWatcherScript from '../../../common/architecture/scripts/nodeWatcher/LegacyNodeWatcherScript';
Adrià Vilanova Martínez58cc67c2024-04-21 16:43:01 +020010import 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
Adrià Vilanova Martínez8b591d92024-10-19 15:55:15 +020018export default class AutoRefreshNodeWatcherScript extends LegacyNodeWatcherScript<AutoRefreshNodeWatcherDependencies> {
Adrià Vilanova Martínez58cc67c2024-04-21 16:43:01 +020019 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}