mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
added signatures to new modules
This commit is contained in:
parent
80f0ddfbc8
commit
7fa283097d
@ -3,18 +3,41 @@ module HTTPX
|
|||||||
module Multipart
|
module Multipart
|
||||||
def self.load_dependencies: (singleton(Session)) -> void
|
def self.load_dependencies: (singleton(Session)) -> void
|
||||||
def self.configure: (*untyped) -> void
|
def self.configure: (*untyped) -> void
|
||||||
def self?.encode: (untyped) -> Encoder
|
def self?.encode: (untyped) -> (Encoder | Transcoder::Form::Encoder)
|
||||||
|
|
||||||
|
type multipart_value = string | Pathname | File | _Reader
|
||||||
|
|
||||||
|
type record_multipart_value = multipart_value |
|
||||||
|
{ content_type: String, filename: String, body: multipart_value } |
|
||||||
|
{ content_type: String, body: multipart_value }
|
||||||
|
|
||||||
|
type multipart_nested_value = multipart_value | _ToAry[multipart_value] | _ToHash[string, multipart_value]
|
||||||
|
|
||||||
|
type multipart_input = Enumerable[[string, multipart_value], untyped]
|
||||||
|
|
||||||
class Encoder
|
class Encoder
|
||||||
include Transcoder::_Encoder
|
include Transcoder::_Encoder
|
||||||
include _ToS
|
|
||||||
include _Reader
|
include _Reader
|
||||||
|
|
||||||
|
def content_type: () -> String
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def initialize: (Hash[Symbol | string, HTTP::FormData::Part | string] multipart_data) -> untyped
|
def initialize: (Hash[Symbol | string, multipart_nested_value] multipart_data) -> untyped
|
||||||
|
|
||||||
def multipart?: (top) -> bool
|
def header_part: (string key, String content_type, String? filename) -> StringIO
|
||||||
|
|
||||||
|
def read_chunks: (String buffer, Integer? length) -> void
|
||||||
|
|
||||||
|
def read_from_part: (Integer? max_length) -> void
|
||||||
|
end
|
||||||
|
|
||||||
|
module Part
|
||||||
|
def self?.call: (multipart_nested_value) -> ([_Reader, String, String?] | [_Reader, String])
|
||||||
|
end
|
||||||
|
|
||||||
|
module MimeTypeDetector
|
||||||
|
def self?.call: (IO file, ?String filename) -> String?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -4,8 +4,8 @@ module HTTPX
|
|||||||
module Transcoder
|
module Transcoder
|
||||||
extend HTTPX::Registry[String, Class]
|
extend HTTPX::Registry[String, Class]
|
||||||
|
|
||||||
def self.normalize_keys: (string | Symbol, top) { (string, top) -> void } -> void
|
def self.normalize_keys: (string | Symbol, top, ?Proc?) { (string, top) -> void } -> void
|
||||||
| (string | Symbol, top) { (string) -> void } -> void
|
| (string | Symbol, top, ?Proc?) { (string) -> void } -> void
|
||||||
|
|
||||||
interface _Encoder
|
interface _Encoder
|
||||||
def bytesize: () -> Numeric
|
def bytesize: () -> Numeric
|
||||||
|
@ -7,6 +7,8 @@ module HTTPX
|
|||||||
|
|
||||||
@raw: bodyIO
|
@raw: bodyIO
|
||||||
|
|
||||||
|
def content_type: () -> String
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def initialize: (untyped body ) -> untyped
|
def initialize: (untyped body ) -> untyped
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
module HTTPX::Transcoder
|
module HTTPX::Transcoder
|
||||||
type urlencoded_input = Enumerable[[string, string], untyped]
|
type form_value = string
|
||||||
|
|
||||||
|
type form_nested_value = form_value | _ToAry[form_value] | _ToHash[string, form_value]
|
||||||
|
|
||||||
|
type urlencoded_input = Enumerable[[string, form_nested_value], untyped]
|
||||||
|
|
||||||
module Form
|
module Form
|
||||||
def self?.encode: (urlencoded_input form) -> Encoder
|
def self?.encode: (urlencoded_input form) -> Encoder
|
||||||
@ -8,6 +12,8 @@ module HTTPX::Transcoder
|
|||||||
include _Encoder
|
include _Encoder
|
||||||
include _ToS
|
include _ToS
|
||||||
|
|
||||||
|
def content_type: () -> String
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def initialize: (urlencoded_input form) -> untyped
|
def initialize: (urlencoded_input form) -> untyped
|
||||||
|
@ -6,9 +6,11 @@ module HTTPX::Transcoder
|
|||||||
include _Encoder
|
include _Encoder
|
||||||
include _ToS
|
include _ToS
|
||||||
|
|
||||||
|
def content_type: () -> String
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def initalize: (_ToJson json) -> untyped
|
def initialize: (_ToJson json) -> untyped
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -35,7 +35,7 @@ if [[ ${RUBY_VERSION:0:1} = "3" ]]; then
|
|||||||
export RUBYOPT="$RUBYOPT -rbundler/setup -rrbs/test/setup"
|
export RUBYOPT="$RUBYOPT -rbundler/setup -rrbs/test/setup"
|
||||||
export RBS_TEST_RAISE=true
|
export RBS_TEST_RAISE=true
|
||||||
export RBS_TEST_LOGLEVEL=error
|
export RBS_TEST_LOGLEVEL=error
|
||||||
export RBS_TEST_OPT="-Isig -ruri -rjson -ripaddr -rhttp-2-next"
|
export RBS_TEST_OPT="-Isig -ruri -rjson -ripaddr -rpathname -rhttp-2-next"
|
||||||
export RBS_TEST_TARGET="HTTP*"
|
export RBS_TEST_TARGET="HTTP*"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user