import { ClientCallArgs, SessionArg, TypeFromProtoc } from '../types';
import { Reader } from 'protobufjs';
import { Operation } from '../../generated/yandex/cloud/operation/operation';
import { CancelOperationRequest, GetOperationRequest } from '../../generated/yandex/cloud/operation/operation_service';
export type GetOperationProps = TypeFromProtoc<GetOperationRequest, 'operationId'>;
export type CancelOperationProps = TypeFromProtoc<CancelOperationRequest, 'operationId'>;
type DecoderFuncType<DecoderT> = (input: Reader | Uint8Array, length?: number) => DecoderT;
type OperationWithDecoder<DecoderT> = Operation & {
    decoder?: DecoderFuncType<DecoderT>;
};
type PollArgs<DecoderT> = {
    operationCallback?: (operation: Operation) => void;
    decoder?: DecoderFuncType<DecoderT>;
};
interface CancellablePromise<T> extends Promise<T> {
    cancelPolling?: () => void;
}
export declare class PollOperationWasCanceled {
    operation?: Operation;
    constructor(operation?: Operation);
}
export declare class PollOperationEmptyResponseForDecoder {
    operation?: Operation;
    constructor(operation?: Operation);
}
export declare class OperationSdk {
    private operationClient;
    constructor(session: SessionArg);
    static PollOperationWasCanceled: typeof PollOperationWasCanceled;
    static PollOperationEmptyResponseForDecoder: typeof PollOperationEmptyResponseForDecoder;
    pollOperation<DecoderT = Operation>(operation: string | OperationWithDecoder<DecoderT>, intervalMs: number, args?: PollArgs<DecoderT>): CancellablePromise<DecoderT>;
    get(params: GetOperationProps, args?: ClientCallArgs): Promise<Operation>;
    cancel(params: CancelOperationProps, args?: ClientCallArgs): Promise<Operation>;
}
export declare const initOperationSdk: (session: SessionArg) => OperationSdk;
export {};
