assets/sig/generated/actionview.rbs in rbs_rails-0.3.0 vs assets/sig/generated/actionview.rbs in rbs_rails-0.4.0

- old
+ new

@@ -191,21 +191,31 @@ # nodoc: def initialize: () -> untyped def <<: (untyped value) -> untyped + alias append= << + def safe_expr_append=: (untyped val) -> untyped + + alias safe_append= safe_concat end class StreamingBuffer # nodoc: def initialize: (untyped block) -> untyped def <<: (untyped value) -> untyped + alias concat << + + alias append= << + def safe_concat: (untyped value) -> untyped + alias safe_append= safe_concat + def html_safe?: () -> ::TrueClass def html_safe: () -> untyped end end @@ -399,10 +409,12 @@ # Called by each renderer object to set the layout contents. def set: (untyped key, untyped value) -> untyped # Called by content_for def append: (untyped key, untyped value) -> untyped + + alias append! append end class StreamingFlow < OutputFlow # nodoc: def initialize: (untyped view, untyped fiber) -> untyped @@ -978,10 +990,12 @@ # # asset_path("foo", skip_pipeline: true, extname: ".js") # => "/foo.js" # asset_path("foo.css", skip_pipeline: true, extname: ".js") # => "/foo.css.js" def asset_path: (untyped source, ?::Hash[untyped, untyped] options) -> (::String | untyped) + alias path_to_asset asset_path + # Computes the full URL to an asset in the public directory. This # will use +asset_path+ internally, so most of their behaviors # will be the same. If :host options is set, it overwrites global # +config.action_controller.asset_host+ setting. # @@ -990,10 +1004,12 @@ # asset_url "application.js" # => http://example.com/assets/application.js # asset_url "application.js", host: "http://cdn.example.com" # => http://cdn.example.com/assets/application.js # def asset_url: (untyped source, ?::Hash[untyped, untyped] options) -> untyped + alias url_to_asset asset_url + ASSET_EXTENSIONS: ::Hash[untyped, untyped] # Compute extname to append to asset path. Returns +nil+ if # nothing should be added. def compute_asset_extname: (untyped source, ?::Hash[untyped, untyped] options) -> (nil | untyped) @@ -1004,10 +1020,12 @@ # Computes asset path to public directory. Plugins and # extensions can override this method to point to custom assets # or generate digested paths or query strings. def compute_asset_path: (untyped source, ?::Hash[untyped, untyped] options) -> untyped + alias public_compute_asset_path compute_asset_path + # Pick an asset host for this source. Returns +nil+ if no host is set, # the host if no wildcard is set, the host interpolated with the # numbers 0-3 if it contains <tt>%d</tt> (the number is the source hash mod 4), # or the value returned from invoking call on an object responding to call # (proc or otherwise). @@ -1023,19 +1041,23 @@ # javascript_path "/dir/xmlhr" # => /dir/xmlhr.js # javascript_path "http://www.example.com/js/xmlhr" # => http://www.example.com/js/xmlhr # javascript_path "http://www.example.com/js/xmlhr.js" # => http://www.example.com/js/xmlhr.js def javascript_path: (untyped source, ?::Hash[untyped, untyped] options) -> untyped + alias path_to_javascript javascript_path + # Computes the full URL to a JavaScript asset in the public javascripts directory. # This will use +javascript_path+ internally, so most of their behaviors will be the same. # Since +javascript_url+ is based on +asset_url+ method you can set :host options. If :host # options is set, it overwrites global +config.action_controller.asset_host+ setting. # # javascript_url "js/xmlhr.js", host: "http://stage.example.com" # => http://stage.example.com/assets/js/xmlhr.js # def javascript_url: (untyped source, ?::Hash[untyped, untyped] options) -> untyped + alias url_to_javascript javascript_url + # Computes the path to a stylesheet asset in the public stylesheets directory. # If the +source+ filename has no extension, .css will be appended (except for explicit URIs). # Full paths from the document root will be passed through. # Used internally by +stylesheet_link_tag+ to build the stylesheet path. # @@ -1044,19 +1066,23 @@ # stylesheet_path "/dir/style.css" # => /dir/style.css # stylesheet_path "http://www.example.com/css/style" # => http://www.example.com/css/style # stylesheet_path "http://www.example.com/css/style.css" # => http://www.example.com/css/style.css def stylesheet_path: (untyped source, ?::Hash[untyped, untyped] options) -> untyped + alias path_to_stylesheet stylesheet_path + # Computes the full URL to a stylesheet asset in the public stylesheets directory. # This will use +stylesheet_path+ internally, so most of their behaviors will be the same. # Since +stylesheet_url+ is based on +asset_url+ method you can set :host options. If :host # options is set, it overwrites global +config.action_controller.asset_host+ setting. # # stylesheet_url "css/style.css", host: "http://stage.example.com" # => http://stage.example.com/assets/css/style.css # def stylesheet_url: (untyped source, ?::Hash[untyped, untyped] options) -> untyped + alias url_to_stylesheet stylesheet_url + # Computes the path to an image asset. # Full paths from the document root will be passed through. # Used internally by +image_tag+ to build the image path: # # image_path("edit") # => "/assets/edit" @@ -1068,19 +1094,23 @@ # If you have images as application resources this method may conflict with their named routes. # The alias +path_to_image+ is provided to avoid that. Rails uses the alias internally, and # plugin authors are encouraged to do so. def image_path: (untyped source, ?::Hash[untyped, untyped] options) -> untyped + alias path_to_image image_path + # Computes the full URL to an image asset. # This will use +image_path+ internally, so most of their behaviors will be the same. # Since +image_url+ is based on +asset_url+ method you can set :host options. If :host # options is set, it overwrites global +config.action_controller.asset_host+ setting. # # image_url "edit.png", host: "http://stage.example.com" # => http://stage.example.com/assets/edit.png # def image_url: (untyped source, ?::Hash[untyped, untyped] options) -> untyped + alias url_to_image image_url + # Computes the path to a video asset in the public videos directory. # Full paths from the document root will be passed through. # Used internally by +video_tag+ to build the video path. # # video_path("hd") # => /videos/hd @@ -1088,19 +1118,23 @@ # video_path("trailers/hd.avi") # => /videos/trailers/hd.avi # video_path("/trailers/hd.avi") # => /trailers/hd.avi # video_path("http://www.example.com/vid/hd.avi") # => http://www.example.com/vid/hd.avi def video_path: (untyped source, ?::Hash[untyped, untyped] options) -> untyped + alias path_to_video video_path + # Computes the full URL to a video asset in the public videos directory. # This will use +video_path+ internally, so most of their behaviors will be the same. # Since +video_url+ is based on +asset_url+ method you can set :host options. If :host # options is set, it overwrites global +config.action_controller.asset_host+ setting. # # video_url "hd.avi", host: "http://stage.example.com" # => http://stage.example.com/videos/hd.avi # def video_url: (untyped source, ?::Hash[untyped, untyped] options) -> untyped + alias url_to_video video_url + # Computes the path to an audio asset in the public audios directory. # Full paths from the document root will be passed through. # Used internally by +audio_tag+ to build the audio path. # # audio_path("horse") # => /audios/horse @@ -1108,37 +1142,45 @@ # audio_path("sounds/horse.wav") # => /audios/sounds/horse.wav # audio_path("/sounds/horse.wav") # => /sounds/horse.wav # audio_path("http://www.example.com/sounds/horse.wav") # => http://www.example.com/sounds/horse.wav def audio_path: (untyped source, ?::Hash[untyped, untyped] options) -> untyped + alias path_to_audio audio_path + # Computes the full URL to an audio asset in the public audios directory. # This will use +audio_path+ internally, so most of their behaviors will be the same. # Since +audio_url+ is based on +asset_url+ method you can set :host options. If :host # options is set, it overwrites global +config.action_controller.asset_host+ setting. # # audio_url "horse.wav", host: "http://stage.example.com" # => http://stage.example.com/audios/horse.wav # def audio_url: (untyped source, ?::Hash[untyped, untyped] options) -> untyped + alias url_to_audio audio_url + # Computes the path to a font asset. # Full paths from the document root will be passed through. # # font_path("font") # => /fonts/font # font_path("font.ttf") # => /fonts/font.ttf # font_path("dir/font.ttf") # => /fonts/dir/font.ttf # font_path("/dir/font.ttf") # => /dir/font.ttf # font_path("http://www.example.com/dir/font.ttf") # => http://www.example.com/dir/font.ttf def font_path: (untyped source, ?::Hash[untyped, untyped] options) -> untyped + alias path_to_font font_path + # Computes the full URL to a font asset. # This will use +font_path+ internally, so most of their behaviors will be the same. # Since +font_url+ is based on +asset_url+ method you can set :host options. If :host # options is set, it overwrites global +config.action_controller.asset_host+ setting. # # font_url "font.ttf", host: "http://stage.example.com" # => http://stage.example.com/fonts/font.ttf # def font_url: (untyped source, ?::Hash[untyped, untyped] options) -> untyped + + alias url_to_font font_url end end end module ActionView @@ -1709,10 +1751,13 @@ # # For AJAX requests other than GETs, extract the "csrf-token" from the meta-tag and send as the # "X-CSRF-Token" HTTP header. If you are using rails-ujs this happens automatically. # def csrf_meta_tags: () -> untyped + + # For backwards compatibility. + alias csrf_meta_tag csrf_meta_tags end end end module ActionView @@ -1820,10 +1865,12 @@ # # Note that you cannot pass a <tt>Numeric</tt> value to <tt>time_ago_in_words</tt>. # def time_ago_in_words: (untyped from_time, ?::Hash[untyped, untyped] options) -> untyped + alias distance_of_time_in_words_to_now time_ago_in_words + # Returns a set of select tags (one for year, month, and day) pre-selected for accessing a specified date-based # attribute (identified by +method+) on an object assigned to the template (identified by +object+). # # ==== Options # * <tt>:use_month_numbers</tt> - Set to true if you want to use month numbers rather than month names (e.g. @@ -3769,10 +3816,13 @@ # telephone_field("user", "phone") # # => <input id="user_phone" name="user[phone]" type="tel" /> # def telephone_field: (untyped object_name, untyped method, ?::Hash[untyped, untyped] options) -> untyped + # aliases telephone_field + alias phone_field telephone_field + # Returns a text_field of type "date". # # date_field("user", "born_on") # # => <input id="user_born_on" name="user[born_on]" type="date" /> # @@ -3851,10 +3901,12 @@ # datetime_field("user", "born_on", min: "2014-05-20T00:00:00") # # => <input id="user_born_on" name="user[born_on]" type="datetime-local" min="2014-05-20T00:00:00.000" /> # def datetime_field: (untyped object_name, untyped method, ?::Hash[untyped, untyped] options) -> untyped + alias datetime_local_field datetime_field + # Returns a text_field of type "month". # # month_field("user", "born_on") # # => <input id="user_born_on" name="user[born_on]" type="month" /> # @@ -3975,10 +4027,12 @@ attr_reader multipart: untyped attr_reader index: untyped + alias multipart? multipart + def multipart=: (untyped multipart) -> untyped def self._to_partial_path: () -> untyped def to_partial_path: () -> untyped @@ -5787,10 +5841,12 @@ # # telephone_field_tag 'tel', '0123456789', class: 'special_input', disabled: true # # => <input disabled="disabled" class="special_input" id="tel" name="tel" type="tel" value="0123456789" /> def telephone_field_tag: (untyped name, ?untyped? value, ?::Hash[untyped, untyped] options) -> untyped + alias phone_field_tag telephone_field_tag + # Creates a text field of type "date". # # ==== Options # * Accepts the same options as text_field_tag. # @@ -5824,10 +5880,12 @@ # * <tt>:max</tt> - The maximum acceptable value. # * <tt>:step</tt> - The acceptable value granularity. # * Otherwise accepts the same options as text_field_tag. def datetime_field_tag: (untyped name, ?untyped? value, ?::Hash[untyped, untyped] options) -> untyped + alias datetime_local_field_tag datetime_field_tag + # Creates a text field of type "month". # # === Options # * <tt>:min</tt> - The minimum acceptable value. # * <tt>:max</tt> - The maximum acceptable value. @@ -5965,10 +6023,12 @@ # responses, like: # # $('some_element').replaceWith('<%= j render 'some/element_template' %>'); def escape_javascript: (untyped javascript) -> untyped + alias j escape_javascript + # Returns a JavaScript tag with the +content+ inside. Example: # javascript_tag "alert('All is good')" # # Returns: # <script> @@ -6446,70 +6506,10 @@ end module ActionView module Helpers # nodoc: - # nodoc: - extend ActiveSupport::Autoload - - def self.eager_load!: () -> untyped - - extend ActiveSupport::Concern - - include ActiveSupport::Benchmarkable - - include ActiveModelHelper - - include AssetTagHelper - - include AssetUrlHelper - - include AtomFeedHelper - - include CacheHelper - - include CaptureHelper - - include ControllerHelper - - include CspHelper - - include CsrfHelper - - include DateHelper - - include DebugHelper - - include FormHelper - - include FormOptionsHelper - - include FormTagHelper - - include JavaScriptHelper - - include NumberHelper - - include OutputSafetyHelper - - include RenderingHelper - - include SanitizeHelper - - include TagHelper - - include TextHelper - - include TranslationHelper - - include UrlHelper - end -end - -module ActionView - module Helpers - # nodoc: # = Action View Rendering # # Implements methods that allow rendering from a view context. # In order to use this module, all you need is to implement # view_renderer that returns an ActionView::Renderer object. @@ -7032,22 +7032,10 @@ end module ActionView module Helpers module Tags - module Checkable - # :nodoc: - # :nodoc: - def input_checked?: (untyped options) -> untyped - end - end - end -end - -module ActionView - module Helpers - module Tags class CheckBox < Base # :nodoc: # nodoc: include Checkable @@ -7064,10 +7052,22 @@ end module ActionView module Helpers module Tags + module Checkable + # :nodoc: + # :nodoc: + def input_checked?: (untyped options) -> untyped + end + end + end +end + +module ActionView + module Helpers + module Tags class CollectionCheckBoxes < Base # :nodoc: # :nodoc: include CollectionHelpers @@ -7391,20 +7391,10 @@ end module ActionView module Helpers module Tags - # nodoc: - # nodoc: - extend ActiveSupport::Autoload - end - end -end - -module ActionView - module Helpers - module Tags class SearchField < TextField # :nodoc: # :nodoc: def render: () -> untyped end @@ -7551,10 +7541,20 @@ end end module ActionView module Helpers + module Tags + # nodoc: + # nodoc: + extend ActiveSupport::Autoload + end + end +end + +module ActionView + module Helpers # = Action View Text Helpers # nodoc: # The TextHelper module provides a set of methods for filtering, formatting # and transforming strings, which can reduce the amount of inline Ruby code in # your views. These helper methods extend Action View making them callable @@ -7937,16 +7937,20 @@ # that include HTML tags so that you know what kind of output to expect # when you call translate in a template and translators know which keys # they can provide HTML values for. def translate: (untyped key, **untyped options) -> untyped + alias t translate + # Delegates to <tt>I18n.localize</tt> with no additional functionality. # # See https://www.rubydoc.info/github/svenfuchs/i18n/master/I18n/Backend/Base:localize # for more information. def localize: (untyped object, **untyped options) -> untyped + alias l localize + def scope_key_by_partial: (untyped key) -> untyped def html_safe_translation_key?: (untyped key) -> untyped end end @@ -8418,10 +8422,70 @@ end end end module ActionView + module Helpers + # nodoc: + # nodoc: + extend ActiveSupport::Autoload + + def self.eager_load!: () -> untyped + + extend ActiveSupport::Concern + + include ActiveSupport::Benchmarkable + + include ActiveModelHelper + + include AssetTagHelper + + include AssetUrlHelper + + include AtomFeedHelper + + include CacheHelper + + include CaptureHelper + + include ControllerHelper + + include CspHelper + + include CsrfHelper + + include DateHelper + + include DebugHelper + + include FormHelper + + include FormOptionsHelper + + include FormTagHelper + + include JavaScriptHelper + + include NumberHelper + + include OutputSafetyHelper + + include RenderingHelper + + include SanitizeHelper + + include TagHelper + + include TextHelper + + include TranslationHelper + + include UrlHelper + end +end + +module ActionView # Layouts reverse the common pattern of including shared headers and footers in many templates to isolate changes in # repeated setups. The inclusion pattern has pages that look like this: # # <%= render "shared/header" %> # Hello World @@ -8769,10 +8833,13 @@ # nodoc: DEFAULT_PROCS: ::Hash[untyped, untyped] end class DetailsKey + # nodoc: + alias eql? equal? + def self.digest_cache: (untyped details) -> untyped def self.details_cache_key: (untyped details) -> untyped def self.clear: () -> untyped @@ -8800,16 +8867,24 @@ attr_reader html_fallback_for_js: untyped def find: (untyped name, ?untyped prefixes, ?bool partial, ?untyped keys, ?::Hash[untyped, untyped] options) -> untyped + alias find_template find + + alias find_file find + def find_all: (untyped name, ?untyped prefixes, ?bool partial, ?untyped keys, ?::Hash[untyped, untyped] options) -> untyped def exists?: (untyped name, ?untyped prefixes, ?bool partial, ?untyped keys, **untyped options) -> untyped + alias template_exists? exists? + def any?: (untyped name, ?untyped prefixes, ?bool partial) -> untyped + alias any_templates? any? + # Adds fallbacks to the view paths. Useful in cases when you are rendering # a :file. def with_fallbacks: () { () -> untyped } -> untyped # Whenever setting view paths, makes a copy so that we can manipulate them in @@ -8893,10 +8968,12 @@ def +: (untyped array) -> PathSet def find: (*untyped args) -> untyped + alias find_file find + def find_all: (untyped path, ?untyped prefixes, *untyped args) -> untyped def exists?: (untyped path, untyped prefixes, *untyped args) -> untyped def find_all_with_query: (untyped query) -> (untyped | ::Array[untyped]) @@ -8914,18 +8991,10 @@ NULL_OPTION: untyped end end module ActionView - extend ActiveSupport::Autoload - - ENCODING_FLAG: ::String - - def self.eager_load!: () -> untyped -end - -module ActionView # RecordIdentifier encapsulates methods used by various ActionView helpers # to associate records with DOM elements. # # Consider for example the following code that form of post: # @@ -9860,10 +9929,12 @@ def initialize: (untyped string, ?untyped? `type`) -> untyped def identifier: () -> "html template" + alias inspect identifier + def to_str: () -> untyped def render: (*untyped args) -> untyped def format: () -> untyped @@ -9908,133 +9979,10 @@ end end end module ActionView - # = Action View Template - class Template - extend ActiveSupport::Autoload - - def self.finalize_compiled_template_methods: () -> untyped - - def self.finalize_compiled_template_methods=: (untyped _) -> untyped - - extend Template::Handlers - - attr_reader identifier: untyped - - attr_reader handler: untyped - - attr_reader original_encoding: untyped - - attr_reader updated_at: untyped - - attr_reader variable: untyped - - attr_reader format: untyped - - attr_reader variant: untyped - - attr_reader locals: untyped - - attr_reader virtual_path: untyped - - def initialize: (untyped source, untyped identifier, untyped handler, ?format: untyped? format, ?variant: untyped? variant, ?locals: untyped? locals, ?virtual_path: untyped? virtual_path, ?updated_at: untyped? updated_at) -> untyped - - def virtual_path=: (untyped _) -> nil - - def locals=: (untyped _) -> nil - - def formats=: (untyped _) -> nil - - def formats: () -> untyped - - def variants=: (untyped _) -> nil - - def variants: () -> ::Array[untyped] - - def refresh: (untyped _) -> untyped - - # Returns whether the underlying handler supports streaming. If so, - # a streaming buffer *may* be passed when it starts rendering. - def supports_streaming?: () -> untyped - - # Render a template. If the template was not compiled yet, it is done - # exactly before rendering. - # - # This method is instrumented as "!render_template.action_view". Notice that - # we use a bang in this instrumentation because you don't want to - # consume this in production. This is only slow if it's being listened to. - def render: (untyped view, untyped locals, ?untyped buffer) { () -> untyped } -> untyped - - def `type`: () -> untyped - - def short_identifier: () -> untyped - - def inspect: () -> ::String - - def source: () -> untyped - - # This method is responsible for properly setting the encoding of the - # source. Until this point, we assume that the source is BINARY data. - # If no additional information is supplied, we assume the encoding is - # the same as <tt>Encoding.default_external</tt>. - # - # The user can also specify the encoding via a comment on the first - # line of the template (# encoding: NAME-OF-ENCODING). This will work - # with any template engine, as we process out the encoding comment - # before passing the source on to the template engine, leaving a - # blank line in its stead. - def encode!: () -> untyped - - def marshal_dump: () -> ::Array[untyped] - - def marshal_load: (untyped array) -> untyped - - # Compile a template. This method ensures a template is compiled - # just once and removes the source after it is compiled. - def compile!: (untyped view) -> (nil | untyped) - - # Note: It inherits unnamed class, but omitted - class LegacyTemplate - # :nodoc: - attr_reader source: untyped - - def initialize: (untyped template, untyped source) -> untyped - end - - # Among other things, this method is responsible for properly setting - # the encoding of the compiled template. - # - # If the template engine handles encodings, we send the encoded - # String to the engine without further processing. This allows - # the template engine to support additional mechanisms for - # specifying the encoding. For instance, ERB supports <%# encoding: %> - # - # Otherwise, after we figure out the correct encoding, we then - # encode the source into <tt>Encoding.default_internal</tt>. - # In general, this means that templates will be UTF-8 inside of Rails, - # regardless of the original source encoding. - def compile: (untyped mod) -> untyped - - def handle_render_error: (untyped view, untyped e) -> untyped - - def locals_code: () -> untyped - - def method_name: () -> untyped - - def identifier_method_name: () -> untyped - - def instrument: (untyped action) { () -> untyped } -> untyped - - def instrument_render_template: () { () -> untyped } -> untyped - - def instrument_payload: () -> { virtual_path: untyped, identifier: untyped } - end -end - -module ActionView # = Action View Resolver class Resolver # Keeps all information about view path and builds virtual path. class Path attr_reader name: untyped @@ -10043,15 +9991,19 @@ attr_reader partial: untyped attr_reader virtual: untyped + alias partial? partial + def self.build: (untyped name, untyped prefix, untyped partial) -> untyped def initialize: (untyped name, untyped prefix, untyped partial, untyped virtual) -> untyped def to_str: () -> untyped + + alias to_s to_str end class Cache # Threadsafe template cache # nodoc: @@ -10085,17 +10037,21 @@ def size: () -> untyped def canonical_no_templates: (untyped templates) -> untyped end + alias self.caching? self.caching + def initialize: () -> untyped def clear_cache: () -> untyped # Normalizes the arguments and passes it on to find_templates. def find_all: (untyped name, ?untyped? prefix, ?bool partial, ?::Hash[untyped, untyped] details, ?untyped? key, ?untyped locals) -> untyped + alias find_all_anywhere find_all + def find_all_with_query: (untyped query) -> untyped def _find_all: (untyped name, untyped prefix, untyped partial, untyped details, untyped key, untyped locals) -> untyped # This is what child classes implement. No defaults are needed @@ -10152,11 +10108,15 @@ def initialize: (untyped path, ?untyped? pattern) -> untyped def to_s: () -> untyped + alias to_path to_s + def eql?: (untyped resolver) -> untyped + + alias == eql? end class OptimizedFileSystemResolver < FileSystemResolver # An Optimized resolver for Rails' most common case. # nodoc: @@ -10207,10 +10167,12 @@ def initialize: (untyped string) -> untyped def identifier: () -> "text template" + alias inspect identifier + def to_str: () -> untyped def render: (*untyped args) -> untyped def format: () -> :text @@ -10233,12 +10195,16 @@ def initialize: (untyped symbol) -> untyped def to_s: () -> untyped + alias to_str to_s + def ref: () -> untyped + alias to_sym ref + def ==: (untyped `type`) -> untyped end def self.delegate_to: (untyped klass) -> untyped @@ -10248,10 +10214,132 @@ end end end module ActionView + # = Action View Template + class Template + extend ActiveSupport::Autoload + + def self.finalize_compiled_template_methods: () -> untyped + + def self.finalize_compiled_template_methods=: (untyped _) -> untyped + + extend Template::Handlers + + attr_reader identifier: untyped + + attr_reader handler: untyped + + attr_reader original_encoding: untyped + + attr_reader updated_at: untyped + + attr_reader variable: untyped + + attr_reader format: untyped + + attr_reader variant: untyped + + attr_reader locals: untyped + + attr_reader virtual_path: untyped + + def initialize: (untyped source, untyped identifier, untyped handler, ?format: untyped? format, ?variant: untyped? variant, ?locals: untyped? locals, ?virtual_path: untyped? virtual_path, ?updated_at: untyped? updated_at) -> untyped + + def virtual_path=: (untyped _) -> nil + + def locals=: (untyped _) -> nil + + def formats=: (untyped _) -> nil + + def formats: () -> untyped + + def variants=: (untyped _) -> nil + + def variants: () -> ::Array[untyped] + + def refresh: (untyped _) -> untyped + + # Returns whether the underlying handler supports streaming. If so, + # a streaming buffer *may* be passed when it starts rendering. + def supports_streaming?: () -> untyped + + # Render a template. If the template was not compiled yet, it is done + # exactly before rendering. + # + # This method is instrumented as "!render_template.action_view". Notice that + # we use a bang in this instrumentation because you don't want to + # consume this in production. This is only slow if it's being listened to. + def render: (untyped view, untyped locals, ?untyped buffer) { () -> untyped } -> untyped + + def `type`: () -> untyped + + def short_identifier: () -> untyped + + def inspect: () -> ::String + + def source: () -> untyped + + # This method is responsible for properly setting the encoding of the + # source. Until this point, we assume that the source is BINARY data. + # If no additional information is supplied, we assume the encoding is + # the same as <tt>Encoding.default_external</tt>. + # + # The user can also specify the encoding via a comment on the first + # line of the template (# encoding: NAME-OF-ENCODING). This will work + # with any template engine, as we process out the encoding comment + # before passing the source on to the template engine, leaving a + # blank line in its stead. + def encode!: () -> untyped + + def marshal_dump: () -> ::Array[untyped] + + def marshal_load: (untyped array) -> untyped + + # Compile a template. This method ensures a template is compiled + # just once and removes the source after it is compiled. + def compile!: (untyped view) -> (nil | untyped) + + class LegacyTemplate + # :nodoc: + attr_reader source: untyped + + def initialize: (untyped template, untyped source) -> untyped + end + + # Among other things, this method is responsible for properly setting + # the encoding of the compiled template. + # + # If the template engine handles encodings, we send the encoded + # String to the engine without further processing. This allows + # the template engine to support additional mechanisms for + # specifying the encoding. For instance, ERB supports <%# encoding: %> + # + # Otherwise, after we figure out the correct encoding, we then + # encode the source into <tt>Encoding.default_internal</tt>. + # In general, this means that templates will be UTF-8 inside of Rails, + # regardless of the original source encoding. + def compile: (untyped mod) -> untyped + + def handle_render_error: (untyped view, untyped e) -> untyped + + def locals_code: () -> untyped + + def method_name: () -> untyped + + def identifier_method_name: () -> untyped + + def instrument: (untyped action) { () -> untyped } -> untyped + + def instrument_render_template: () { () -> untyped } -> untyped + + def instrument_payload: () -> { virtual_path: untyped, identifier: untyped } + end +end + +module ActionView # = Action View Test Case class TestCase < ActiveSupport::TestCase class TestController < ActionController::Base include ActionDispatch::TestProcess @@ -10283,10 +10371,12 @@ include ActionDispatch::Routing::PolymorphicRoutes include AbstractController::Helpers + extend ::AbstractController::Helpers::ClassMethods + include ActionView::Helpers include ActionView::RecordIdentifier include ActionView::RoutingUrlFor @@ -10354,10 +10444,12 @@ end # The instance of ActionView::Base that is used by +render+. def view: () -> untyped + alias _view view + INTERNAL_IVARS: ::Array[untyped] def _user_defined_ivars: () -> untyped # Returns a Hash of instance variables and their values, as defined by @@ -10486,6 +10578,14 @@ # * <tt>paths</tt> - If a PathSet is provided, use that; # otherwise, process the parameter into a PathSet. def view_paths=: (untyped paths) -> untyped end end +end + +module ActionView + extend ActiveSupport::Autoload + + ENCODING_FLAG: ::String + + def self.eager_load!: () -> untyped end