import type { UnknownContext } from "@pie-players/pie-context";
import { type RegionScopeContextListener, type RuntimeContextListener, type ShellContextListener } from "../context/runtime-context-consumer.js";
type BaseEventInit = Pick<EventInit, "bubbles" | "composed" | "cancelable">;
/**
 * Contract helper for all toolkit/tool events that must cross custom-element boundaries.
 */
export declare function createCrossBoundaryEvent<T>(name: string, detail: T, init?: Partial<BaseEventInit>): CustomEvent<T>;
/**
 * Dispatches a cross-boundary event with toolkit defaults.
 */
export declare function dispatchCrossBoundaryEvent<T>(target: EventTarget, name: string, detail: T, init?: Partial<BaseEventInit>): boolean;
/**
 * Shared runtime-context connection contract for tools and shells.
 * Uses retry + provider announcements so late providers are tolerated.
 */
export declare function connectToolRuntimeContext(host: HTMLElement, onValue: RuntimeContextListener): () => void;
/**
 * Shared shell-context connection contract for tools needing item/passage scope.
 */
export declare function connectToolShellContext(host: HTMLElement, onValue: ShellContextListener): () => void;
/**
 * Shared region-scope context contract for tools targeting content subregions.
 */
export declare function connectToolRegionScopeContext(host: HTMLElement, onValue: RegionScopeContextListener): () => void;
/**
 * Guard utility: narrows unknown context payloads when needed by callers.
 */
export declare function isContextValueDefined<T extends UnknownContext>(value: unknown): value is T["__context__"];
export {};
