import type { Atom } from 'jotai/vanilla';
/**
 * in milliseconds
 */
type CreatedAt = number;
type ShouldRemove = (createdAt: CreatedAt, param: Param) => boolean;
type Cleanup = () => void;
type Callback = (event: {
    type: 'CREATE' | 'REMOVE';
    param: Param;
    atom: AtomType;
}) => void;
export interface AtomFamily {
    (param: Param): AtomType;
    getParams(): Iterable;
    remove(param: Param): void;
    setShouldRemove(shouldRemove: ShouldRemove | null): void;
    /**
     * fires when a atom is created or removed
     * This API is for advanced use cases, and can change without notice.
     */
    unstable_listen(callback: Callback): Cleanup;
}
export declare function atomFamily>(initializeAtom: (param: Param) => AtomType, areEqual?: (a: Param, b: Param) => boolean): AtomFamily;
export {};
declare type Awaited = T extends Promise ? V : T;