import type { Alpine } from "alpinejs";

import { headerMenu } from "./header-menu";
import { postLineNum } from "./post-line-num";
import { postToc } from "./post-toc";
import { themeComment } from "./theme-comment";
import { themeMode } from "./theme-mode";
import { upvote } from "./upvote";
import { initDevcmActivityActions } from "./activity-actions";
import { initTypedText } from "./typed-text";

export const bootDevcmAlpine = (Alpine: Alpine) => {
  window.Alpine = Alpine;

  Alpine.data("upvote", upvote);
  Alpine.data("themeMode", themeMode);
  Alpine.data("postLineNum", postLineNum);
  Alpine.data("postToc", postToc);
  Alpine.data("headerMenu", headerMenu);
  Alpine.data("themeComment", themeComment);

  initDevcmActivityActions();
  initTypedText();

  Alpine.start();
};
