phlex-stimulus 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +16 -0
- data/LICENSE.txt +21 -0
- data/README.md +341 -0
- data/Rakefile +12 -0
- data/lib/generators/phlex/stimulus/controller/USAGE +5 -0
- data/lib/generators/phlex/stimulus/controller/controller_generator.rb +49 -0
- data/lib/generators/phlex/stimulus/controller/templates/component.rb.erb +30 -0
- data/lib/generators/phlex/stimulus/controller/templates/controller.ts.erb +23 -0
- data/lib/generators/phlex/stimulus/generator_mixin.rb +21 -0
- data/lib/generators/phlex/stimulus/install/USAGE +5 -0
- data/lib/generators/phlex/stimulus/install/install_generator.rb +111 -0
- data/lib/generators/phlex/stimulus/install/templates/app/components/base.rb.erb +29 -0
- data/lib/generators/phlex/stimulus/install/templates/app/components/chain_controller.rb.erb +29 -0
- data/lib/generators/phlex/stimulus/install/templates/app/components/classlist_controller.rb.erb +30 -0
- data/lib/generators/phlex/stimulus/install/templates/app/components/controller.rb.erb +10 -0
- data/lib/generators/phlex/stimulus/install/templates/app/components/controller_chain.rb.erb +32 -0
- data/lib/generators/phlex/stimulus/install/templates/app/components/controller_template.rb.erb +24 -0
- data/lib/generators/phlex/stimulus/install/templates/app/components/log_controller.rb.erb +33 -0
- data/lib/generators/phlex/stimulus/install/templates/app/components/sleep_controller.rb.erb +30 -0
- data/lib/generators/phlex/stimulus/install/templates/app/components.rb.erb +7 -0
- data/lib/generators/phlex/stimulus/install/templates/app/javascript/application.ts.erb +5 -0
- data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/application.ts.erb +10 -0
- data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/chain_controller.ts.erb +32 -0
- data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/chainable_controller.ts.erb +44 -0
- data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/classlist_controller.ts.erb +30 -0
- data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/index.ts.erb +4 -0
- data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/log_controller.ts.erb +25 -0
- data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/sleep_controller.ts.erb +19 -0
- data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/typed_controller.ts.erb +53 -0
- data/lib/generators/phlex/stimulus/install/templates/app/javascript/utils/misc.ts.erb +37 -0
- data/lib/generators/phlex/stimulus/install/templates/app/javascript/utils/template.ts.erb +11 -0
- data/lib/phlex/stimulus/components/base.rb +81 -0
- data/lib/phlex/stimulus/components/controller.rb +170 -0
- data/lib/phlex/stimulus/components.rb +9 -0
- data/lib/phlex/stimulus/version.rb +8 -0
- data/lib/phlex/stimulus.rb +15 -0
- data/sorbet/config +7 -0
- data/sorbet/rbi/annotations/.gitattributes +1 -0
- data/sorbet/rbi/annotations/actionmailer.rbi +15 -0
- data/sorbet/rbi/annotations/actionpack.rbi +430 -0
- data/sorbet/rbi/annotations/actionview.rbi +75 -0
- data/sorbet/rbi/annotations/activejob.rbi +50 -0
- data/sorbet/rbi/annotations/activemodel.rbi +119 -0
- data/sorbet/rbi/annotations/activerecord.rbi +172 -0
- data/sorbet/rbi/annotations/activesupport.rbi +561 -0
- data/sorbet/rbi/annotations/globalid.rbi +30 -0
- data/sorbet/rbi/annotations/minitest.rbi +116 -0
- data/sorbet/rbi/annotations/railties.rbi +104 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/dsl/.gitattributes +1 -0
- data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/action_text-trix@2.1.19.rbi +9 -0
- data/sorbet/rbi/gems/actioncable@8.1.3.rbi +9 -0
- data/sorbet/rbi/gems/actionmailbox@8.1.3.rbi +9 -0
- data/sorbet/rbi/gems/actionmailer@8.1.3.rbi +9 -0
- data/sorbet/rbi/gems/actionpack@8.1.3.rbi +20478 -0
- data/sorbet/rbi/gems/actiontext@8.1.3.rbi +9 -0
- data/sorbet/rbi/gems/actionview@8.1.3.rbi +14722 -0
- data/sorbet/rbi/gems/activejob@8.1.3.rbi +9 -0
- data/sorbet/rbi/gems/activemodel@8.1.3.rbi +9 -0
- data/sorbet/rbi/gems/activerecord@8.1.3.rbi +9 -0
- data/sorbet/rbi/gems/activestorage@8.1.3.rbi +9 -0
- data/sorbet/rbi/gems/activesupport@8.1.3.rbi +20153 -0
- data/sorbet/rbi/gems/ast@2.4.3.rbi +550 -0
- data/sorbet/rbi/gems/base64@0.3.0.rbi +545 -0
- data/sorbet/rbi/gems/benchmark@0.5.0.rbi +621 -0
- data/sorbet/rbi/gems/booleans@0.1.3.rbi +31 -0
- data/sorbet/rbi/gems/builder@3.3.0.rbi +9 -0
- data/sorbet/rbi/gems/byebug@12.0.0.rbi +49 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.3.8.rbi +10656 -0
- data/sorbet/rbi/gems/connection_pool@3.0.2.rbi +9 -0
- data/sorbet/rbi/gems/crass@1.0.7.rbi +648 -0
- data/sorbet/rbi/gems/date@3.5.1.rbi +391 -0
- data/sorbet/rbi/gems/drb@2.2.3.rbi +9 -0
- data/sorbet/rbi/gems/erb@6.0.6.rbi +1600 -0
- data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
- data/sorbet/rbi/gems/globalid@1.4.0.rbi +9 -0
- data/sorbet/rbi/gems/i18n@1.15.2.rbi +2285 -0
- data/sorbet/rbi/gems/io-console@0.8.2.rbi +9 -0
- data/sorbet/rbi/gems/json@2.21.1.rbi +2289 -0
- data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +189 -0
- data/sorbet/rbi/gems/logger@1.7.0.rbi +896 -0
- data/sorbet/rbi/gems/loofah@2.25.2.rbi +1134 -0
- data/sorbet/rbi/gems/mail@2.9.1.rbi +9 -0
- data/sorbet/rbi/gems/marcel@1.2.1.rbi +9 -0
- data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +9 -0
- data/sorbet/rbi/gems/minitest@6.0.6.rbi +1482 -0
- data/sorbet/rbi/gems/net-imap@0.6.4.1.rbi +9 -0
- data/sorbet/rbi/gems/net-pop@0.1.2.rbi +9 -0
- data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +244 -0
- data/sorbet/rbi/gems/net-smtp@0.5.1.rbi +9 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +147 -0
- data/sorbet/rbi/gems/nio4r@2.7.5.rbi +9 -0
- data/sorbet/rbi/gems/nokogiri@1.19.4.rbi +8168 -0
- data/sorbet/rbi/gems/parallel@1.28.0.rbi +270 -0
- data/sorbet/rbi/gems/phlex-rails@2.4.0.rbi +1945 -0
- data/sorbet/rbi/gems/phlex@2.4.1.rbi +1413 -0
- data/sorbet/rbi/gems/pp@0.6.4.rbi +387 -0
- data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +455 -0
- data/sorbet/rbi/gems/prism@1.9.0.rbi +42226 -0
- data/sorbet/rbi/gems/racc@1.8.1.rbi +165 -0
- data/sorbet/rbi/gems/rack-session@2.1.2.rbi +756 -0
- data/sorbet/rbi/gems/rack-test@2.2.0.rbi +681 -0
- data/sorbet/rbi/gems/rack@3.2.6.rbi +4653 -0
- data/sorbet/rbi/gems/rackup@2.3.1.rbi +9 -0
- data/sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi +517 -0
- data/sorbet/rbi/gems/rails-html-sanitizer@1.7.1.rbi +620 -0
- data/sorbet/rbi/gems/rails@8.1.3.rbi +9 -0
- data/sorbet/rbi/gems/railties@8.1.3.rbi +3507 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +362 -0
- data/sorbet/rbi/gems/rake@13.4.2.rbi +3130 -0
- data/sorbet/rbi/gems/rbi@0.4.0.rbi +5706 -0
- data/sorbet/rbi/gems/rbs@4.0.3.rbi +6908 -0
- data/sorbet/rbi/gems/refract@1.1.0.rbi +9 -0
- data/sorbet/rbi/gems/reline@0.6.3.rbi +2446 -0
- data/sorbet/rbi/gems/require-hooks@0.4.0.rbi +152 -0
- data/sorbet/rbi/gems/rexml@3.4.4.rbi +4905 -0
- data/sorbet/rbi/gems/rubocop-espago@1.3.0.rbi +9 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +988 -0
- data/sorbet/rbi/gems/rubydex@0.2.9.rbi +841 -0
- data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
- data/sorbet/rbi/gems/shoulda-context@2.0.0.rbi +544 -0
- data/sorbet/rbi/gems/spoom@1.8.4.rbi +6738 -0
- data/sorbet/rbi/gems/tapioca@0.19.2.rbi +3599 -0
- data/sorbet/rbi/gems/thor@1.5.0.rbi +3870 -0
- data/sorbet/rbi/gems/timeout@0.6.1.rbi +200 -0
- data/sorbet/rbi/gems/tsort@0.2.0.rbi +389 -0
- data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5474 -0
- data/sorbet/rbi/gems/unicode-display_width@3.2.0.rbi +130 -0
- data/sorbet/rbi/gems/unicode-emoji@4.2.0.rbi +332 -0
- data/sorbet/rbi/gems/uri@1.1.1.rbi +2402 -0
- data/sorbet/rbi/gems/useragent@0.16.11.rbi +9 -0
- data/sorbet/rbi/gems/websocket-driver@0.8.2.rbi +9 -0
- data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +9 -0
- data/sorbet/rbi/gems/zeitwerk@2.8.2.rbi +9 -0
- data/sorbet/rbi/shims/gems/parser.rbi +12 -0
- data/sorbet/rbi/shims/gems/rails.rbi +55 -0
- data/sorbet/rbi/shims/gems/refract.rbi +13 -0
- data/sorbet/rbi/shims/gems/shoulda-context.rbi +16 -0
- data/sorbet/tapioca/compilers/phlex_controller.rb +80 -0
- data/sorbet/tapioca/config.yml +26 -0
- data/sorbet/tapioca/extensions/load_gem.rb +1 -0
- data/sorbet/tapioca/require.rb +4 -0
- metadata +266 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
|
|
3
|
+
# DO NOT EDIT MANUALLY
|
|
4
|
+
# This file was pulled from a central RBI files repository.
|
|
5
|
+
# Please run `bin/tapioca annotations` to update it.
|
|
6
|
+
|
|
7
|
+
module ActionView
|
|
8
|
+
TemplateError = T.type_alias { Template::Error }
|
|
9
|
+
|
|
10
|
+
class MissingTemplate < ActionView::ActionViewError
|
|
11
|
+
sig { returns(String) }
|
|
12
|
+
def path; end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
class ActionView::Helpers::FormBuilder
|
|
17
|
+
sig { returns(T.untyped) }
|
|
18
|
+
def object; end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
module ActionView::Helpers::NumberHelper
|
|
22
|
+
sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) }
|
|
23
|
+
def number_to_currency(number, options = T.unsafe(nil)); end
|
|
24
|
+
|
|
25
|
+
sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) }
|
|
26
|
+
def number_to_human(number, options = T.unsafe(nil)); end
|
|
27
|
+
|
|
28
|
+
sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) }
|
|
29
|
+
def number_to_human_size(number, options = T.unsafe(nil)); end
|
|
30
|
+
|
|
31
|
+
sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) }
|
|
32
|
+
def number_to_percentage(number, options = T.unsafe(nil)); end
|
|
33
|
+
|
|
34
|
+
sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) }
|
|
35
|
+
def number_to_phone(number, options = T.unsafe(nil)); end
|
|
36
|
+
|
|
37
|
+
sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) }
|
|
38
|
+
def number_with_delimiter(number, options = T.unsafe(nil)); end
|
|
39
|
+
|
|
40
|
+
sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) }
|
|
41
|
+
def number_with_precision(number, options = T.unsafe(nil)); end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
module ActionView::Helpers::SanitizeHelper
|
|
45
|
+
mixes_in_class_methods ActionView::Helpers::SanitizeHelper::ClassMethods
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
module ActionView::Helpers::UrlHelper
|
|
49
|
+
extend ActiveSupport::Concern
|
|
50
|
+
include ActionView::Helpers::TagHelper
|
|
51
|
+
mixes_in_class_methods ActionView::Helpers::UrlHelper::ClassMethods
|
|
52
|
+
|
|
53
|
+
sig { params(name: T.nilable(String), options: T.untyped, html_options: T.untyped, block: T.untyped).returns(ActiveSupport::SafeBuffer) }
|
|
54
|
+
def link_to(name = nil, options = nil, html_options = nil, &block); end
|
|
55
|
+
|
|
56
|
+
sig { params(condition: T.untyped, name: String, options: T.untyped, html_options: T.untyped, block: T.untyped).returns(T.untyped) }
|
|
57
|
+
def link_to_if(condition, name, options = {}, html_options = {}, &block); end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
module ActionView::Layouts
|
|
61
|
+
mixes_in_class_methods ActionView::Layouts::ClassMethods
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
module ActionView::Rendering
|
|
65
|
+
mixes_in_class_methods ActionView::Rendering::ClassMethods
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
module ActionView::ViewPaths
|
|
69
|
+
mixes_in_class_methods ActionView::ViewPaths::ClassMethods
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
module ActionView::ViewPaths::ClassMethods
|
|
73
|
+
sig { params(value: T.any(String, T::Array[String])).void }
|
|
74
|
+
def append_view_path(value); end
|
|
75
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
|
|
3
|
+
# DO NOT EDIT MANUALLY
|
|
4
|
+
# This file was pulled from a central RBI files repository.
|
|
5
|
+
# Please run `bin/tapioca annotations` to update it.
|
|
6
|
+
|
|
7
|
+
class ActiveJob::Base
|
|
8
|
+
sig { params(blk: T.proc.bind(T.attached_class).params(job: T.attached_class, exception: Exception).void).void }
|
|
9
|
+
def self.after_discard(&blk); end
|
|
10
|
+
|
|
11
|
+
sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class).void)).void }
|
|
12
|
+
def self.after_enqueue(*filters, &blk); end
|
|
13
|
+
|
|
14
|
+
sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class).void)).void }
|
|
15
|
+
def self.after_perform(*filters, &blk); end
|
|
16
|
+
|
|
17
|
+
sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class, block: T.untyped).void)).void }
|
|
18
|
+
def self.around_enqueue(*filters, &blk); end
|
|
19
|
+
|
|
20
|
+
sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class, block: T.untyped).void)).void }
|
|
21
|
+
def self.around_perform(*filters, &blk); end
|
|
22
|
+
|
|
23
|
+
sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class).void)).void }
|
|
24
|
+
def self.before_enqueue(*filters, &blk); end
|
|
25
|
+
|
|
26
|
+
sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class).void)).void }
|
|
27
|
+
def self.before_perform(*filters, &blk); end
|
|
28
|
+
|
|
29
|
+
sig { type_parameters(:ExceptionType).params(exceptions: T::Class[T.type_parameter(:ExceptionType)], block: T.nilable(T.proc.params(job: T.attached_class, error: T.type_parameter(:ExceptionType)).void)).void }
|
|
30
|
+
sig { params(exceptions: T.any(Module, String), block: T.nilable(T.proc.params(job: T.attached_class, error: T.untyped).void)).void }
|
|
31
|
+
def self.discard_on(*exceptions, &block); end
|
|
32
|
+
|
|
33
|
+
sig { params(klasses: T.any(Module, String), with: T.nilable(Symbol), block: T.nilable(T.proc.params(exception: T.untyped).void)).void }
|
|
34
|
+
def self.rescue_from(*klasses, with: nil, &block); end
|
|
35
|
+
|
|
36
|
+
sig { params(exceptions: T.any(Module, String), wait: T.any(ActiveSupport::Duration, Integer, Symbol, T.proc.params(executions: Integer).returns(Integer)), attempts: T.any(Integer, Symbol), queue: T.nilable(T.any(String, Symbol)), priority: T.untyped, jitter: Numeric, block: T.nilable(T.proc.params(job: T.attached_class, error: T.untyped).void)).void }
|
|
37
|
+
def self.retry_on(*exceptions, wait: 3.seconds, attempts: 5, queue: nil, priority: nil, jitter: ActiveJob::Exceptions::JITTER_DEFAULT, &block); end
|
|
38
|
+
|
|
39
|
+
sig { params(part_name: T.nilable(T.any(String, Symbol)), block: T.nilable(T.proc.bind(T.attached_class).returns(T.untyped))).void }
|
|
40
|
+
def self.queue_as(part_name = nil, &block); end
|
|
41
|
+
|
|
42
|
+
sig { params(priority: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).returns(T.untyped))).void }
|
|
43
|
+
def self.queue_with_priority(priority = nil, &block); end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# @version >= 8.1.0.beta1
|
|
47
|
+
module ActiveJob::Continuable
|
|
48
|
+
sig { params(step_name: Symbol, start: T.untyped, isolated: T::Boolean, block: T.nilable(T.proc.params(step: ActiveJob::Continuation::Step).void)).void }
|
|
49
|
+
def step(step_name, start: nil, isolated: false, &block); end
|
|
50
|
+
end
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
|
|
3
|
+
# DO NOT EDIT MANUALLY
|
|
4
|
+
# This file was pulled from a central RBI files repository.
|
|
5
|
+
# Please run `bin/tapioca annotations` to update it.
|
|
6
|
+
|
|
7
|
+
module ActiveModel::Attributes
|
|
8
|
+
sig { returns(T::Array[String]) }
|
|
9
|
+
def attribute_names; end
|
|
10
|
+
|
|
11
|
+
sig { returns(T::Hash[String, T.untyped]) }
|
|
12
|
+
def attributes; end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
module ActiveModel::Attributes::ClassMethods
|
|
16
|
+
sig { returns(T::Array[String]) }
|
|
17
|
+
def attribute_names; end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
module ActiveModel::Dirty
|
|
21
|
+
sig { returns(T::Array[String]) }
|
|
22
|
+
def changed; end
|
|
23
|
+
|
|
24
|
+
sig { returns(T::Boolean) }
|
|
25
|
+
def changed?; end
|
|
26
|
+
|
|
27
|
+
sig { returns(ActiveSupport::HashWithIndifferentAccess) }
|
|
28
|
+
def changed_attributes; end
|
|
29
|
+
|
|
30
|
+
sig { returns(ActiveSupport::HashWithIndifferentAccess) }
|
|
31
|
+
def changes; end
|
|
32
|
+
|
|
33
|
+
sig { returns(ActiveSupport::HashWithIndifferentAccess) }
|
|
34
|
+
def previous_changes; end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
class ActiveModel::Errors
|
|
38
|
+
Elem = type_member { { fixed: ActiveModel::Error } }
|
|
39
|
+
|
|
40
|
+
sig { params(attribute: T.any(Symbol, String)).returns(T::Array[String]) }
|
|
41
|
+
def [](attribute); end
|
|
42
|
+
|
|
43
|
+
sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(ActiveModel::Error) }
|
|
44
|
+
def add(attribute, type = :invalid, **options); end
|
|
45
|
+
|
|
46
|
+
sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(T::Boolean) }
|
|
47
|
+
def added?(attribute, type = :invalid, options = {}); end
|
|
48
|
+
|
|
49
|
+
sig { params(options: T.untyped).returns(T::Hash[T.untyped, T.untyped]) }
|
|
50
|
+
def as_json(options = nil); end
|
|
51
|
+
|
|
52
|
+
sig { returns(T::Array[Symbol]) }
|
|
53
|
+
def attribute_names; end
|
|
54
|
+
|
|
55
|
+
sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(T.nilable(T::Array[String])) }
|
|
56
|
+
def delete(attribute, type = nil, **options); end
|
|
57
|
+
|
|
58
|
+
sig { returns(T::Hash[Symbol, T::Array[T::Hash[Symbol, T.untyped]]]) }
|
|
59
|
+
def details; end
|
|
60
|
+
|
|
61
|
+
sig { returns(T::Array[Elem]) }
|
|
62
|
+
def errors; end
|
|
63
|
+
|
|
64
|
+
sig { params(attribute: T.any(Symbol, String), message: String).returns(String) }
|
|
65
|
+
def full_message(attribute, message); end
|
|
66
|
+
|
|
67
|
+
sig { returns(T::Array[String]) }
|
|
68
|
+
def full_messages; end
|
|
69
|
+
|
|
70
|
+
sig { params(attribute: T.any(Symbol, String)).returns(T::Array[String]) }
|
|
71
|
+
def full_messages_for(attribute); end
|
|
72
|
+
|
|
73
|
+
sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(String) }
|
|
74
|
+
def generate_message(attribute, type = :invalid, options = {}); end
|
|
75
|
+
|
|
76
|
+
sig { returns(T::Hash[Symbol, T::Array[ActiveModel::Error]]) }
|
|
77
|
+
def group_by_attribute; end
|
|
78
|
+
|
|
79
|
+
sig { params(attribute: T.any(Symbol, String)).returns(T::Boolean) }
|
|
80
|
+
def has_key?(attribute); end
|
|
81
|
+
|
|
82
|
+
sig { params(error: ActiveModel::Error, override_options: T.untyped).returns(T::Array[ActiveModel::Error]) }
|
|
83
|
+
def import(error, override_options = {}); end
|
|
84
|
+
|
|
85
|
+
sig { params(attribute: T.any(Symbol, String)).returns(T::Boolean) }
|
|
86
|
+
def include?(attribute); end
|
|
87
|
+
|
|
88
|
+
sig { params(attribute: T.any(Symbol, String)).returns(T::Boolean) }
|
|
89
|
+
def key?(attribute); end
|
|
90
|
+
|
|
91
|
+
sig { params(other: T.untyped).returns(T::Array[ActiveModel::Error]) }
|
|
92
|
+
def merge!(other); end
|
|
93
|
+
|
|
94
|
+
sig { returns(T::Hash[Symbol, T::Array[String]]) }
|
|
95
|
+
def messages; end
|
|
96
|
+
|
|
97
|
+
sig { params(attribute: T.any(Symbol, String)).returns(T::Array[String]) }
|
|
98
|
+
def messages_for(attribute); end
|
|
99
|
+
|
|
100
|
+
sig { returns(T::Array[Elem]) }
|
|
101
|
+
def objects; end
|
|
102
|
+
|
|
103
|
+
sig { params(attribute: T.any(Symbol, String), type: T.untyped).returns(T::Boolean) }
|
|
104
|
+
def of_kind?(attribute, type = :invalid); end
|
|
105
|
+
|
|
106
|
+
sig { returns(T::Array[String]) }
|
|
107
|
+
def to_a; end
|
|
108
|
+
|
|
109
|
+
sig { params(full_messages: T.untyped).returns(T::Hash[Symbol, T::Array[String]]) }
|
|
110
|
+
def to_hash(full_messages = false); end
|
|
111
|
+
|
|
112
|
+
sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(T::Array[ActiveModel::Error]) }
|
|
113
|
+
def where(attribute, type = nil, **options); end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
module ActiveModel::Validations
|
|
117
|
+
sig { returns(ActiveModel::Errors) }
|
|
118
|
+
def errors; end
|
|
119
|
+
end
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
|
|
3
|
+
# DO NOT EDIT MANUALLY
|
|
4
|
+
# This file was pulled from a central RBI files repository.
|
|
5
|
+
# Please run `bin/tapioca annotations` to update it.
|
|
6
|
+
|
|
7
|
+
module ActiveRecord::AttributeMethods::ClassMethods
|
|
8
|
+
sig { returns(T::Array[String]) }
|
|
9
|
+
def attribute_names; end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
module ActiveRecord::AttributeMethods::Dirty
|
|
13
|
+
sig { returns(ActiveSupport::HashWithIndifferentAccess) }
|
|
14
|
+
def attributes_in_database; end
|
|
15
|
+
|
|
16
|
+
sig { returns(T::Array[String]) }
|
|
17
|
+
def changed_attribute_names_to_save; end
|
|
18
|
+
|
|
19
|
+
sig { returns(ActiveSupport::HashWithIndifferentAccess) }
|
|
20
|
+
def changes_to_save; end
|
|
21
|
+
|
|
22
|
+
sig { returns(T::Boolean) }
|
|
23
|
+
def has_changes_to_save?; end
|
|
24
|
+
|
|
25
|
+
sig { returns(ActiveSupport::HashWithIndifferentAccess) }
|
|
26
|
+
def saved_changes; end
|
|
27
|
+
|
|
28
|
+
sig { returns(T::Boolean) }
|
|
29
|
+
def saved_changes?; end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
class ActiveRecord::Schema
|
|
33
|
+
sig { params(info: T::Hash[T.untyped, T.untyped], blk: T.proc.bind(ActiveRecord::Schema).void).void }
|
|
34
|
+
def self.define(info = nil, &blk); end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
class ActiveRecord::Migration
|
|
38
|
+
# @shim: Methods on migration are delegated to `SchemaStatements` using `method_missing`
|
|
39
|
+
include ActiveRecord::ConnectionAdapters::SchemaStatements
|
|
40
|
+
|
|
41
|
+
# @shim: Methods on migration are delegated to `DatabaseStatements` using `method_missing`
|
|
42
|
+
include ActiveRecord::ConnectionAdapters::DatabaseStatements
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# @version >= 7.2.0
|
|
46
|
+
module ActiveRecord::Assertions::QueryAssertions
|
|
47
|
+
sig { type_parameters(:R).params(count: T.nilable(Integer), include_schema: T::Boolean, block: T.proc.returns(T.type_parameter(:R))).returns(T.type_parameter(:R)) }
|
|
48
|
+
def assert_queries_count(count = nil, include_schema: false, &block); end
|
|
49
|
+
|
|
50
|
+
sig { type_parameters(:R).params(include_schema: T::Boolean, block: T.proc.returns(T.type_parameter(:R))).returns(T.type_parameter(:R)) }
|
|
51
|
+
def assert_no_queries(include_schema: false, &block); end
|
|
52
|
+
|
|
53
|
+
sig { type_parameters(:R).params(match: T.any(String, Regexp), count: T.nilable(Integer), include_schema: T::Boolean, block: T.proc.returns(T.type_parameter(:R))).returns(T.type_parameter(:R)) }
|
|
54
|
+
def assert_queries_match(match, count: nil, include_schema: false, &block); end
|
|
55
|
+
|
|
56
|
+
sig { type_parameters(:R).params(match: T.any(String, Regexp), include_schema: T::Boolean, block: T.proc.returns(T.type_parameter(:R))).returns(T.type_parameter(:R)) }
|
|
57
|
+
def assert_no_queries_match(match, include_schema: false, &block); end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# @version >= 7.2.0
|
|
61
|
+
class ActiveSupport::TestCase
|
|
62
|
+
# @shim: Rails includes query assertions into ActiveSupport::TestCase from rails/test_help when ActiveRecord is loaded.
|
|
63
|
+
include ActiveRecord::Assertions::QueryAssertions
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
class ActiveRecord::Base
|
|
67
|
+
sig { returns(FalseClass) }
|
|
68
|
+
def blank?; end
|
|
69
|
+
|
|
70
|
+
# @shim: since `present?` is always true, `presence` always returns `self`
|
|
71
|
+
sig { returns(T.self_type) }
|
|
72
|
+
def presence; end
|
|
73
|
+
|
|
74
|
+
sig { returns(TrueClass) }
|
|
75
|
+
def present?; end
|
|
76
|
+
|
|
77
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
78
|
+
def self.after_initialize(*args, **options, &block); end
|
|
79
|
+
|
|
80
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
81
|
+
def self.after_find(*args, **options, &block); end
|
|
82
|
+
|
|
83
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
84
|
+
def self.after_touch(*args, **options, &block); end
|
|
85
|
+
|
|
86
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
87
|
+
def self.before_validation(*args, **options, &block); end
|
|
88
|
+
|
|
89
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
90
|
+
def self.after_validation(*args, **options, &block); end
|
|
91
|
+
|
|
92
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
93
|
+
def self.before_save(*args, **options, &block); end
|
|
94
|
+
|
|
95
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
96
|
+
def self.around_save(*args, **options, &block); end
|
|
97
|
+
|
|
98
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
99
|
+
def self.after_save(*args, **options, &block); end
|
|
100
|
+
|
|
101
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
102
|
+
def self.before_create(*args, **options, &block); end
|
|
103
|
+
|
|
104
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
105
|
+
def self.around_create(*args, **options, &block); end
|
|
106
|
+
|
|
107
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
108
|
+
def self.after_create(*args, **options, &block); end
|
|
109
|
+
|
|
110
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
111
|
+
def self.before_update(*args, **options, &block); end
|
|
112
|
+
|
|
113
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
114
|
+
def self.around_update(*args, **options, &block); end
|
|
115
|
+
|
|
116
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
117
|
+
def self.after_update(*args, **options, &block); end
|
|
118
|
+
|
|
119
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
120
|
+
def self.before_destroy(*args, **options, &block); end
|
|
121
|
+
|
|
122
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
123
|
+
def self.around_destroy(*args, **options, &block); end
|
|
124
|
+
|
|
125
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
126
|
+
def self.after_destroy(*args, **options, &block); end
|
|
127
|
+
|
|
128
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
129
|
+
def self.after_commit(*args, **options, &block); end
|
|
130
|
+
|
|
131
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
|
132
|
+
def self.after_rollback(*args, **options, &block); end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
class ActiveRecord::Relation
|
|
136
|
+
Elem = type_member(:out) { { fixed: T.untyped } }
|
|
137
|
+
|
|
138
|
+
sig { returns(T::Boolean) }
|
|
139
|
+
def blank?; end
|
|
140
|
+
|
|
141
|
+
sig { abstract.params(blk: T.proc.params(arg0: Elem).returns(BasicObject)).returns(T.untyped) }
|
|
142
|
+
sig { abstract.returns(T::Enumerator[Elem]) }
|
|
143
|
+
def each(&blk); end
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
module ActiveRecord::Core
|
|
147
|
+
sig { params(comparison_object: T.anything).returns(T::Boolean) }
|
|
148
|
+
def ==(comparison_object); end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
module ActiveRecord::Persistence
|
|
152
|
+
sig { type_parameters(:Klass).params(klass: T::Class[T.type_parameter(:Klass)]).returns(T.type_parameter(:Klass)) }
|
|
153
|
+
def becomes(klass); end
|
|
154
|
+
|
|
155
|
+
sig { type_parameters(:Klass).params(klass: T::Class[T.type_parameter(:Klass)]).returns(T.type_parameter(:Klass)) }
|
|
156
|
+
def becomes!(klass); end
|
|
157
|
+
|
|
158
|
+
sig { returns(T::Boolean) }
|
|
159
|
+
def destroyed?; end
|
|
160
|
+
|
|
161
|
+
sig { returns(T::Boolean) }
|
|
162
|
+
def new_record?; end
|
|
163
|
+
|
|
164
|
+
sig { returns(T::Boolean) }
|
|
165
|
+
def persisted?; end
|
|
166
|
+
|
|
167
|
+
sig { returns(T::Boolean) }
|
|
168
|
+
def previously_new_record?; end
|
|
169
|
+
|
|
170
|
+
sig { returns(T::Boolean) }
|
|
171
|
+
def previously_persisted?; end
|
|
172
|
+
end
|