<?php
/**
 * Schema generator interface — every generator implements this.
 *
 * @package WPLens
 */

namespace WPLens\Schema;

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

interface Generator {

	/**
	 * Stable identifier used for per-type toggles.
	 */
	public function get_slug(): string;

	/**
	 * Human-readable label for the settings UI.
	 */
	public function get_label(): string;

	/**
	 * Whether this generator should run for the current view.
	 *
	 * @param \WP_Post|null $post The current post when applicable.
	 */
	public function applies( ?\WP_Post $post = null ): bool;

	/**
	 * Build the JSON-LD payload as an associative array. Return null to skip emission.
	 *
	 * @param \WP_Post|null $post
	 * @return array<string, mixed>|null
	 */
	public function generate( ?\WP_Post $post = null ): ?array;
}
