Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add basic devise annotation #180

Merged
merged 10 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
},
"delayed_job": {
},
"devise": {
},
"elasticsearch-dsl": {
"requires": [
"elasticsearch/dsl"
Expand Down
145 changes: 145 additions & 0 deletions rbi/annotations/devise.rbi
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# typed: true

# @shim: Devise controllers are loaded by rails
class DeviseController
protected

sig {returns(T.untyped)}
def resource; end

# Proxy to devise map name
sig {returns(String)}
def resource_name; end

sig {returns(String)}
def scope_name; end

# Proxy to devise map class
sig {returns(T::Class[T.anything])}
def resource_class; end

# Returns a signed in resource from session (if one exists)
sig {returns(T.untyped)}
def signed_in_resource; end

# Attempt to find the mapped route for devise based on request path
sig {returns(T.untyped)}
def devise_mapping; end

sig {returns(T.untyped)}
def navigational_formats; end

sig {returns(ActionController::Parameters)}
def resource_params; end

sig {returns(String)}
def translation_scope; end
end

# @shim: Devise controllers are loaded by rails
class Devise::ConfirmationsController < DeviseController
sig {returns(T.untyped)}
def new; end
# POST /resource/confirmation
sig {returns(T.untyped)}
def create; end
# GET /resource/confirmation?confirmation_token=abcdef
sig {returns(T.untyped)}
def show; end
end

# @shim: Devise controllers are loaded by rails
class Devise::PasswordsController < DeviseController
# GET /resource/password/new
sig {returns(T.untyped)}
def new; end

# POST /resource/password
sig {returns(T.untyped)}
def create; end

# GET /resource/password/edit?reset_password_token=abcdef
sig {returns(T.untyped)}
def edit; end

# PUT /resource/password
sig {returns(T.untyped)}
def update; end
end

# @shim: Devise controllers are loaded by rails
class Devise::RegistrationsController < DeviseController
sig {returns(T.untyped)}
def new; end

# POST /resource
sig {returns(T.untyped)}
def create; end

# GET /resource/edit
sig {returns(T.untyped)}
def edit; end

# PUT /resource
# We need to use a copy of the resource because we don't want to change
# the current user in place.
sig {returns(T.untyped)}
def update; end

# DELETE /resource
sig {returns(T.untyped)}
def destroy; end

# GET /resource/cancel
# Forces the session data which is usually expired after sign
# in to be expired now. This is useful if the user wants to
# cancel oauth signing in/up in the middle of the process,
# removing all OAuth session data.
sig {returns(T.untyped)}
def cancel; end
end

# @shim: Devise controllers are loaded by rails
class Devise::SessionsController < DeviseController
# GET /resource/sign_in
sig {returns(T.untyped)}
def new; end

# POST /resource/sign_in
sig {returns(T.untyped)}
def create; end

# DELETE /resource/sign_out
sig {returns(T.untyped)}
def destroy; end

protected

sig { returns(ActionController::Parameters)}
def sign_in_params; end
end

# @shim: Devise controllers are loaded by rails
class Devise::UnlocksController < DeviseController
# GET /resource/unlock/new
sig {returns(T.untyped)}
def new; end

# POST /resource/unlock
sig {returns(T.untyped)}
def create; end

# GET /resource/unlock?unlock_token=abcdef
sig {returns(T.untyped)}
def show; end

protected

# The path used after sending unlock password instructions
sig {params(resource: T.untyped).returns(String)}
def after_sending_unlock_instructions_path_for(resource); end

sig {params(resource: T.untyped).returns(String)}
# The path used after unlocking the resource
def after_unlock_path_for(resource); end
end
Loading