<?php
/**
 * Module contract.
 *
 * Every feature in Platform Helm is a self-contained module implementing this
 * interface and registered through the ModuleRegistry. The Plugin loader calls
 * boot() on every enabled module during the `plugins_loaded` action.
 *
 * The contract is intentionally tiny: identity, a human label, a default
 * on/off state, and a single boot() that registers hooks. Modules must NOT do
 * expensive work in boot() — hooks only.
 *
 * @package Platform\Helm\Contracts
 */

declare( strict_types = 1 );

namespace Platform\Helm\Contracts;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

interface ModuleInterface {

	/**
	 * Unique, stable identifier. Used as the settings key for the on/off
	 * toggle and as an AJAX action prefix where applicable.
	 *
	 * Must be lowercase snake_case, e.g. `link_suggester`.
	 */
	public function id(): string;

	/**
	 * Human-readable name shown on the settings page.
	 */
	public function name(): string;

	/**
	 * Short description shown beneath the toggle on the settings page.
	 */
	public function description(): string;

	/**
	 * Whether this module is enabled by default on a fresh install.
	 */
	public function default_enabled(): bool;

	/**
	 * Register all hooks. Called exactly once per request when the module is
	 * enabled. Must not perform expensive work — hooks only.
	 */
	public function boot(): void;
}
