httpx/sig/transcoder.rbs
HoneyryderChuck 25b949cf66 Added support for multiple JSON parsers
When available, httpx will either use `multi_json`, `oj`, or `yajl`,
before it falls back to default `json`.
2022-08-05 22:57:06 +01:00

29 lines
846 B
Plaintext

module HTTPX
type bodyIO = _Reader | _Each[[String, untyped]] | _ToS
type body_encoder = Transcoder::_Encoder | _Each[String]
module Transcoder
def self?.registry: (String tag) -> _Encode
| () -> Hash[String, _Encode]
def self?.register: (String tag, _Encode handler) -> void
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 _Encoder
def bytesize: () -> Numeric
end
interface _Decoder
def call: (Response response, *untyped) -> untyped
end
end
end