js-routes 2.2.7 → 2.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -9
- data/Gemfile +5 -0
- data/Readme.md +63 -47
- data/bin/tapioca +27 -0
- data/js-routes.gemspec +4 -1
- data/lib/js_routes/configuration.rb +80 -34
- data/lib/js_routes/engine.rb +2 -0
- data/lib/js_routes/generators/base.rb +15 -1
- data/lib/js_routes/generators/middleware.rb +3 -6
- data/lib/js_routes/generators/webpacker.rb +2 -4
- data/lib/js_routes/instance.rb +42 -15
- data/lib/js_routes/middleware.rb +14 -3
- data/lib/js_routes/route.rb +57 -16
- data/lib/js_routes/types.rb +28 -0
- data/lib/js_routes/version.rb +2 -1
- data/lib/js_routes.rb +20 -7
- data/lib/routes.js +25 -3
- data/lib/routes.ts +30 -6
- data/sorbet/config +4 -0
- data/sorbet/rbi/annotations/.gitattributes +1 -0
- data/sorbet/rbi/annotations/actionpack.rbi +428 -0
- data/sorbet/rbi/annotations/actionview.rbi +75 -0
- data/sorbet/rbi/annotations/activesupport.rbi +421 -0
- data/sorbet/rbi/annotations/railties.rbi +61 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/actionpack@7.0.4.1.rbi +303 -0
- data/sorbet/rbi/gems/actionview@7.0.4.1.rbi +8 -0
- data/sorbet/rbi/gems/activesupport@7.0.4.1.rbi +16424 -0
- data/sorbet/rbi/gems/appraisal@2.4.1.rbi +584 -0
- data/sorbet/rbi/gems/builder@3.2.4.rbi +8 -0
- data/sorbet/rbi/gems/bump@0.10.0.rbi +168 -0
- data/sorbet/rbi/gems/byebug@11.1.3.rbi +3606 -0
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +3426 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.2.0.rbi +11570 -0
- data/sorbet/rbi/gems/crass@1.0.6.rbi +8 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1083 -0
- data/sorbet/rbi/gems/erubi@1.12.0.rbi +145 -0
- data/sorbet/rbi/gems/i18n@1.12.0.rbi +2296 -0
- data/sorbet/rbi/gems/libv8-node@16.10.0.0.rbi +8 -0
- data/sorbet/rbi/gems/loofah@2.19.1.rbi +8 -0
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +272 -0
- data/sorbet/rbi/gems/mini_racer@0.6.3.rbi +224 -0
- data/sorbet/rbi/gems/minitest@5.17.0.rbi +1457 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
- data/sorbet/rbi/gems/nokogiri@1.14.0.rbi +8 -0
- data/sorbet/rbi/gems/parallel@1.24.0.rbi +280 -0
- data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +951 -0
- data/sorbet/rbi/gems/prism@0.24.0.rbi +29744 -0
- data/sorbet/rbi/gems/pry-byebug@3.10.1.rbi +1150 -0
- data/sorbet/rbi/gems/pry@0.14.2.rbi +10075 -0
- data/sorbet/rbi/gems/racc@1.6.2.rbi +150 -0
- data/sorbet/rbi/gems/rack-test@2.0.2.rbi +8 -0
- data/sorbet/rbi/gems/rack@2.2.6.2.rbi +5585 -0
- data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +8 -0
- data/sorbet/rbi/gems/rails-html-sanitizer@1.5.0.rbi +8 -0
- data/sorbet/rbi/gems/railties@7.0.4.1.rbi +1959 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +3072 -0
- data/sorbet/rbi/gems/rbi@0.1.9.rbi +3006 -0
- data/sorbet/rbi/gems/rspec-core@3.12.0.rbi +10868 -0
- data/sorbet/rbi/gems/rspec-expectations@3.12.2.rbi +8100 -0
- data/sorbet/rbi/gems/rspec-mocks@3.12.3.rbi +5299 -0
- data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +1611 -0
- data/sorbet/rbi/gems/rspec@3.12.0.rbi +82 -0
- data/sorbet/rbi/gems/spoom@1.2.4.rbi +3777 -0
- data/sorbet/rbi/gems/sprockets-rails@3.4.2.rbi +14 -0
- data/sorbet/rbi/gems/sprockets@4.2.0.rbi +8 -0
- data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +23136 -0
- data/sorbet/rbi/gems/tapioca@0.12.0.rbi +3510 -0
- data/sorbet/rbi/gems/thor@1.2.1.rbi +3956 -0
- data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +5914 -0
- data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +428 -0
- data/sorbet/rbi/gems/yard@0.9.34.rbi +18332 -0
- data/sorbet/rbi/gems/zeitwerk@2.6.8.rbi +8 -0
- data/sorbet/rbi/todo.rbi +31 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +4 -0
- data/spec/js_routes/default_serializer_spec.rb +1 -1
- data/spec/js_routes/module_types/dts_spec.rb +17 -2
- data/spec/js_routes/module_types/umd_spec.rb +2 -2
- data/spec/js_routes/options_spec.rb +6 -6
- data/spec/js_routes/rails_routes_compatibility_spec.rb +17 -12
- data/spec/js_routes/route_specification_spec.rb +1 -4
- data/spec/js_routes/{zzz_last_post_rails_init_spec.rb → zzz_sprockets_spec.rb} +1 -1
- data/spec/spec_helper.rb +4 -0
- metadata +82 -7
@@ -0,0 +1,428 @@
|
|
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 ActionController::API
|
8
|
+
MODULES = T.let(T.unsafe(nil), T::Array[T.untyped])
|
9
|
+
end
|
10
|
+
|
11
|
+
module ActionController::Flash::ClassMethods
|
12
|
+
sig { params(types: Symbol).void }
|
13
|
+
def add_flash_types(*types); end
|
14
|
+
end
|
15
|
+
|
16
|
+
module ActionController::Helpers::ClassMethods
|
17
|
+
sig { returns(ActionView::Base) }
|
18
|
+
def helpers; end
|
19
|
+
end
|
20
|
+
|
21
|
+
class ActionController::Metal < AbstractController::Base
|
22
|
+
sig { returns(ActionController::Parameters) }
|
23
|
+
def params; end
|
24
|
+
|
25
|
+
sig { returns(ActionDispatch::Request) }
|
26
|
+
def request; end
|
27
|
+
|
28
|
+
sig { returns(ActionDispatch::Response) }
|
29
|
+
def response; end
|
30
|
+
end
|
31
|
+
|
32
|
+
module ActionController::MimeResponds
|
33
|
+
sig { params(mimes: T.nilable(Symbol), block: T.nilable(T.proc.params(arg0: ActionController::MimeResponds::Collector).void)).void }
|
34
|
+
def respond_to(*mimes, &block); end
|
35
|
+
end
|
36
|
+
|
37
|
+
class ActionController::Parameters
|
38
|
+
sig { params(other: T.any(String, ActionController::Parameters)).returns(T::Boolean) }
|
39
|
+
def ==(other); end
|
40
|
+
|
41
|
+
sig { params(key: T.any(String, Symbol), value: T.untyped).void }
|
42
|
+
def []=(key, value); end
|
43
|
+
|
44
|
+
sig { returns(T.nilable(T::Array[T.any(String, Symbol)])) }
|
45
|
+
def always_permitted_parameters; end
|
46
|
+
|
47
|
+
sig { params(obj: T.nilable(T::Array[T.any(String, Symbol)])).void }
|
48
|
+
def always_permitted_parameters=(obj); end
|
49
|
+
|
50
|
+
sig { returns(T.untyped) }
|
51
|
+
def deep_dup; end
|
52
|
+
|
53
|
+
sig { params(key: T.any(String, Symbol), block: T.untyped).returns(T.untyped) }
|
54
|
+
def delete(key, &block); end
|
55
|
+
|
56
|
+
sig { params(keys: T.any(String, Symbol)).returns(T.untyped) }
|
57
|
+
def dig(*keys); end
|
58
|
+
|
59
|
+
sig { params(block: T.untyped).returns(T.untyped) }
|
60
|
+
def each_pair(&block); end
|
61
|
+
|
62
|
+
# each is an alias of each_pair
|
63
|
+
sig { params(block: T.untyped).returns(T.untyped) }
|
64
|
+
def each(&block); end
|
65
|
+
|
66
|
+
sig { params(keys: T.any(String, Symbol)).returns(ActionController::Parameters) }
|
67
|
+
def except(*keys); end
|
68
|
+
|
69
|
+
sig { params(keys: T.any(String, Symbol)).returns(T.untyped) }
|
70
|
+
def extract!(*keys); end
|
71
|
+
|
72
|
+
sig { params(key: T.any(String, Symbol), args: T.untyped).returns(T.untyped) }
|
73
|
+
def fetch(key, *args); end
|
74
|
+
|
75
|
+
sig { returns(String) }
|
76
|
+
def inspect; end
|
77
|
+
|
78
|
+
sig { params(other_hash: T.untyped, block: T.untyped).returns(ActionController::Parameters) }
|
79
|
+
def merge!(other_hash, &block); end
|
80
|
+
|
81
|
+
sig { params(other_hash: T.untyped).returns(ActionController::Parameters) }
|
82
|
+
def merge(other_hash); end
|
83
|
+
|
84
|
+
sig { returns(T.untyped) }
|
85
|
+
def parameters; end
|
86
|
+
|
87
|
+
sig { returns(T.self_type) }
|
88
|
+
def permit!; end
|
89
|
+
|
90
|
+
# You can pass _a lot_ of stuff to permit, so filters is left untyped for now.
|
91
|
+
sig { params(filters: T.untyped).returns(ActionController::Parameters) }
|
92
|
+
def permit(*filters); end
|
93
|
+
|
94
|
+
sig { params(new_permitted: T.untyped).void }
|
95
|
+
def permitted=(new_permitted); end
|
96
|
+
|
97
|
+
sig { returns(T::Boolean) }
|
98
|
+
def permitted?; end
|
99
|
+
|
100
|
+
sig { params(block: T.untyped).returns(T.untyped) }
|
101
|
+
def reject!(&block); end
|
102
|
+
|
103
|
+
# delete_if is an alias of reject!
|
104
|
+
sig { params(block: T.untyped).returns(T.untyped) }
|
105
|
+
def delete_if(&block); end
|
106
|
+
|
107
|
+
sig { params(block: T.untyped).returns(T.untyped) }
|
108
|
+
def reject(&block); end
|
109
|
+
|
110
|
+
sig { params(key: T.any(String, Symbol)).returns(T.untyped) }
|
111
|
+
def [](key); end
|
112
|
+
|
113
|
+
sig { params(key: T.any(String, Symbol, T::Array[T.any(String, Symbol)])).returns(T.untyped) }
|
114
|
+
def require(key); end
|
115
|
+
|
116
|
+
# required is an alias of require
|
117
|
+
sig { params(key: T.any(String, Symbol, T::Array[T.any(String, Symbol)])).returns(T.untyped) }
|
118
|
+
def required(key); end
|
119
|
+
|
120
|
+
sig { params(other_hash: T.untyped).returns(ActionController::Parameters) }
|
121
|
+
def reverse_merge!(other_hash); end
|
122
|
+
|
123
|
+
# with_defaults! is an alias of reverse_merge!
|
124
|
+
sig { params(other_hash: T.untyped).returns(ActionController::Parameters) }
|
125
|
+
def with_defaults!(other_hash); end
|
126
|
+
|
127
|
+
sig { params(other_hash: T.untyped).returns(ActionController::Parameters) }
|
128
|
+
def reverse_merge(other_hash); end
|
129
|
+
|
130
|
+
# with_defaults is an alias of reverse_merge
|
131
|
+
sig { params(other_hash: T.untyped).returns(ActionController::Parameters) }
|
132
|
+
def with_defaults(other_hash); end
|
133
|
+
|
134
|
+
sig { params(block: T.untyped).returns(T.nilable(ActionController::Parameters)) }
|
135
|
+
def select!(&block); end
|
136
|
+
|
137
|
+
# keep_if is an alias of select!
|
138
|
+
sig { params(block: T.untyped).returns(T.nilable(ActionController::Parameters)) }
|
139
|
+
def keep_if(&block); end
|
140
|
+
|
141
|
+
sig { params(block: T.untyped).returns(ActionController::Parameters) }
|
142
|
+
def select(&block); end
|
143
|
+
|
144
|
+
sig { params(keys: T.any(String, Symbol)).returns(ActionController::Parameters) }
|
145
|
+
def slice!(*keys); end
|
146
|
+
|
147
|
+
sig { params(keys: T.any(String, Symbol)).returns(ActionController::Parameters) }
|
148
|
+
def slice(*keys); end
|
149
|
+
|
150
|
+
sig { params(block: T.nilable(Proc)).returns(ActiveSupport::HashWithIndifferentAccess) }
|
151
|
+
def to_h(&block); end
|
152
|
+
|
153
|
+
sig { returns(T::Hash[T.untyped, T.untyped]) }
|
154
|
+
def to_hash; end
|
155
|
+
|
156
|
+
# to_param is an alias of to_query
|
157
|
+
sig { params(args: String).returns(T.nilable(String)) }
|
158
|
+
def to_param(*args); end
|
159
|
+
|
160
|
+
sig { params(args: String).returns(T.nilable(String)) }
|
161
|
+
def to_query(*args); end
|
162
|
+
|
163
|
+
sig { returns(ActiveSupport::HashWithIndifferentAccess) }
|
164
|
+
def to_unsafe_h; end
|
165
|
+
|
166
|
+
# to_unsafe_hash is an alias of to_unsafe_h
|
167
|
+
sig { returns(ActiveSupport::HashWithIndifferentAccess) }
|
168
|
+
def to_unsafe_hash; end
|
169
|
+
|
170
|
+
sig { params(block: T.untyped).returns(ActionController::Parameters) }
|
171
|
+
def transform_keys!(&block); end
|
172
|
+
|
173
|
+
sig { params(block: T.untyped).returns(ActionController::Parameters) }
|
174
|
+
def transform_keys(&block); end
|
175
|
+
|
176
|
+
sig { returns(ActionController::Parameters) }
|
177
|
+
def transform_values!; end
|
178
|
+
|
179
|
+
sig { returns(ActionController::Parameters) }
|
180
|
+
def transform_values; end
|
181
|
+
|
182
|
+
sig { params(keys: T.any(String, Symbol)).returns(T.untyped) }
|
183
|
+
def values_at(*keys); end
|
184
|
+
|
185
|
+
sig { returns(T.any(Symbol, T::Boolean)) }
|
186
|
+
def self.action_on_unpermitted_parameters; end
|
187
|
+
|
188
|
+
sig { params(obj: T.any(Symbol, T::Boolean)).void }
|
189
|
+
def self.action_on_unpermitted_parameters=(obj); end
|
190
|
+
|
191
|
+
sig { returns(T::Array[T.any(String, Symbol)]) }
|
192
|
+
def self.always_permitted_parameters; end
|
193
|
+
|
194
|
+
sig { params(obj: T::Array[T.any(String, Symbol)]).void }
|
195
|
+
def self.always_permitted_parameters=(obj); end
|
196
|
+
|
197
|
+
sig { returns(T::Boolean) }
|
198
|
+
def self.permit_all_parameters; end
|
199
|
+
|
200
|
+
sig { params(obj: T::Boolean).void }
|
201
|
+
def self.permit_all_parameters=(obj); end
|
202
|
+
end
|
203
|
+
|
204
|
+
module ActionController::RequestForgeryProtection
|
205
|
+
sig { returns(T::Boolean) }
|
206
|
+
def protect_against_forgery?; end
|
207
|
+
|
208
|
+
sig { params(form_options: T::Hash[T.untyped, T.untyped]).returns(String) }
|
209
|
+
def form_authenticity_token(form_options: {}); end
|
210
|
+
end
|
211
|
+
|
212
|
+
module ActionController::RequestForgeryProtection::ClassMethods
|
213
|
+
sig { params(options: T::Hash[T.untyped, T.untyped]).void }
|
214
|
+
def skip_forgery_protection(options = T.unsafe(nil)); end
|
215
|
+
end
|
216
|
+
|
217
|
+
module ActionController::StrongParameters
|
218
|
+
sig { returns(ActionController::Parameters) }
|
219
|
+
def params; end
|
220
|
+
end
|
221
|
+
|
222
|
+
module ActionDispatch::Http::Parameters
|
223
|
+
sig { returns(ActionController::Parameters) }
|
224
|
+
def parameters; end
|
225
|
+
|
226
|
+
# params is an alias of parameters
|
227
|
+
sig { returns(ActionController::Parameters) }
|
228
|
+
def params; end
|
229
|
+
end
|
230
|
+
|
231
|
+
module ActionDispatch::Integration::Runner
|
232
|
+
# @method_missing: delegated to ActionDispatch::Integration::Session
|
233
|
+
sig { params(host: String).returns(String) }
|
234
|
+
def host!(host); end
|
235
|
+
|
236
|
+
# @method_missing: delegated to ActionDispatch::Integration::Session
|
237
|
+
sig { params(flag: T::Boolean).returns(T::Boolean) }
|
238
|
+
def https!(flag = true); end
|
239
|
+
end
|
240
|
+
|
241
|
+
class ActionDispatch::IntegrationTest
|
242
|
+
# The following methods are accessible on `IntegrationTest`
|
243
|
+
# through the following delegation chain:
|
244
|
+
# - `IntegrationTest` includes `IntegrationTest::Behavior`
|
245
|
+
# - `IntegrationTest::Behavior` includes `Integration::Runner`
|
246
|
+
# - `Integration::Runner#method_missing` delegates to `Integration::Session`
|
247
|
+
#
|
248
|
+
# Then `Integration::Session` either implements the methods
|
249
|
+
# directly or further delegates to `TestProcess` (included) or
|
250
|
+
# `TestResponse` / `Request` (via `delegate`).
|
251
|
+
#
|
252
|
+
# Cf. https://github.com/Shopify/rbi-central/pull/138 for more context.
|
253
|
+
# @method_missing: delegated to ActionDispatch::TestProcess
|
254
|
+
sig { returns(ActionDispatch::Flash::FlashHash) }
|
255
|
+
def flash; end
|
256
|
+
|
257
|
+
# @method_missing: delegated to ActionDispatch::TestProcess
|
258
|
+
sig { returns(ActionDispatch::Request::Session) }
|
259
|
+
def session; end
|
260
|
+
|
261
|
+
# @method_missing: delegated to ActionDispatch::TestResponse
|
262
|
+
sig { returns(T.nilable(Integer)) }
|
263
|
+
def status; end
|
264
|
+
|
265
|
+
# @method_missing: delegated to ActionDispatch::TestResponse
|
266
|
+
sig { returns(T.nilable(String)) }
|
267
|
+
def status_message; end
|
268
|
+
|
269
|
+
# @method_missing: delegated to ActionDispatch::TestResponse
|
270
|
+
sig { returns(ActionDispatch::Response::Header) }
|
271
|
+
def headers; end
|
272
|
+
|
273
|
+
# @method_missing: delegated to ActionDispatch::TestResponse
|
274
|
+
sig { returns(T.nilable(String)) }
|
275
|
+
def body; end
|
276
|
+
|
277
|
+
# @method_missing: delegated to ActionDispatch::TestResponse
|
278
|
+
sig { returns(T.nilable(T::Boolean)) }
|
279
|
+
def redirect?; end
|
280
|
+
|
281
|
+
# @method_missing: delegated to ActionDispatch::Request
|
282
|
+
sig { returns(T.nilable(String)) }
|
283
|
+
def path; end
|
284
|
+
|
285
|
+
# @method_missing: delegated to ActionDispatch::Integration::Session
|
286
|
+
sig { returns(String) }
|
287
|
+
def host; end
|
288
|
+
|
289
|
+
# @method_missing: delegated to ActionDispatch::Integration::Session
|
290
|
+
sig { params(host: String).returns(String) }
|
291
|
+
attr_writer :host
|
292
|
+
|
293
|
+
# @method_missing: delegated to ActionDispatch::Integration::Session
|
294
|
+
sig { returns(T.nilable(String)) }
|
295
|
+
attr_accessor :remote_addr
|
296
|
+
|
297
|
+
# @method_missing: delegated to ActionDispatch::Integration::Session
|
298
|
+
sig { returns(T.nilable(String)) }
|
299
|
+
attr_accessor :accept
|
300
|
+
|
301
|
+
# @method_missing: delegated to ActionDispatch::Integration::Session
|
302
|
+
sig { returns(Rack::Test::CookieJar) }
|
303
|
+
def cookies; end
|
304
|
+
|
305
|
+
# @method_missing: delegated to ActionDispatch::Integration::Session
|
306
|
+
sig { returns(T.nilable(ActionController::Base)) }
|
307
|
+
attr_reader :controller
|
308
|
+
|
309
|
+
# @method_missing: delegated to ActionDispatch::Integration::Session
|
310
|
+
sig { returns(ActionDispatch::TestRequest) }
|
311
|
+
attr_reader :request
|
312
|
+
|
313
|
+
# @method_missing: delegated to ActionDispatch::Integration::Session
|
314
|
+
sig { returns(ActionDispatch::TestResponse) }
|
315
|
+
attr_reader :response
|
316
|
+
|
317
|
+
# @method_missing: delegated to ActionDispatch::Integration::Session
|
318
|
+
sig { returns(Integer) }
|
319
|
+
attr_accessor :request_count
|
320
|
+
end
|
321
|
+
|
322
|
+
class ActionDispatch::Request
|
323
|
+
# Provides access to the request's HTTP headers, for example:
|
324
|
+
#
|
325
|
+
# ```ruby
|
326
|
+
# request.headers["Content-Type"] # => "text/plain"
|
327
|
+
# ```
|
328
|
+
sig { returns(ActionDispatch::Http::Headers) }
|
329
|
+
def headers; end
|
330
|
+
|
331
|
+
# Returns a `String` with the last requested path including their params.
|
332
|
+
#
|
333
|
+
# ```ruby
|
334
|
+
# # get '/foo'
|
335
|
+
# request.original_fullpath # => '/foo'
|
336
|
+
#
|
337
|
+
# # get '/foo?bar'
|
338
|
+
# request.original_fullpath # => '/foo?bar'
|
339
|
+
# ```
|
340
|
+
sig { returns(String) }
|
341
|
+
def original_fullpath; end
|
342
|
+
|
343
|
+
# Returns the `String` full path including params of the last URL requested.
|
344
|
+
#
|
345
|
+
# ```ruby
|
346
|
+
# # get "/articles"
|
347
|
+
# request.fullpath # => "/articles"
|
348
|
+
#
|
349
|
+
# # get "/articles?page=2"
|
350
|
+
# request.fullpath # => "/articles?page=2"
|
351
|
+
# ```
|
352
|
+
sig { returns(String) }
|
353
|
+
def fullpath; end
|
354
|
+
|
355
|
+
# Returns the original request URL as a `String`.
|
356
|
+
#
|
357
|
+
# ```ruby
|
358
|
+
# # get "/articles?page=2"
|
359
|
+
# request.original_url # => "http://www.example.com/articles?page=2"
|
360
|
+
# ```
|
361
|
+
sig { returns(String) }
|
362
|
+
def original_url; end
|
363
|
+
|
364
|
+
# The `String` MIME type of the request.
|
365
|
+
#
|
366
|
+
# ```
|
367
|
+
# # get "/articles"
|
368
|
+
# request.media_type # => "application/x-www-form-urlencoded"
|
369
|
+
# ```
|
370
|
+
sig { returns(String) }
|
371
|
+
def media_type; end
|
372
|
+
|
373
|
+
# Returns the content length of the request as an integer.
|
374
|
+
sig { returns(Integer) }
|
375
|
+
def content_length; end
|
376
|
+
|
377
|
+
# Returns the IP address of client as a `String`.
|
378
|
+
sig { returns(String) }
|
379
|
+
def ip; end
|
380
|
+
|
381
|
+
# Returns the IP address of client as a `String`,
|
382
|
+
# usually set by the RemoteIp middleware.
|
383
|
+
sig { returns(String) }
|
384
|
+
def remote_ip; end
|
385
|
+
|
386
|
+
# Returns the unique request id, which is based on either the X-Request-Id header that can
|
387
|
+
# be generated by a firewall, load balancer, or web server or by the RequestId middleware
|
388
|
+
# (which sets the action_dispatch.request_id environment variable).
|
389
|
+
#
|
390
|
+
# This unique ID is useful for tracing a request from end-to-end as part of logging or debugging.
|
391
|
+
# This relies on the Rack variable set by the ActionDispatch::RequestId middleware.
|
392
|
+
sig { returns(T.nilable(String)) }
|
393
|
+
def request_id; end
|
394
|
+
|
395
|
+
# Returns true if the request has a header matching the given key parameter.
|
396
|
+
#
|
397
|
+
# ```ruby
|
398
|
+
# request.key? :ip_spoofing_check # => true
|
399
|
+
# ```
|
400
|
+
sig { params(key: Symbol).returns(T::Boolean) }
|
401
|
+
def key?(key); end
|
402
|
+
|
403
|
+
# True if the request came from localhost, 127.0.0.1, or ::1.
|
404
|
+
sig { returns(T::Boolean) }
|
405
|
+
def local?; end
|
406
|
+
end
|
407
|
+
|
408
|
+
module ActionDispatch::Routing::Mapper::Resources
|
409
|
+
sig { params(name: T.untyped).returns(T.untyped) }
|
410
|
+
def action_path(name); end
|
411
|
+
|
412
|
+
sig { params(block: T.untyped).returns(T.untyped) }
|
413
|
+
def collection(&block); end
|
414
|
+
|
415
|
+
sig { params(block: T.untyped).returns(T.untyped) }
|
416
|
+
def member(&block); end
|
417
|
+
|
418
|
+
sig { returns(T.untyped) }
|
419
|
+
def shallow; end
|
420
|
+
|
421
|
+
sig { returns(T::Boolean) }
|
422
|
+
def shallow?; end
|
423
|
+
end
|
424
|
+
|
425
|
+
class ActionDispatch::Routing::RouteSet
|
426
|
+
sig { params(block: T.proc.bind(ActionDispatch::Routing::Mapper).void).void }
|
427
|
+
def draw(&block); end
|
428
|
+
end
|
@@ -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
|