| 1: | <?php |
| 2: | |
| 3: | namespace LaravelUi5\Core\Ui5\Contracts; |
| 4: | |
| 5: | use LaravelUi5\Core\Ui5\Data\Payload; |
| 6: | |
| 7: | /** |
| 8: | * Defines a contract for UI5 components that can render themselves based on dynamic data. |
| 9: | * |
| 10: | * A Renderable component transforms structured data provided by a Provider into |
| 11: | * a UI5-compatible output format (e.g., XML or JSON). This allows dynamic artifacts |
| 12: | * like Tiles, Cards, or KPIs to remain declarative while consuming real-time values. |
| 13: | */ |
| 14: | interface RenderableInterface |
| 15: | { |
| 16: | /** |
| 17: | * Renders the component using the given Payload. |
| 18: | * |
| 19: | * The returned string must be a valid XML fragment compatible with the UI5 runtime. |
| 20: | * The rendering process combines the declarative component structure with |
| 21: | * dynamic values provided at runtime. |
| 22: | * |
| 23: | * @param Payload $data The dynamic values calculated for this artifact instance. |
| 24: | * @return string XML representation of the fully composed UI5 component. |
| 25: | */ |
| 26: | public function render(Payload $data): string; |
| 27: | } |
| 28: |