import { Synnax as Client } from '@synnaxlabs/client';
import { observe, primitive } from '@synnaxlabs/x';
import { z } from 'zod';
import { ContextValue } from './Context';
import { OnChangeArgs, UseArgs, UseReturn } from './use';
interface QueryFnProps {
    client: Client;
}
interface ApplyObservableProps<Z extends z.ZodType, O = Z> {
    changes: O;
    ctx: ContextValue<Z>;
}
interface SyncLocalProps<Z extends z.ZodType> extends OnChangeArgs<Z> {
    client: Client;
}
interface UseSyncedProps<Z extends z.ZodType, O = Z> extends UseArgs<Z> {
    name: string;
    key: primitive.Value[];
    queryFn: (props: QueryFnProps) => Promise<z.infer<Z>>;
    openObservable?: (client: Client) => Promise<observe.ObservableAsyncCloseable<O>>;
    applyObservable?: (props: ApplyObservableProps<Z, O>) => void;
    applyChanges?: (props: SyncLocalProps<Z>) => Promise<void>;
}
export declare const useSynced: <Z extends z.ZodType, O = Z>({ key, name, queryFn, values: initialValues, openObservable, applyChanges, applyObservable, ...rest }: UseSyncedProps<Z, O>) => UseReturn<Z>;
export {};
//# sourceMappingURL=synced.d.ts.map