# typed: strict
class Scraper::HttpClientConfig
  extend T::Sig
  extend T::Helpers
  abstract!

  Request = Scraper::CurlHttpPerformer::Request
  Response = Scraper::CurlHttpPerformer::Response

  include HasColorLogger

  sig { abstract.returns(T.nilable(T::Array[T::Hash[Symbol, T.untyped]])) }
  def cookies
  end

  sig { overridable.params(performer: Scraper::CurlHttpPerformer).void }
  def do_login(performer)
    # nop
  end

  sig { overridable.params(uri: Addressable::URI).returns(Addressable::URI) }
  def map_uri(uri)
    uri
  end

  sig { overridable.params(uri: Addressable::URI).returns(Addressable::URI) }
  def scrub_stored_uri(uri)
    uri
  end

  sig { abstract.returns(T::Array[[String, Numeric]]) }
  def ratelimit
  end

  sig { abstract.returns(T::Array[String]) }
  def allowed_domains
  end

  sig { abstract.returns(Integer) }
  def redirect_limit
  end

  sig { overridable.params(request: Request).returns(Request) }
  def map_request(request)
    request
  end

  sig { overridable.params(response: Response).returns(Response) }
  def map_response(response)
    response
  end
end
