import { DefaultTheme } from 'styled-components'; import { OSTheme } from './contract'; /** * Resolve the active OS theme, falling back to the default XP theme when no * `ThemeProvider` is above the consumer (#213 B1). * * Bare usage of the public `/apps` and `/components` subpaths — and direct * unit renders — has no provider; styled interpolations then receive `{}` * (reading `theme.tokens` crashes) and styled-components' `useTheme()` hook * throws outright. Crashing there would break the package's public API, so * the fallback mirrors AppProviders' own `theme = xpTheme` default. * Consumers never test for this themselves: every theme read goes through * this resolver. */ export declare const resolveOSTheme: (theme: DefaultTheme | undefined) => OSTheme; /** * Read the active OS theme from context (#213 B1). * * The composition root wraps the desktop in a styled-components `ThemeProvider` * carrying the selected {@link OSTheme} (default `xpTheme`). `useOSTheme()` is * the typed accessor non-styled TSX uses to reach tokens/fonts/assets at * runtime — the counterpart of `props.theme` inside styled components. It is the * migration target for consumers that currently import the static `COLORS` / * `FONTS`: once a call site reads the theme from context, a swapped theme * reaches it without a rebuild. * * Works with or without the provider (see {@link resolveOSTheme}); under the * provider the active theme is returned as-is. Reads `ThemeContext` directly * because styled-components' `useTheme()` *throws* without a provider instead * of yielding an empty theme. `DefaultTheme` is augmented to `OSTheme` in * `src/styled.d.ts`, so the return is already typed; the annotation here just * makes the contract explicit. */ export declare const useOSTheme: () => OSTheme;