mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
removed with_ options, which are unsupported, undocumented and irrelevant (contrary to the similar with session methods)
58 lines
1.4 KiB
Plaintext
58 lines
1.4 KiB
Plaintext
module HTTPX
|
|
module Plugins
|
|
module Compression
|
|
type encodings_registry = Registry[Symbol, Class]
|
|
|
|
type deflatable = _Reader | _ToS
|
|
|
|
interface _Deflater
|
|
def deflate: (deflatable, _Writer, chunk_size: Integer) -> void
|
|
| (deflatable, _Writer, chunk_size: Integer) { (String) -> void } -> void
|
|
end
|
|
|
|
interface _Inflater
|
|
def inflate: (string) -> String
|
|
|
|
def initialize: (Numeric bytesize) -> untyped
|
|
end
|
|
|
|
def self.configure: (singleton(Session)) -> void
|
|
|
|
interface _CompressionOptions
|
|
def compression_threshold_size: () -> _Integer?
|
|
def compression_threshold_size=: (int) -> int
|
|
|
|
def encodings: () -> encodings_registry?
|
|
def encodings=: (encodings_registry) -> encodings_registry
|
|
end
|
|
|
|
def self.extra_options: (Options) -> (Options & _CompressionOptions)
|
|
|
|
|
|
module ResponseBodyMethods
|
|
@encodings: Array[String]
|
|
@_deflaters: Array[_Decoder]
|
|
|
|
private
|
|
|
|
def decompress: (string) -> String
|
|
end
|
|
|
|
class Encoder
|
|
include Transcoder::_Encoder
|
|
include _ToS
|
|
include _Each[String]
|
|
|
|
def close: () -> void
|
|
|
|
private
|
|
|
|
def initialize: (deflatable body, _Deflater deflater) -> untyped
|
|
def deflate: () -> void
|
|
| () { (String) -> void } -> void
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|