import { Primitive, UnknownRecord } from '@synnaxlabs/x';
export type State = Primitive | UnknownRecord;
export type SetFunc<S, PS = S> = (prev: PS) => S;
export declare const isSetter: <S extends State>(arg: SetArg<S>) => arg is SetFunc<S>;
export type SetArg<S extends State, PS = S> = S | SetFunc<S, PS>;
export type Set<S extends State> = (value: SetArg<S>) => void;
export type PureSet<S extends State> = (value: S) => void;
export type Initial<S extends State> = S | (() => S);
export declare const executeSetter: <S extends State>(setter: SetArg<S>, prev: S) => S;
export declare const executeInitialSetter: <S extends State>(setter: Initial<S>) => S;
export declare const isInitialSetter: <S extends State>(arg: Initial<S>) => arg is () => S;
export type UseReturn<S extends State> = [S, Set<S>];
export type Use = <S extends State>(initial: Initial<S>) => UseReturn<S>;
export type PureUseReturn<S extends State> = [S, PureSet<S>];
export type PureUse<S extends State> = (initial: S) => PureUseReturn<S>;
export interface UsePassthroughProps<S extends State> {
    initial: Initial<S>;
    value?: S;
    onChange?: Set<S>;
}
export declare const usePassthrough: <S extends State>({ initial, value, onChange, }: UsePassthroughProps<S>) => UseReturn<S>;
export interface UsePurePassthroughProps<S extends State> {
    initial: Initial<S>;
    value?: S;
    onChange?: PureSet<S>;
    callOnChangeIfValueIsUndefined?: boolean;
}
export declare const usePurePassthrough: <S extends State>({ initial, value, onChange, }: UsePurePassthroughProps<S>) => PureUseReturn<S>;
export declare const usePersisted: <S extends State>(initial: Initial<S>, key: string) => UseReturn<S>;
//# sourceMappingURL=state.d.ts.map