tus-js-client-stall-detection
Version:
A pure JavaScript client for the tus resumable upload protocol
31 lines (30 loc) • 852 B
TypeScript
import type { StallDetectionOptions } from './options.js';
export declare class StallDetector {
private options;
private onStallDetected;
private intervalId;
private lastProgressTime;
private isActive;
constructor(options: StallDetectionOptions, onStallDetected: (reason: string) => void);
/**
* Start monitoring for stalls
*/
start(): void;
/**
* Stop monitoring for stalls
*/
stop(): void;
/**
* Update progress information
* @param _progressValue The current progress value (bytes uploaded) - currently unused but kept for future use
*/
updateProgress(_progressValue: number): void;
/**
* Check if upload has stalled based on progress events
*/
private _isProgressStalled;
/**
* Handle a detected stall
*/
private _handleStall;
}