import type { Unsubscribe } from './events';
/**
 * @category Utilities
 */
export declare class KeyedObserver<Key extends string> {
    private subscribe;
    private observedKeys;
    constructor(subscribe: (key: Key) => Unsubscribe | undefined);
    setSubscribe(subscribe: (key: Key) => Unsubscribe | undefined): void;
    observe(keys: ReadonlyArray<Key>): void;
    stopListening(): void;
}
/**
 * Represents a per-key event store which can be subscribed to listen its changes.
 *
 * This store is similar to one accepted by
 * [React.useSyncEventStore](https://react.dev/reference/react/useSyncExternalStore)
 * hook but accepted by {@link useKeyedSyncStore} instead.
 *
 * Arbitrary `context` value can be made required by the store which is captured
 * on the initial subscription and its changes does not force a re-subscription.
 *
 * @see {@link useKeyedSyncStore}
 */
export type KeyedSyncStore<K, Context> = (key: K, context: Context, onStoreChange: () => void) => () => void;
/**
 * Same as [React.useSyncEventStore](https://react.dev/reference/react/useSyncExternalStore)
 * but for {@link KeyedSyncStore} which supports per-key store subscription.
 *
 * @category Hooks
 */
export declare function useKeyedSyncStore<K extends string, Context>(store: KeyedSyncStore<K, Context>, keys: ReadonlyArray<K>, context: Context): void;
//# sourceMappingURL=keyedObserver.d.ts.map