From 037621d354f045e25ab6856cc7b90aff5682393a Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Wed, 3 Jul 2024 15:20:02 -0700 Subject: [PATCH] Add signatures for `error!` and a few other methods --- rbi/grape.rbi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/rbi/grape.rbi b/rbi/grape.rbi index 65207c5..2b22b05 100644 --- a/rbi/grape.rbi +++ b/rbi/grape.rbi @@ -29,6 +29,26 @@ module Grape end end + module InsideRoute + sig do + params( + message: T.any(String, T::Hash[Symbol, T.untyped]), + status: T.nilable(T.any(Integer, Symbol)), + additional_headers: T.nilable(T::Hash[String, String]), + ).returns(T.noreturn) + end + def error!(message, status = nil, additional_headers = nil); end + + sig { params(status: T.nilable(T.any(Integer, Symbol))).returns(Integer) } + def status(status = nil); end + + sig { returns(Grape::Cookies) } + def cookies; end + + sig { returns(Grape::Router::Route) } + def route; end + end + module RequestResponse module ClassMethods sig { params(args: T.untyped, block: T.proc.bind(Grape::Endpoint).params(e: Exception).void).void }