import _Eventer from './eventer'; import { Opts, Obj } from './types'; declare const Offer_base: typeof _Eventer; /** * A class to represent a receiver’s interaction with a single file * transfer offer within a batch. There is functionality here to * skip or accept offered files and either to spool the packet * payloads or to handle them yourself. */ declare class Offer extends Offer_base { _zfile_opts: any; _file_info: any; _accept_func: Function; _skip_func: Function; _skipped: boolean; _accepted: boolean; _file_offset: number; _spool: any; _input_handler_mode: string | Function; /** * Not called directly. */ constructor(zfileOpts: Obj, fileInfo: Obj, acceptFunc: Function, skipFunc: Function); _verify_not_skipped(): void; /** * Tell the sender that you don’t want the offered file. * * You can send this in lieu of `accept()` or after it, e.g., * if you find that the transfer is taking too long. Note that, * if you `skip()` after you `accept()`, you’ll likely have to * wait for buffers to clear out. * */ skip(...args: any[]): any; /** * Tell the sender to send the offered file. * * @param {Object} [opts] - Can be: * @param {string} [opts.oninput=spool_uint8array] - Can be: * * - `spool_uint8array`: Stores the ZMODEM * packet payloads as Uint8Array instances. * This makes for an easy transition to a Blob, * which JavaScript can use to save the file to disk. * * - `spool_array`: Stores the ZMODEM packet payloads * as Array instances. Each value is an octet value. * * - (function): A handler that receives each payload * as it arrives. The Offer object does not store * the payloads internally when thus configured. * * @return { Promise } Resolves when the file is fully received. * If the Offer has been spooling * the packet payloads, the promise resolves with an Array * that contains those payloads. */ accept(opts?: Opts): Promise; _input_handler(payload: any): void; _get_spool(): any; } export default Offer;