<?php

namespace GemBoards;

use GemBoards\Ajax\Auth;
use GemBoards\Ajax\Bookmark;
use GemBoards\Ajax\Board;
use GemBoards\Ajax\BoardMembers;
use GemBoards\Ajax\BulkCard;
use GemBoards\Ajax\Card;
use GemBoards\Ajax\Columns;
use GemBoards\Ajax\Folder;
use GemBoards\Ajax\GlobalSearch;
use GemBoards\Ajax\Project;
use GemBoards\Ajax\Setting;
use GemBoards\Ajax\Tasks;
use GemBoards\Ajax\Taxonomy;

if ( ! defined('ABSPATH') ) {
	exit; // Exit if accessed directly.
}

class Ajax {

	public static function init(): void {
		$self = new self();
		add_action( 'init', [ $self, 'dispatch_hooks' ]);
	}

	public function dispatch_hooks(): void {
		( new Board() )->dispatch_actions();
		( new Bookmark() )->dispatch_actions();
		( new Card() )->dispatch_actions();
		( new Columns() )->dispatch_actions();
		( new BoardMembers() )->dispatch_actions();
		( new Tasks() )->dispatch_actions();
		( new Taxonomy() )->dispatch_actions();
		( new Folder() )->dispatch_actions();
		( new Project() )->dispatch_actions();
		( new Setting() )->dispatch_actions();
		( new Auth() )->dispatch_actions();
		( new GlobalSearch() )->dispatch_actions();
		( new BulkCard() )->dispatch_actions();
	}
}
