export interface CacheLimit { pc: number; mobile: number; } export interface SignalConfig { main: string; backup: string; } export enum LogLevel { Warn = 'warn', Error = 'error', None = 'none', } export enum TrackerZone { Europe = 'eu', HongKong = 'hk', USA = 'us', CN = 'cn', } export interface P2pConfig { logLevel?: LogLevel | boolean; signalConfig?: string | SignalConfig; announce?: string; trackerZone?: TrackerZone; diskCacheLimit?: CacheLimit; p2pEnabled?: boolean; dcDownloadTimeout?: number; webRTCConfig?: any; tag?: string; waitForPeer?: boolean; waitForPeerTimeout?: number; token?: string; appName?: string; appId?: string; showSlogan?: boolean; trickleICE?: boolean; geoIpPreflight?: boolean; pieceLength?: number; httpMaxRetrys?: number; getStats?: (totalP2PDownloaded: number, totalP2PUploaded: number, totalHTTPDownloaded: number, p2pDownloadSpeed: number)=>void; getPeerId?: (peerId: string)=>void; getPeersInfo?: (peers: string[])=>void; channelId?: ((url: string)=>string) | string; mitm?: string; } export declare class P2PEngineFile { static isSupported(): boolean; static readonly version: string; static readonly protocolVersion: string; public readonly version: string; constructor(url: string, p2pConfig?: P2pConfig); disableP2P(): void; destroy(): void; enableP2P(): void; start(): void; pause(): void; resume(): void; stop(): void; on(name: string, func: (...args)=>void): P2PEngineFile; once(name: string, func: (...args)=>void): P2PEngineFile; off(name: string, func: (...args)=>void): P2PEngineFile; isSaveByStreamSupported(): boolean; saveByServiceWorkerStream(filename: string): Promise } export default P2PEngineFile;