import { ZmodemHeader } from './zheader'; import { ValidateParams } from './types'; import ZmodemSessionBase from './zsess-base'; /** A class for ZMODEM receive sessions. * * @extends Session */ declare class ZmodemSendSession extends ZmodemSessionBase { _subpacket_encode_func: any; _start_keepalive_on_set_sender: boolean; _keepalive_promise: any; _keepalive_timeout: any; _got_ZSINIT_ZACK: boolean; _textencoder: TextEncoder; _sent_OO: any; _sending_file: boolean; _file_offset: number; _last_ZRINIT?: ZmodemHeader; _sent_ZDATA: boolean; type: string; _sender: Function; /** * Not called directly. */ constructor(zrinitHdr?: ZmodemHeader); /** * Sets the sender function. The first time this is called, * it will also initiate a keepalive using ZSINIT until the * first file is sent. * * @param {Function} func - The function to call. * It will receive an Array with the relevant octets. * * @return {Session} The session object (for chaining). */ set_sender: (func: Function) => this; _get_header_formatter(name: string): string; _start_keepalive: () => void; _stop_keepalive(): void; _send_ZSINIT(): void; _consume_ZRINIT(hdr: ZmodemHeader): void; _ensure_receiver_escapes_ctrl_chars: () => Promise; _convert_params_to_offer_payload_array: (_params: ValidateParams) => number[]; /** * Send an offer to the receiver. * * @param {FileDetails} params - All about the file you want to transfer. * * @returns {Promise} If the receiver accepts the offer, then the * resolution is a Transfer object otherwise the resolution is * undefined. */ send_offer: (params: ValidateParams) => Promise; _send_header_and_data: (hdrNameAndArgs: any[], dataArr: any[], frameEnd: string) => void; _build_subpacket_bytes: (bytesArr: number[], frameEnd: string) => any; _build_and_send_subpacket: (bytesArr: number[], frameEnd: string) => void; _string_to_octets: (str: string) => number[]; _send_interim_file_piece: (bytesObj: number[]) => Promise; _ensure_we_are_sending: () => void; _end_file: (bytesObj: number[]) => Promise; _prepare_to_receive_ZRINIT: (afterConsume: Function) => void; /** * Signal to the receiver that the ZMODEM session is wrapping up. * * @returns {Promise} Resolves when the receiver has responded to * our signal that the session is over. */ close: () => Promise; _has_ended: () => boolean; _send_file_part: (bytesObj: number[], finalPacketend: string) => void; _consume_first: () => void; _on_session_end: () => void; } export default ZmodemSendSession;