import { AppElementsInterception, AppElementsSlotBinding } from "./app-elements-wire.js";
import "./app-elements.js";
import { AppPageParams } from "./app-page-boundary.js";
import { AppPageErrorModule, AppPageLayoutEntry, AppPageModule, AppPageRouteWiringRoute, AppPageRouteWiringSlot, AppPageSlotOverride, AppPageTemplateEntry } from "./app-page-route-wiring.js";
//#region src/server/app-page-segment-plan.d.ts
type AppPageSlotSegmentPlan<TModule extends AppPageModule> = Readonly<{
  branchSegments: readonly string[];
  includedInPayload: boolean;
  key: string;
  nestedBfcacheSegments: readonly Readonly<{
    id: string;
    stateKey: string;
    treePosition: number | null;
  }>[];
  ownerTreePosition: number;
  params: AppPageParams;
  resetKey: string;
  routeSegments: readonly string[];
  slot: AppPageRouteWiringSlot<TModule>;
  slotId: string;
  slotOverride: AppPageSlotOverride<TModule> | undefined;
  targetIndex: number;
}>;
type AppPageSegmentPlan<TModule extends AppPageModule> = Readonly<{
  bfcacheSegmentIdentities: Readonly<Record<string, string>>;
  routeResetKey: string;
  slots: readonly AppPageSlotSegmentPlan<TModule>[];
}>;
/**
 * Serialise the resolved route/render model into the BFCache identities and
 * per-slot reset keys the browser treats as opaque. Route matching owns the
 * semantics — which segment intercepts, which params bind it — so this layer
 * only binds keys and derives identities from graph ids.
 */
declare function createAppPageSegmentPlan<TModule extends AppPageModule, TErrorModule extends AppPageErrorModule>(options: {
  includeSlot: (ownerTreePosition: number, targetTreePosition: number) => boolean;
  interception: AppElementsInterception | null;
  layoutEntries: readonly AppPageLayoutEntry<TModule, TErrorModule>[];
  matchedParams: AppPageParams;
  pageElementId: string;
  resolveSlotOverride: (slotKey: string, slotName: string) => AppPageSlotOverride<TModule> | undefined;
  rootLayoutTreePath: string | null;
  route: AppPageRouteWiringRoute<TModule, TErrorModule>;
  routeSegments: readonly string[];
  semanticPageIdentity: Readonly<{
    boundSegmentKey: string;
    interceptionGraphId: string;
    sourceBoundSegmentKey: string;
    sourceRouteGraphId: string;
  }> | null | undefined;
  semanticInterceptionTargetRouteId: string | null;
  slotBindings: readonly AppElementsSlotBinding[];
  templateEntries: readonly AppPageTemplateEntry<TModule>[];
}): AppPageSegmentPlan<TModule>;
//#endregion
export { createAppPageSegmentPlan };