import { Vim } from './vim';
export type LoadRequestResult = LoadSuccess | LoadError;
export declare class LoadSuccess {
    readonly isError = false;
    readonly isSuccess = true;
    readonly vim: Vim;
    constructor(vim: Vim);
}
export declare class LoadError {
    error: VimRequestErrorType;
    readonly isError = true;
    readonly isSuccess = false;
    readonly type: VimRequestErrorType;
    readonly details: string | undefined;
    constructor(error: VimRequestErrorType, details?: string);
}
export interface ILoadRequest {
    get isCompleted(): boolean;
    getProgress(): AsyncGenerator<number>;
    getResult(): Promise<LoadError | LoadSuccess>;
    abort(): void;
}
export type VimRequestErrorType = 'loadingError' | 'downloadingError' | 'serverDisconnected' | 'unknown' | 'cancelled';
export declare class LoadRequest implements ILoadRequest {
    private _progress;
    private _progressPromise;
    private _completionPromise;
    private _result;
    get isCompleted(): boolean;
    getProgress(): AsyncGenerator<number, void, unknown>;
    getResult(): Promise<LoadError | LoadSuccess>;
    onProgress(progress: number): void;
    success(vim: Vim): this;
    error(error: VimRequestErrorType, details?: string): this;
    abort(): void;
}
