import type { PollerLike, OperationState, CancelOnProgress } from "@azure/core-lro"; import type { AbortSignalLike } from "@azure/abort-controller"; /** * A simple poller that can be used to poll a long running operation. */ export interface SimplePollerLike, TResult> { /** * Returns true if the poller has finished polling. */ isDone(): boolean; /** * Returns the state of the operation. */ getOperationState(): TState; /** * Returns the result value of the operation, * regardless of the state of the poller. * It can return undefined or an incomplete form of the final TResult value * depending on the implementation. */ getResult(): TResult | undefined; /** * Returns a promise that will resolve once a single polling request finishes. * It does this by calling the update method of the Poller's operation. */ poll(options?: { abortSignal?: AbortSignalLike; }): Promise; /** * Returns a promise that will resolve once the underlying operation is completed. */ pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike; }): Promise; /** * Invokes the provided callback after each polling is completed, * sending the current state of the poller's operation. * * It returns a method that can be used to stop receiving updates on the given callback function. */ onProgress(callback: (state: TState) => void): CancelOnProgress; /** * Returns a promise that could be used for serialized version of the poller's operation * by invoking the operation's serialize method. */ serialize(): Promise; /** * Wait the poller to be submitted. */ submitted(): Promise; /** * Returns a string representation of the poller's operation. Similar to serialize but returns a string. * @deprecated Use serialize() instead. */ toString(): string; /** * Stops the poller from continuing to poll. Please note this will only stop the client-side polling * @deprecated Use abortSignal to stop polling instead. */ stopPolling(): void; /** * Returns true if the poller is stopped. * @deprecated Use abortSignal status to track this instead. */ isStopped(): boolean; } /** * Create the deprecated SimplePollerLike from PollerLike * @param poller PollerLike to convert * @returns SimplePollerLike */ export declare function getSimplePoller(poller: PollerLike, TResult>): SimplePollerLike, TResult>; //# sourceMappingURL=simplePollerHelpers.d.ts.map