/** * Locale Rows * * The switcher's list, built from the site's markets and the variants a * canonical page holds. Rows are measured from the canonical rather than from * the open document, so a translation sees the same set its canonical does and * "add a locale" means the same thing wherever the editor is standing. */ import type { Document } from '@pantheon-systems/css-client'; /** * `exists` names a document to open, `available` offers to create one, and * `current` is the document already open. */ export type LocaleRowState = 'current' | 'exists' | 'available'; export interface LocaleRow { /** The market this row publishes, or null for the canonical's untagged page. */ locale: string | null; /** The document to open, or null when this locale has none yet. */ documentId: string | null; state: LocaleRowState; /** This row is the canonical's own document — the switcher's Source row. */ isSource: boolean; } export interface BuildLocaleRowsParams { /** The site's configured markets, in the order editors should see them. */ markets: string[]; canonical: Document; /** The canonical's locale variants. */ variants: Document[]; currentDocumentId: string | null; } export declare function buildLocaleRows({ markets, canonical, variants, currentDocumentId, }: BuildLocaleRowsParams): LocaleRow[];