<?php
/**
 * TOON Decoder Interface
 *
 * Defines the contract for decoding TOON format to PHP arrays.
 *
 * @package AIPT\Api\StoreIndex
 * @since 2.5.0
 */

namespace AIPT\Api\StoreIndex;

/**
 * ToonDecoderInterface
 *
 * Contract for TOON decoding operations.
 */
interface ToonDecoderInterface {

	/**
	 * Decode a TOON string to PHP array.
	 *
	 * @param string $toon TOON-formatted string.
	 * @return array Index data with 'meta', 'products', 'categories' keys.
	 * @throws \RuntimeException If TOON is malformed.
	 */
	public function decode( string $toon ): array;

	/**
	 * Validate TOON structure without full decode.
	 *
	 * Performs lightweight validation to check basic structure.
	 *
	 * @param string $toon TOON-formatted string.
	 * @return bool True if valid structure.
	 */
	public function validate( string $toon ): bool;
}
