blob: 29dbd1f1ff70d3a7b65dd7c53b3abc6d8f02c148 [file] [log] [blame]
import Script from "../../../common/architecture/scripts/Script";
import { NodeWatcherHandler } from "../../../presentation/nodeWatcher/NodeWatcherHandler";
import { NodeWatcherPort } from "../../../presentation/nodeWatcher/NodeWatcher.port";
export default class NodeWatcherScriptAdapter extends Script {
// TODO: Delete this once these properties are removed from Script.
page: never;
environment: never;
runPhase: never;
constructor(
private nodeWatcher: NodeWatcherPort,
private handlers: Map<string, NodeWatcherHandler>,
) {
super();
}
execute() {
this.nodeWatcher.start();
for (const [key, handler] of this.handlers) {
this.nodeWatcher.setHandler(key, handler);
}
}
}