import * as React from "react"; import type { AdminHost, AdminSurface } from "./hooks.js"; /** What a slot's component receives: the default's props, and `renderDefault` to render what it replaces. */ export type SlotProps
= P & { /** * The next layer: the built-in component, or the plugin below this one. Pass the props you received (spread them to * change some); Admin keeps some state of its own in them. */ readonly renderDefault: (props: P) => React.ReactNode; }; /** A component for a slot; `X` is what Admin adds for the surface (`surface`, in the slots that render in both). */ export type SlotComponent
= (props: SlotProps
& X) => React.ReactNode;
/** The components registered for each slot name, innermost (nearest the built-in) first. */
export type AdminLayers = {
readonly [name: string]: readonly SlotComponent ({ name, Default, props }: {
name: string | readonly string[];
Default: React.ComponentType ;
props: P;
}): React.ReactElement;
/** The built-in component of a slot that has none: it renders nothing, so an application's component adds to the page. */
export declare function Empty(): null;
/** The admin MCP tool of a View or Procedure: its name lowercased, kebab to snake (`mcpToolNameSegment` in @aotter/mantle's compiler). */
export declare const toolName: (name: string) => string;
/**
* The slots for one column of a View an MCP App shows. The App knows a View by its tool, and a slot names the View, so the
* registered `cell:view:` names are matched by their tool name.
*/
export declare function useViewCellNames(tool: string, column: string): readonly string[];
/** Where this component renders. Branching on it is allowed; both branches must render. */
export declare function useSurface(): AdminSurface;
/**
* Open an http(s) URL outside Admin: a new tab in the browser, `ui/open-link` in an MCP host (which blocks navigation
* from its sandbox, so never `window.open` or `target="_blank"` in a component that renders there). Resolves false when
* the URL is not http(s), or an MCP host cannot or refuses to open it (the browser cannot tell, so it resolves true).
*
* Surface: both.
*/
export declare function useOpenLink(): (url: string) => Promise