/** * SDK-internal data layer initialization. * * Called lazily by createP1Handler / createP1Pages on the first * request. Deduplicates so the init runs at most once regardless * of how many entry points import it. */ import type { PageStore } from "./types"; import { type P1StoreClient } from "./p1-store"; export interface P1DataConfig { /** Base URL of the API. */ p1BaseUrl?: string; /** API key for the backend. */ p1ApiKey?: string; /** Site ID in the backend. */ p1SiteId?: string; /** * Branch ID. When omitted the SDK auto-detects the main branch. */ p1BranchId?: string; } /** * Ensures data stores are initialized. Safe to call from multiple * entry points — runs only once and subsequent calls return the * same resolved promise. */ export declare function ensureInitialized(dataConfig: P1DataConfig): Promise; /** * Creates a PageStore scoped to a specific branch, reusing the * shared P1Client and siteId from the initial ensureInitialized() call. * Useful for the structure page to read/write routes on non-default branches. */ export declare function createPageStoreForBranch(branchId: string): PageStore; export declare function getSharedP1Client(): P1StoreClient | null; export declare function getSharedSiteId(): string | null; export declare function getSharedBranchId(): string | null; export declare function createAuthenticatedClient(bearerToken: string): P1StoreClient | null; /** Reset for testing. */ export declare function _resetInit(): void;