import type { Abortable } from '../../../../framework-types/abortable/Abortable';
import type { ContextualizedTask } from '../../../../framework-types/execution-context/ExecutionContext';
import type { ContextHaving } from '../../../../framework-types/execution-context/Types';
import type { AnyTask, NamedTask, Task } from '../../../../framework-types/task/Types';
import type { EmptyObject, Unsubscribe } from '../../../Types';
import type { ContextWithState } from '../../Types';
import type { ArrayAtom } from '../state/ArrayStateAtom';
import type { ErrorCallback, ParameterizedTask, TaskParameter } from '../state/state-effect/Types';
import type { StateAtom } from '../state/Types';
import { CoreExportNames } from '../Types';
import { mapSubscribe } from './MapSubscribe';
import { MapUnsubscribedError } from './MapUnsubscribedError';
import type { CoreUtils } from './Types';
declare function subscribeAndRun<Ctx extends ContextWithState, Atom extends StateAtom, A extends ParameterizedTask<Atom, NamedTask<AnyTask>>>(context: Ctx, atom: TaskParameter<Atom, A>, task: ContextualizedTask<Ctx, A>, errorCallback?: ErrorCallback): Unsubscribe;
declare function deriveFrom<O, K extends keyof O>(obj: O, key: K, derive: (obj: O) => O[K]): void;
declare function runOrSubscribeOnce<Context extends ContextWithState, T>(context: Context, transient: Transient<T>, task: NamedTask<Task<Context, Transient<T>, void>>, errorCallback?: ErrorCallback): Unsubscribe;
declare function subscribeOnce<Context extends ContextWithState, Atom extends StateAtom>(context: Context, atom: Atom, task: NamedTask<Task<Context, Atom, void>>, errorCallback?: ErrorCallback): Unsubscribe;
export type Transient<T> = ReturnType<typeof createTransient<T>>;
declare function createTransient<T>(context: ContextWithState): StateAtom<{
    value: T | undefined;
}, {
    trigger: (t: {
        value: T | undefined;
    }, value: T) => boolean;
}>;
declare function waitFor<Context extends ContextHaving<{
    [CoreExportNames.Utils]: CoreUtils;
}, EmptyObject, ContextWithState>, T>(context: Context, transient: Transient<T>): Abortable<T | undefined> & {
    unsubscribe: Unsubscribe;
};
declare function getArrayStateAtomTransients<T>(arrayAtom: ArrayAtom<T>, context: ContextWithState): {
    added: Transient<T[]>;
    removed: Transient<T[]>;
};
declare const _default: {
    mapSubscribe: typeof mapSubscribe;
    subscribeAndRun: typeof subscribeAndRun;
    MapUnsubscribedError: typeof MapUnsubscribedError;
    subscribeOnce: typeof subscribeOnce;
    waitFor: typeof waitFor;
    deriveFrom: typeof deriveFrom;
    createTransient: typeof createTransient;
    runOrSubscribeOnce: typeof runOrSubscribeOnce;
    getArrayStateAtomTransients: typeof getArrayStateAtomTransients;
};
export default _default;
