import { NappletMessage, LinkOpenStatus, LinkOpenErrorCode, LinkOpenOptions } from '@napplet/core'; export { LinkOpenErrorCode, LinkOpenOptions, LinkOpenResult, LinkOpenStatus } from '@napplet/core'; /** * Napplet NAP link types entrypoint. * * @module */ /** * @napplet/nap/link -- Shell-mediated link opening message types. * * NAP-LINK lets a sandboxed napplet ask the shell to open an external URL for * the user. The shell owns navigation, policy, prompting, and browser context. * The napplet never receives direct navigation authority, opener access, * network access, or fetched bytes. */ /** The NAP domain name for shell-mediated link opening. */ declare const DOMAIN: "link"; /** Base interface for all link NAP messages. */ interface LinkMessage extends NappletMessage { /** Message type in "link." format. */ type: `link.${string}`; } /** Request that the shell open a user-visible external URL. */ interface LinkOpenMessage extends LinkMessage { type: 'link.open'; /** Correlation ID for this request. */ id: string; /** Absolute URL requested by the napplet. */ url: string; /** Optional prompt/display hints. */ options?: LinkOpenOptions; } /** Result of a `link.open` request. */ interface LinkOpenResultMessage extends LinkMessage { type: 'link.open.result'; /** Correlation ID matching the original request. */ id: string; /** Whether the shell opened or denied the link. */ status: LinkOpenStatus; /** Optional denial reason when `status` is `"denied"`. */ error?: LinkOpenErrorCode; } /** Napplet -> Shell link messages. */ type LinkOutboundMessage = LinkOpenMessage; /** Shell -> Napplet link messages. */ type LinkInboundMessage = LinkOpenResultMessage; /** All link NAP message types. */ type LinkNapMessage = LinkOutboundMessage | LinkInboundMessage; export { DOMAIN, type LinkInboundMessage, type LinkMessage, type LinkNapMessage, type LinkOpenMessage, type LinkOpenResultMessage, type LinkOutboundMessage };