parseControlResponse.d.ts 1010 B

12345678910111213141516171819202122
  1. export interface ParsedResponse {
  2. readonly messages: string[];
  3. readonly rest: string;
  4. }
  5. /**
  6. * Parse an FTP control response as a collection of messages. A message is a complete
  7. * single- or multiline response. A response can also contain multiple multiline responses
  8. * that will each be represented by a message. A response can also be incomplete
  9. * and be completed on the next incoming data chunk for which case this function also
  10. * describes a `rest`. This function converts all CRLF to LF.
  11. */
  12. export declare function parseControlResponse(text: string): ParsedResponse;
  13. export declare function isSingleLine(line: string): boolean;
  14. export declare function isMultiline(line: string): boolean;
  15. /**
  16. * Return true if an FTP return code describes a positive completion.
  17. */
  18. export declare function positiveCompletion(code: number): boolean;
  19. /**
  20. * Return true if an FTP return code describes a positive intermediate response.
  21. */
  22. export declare function positiveIntermediate(code: number): boolean;