tus-js-client-stall-detection
Version:
A pure JavaScript client for the tus resumable upload protocol (fork with stall detection)
54 lines (53 loc) • 1.98 kB
TypeScript
import { DetailedError } from '../DetailedError.js';
import { NoopUrlStorage } from '../NoopUrlStorage.js';
import { enableDebugLog } from '../logger.js';
import type { UploadInput, UploadOptions } from '../options.js';
import { BaseUpload } from '../upload.js';
import { canStoreURLs } from './FileUrlStorage.js';
import { NodeFileReader } from './NodeFileReader.js';
import { NodeHttpStack as DefaultHttpStack } from './NodeHttpStack.js';
import { fingerprint } from './fileSignature.js';
declare const defaultOptions: {
httpStack: DefaultHttpStack;
fileReader: NodeFileReader;
urlStorage: NoopUrlStorage;
fingerprint: typeof fingerprint;
endpoint: undefined;
uploadUrl: undefined;
metadata: {};
metadataForPartialUploads: {};
uploadSize: undefined;
onProgress: undefined;
onChunkComplete: undefined;
onSuccess: undefined;
onError: undefined;
onUploadUrlAvailable: undefined;
overridePatchMethod: boolean;
headers: {};
addRequestId: boolean;
onBeforeRequest: undefined;
onAfterResponse: undefined;
onShouldRetry: (err: DetailedError) => boolean;
chunkSize: number;
retryDelays: number[];
parallelUploads: number;
parallelUploadBoundaries: undefined;
storeFingerprintForResuming: boolean;
removeFingerprintOnSuccess: boolean;
uploadLengthDeferred: boolean;
uploadDataDuringCreation: boolean;
protocol: UploadOptions["protocol"];
stallDetection: {
enabled: boolean;
stallTimeout: number;
checkInterval: number;
};
};
declare class Upload extends BaseUpload {
constructor(file: UploadInput, options?: Partial<UploadOptions>);
static terminate(url: string, options?: Partial<UploadOptions>): Promise<void>;
}
declare const isSupported = true;
export { Upload, defaultOptions, isSupported, canStoreURLs, enableDebugLog, DetailedError };
export { NodeHttpStack } from './NodeHttpStack.js';
export type * from '../options.js';