// A page's head: what search engines and link previews read of it. The
// screen on top says it, as its view's `head` resolved against its answer
// (`_meta.ui.head`: a gallery's title, its first photo, its JSON-LD), with
// the picture it draws first and large preloaded (`_meta.ui.hero`), and
// the app's file says what any field it leaves out is (`head` in
// grain.social.json: the site's name, its title and description, the
// picture a page with none of its own shows, its Twitter account).
import { heroPreload, type UiHead } from '@hud/renderer';
import { read, type View } from '@hud/shared/result';
import { measureOf, type Measure } from './app';
import type { Answer } from './screen';
/** The app's defaults, from its file. */
export type AppHead = { siteName: string; title: string; description: string; image: string; imageAlt?: string; twitter?: string };
/** A picture's preload, as the renderer's `heroPreload` makes it: the attributes of its . */
export type Preload = NonNullable>;
/** What the screen on top says of the page: its view's `head`, the preload of its first large picture, its hero, and how wide it is drawn (`measure`, the shell's column). */
export type ScreenHead = { head: UiHead | null; preload: Preload | null; measure: Measure };
/** What the page's head says, every field filled. */
export type Head = {
title: string;
description: string;
image: string;
imageAlt: string | null;
/** Whether the image is the app's own, whose size is known (1200×630). */
ownImage: boolean;
type: 'website' | 'article' | 'profile';
/** The page's canonical URL, absolute. */
url: string;
noindex: boolean;
siteName: string;
twitter: string | null;
/** Its JSON-LD as the text of a