import * as React from 'react'; /** * Creates a scoped `[Provider, useContext]` pair for a compound component's internal state, whose `useContext(consumerName)` throws a descriptive error instead of silently returning `undefined` outside its root. * * @param rootComponentName - Name of the root component, used in the Provider's `displayName` and in error messages. * @param defaultValue - Optional fallback so the context also works without a Provider (rare; most compound components require one). * @returns A `[Provider, useContext, useOptionalContext]` tuple. `useContext` takes the *consuming* part's name so its error message names the right component; `useOptionalContext` returns `undefined` instead of throwing, for the rare part whose root is optional. * * @example * ```tsx * const [TabsProvider, useTabsContext] = createSafeContext('Tabs'); * * // in Tabs.tsx * {children} * * // in TabsTrigger.tsx * const context = useTabsContext('TabsTrigger'); // throws "`TabsTrigger` must be used within `Tabs`." if misused * ``` * * @internal Not part of the public API; import it inside the package only. */ export declare function createSafeContext(rootComponentName: string, defaultValue?: ContextValue): readonly [ React.FC, (consumerName: string) => ContextValue, () => ContextValue | undefined ];