Skip to content

Commit

Permalink
sinatra: Add types for req/res and some callbacks (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
euglena1215 authored Sep 22, 2024
1 parent 5c4fbfc commit f7684ee
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions gems/sinatra/4.0/base.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,9 @@ module Sinatra

@params: IndifferentHash

@request: untyped
@request: Request

@response: untyped
@response: Response

include Rack::Utils

Expand All @@ -461,9 +461,9 @@ module Sinatra

attr_accessor env: Hash[String, untyped]

attr_accessor request: untyped
attr_accessor request: Request

attr_accessor response: untyped
attr_accessor response: Response

attr_accessor params: IndifferentHash

Expand Down Expand Up @@ -603,7 +603,7 @@ module Sinatra
# Define a before filter; runs before all requests within the same
# context as route handlers and may access/modify the request and
# response.
def self.before: (?untyped path, **untyped options) { () -> untyped } -> untyped
def self.before: (?untyped path, **untyped options) { () [self: instance] -> void } -> void

# Define an after filter; runs after all requests within the same
# context as route handlers and may access/modify the request and
Expand All @@ -619,7 +619,7 @@ module Sinatra

# Add a route condition. The route is considered non-matching when the
# block returns false.
def self.condition: (?::String name) { () -> untyped } -> untyped
def self.condition: (?::String name) { () [self: instance] -> void } -> void

def self.public=: (untyped value) -> untyped

Expand Down Expand Up @@ -653,7 +653,7 @@ module Sinatra

# Register an extension. Alternatively take a block from which an
# extension will be created and registered on the fly.
def self.register: (*untyped extensions) ?{ () -> untyped } -> untyped
def self.register: (*Module extensions) ?{ () -> untyped } -> untyped

def self.development?: () -> untyped

Expand Down

0 comments on commit f7684ee

Please sign in to comment.