httpx/sig/plugins/proxy.rbs
HoneyryderChuck 6b61b8ccdb fixing signatures
also adding some checks on code, in order for steep to stop complaining
about potential nil returns.
2021-08-10 10:28:58 +01:00

47 lines
1.2 KiB
Plaintext

module HTTPX
class HTTPProxyError < Error
end
module Plugins
module Proxy
Error: singleton(HTTPProxyError)
PROXY_ERRORS: Array[singleton(StandardError)]
class Parameters
attr_reader uri: URI::Generic
attr_reader username: String?
attr_reader password: String?
def authenticated?: () -> boolish
def token_authentication: () -> String?
def ==: (untyped) -> bool
private
def initialize: (uri: generic_uri, ?username: String, ?password: String) -> untyped
end
def self.configure: (singleton(Session)) -> void
type proxyParam = Parameters | Hash[Symbol, untyped]
interface _ProxyOptions
def proxy: () -> proxyParam?
end
def self.extra_options: (Options) -> (Options & _ProxyOptions)
module InstanceMethods
private
def proxy_uris: (generic_uri, Options & _ProxyOptions) -> { uri: generic_uri, username: String, password: String }
| (generic_uri, Options & _ProxyOptions) -> { uri: generic_uri }
| (generic_uri, Options & _ProxyOptions) -> nil
end
end
type sessionProxy = Session & Proxy::InstanceMethods
end
end