import type { EntrySubrouteContextData, OccurrenceContextData } from '../PageRenderer';
/**
 * Every known subroute kind. Derived from {@link EntrySubrouteContextData} so
 * adding a new variant there flows here automatically.
 */
export type EntrySubrouteKind = EntrySubrouteContextData['kind'];
/**
 * Inner payload shape for the `course-run` variant. Exposed because it's the
 * only kind whose payload isn't already named (events use `OccurrenceContextData`).
 */
export type CourseRunPayload = Extract<EntrySubrouteContextData, {
    kind: 'course-run';
}>['run'];
/**
 * Inner payload type for a given subroute kind.
 *
 * The conditional mapping centralises the `occurrence`/`run` field-name
 * asymmetry so consumers can stay generic. When you extend
 * {@link EntrySubrouteContextData} with a new variant, add a branch here and
 * {@link foldSubroute} below — the type system will surface every other
 * call site that needs updating.
 */
export type SubroutePayload<K extends EntrySubrouteKind> = K extends 'event-occurrence' ? OccurrenceContextData : K extends 'course-run' ? CourseRunPayload : never;
/**
 * Per-kind handler set. The `Record<EntrySubrouteKind, …>` shape forces every
 * kind to have a handler — adding a new kind to {@link EntrySubrouteContextData}
 * will fail to typecheck until every fold in the codebase is updated.
 */
export type SubrouteFold<T> = {
    [K in EntrySubrouteKind]: (payload: SubroutePayload<K>) => T;
};
/**
 * Typeclass-style exhaustive dispatch over a subroute context.
 *
 * The single place that knows how to peel the discriminated union open and
 * hand its inner payload to a kind-specific handler. Use this instead of
 * inline `switch (ctx.kind)` so the dispatch stays consistent across
 * consumers (notice, SEO, breadcrumbs, …).
 */
export declare function foldSubroute<T>(ctx: EntrySubrouteContextData, fold: SubrouteFold<T>): T;
