@metamask/polling-controller
Version:
Polling Controller is the base for controllers that polling by networkClientId
37 lines • 2.06 kB
text/typescript
import { BaseController } from "@metamask/base-controller";
import type { Json } from "@metamask/utils";
import type { PollingTokenSetId } from "./types.mjs";
declare class Empty {
}
export declare const StaticIntervalPollingControllerOnly: <PollingInput extends Json>() => (abstract new (...args: any[]) => {
readonly "__#14@#intervalIds": Record<PollingTokenSetId, NodeJS.Timeout>;
"__#14@#intervalLength": number | undefined;
setIntervalLength(intervalLength: number): void;
getIntervalLength(): number | undefined;
_startPolling(input: PollingInput): void;
_stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;
readonly "__#3@#pollingTokenSets": Map<string, Set<string>>;
"__#3@#callbacks": Map<string, Set<(input: PollingInput) => void>>;
_executePoll(input: PollingInput): Promise<void>;
startPolling(input: PollingInput): string;
stopAllPolling(): void;
stopPollingByPollingToken(pollingToken: string): void;
onPollingComplete(input: PollingInput, callback: (input: PollingInput) => void): void;
}) & typeof Empty;
export declare const StaticIntervalPollingController: <PollingInput extends Json>() => (abstract new (...args: any[]) => {
readonly "__#14@#intervalIds": Record<PollingTokenSetId, NodeJS.Timeout>;
"__#14@#intervalLength": number | undefined;
setIntervalLength(intervalLength: number): void;
getIntervalLength(): number | undefined;
_startPolling(input: PollingInput): void;
_stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;
readonly "__#3@#pollingTokenSets": Map<string, Set<string>>;
"__#3@#callbacks": Map<string, Set<(input: PollingInput) => void>>;
_executePoll(input: PollingInput): Promise<void>;
startPolling(input: PollingInput): string;
stopAllPolling(): void;
stopPollingByPollingToken(pollingToken: string): void;
onPollingComplete(input: PollingInput, callback: (input: PollingInput) => void): void;
}) & typeof BaseController;
export {};
//# sourceMappingURL=StaticIntervalPollingController.d.mts.map