<?php
/**
 * REST routes registration.
 *
 * @package AuraBuilder
 */

declare(strict_types=1);

namespace AuraBuilder\REST;

final class RestRegistrar {

	/** Unique REST namespace (Plugin Review: avoid generic prefixes). */
	public const NS = 'aptb/v1';

	public function hooks(): void {
		add_action( 'rest_api_init', array( $this, 'register' ) );
	}

	public function register(): void {
		( new DocumentsController() )->register( self::NS );
		( new WidgetsController() )->register( self::NS );
		( new GlobalsController() )->register( self::NS );
		( new ThemePartsController() )->register( self::NS );
		( new TemplatesController() )->register( self::NS );
	}
}
