<?php

namespace Storeplugin\PDFInvoice\Framework\Contracts;

defined('ABSPATH') || exit;

/**
 * Meta Box Builder Interface
 *
 * Defines the public API for configuring custom meta boxes.
 * Factory methods (create) are left to concrete classes since their
 * signatures differ (e.g. post-type metabox vs order metabox).
 *
 * @package Storeplugin\PDFInvoice\Framework\Contracts
 */
interface MetaInterface
{
    /**
     * Set a description for the next section added via addSection().
     *
     * @param string $description Section description text
     *
     * @return self
     */
    public function withSectionDescription(string $description): self;

    /**
     * Add a section of fields to the metabox
     *
     * @param string $title  Section title
     * @param array  $fields Array of field definitions
     *
     * @return self
     */
    public function addSection($title, $fields): self;

    /**
     * Register and initialize the metabox
     *
     * @return void
     */
    public function render(): void;
}
