line.d.ts 740 B

123456789101112131415161718192021
  1. export type Bytes = string | ArrayBuffer | Uint8Array | Buffer | null | undefined;
  2. /**
  3. * A re-implementation of httpx's `LineDecoder` in Python that handles incrementally
  4. * reading lines from text.
  5. *
  6. * https://github.com/encode/httpx/blob/920333ea98118e9cf617f246905d7b202510941c/httpx/_decoders.py#L258
  7. */
  8. export declare class LineDecoder {
  9. #private;
  10. static NEWLINE_CHARS: Set<string>;
  11. static NEWLINE_REGEXP: RegExp;
  12. buffer: Uint8Array;
  13. textDecoder: any;
  14. constructor();
  15. decode(chunk: Bytes): string[];
  16. decodeText(bytes: Bytes): string;
  17. flush(): string[];
  18. }
  19. export declare function findDoubleNewlineIndex(buffer: Uint8Array): number;
  20. //# sourceMappingURL=line.d.ts.map