import * as react_jsx_runtime from 'react/jsx-runtime';
import { ReactNode } from 'react';

/**
 * Context value that provides plugin-specific overrides
 * Generic over the shape of all plugin overrides
 */
interface StackContextValue<TPluginOverrides extends Record<string, any>> {
    /**
     * The overrides for the plugin.
     */
    overrides: TPluginOverrides;
    /**
     * The base path where the client router is mounted.
     */
    basePath: string;
}
/**
 * Provider component for BTST context
 * Provides type-safe access to plugin-specific overrides
 *
 * Only requires override values, not plugin objects - keeps bundle size minimal!
 *
 * @example
 * ```tsx
 * // Define the type shape (no import of plugin values needed!)
 * type MyPluginOverrides = {
 *   todos: TodosPluginOverrides;
 *   messages: MessagesPluginOverrides;
 * };
 *
 * <StackProvider<MyPluginOverrides>
 *   overrides={{
 *     todos: {
 *       Link: (props) => <NextLink {...props} />,
 *       navigate: (path) => router.push(path),
 *     },
 *     messages: {
 *       MarkdownRenderer: (props) => <ReactMarkdown {...props} />,
 *     }
 *   }}
 * >
 *   {children}
 * </StackProvider>
 * ```
 */
declare function StackProvider<TPluginOverrides extends Record<string, any> = Record<string, any>>({ children, overrides, basePath, }: {
    children?: ReactNode;
    overrides: TPluginOverrides;
    basePath: string;
}): react_jsx_runtime.JSX.Element;
/**
 * Hook to access the entire BTST context
 * Useful if you need access to multiple plugins or the full context
 *
 * @returns The full context value including overrides and basePath
 * @throws Error if used outside of StackProvider
 *
 * @example
 * ```tsx
 * const { overrides, basePath } = useStack<MyPluginOverrides>();
 * ```
 */
declare function useStack<TPluginOverrides extends Record<string, any> = Record<string, any>>(): StackContextValue<TPluginOverrides>;
type OverridesResult<TOverrides, TDefaults> = undefined extends TDefaults ? TOverrides : TOverrides & Required<Pick<TDefaults & {}, keyof TDefaults>>;
/**
 * Hook to access overrides for a specific plugin
 * This is type-safe and will only expose the overrides defined by that plugin
 *
 * When default values are provided, properties with defaults are guaranteed to be non-null.
 *
 * @example
 * ```tsx
 * // Without defaults - trusts plugin is configured
 * function TodosList() {
 *   const { navigate } = usePluginOverrides<TodosPluginOverrides>("todos");
 *   // navigate is (path: string) => void (required fields are non-nullable)
 *   navigate("/todos/add");
 * }
 *
 * // With defaults - optional fields with defaults become required
 * function TodosList() {
 *   const { localization } = usePluginOverrides<TodosPluginOverrides, Partial<TodosPluginOverrides>>("todos", {
 *     localization: DEFAULT_LOCALIZATION
 *   });
 *   // localization is Localization (guaranteed to exist because we provided a default)
 *   console.log(localization.SOME_KEY);
 * }
 * ```
 */
declare function usePluginOverrides<TOverrides = any, TDefaults extends Partial<TOverrides> | undefined = undefined>(pluginName: string, defaultValues?: TDefaults): OverridesResult<TOverrides, TDefaults>;
/**
 * Hook to access the base path where the client router is mounted
 *
 * @returns The base path string (e.g., "/pages")
 * @throws Error if used outside of StackProvider
 *
 * @example
 * ```tsx
 * const basePath = useBasePath();
 * // basePath = "/pages"
 * ```
 */
declare function useBasePath(): string;

export { StackProvider, useBasePath, usePluginOverrides, useStack };
