import {TypedAnimNode} from "./_Base";
import {TimelineBuilder as TimelineBuilder2} from "../../../core/animation/TimelineBuilder";
import {NodeParamsConfig, ParamConfig} from "../utils/params/ParamsConfig";
class DelayAnimParamsConfig extends NodeParamsConfig {
  constructor() {
    super(...arguments);
    this.delay = ParamConfig.FLOAT(1);
  }
}
const ParamsConfig2 = new DelayAnimParamsConfig();
export class DelayAnimNode extends TypedAnimNode {
  constructor() {
    super(...arguments);
    this.params_config = ParamsConfig2;
  }
  static type() {
    return "delay";
  }
  initializeNode() {
    this.io.inputs.setCount(0, 1);
    this.scene().dispatchController.onAddListener(() => {
      this.params.onParamsCreated("params_label", () => {
        this.params.label.init([this.p.delay]);
      });
    });
  }
  cook(input_contents) {
    const timeline_builder = input_contents[0] || new TimelineBuilder2();
    timeline_builder.set_delay(this.pv.delay);
    this.set_timeline_builder(timeline_builder);
  }
}
