import './init-css-interop';
import React from 'react';
import { type StyleProp, type ViewStyle } from 'react-native';
import { type AppColorName } from './color-presets';
import { type BloomThemeStorage } from './persistence';
import type { Theme, ThemeMode } from './types';
export interface BloomThemeContextValue {
    theme: Theme;
    mode: ThemeMode;
    colorPreset: AppColorName;
    setMode: (mode: ThemeMode) => void;
    setColorPreset: (preset: AppColorName) => void;
    /**
     * Restore mode and color preset to the provider defaults
     * (`defaultMode` / `defaultColorPreset`) and clear the persisted entry.
     * Use this when signing out or otherwise resetting per-user state.
     */
    resetTheme: () => void;
}
declare global {
    var __oxyhq_bloom_theme_context__: React.Context<BloomThemeContextValue | null> | undefined;
}
/**
 * `BloomThemeContext` is a `globalThis`-guarded singleton so that every physical
 * copy of this module returns the SAME React context object.
 *
 * Why this is required: `package.json`'s `exports["./theme"]` ships a
 * `react-native` → `./src/...` condition alongside the `import` → `./lib/module/...`
 * and `require` → `./lib/commonjs/...` forks, so up to three physical copies of the
 * theme module can coexist in a single bundle. A bundler can resolve them through
 * DIFFERENT conditions across import paths — e.g. an app importing `@oxyhq/bloom/theme`
 * lands on the `src` copy while `@oxyhq/bloom/toast`'s `Toast.tsx` imports
 * `../theme/use-theme` relatively and lands on a different physical copy. With a plain
 * module-level `createContext(...)`, each copy creates its OWN context object: the
 * mounted `<BloomThemeProvider>` writes into context A while `useTheme`/`useBloomTheme`/
 * `Toast`/`Dialog` read context B, so `useContext` returns `null` and they throw
 * "must be used within a <BloomThemeProvider>" even when correctly wrapped. This is the
 * same src-vs-lib dual-instance class react-native-css guards its `StyleCollection`/
 * root-variable families against. Anchoring the context on `globalThis` (keyed by the
 * `__oxyhq_bloom_theme_context__` property) collapses all copies onto one object. The
 * `??=` runs `createContext` at most once per process.
 */
export declare const BloomThemeContext: React.Context<BloomThemeContextValue | null>;
export interface BloomThemeProviderProps {
    /** Controlled mode. Omit to use Bloom's internal state (with optional persistence). */
    mode?: ThemeMode;
    /** Controlled color preset. Omit to use Bloom's internal state. */
    colorPreset?: AppColorName;
    /** Initial mode when uncontrolled and nothing is persisted yet. */
    defaultMode?: ThemeMode;
    /** Initial color preset when uncontrolled and nothing is persisted yet. */
    defaultColorPreset?: AppColorName;
    onModeChange?: (mode: ThemeMode) => void;
    onColorPresetChange?: (preset: AppColorName) => void;
    /**
     * Persist mode + preset under this storage key. Bloom becomes the single
     * source of truth — apps don't need their own theme store. Has no effect
     * without `storage`.
     */
    persistKey?: string;
    /**
     * Storage adapter paired with `persistKey`. Use `webLocalStorage` on web,
     * or pass an `AsyncStorage`-compatible adapter on native.
     */
    storage?: BloomThemeStorage;
    /**
     * Block rendering until persisted state has been read. Default `true` when
     * both `persistKey` and `storage` are provided, ensuring native apps don't
     * flash the default palette. Web hydrates synchronously so this is a no-op
     * there.
     */
    awaitHydration?: boolean;
    /** Rendered while async hydration is pending. */
    onHydrating?: React.ReactNode;
    /** Load and inject Bloom's font system. Default `true`. */
    fonts?: boolean;
    /** Rendered while native fonts load. Ignored on web. */
    onFontsLoading?: React.ReactNode;
    /**
     * Style applied to the native `<View>` wrapper that carries the preset's
     * CSS vars. Defaults to `{ flex: 1 }`. Ignored on web (the provider writes
     * vars to `document.documentElement` instead of using a wrapper).
     */
    nativeWrapperStyle?: StyleProp<ViewStyle>;
    children: React.ReactNode;
}
export declare function BloomThemeProvider({ mode: controlledMode, colorPreset: controlledPreset, defaultMode, defaultColorPreset, onModeChange, onColorPresetChange, persistKey, storage, awaitHydration, onHydrating, fonts, onFontsLoading, nativeWrapperStyle, children, }: BloomThemeProviderProps): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=BloomThemeProvider.d.ts.map