httpx/sig/transcoder.rbs
HoneyryderChuck bbf257477b Removing HTTPX::Registry and its usage internally
These internnal registries were a bit magical to use, difficult to
debug, not thread-safe, and overall a nuisance when it came to type
checking. So long.
2023-04-27 22:49:20 +01:00

28 lines
783 B
Plaintext

module HTTPX
type bodyIO = _Reader | _Each[[String, untyped]] | _ToS
type body_encoder = 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)
end
interface _Decoder
def call: (Response response, *untyped) -> untyped
end
end
end