import { NativeBridgeFrame } from "./native-bridge.js"; import { FlutterMobileRoutePattern } from "./shell-route-matcher.js"; import { CoreframeNavigation, CoreframeShell, NavigationDestination, NavigationInput, NavigationResult, NavigationType, ShellPlatform, ShellRouteEntry } from "@coreframe/lib/shell"; //#region src/shell.d.ts type FlutterRouteEntry = ShellRouteEntry & { readonly params: Readonly>; }; /** Web-local route state that accompanies a native navigation without crossing the bridge. */ type FlutterRouterNavigation = { readonly destination: NavigationDestination; readonly state: unknown; }; type FlutterNavigationInput = NavigationInput | FlutterRouterNavigation; type FlutterNavigation = CoreframeNavigation & { navigate(input: FlutterNavigationInput, type?: NavigationType): Promise; }; type FlutterShell = Omit & { readonly navigation: FlutterNavigation; }; type FlutterSessionHint = { readonly revision: string; readonly status: "unknown"; } | { readonly revision: string; readonly status: "authenticated" | "unauthenticated"; readonly validUntil: number; }; type FlutterShellOptions = { readonly clearApplicationState?: () => Promise | void; readonly clearSession: () => Promise; readonly contract: { readonly decodeHostToWebFrame: (value: unknown) => HostFrame; readonly encodeWebToHostFrame: (value: unknown) => string; readonly protocolVersion: number; readonly routes: readonly FlutterMobileRoutePattern[]; readonly stacks: readonly { readonly id: string; }[]; }; readonly platform: ShellPlatform; readonly sessionHint: { get(): FlutterSessionHint; subscribe(notify: () => void): () => void; }; }; /** Composes the persistent root-WebView shell around an application's generated route contract. */ declare function createFlutterShell(options: FlutterShellOptions): FlutterShell; //#endregion export { type FlutterMobileRoutePattern, FlutterNavigation, FlutterNavigationInput, FlutterRouteEntry, FlutterRouterNavigation, FlutterShell, FlutterShellOptions, createFlutterShell };