httpx/sig/transcoder.rbs
HoneyryderChuck 0d58408c58 compression plugins for gzip and deflate supported by default
most of the code was moved to the transcoder layer.

The `compression_threshold_size` option has been removed.

The `:compression/brotli` plugin becomes only ´:brotli`, and depends on
the new transcoding APIs.

options to skip compression and decompression were added.
2023-09-20 17:57:41 +01:00

44 lines
1.2 KiB
Plaintext

module HTTPX
type bodyIO = _Reader | _Each[String] | _ToS
type body_encoder = (Transcoder::_Encoder & _ToS) | (Transcoder::_Encoder & _Reader) | (Transcoder::_Encoder & _Each[String])
module Transcoder
def self?.normalize_keys: [U] (_ToS key, _ToAry[untyped] | _ToHash[_ToS, untyped] | untyped value, ?(^(untyped value) -> bool | nil) cond) { (String, ?untyped) -> U } -> U
def self?.normalize_query: (Hash[String, untyped] params, String name, String v, Integer depth) -> void
interface _Encode
def encode: (untyped payload) -> body_encoder
end
interface _Decode
def decode: (HTTPX::Response response) -> _Decoder
end
interface _Encoder
def bytesize: () -> (Integer | Float)
def content_type: () -> String
end
interface _Decoder
def call: (Response response, *untyped) -> untyped
end
interface _Inflater
def initialize: (Integer | Float bytesize) -> void
def call: (String chunk) -> String
end
interface _Deflater
def initialize: (Response body) -> void
def deflate: () -> void
def call: (StringIO | File buffer, ?chunk_size: Integer) ?{ (String chunk) -> void } -> void
end
end
end