export interface PromiseStatusIdle {
    type: 'idle';
    data?: undefined;
    promise?: undefined;
}
export interface PromiseStatusLoading<T> {
    type: 'loading';
    data?: undefined;
    promise: Promise<T>;
}
export interface PromiseStatusSuccess<T> {
    type: 'success';
    data: T;
    promise: Promise<T>;
}
export interface PromiseStatusError {
    type: 'error';
    error: unknown;
    data?: undefined;
    promise?: undefined;
}
export type PromiseStatus<T> = PromiseStatusIdle | PromiseStatusLoading<T> | PromiseStatusSuccess<T> | PromiseStatusError;
export interface PromiseStateParams<T> {
    fn: () => Promise<T>;
    onError?: (err: unknown) => unknown;
}
export declare class PromiseState<T> {
    readonly status: import("./reactive").Reactive<PromiseStatus<T>>;
    readonly onError: ((err: unknown) => unknown) | undefined;
    fn: () => Promise<T>;
    constructor(params: PromiseStateParams<T>);
    once(): Promise<void>;
    run(): Promise<void>;
}
//# sourceMappingURL=PromiseState.d.ts.map