UNPKG

@azure/ai-text-analytics

Version:
26 lines 1.02 kB
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import { delay } from "../../util"; import { AnalysisPoller } from "../poller"; import { BeginAnalyzeActionsPollerOperation } from "./operation"; /** * Class that represents a poller that waits for the analyze actions results. * @internal */ export class BeginAnalyzeActionsPoller extends AnalysisPoller { // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters constructor(pollerOptions) { const { client, documents, actions, options, updateIntervalInMs = 5000, resumeFrom } = pollerOptions; let state; if (resumeFrom) { state = JSON.parse(resumeFrom).state; } const operation = new BeginAnalyzeActionsPollerOperation((state || {}), client, documents, actions, options); super(operation); this.updateIntervalInMs = updateIntervalInMs; } delay() { return delay(this.updateIntervalInMs); } } //# sourceMappingURL=poller.js.map