/**
 * The ID describing a client.
 */
type ClientID = string;

type SubscribeToPresenceCallback = (presentClientIDs: ReadonlyArray<ClientID>) => void;
type PresenceSubscribable = {
    subscribeToPresence(callback: SubscribeToPresenceCallback): () => void;
};
declare function usePresence(r: PresenceSubscribable | null | undefined): ReadonlyArray<ClientID>;

declare type Subscribable<Tx, Data> = {
    subscribe: (query: (tx: Tx) => Promise<Data>, { onData }: {
        onData: (data: Data) => void;
    }) => () => void;
};
declare type RemoveUndefined<T> = T extends undefined ? never : T;
declare function useSubscribe<Tx, Data, QueryRet extends Data, Default>(r: Subscribable<Tx, Data> | null | undefined, query: (tx: Tx) => Promise<QueryRet>, def: Default, deps?: Array<unknown>): Default | RemoveUndefined<QueryRet>;

export { PresenceSubscribable, RemoveUndefined, Subscribable, SubscribeToPresenceCallback, usePresence, useSubscribe };
