fixinng the signatures for the last rbs upstream

This commit is contained in:
HoneyryderChuck 2020-11-23 18:34:21 +00:00
parent 6cc24b63f5
commit 1e21c33da0
6 changed files with 36 additions and 15 deletions

View File

@ -39,7 +39,7 @@ module HTTPX
class Encoder
include Transcoder::_Encoder
include _ToS
include _Each[String, untyped]
include _Each[String]
def close: () -> void

View File

@ -3,7 +3,7 @@ module HTTPX
class Jar
type cookie = Cookie | Array[String, String, cookie_attributes] | Array[String, String] | cookie_attributes
include Enumerable[Cookie, void]
include Enumerable[Cookie]
@cookies: Array[Cookie]
@ -15,9 +15,9 @@ module HTTPX
def []: (uri) -> Array[Cookie]
def each: (uri) { (Cookie) -> void } -> void
| (uri) -> Enumerable[Cookie, void]
| (uri) -> Enumerable[Cookie]
| () { (Cookie) -> void } -> void
| () -> Enumerable[Cookie, void]
| () -> Enumerable[Cookie]
private
def initialize: () -> void

View File

@ -1,18 +1,39 @@
module HTTPX
module Plugins
module Stream
# def self.load_dependencies: (singleton(Session)) -> void
module InstanceMethods
def stream: () -> instance
private
# def request: (*Request, stream: false, **untyped) -> (response | Array[response])
# | (*untyped, stream: false, **untyped) -> (response | Array[response])
end
module RequestMethods
attr_accessor stream: StreamResponse?
end
module ResponseMethods
def complete?: () -> bool
def stream?: () -> bool
def stream: () -> StreamResponse?
end
class StreamResponse
include _ToS
def each: () { (String) -> void } -> void
| () -> Enumerable[String]
def each_line: () { (String) -> void } -> void
| () -> Enumerable[String]
def on_chunk: (string) -> void
private
def response: () -> response
def initialize: (Request, Session) -> untyped
end
end
type sessionStream = Session & Plugins::H2C::InstanceMethods
type sessionStream = Session & Plugins::Stream::InstanceMethods
end
end

View File

@ -42,7 +42,7 @@ module HTTPX
class Body
def initialize: (Headers, Options) -> untyped
def each: () { (String) -> void } -> void
| () -> Enumerable[String, void]
| () -> Enumerable[String]
def empty?: () -> bool
def bytesize: () -> Integer

View File

@ -39,7 +39,7 @@ module HTTPX
@state: :idle | :memory | :buffer
def each: () { (String) -> void } -> void
| () -> Enumerable[String, void]
| () -> Enumerable[String]
def bytesize: () -> Integer
def empty?: () -> bool

View File

@ -3,9 +3,9 @@ module HTTPX::Transcoder
def self?.encode: (_Encoder chunks) -> Encoder
class Encoder
@raw: _Each[String, untyped]
@raw: _Each[String]
include _Each[String, untyped]
include _Each[String]
private
@ -14,7 +14,7 @@ module HTTPX::Transcoder
class Decoder
include _ToS
include _Each[String, untyped]
include _Each[String]
def finished?: () -> bool
def empty?: () -> bool