import { Foxact } from '../types/index.js';

interface ProviderProps<T> {
    initialState?: T | (() => T);
}
/** @see https://foxact.skk.moe/context-state */
declare function createContextState<T>(initialState: T): [
    Provider: React.ComponentType<Foxact.PropsWithChildren>,
    useValue: () => T,
    useSetValue: () => React.Dispatch<React.SetStateAction<T>>,
    StateContext: React.Context<T>
];
declare function createContextState<T>(initialState: T): [
    Provider: React.ComponentType<Foxact.PropsWithChildren<ProviderProps<T>>>,
    useValue: () => T,
    useSetValue: () => React.Dispatch<React.SetStateAction<T>>,
    StateContext: React.Context<T>
];
declare function createContextState<T>(): [
    Provider: React.ComponentType<Foxact.PropsWithChildren<Required<ProviderProps<T>>>>,
    useValue: () => T,
    useSetValue: () => React.Dispatch<React.SetStateAction<T>>,
    StateContext: React.Context<T>
];

export { createContextState };
export type { ProviderProps };
