import { InputSocket } from '../core/socket'; export declare const DEFAULT_FILENAME_TEMPLATE: string; export declare const DEFAULT_HTML_TEMPLATE: string; export declare class WebFileDownloadSocket extends InputSocket { private _downloadLinkContainer; private _mimeType; private _fileNameTemplate; private _htmlTemplate; private _fallbackToSaveAs; private _bufferDownloadCnt; /** * * @param _downloadLinkContainer an HTML element to create a link in with the given templates or `null` and then FileSaver will spawn a dialog @see https://github.com/eligrey/FileSaver.js * @param _fileNameTemplate can contain the local var `counter` as well as access public and private members via `this`, see default * @param _htmlTemplate can contain the local var `filename` which will be whatever the respective template string has eval'd to, see default for example (or like `makeTemplate('buffer${counter}-${Date.now()}.mp4'`) * @param _mimeType mime-type string for the blob object to be created (this sometimes matters for platforms to understand what file-type it is), @see https://developer.mozilla.org/en-US/docs/Web/API/Blob * @param _fallbackToSaveAs when no downloadLinkContainer set, we can call the `saveAs` function to trigger a download dialog (if running in a web-like window context) */ constructor(_downloadLinkContainer: HTMLElement | null, _mimeType?: string, // FIXME: this can be a default when packet has no mime-type but we should read the mime-type from the defaultPayload info of the packet _fileNameTemplate?: string, _htmlTemplate?: string, _fallbackToSaveAs?: boolean); private _onPacketReceived; }