import type { RenderMode, VaryDimension } from './render-mode.js';

export interface PageDocument {
  path: string;
  layout: string;
  locale: string;
  metadata: PageMetadata;
  regions: Record<string, RegionNode>;
  renderMode: RenderMode;
}

export interface PageMetadata {
  title: string;
  description?: string;
  openGraph?: Record<string, string>;
  canonicalUrl?: string;
  alternateLocales?: { locale: string; path: string }[];
  customHead?: string[];
}

export interface RegionNode {
  kind: 'region';
  name: string;
  children: Array<BlockNode | FragmentRefNode>;
}

export interface BlockNode {
  kind: 'block';
  id: string;
  component: string;
  props: Record<string, unknown>;
  renderHints: BlockRenderHints;
  contentRef?: string;
}

export interface BlockRenderHints {
  canStatic: boolean;
  needsSSR: boolean;
  isIsland: boolean;
  islandMode?: 'ssr' | 'client';
  varyDimensions?: VaryDimension[];
}

export interface FragmentRefNode {
  kind: 'fragment-ref';
  fragmentId: string;
  inline: boolean;
}
