<?php
declare(strict_types=1);
namespace PpPhp\Core\Designer\Generation\Contracts;
final class GeneratedPage{
 public function __construct(private readonly string $id,private readonly string $pageType,private readonly string $path,private readonly string $title,private readonly string $html,private readonly array $assets=[],private readonly array $route=[],private readonly array $meta=[]){ }
 public static function create(string $id,string $pageType,string $path,string $title,string $html,array $assets=[],array $route=[],array $meta=[]):self{return new self($id,$pageType,$path,$title,$html,$assets,$route,$meta);} 
 public function id():string{return $this->id;} public function pageType():string{return $this->pageType;} public function path():string{return $this->path;}
 public function toArray():array{return ['id'=>$this->id,'pageType'=>$this->pageType,'path'=>$this->path,'title'=>$this->title,'html'=>$this->html,'assets'=>$this->assets,'route'=>$this->route,'meta'=>$this->meta,'bytes'=>strlen($this->html)];}
}
