import { Subscription } from '@napplet/core'; import { Theme } from './types.js'; /** * Napplet NAP theme shim entrypoint. * * @module */ /** * Handle theme.* result and push messages from the shell via the central * message listener. */ declare function handleThemeMessage(msg: { type: string; [key: string]: unknown; }): void; /** * Get the shell's current active theme. * * @returns The current theme payload (colors, optional fonts/background/title) * * @example * ```ts * const theme = await window.napplet.theme.get(); * document.body.style.background = theme.colors.background; * ``` */ declare function get(): Promise; /** * Listen for shell-pushed theme changes (theme.changed). * * @param handler Called with the updated theme whenever the shell's active * theme changes * @returns Subscription with close() to detach the handler * * @example * ```ts * const sub = window.napplet.theme.onChanged((theme) => applyTheme(theme)); * // later: sub.close(); * ``` */ declare function onChanged(handler: (theme: Theme) => void): Subscription; /** * Install the theme shim. * * @returns cleanup function that clears pending requests and change handlers */ declare function installThemeShim(): () => void; export { get, handleThemeMessage, installThemeShim, onChanged };