# typed: true # DO NOT EDIT MANUALLY # This is an autogenerated file for types exported from the `irb` gem. # Please instead update this file by running `bin/tapioca gem irb`. # An output formatter used internally by the lexer. # # source://irb//lib/irb/notifier.rb#17 module IRB::Notifier private # Define a new Notifier output source, returning a new CompositeNotifier # with the given +prefix+ and +output_method+. # # The optional +prefix+ will be appended to all objects being inspected # during output, using the given +output_method+ as the output source. If # no +output_method+ is given, StdioOutputMethod will be used, and all # expressions will be sent directly to STDOUT without any additional # formatting. # # source://irb//lib/irb/notifier.rb#37 def def_notifier(prefix = T.unsafe(nil), output_method = T.unsafe(nil)); end class << self # Define a new Notifier output source, returning a new CompositeNotifier # with the given +prefix+ and +output_method+. # # The optional +prefix+ will be appended to all objects being inspected # during output, using the given +output_method+ as the output source. If # no +output_method+ is given, StdioOutputMethod will be used, and all # expressions will be sent directly to STDOUT without any additional # formatting. # # source://irb//lib/irb/notifier.rb#37 def def_notifier(prefix = T.unsafe(nil), output_method = T.unsafe(nil)); end end end # An abstract class, or superclass, for CompositeNotifier and # LeveledNotifier to inherit. It provides several wrapper methods for the # OutputMethod object used by the Notifier. # # source://irb//lib/irb/notifier.rb#45 class IRB::Notifier::AbstractNotifier # Creates a new Notifier object # # @return [AbstractNotifier] a new instance of AbstractNotifier # # source://irb//lib/irb/notifier.rb#47 def initialize(prefix, base_notifier); end # Execute the given block if notifications are enabled. # # @yield [@base_notifier] # # source://irb//lib/irb/notifier.rb#105 def exec_if; end # A wrapper method used to determine whether notifications are enabled. # # Defaults to +true+. # # @return [Boolean] # # source://irb//lib/irb/notifier.rb#59 def notify?; end # Same as #ppx, except it uses the #prefix given during object # initialization. # See OutputMethod#ppx for more detail. # # source://irb//lib/irb/notifier.rb#88 def pp(*objs); end # Same as #pp, except it concatenates the given +prefix+ with the #prefix # given during object initialization. # # See OutputMethod#ppx for more detail. # # source://irb//lib/irb/notifier.rb#98 def ppx(prefix, *objs); end # The +prefix+ for this Notifier, which is appended to all objects being # inspected during output. # # source://irb//lib/irb/notifier.rb#54 def prefix; end # See OutputMethod#print for more detail. # # source://irb//lib/irb/notifier.rb#64 def print(*opts); end # See OutputMethod#printf for more detail. # # source://irb//lib/irb/notifier.rb#74 def printf(format, *opts); end # See OutputMethod#printn for more detail. # # source://irb//lib/irb/notifier.rb#69 def printn(*opts); end # See OutputMethod#puts for more detail. # # source://irb//lib/irb/notifier.rb#79 def puts(*objs); end end # A class that can be used to create a group of notifier objects with the # intent of representing a leveled notification system for irb. # # This class will allow you to generate other notifiers, and assign them # the appropriate level for output. # # The Notifier class provides a class-method Notifier.def_notifier to # create a new composite notifier. Using the first composite notifier # object you create, sibling notifiers can be initialized with # #def_notifier. # # source://irb//lib/irb/notifier.rb#122 class IRB::Notifier::CompositeNotifier < ::IRB::Notifier::AbstractNotifier # Create a new composite notifier object with the given +prefix+, and # +base_notifier+ to use for output. # # @return [CompositeNotifier] a new instance of CompositeNotifier # # source://irb//lib/irb/notifier.rb#123 def initialize(prefix, base_notifier); end # Creates a new LeveledNotifier in the composite #notifiers group. # # The given +prefix+ will be assigned to the notifier, and +level+ will # be used as the index of the #notifiers Array. # # This method returns the newly created instance. # # source://irb//lib/irb/notifier.rb#139 def def_notifier(level, prefix = T.unsafe(nil)); end # Returns the leveled notifier for this object # # source://irb//lib/irb/notifier.rb#146 def level; end # Sets the leveled notifier for this object. # # When the given +value+ is an instance of AbstractNotifier, # #level_notifier is set to the given object. # # When an Integer is given, #level_notifier is set to the notifier at the # index +value+ in the #notifiers Array. # # If no notifier exists at the index +value+ in the #notifiers Array, an # ErrUndefinedNotifier exception is raised. # # An ErrUnrecognizedLevel exception is raised if the given +value+ is not # found in the existing #notifiers Array, or an instance of # AbstractNotifier # # source://irb//lib/irb/notifier.rb#163 def level=(value); end # Returns the leveled notifier for this object # # source://irb//lib/irb/notifier.rb#146 def level_notifier; end # Sets the leveled notifier for this object. # # When the given +value+ is an instance of AbstractNotifier, # #level_notifier is set to the given object. # # When an Integer is given, #level_notifier is set to the notifier at the # index +value+ in the #notifiers Array. # # If no notifier exists at the index +value+ in the #notifiers Array, an # ErrUndefinedNotifier exception is raised. # # An ErrUnrecognizedLevel exception is raised if the given +value+ is not # found in the existing #notifiers Array, or an instance of # AbstractNotifier # # source://irb//lib/irb/notifier.rb#163 def level_notifier=(value); end # List of notifiers in the group # # source://irb//lib/irb/notifier.rb#131 def notifiers; end end # source://irb//lib/irb/notifier.rb#18 class IRB::Notifier::ErrUndefinedNotifier < ::StandardError # @return [ErrUndefinedNotifier] a new instance of ErrUndefinedNotifier # # source://irb//lib/irb/notifier.rb#19 def initialize(val); end end # source://irb//lib/irb/notifier.rb#23 class IRB::Notifier::ErrUnrecognizedLevel < ::StandardError # @return [ErrUnrecognizedLevel] a new instance of ErrUnrecognizedLevel # # source://irb//lib/irb/notifier.rb#24 def initialize(val); end end # A leveled notifier is comparable to the composite group from # CompositeNotifier#notifiers. # # source://irb//lib/irb/notifier.rb#181 class IRB::Notifier::LeveledNotifier < ::IRB::Notifier::AbstractNotifier include ::Comparable # Create a new leveled notifier with the given +base+, and +prefix+ to # send to AbstractNotifier.new # # The given +level+ is used to compare other leveled notifiers in the # CompositeNotifier group to determine whether or not to output # notifications. # # @return [LeveledNotifier] a new instance of LeveledNotifier # # source://irb//lib/irb/notifier.rb#190 def initialize(base, level, prefix); end # Compares the level of this notifier object with the given +other+ # notifier. # # See the Comparable module for more information. # # source://irb//lib/irb/notifier.rb#203 def <=>(other); end # The current level of this notifier object # # source://irb//lib/irb/notifier.rb#197 def level; end # Whether to output messages to the output method, depending on the level # of this notifier object. # # @return [Boolean] # # source://irb//lib/irb/notifier.rb#209 def notify?; end end # NoMsgNotifier is a LeveledNotifier that's used as the default notifier # when creating a new CompositeNotifier. # # This notifier is used as the +zero+ index, or level +0+, for # CompositeNotifier#notifiers, and will not output messages of any sort. # # source://irb//lib/irb/notifier.rb#220 class IRB::Notifier::NoMsgNotifier < ::IRB::Notifier::LeveledNotifier # Creates a new notifier that should not be used to output messages. # # @return [NoMsgNotifier] a new instance of NoMsgNotifier # # source://irb//lib/irb/notifier.rb#221 def initialize; end # Ensures notifications are ignored, see AbstractNotifier#notify? for # more information. # # @return [Boolean] # # source://irb//lib/irb/notifier.rb#229 def notify?; end end # An abstract output class for IO in irb. This is mainly used internally by # IRB::Notifier. You can define your own output method to use with Irb.new, # or Context.new # # source://irb//lib/irb/output-method.rb#17 class IRB::OutputMethod # Returns an array of the given +format+ and +opts+ to be used by # Kernel#sprintf, if there was a successful Regexp match in the given # +format+ from #printf # # % # [#0- +] # (\*|\*[1-9][0-9]*\$|[1-9][0-9]*) # .(\*|\*[1-9][0-9]*\$|[1-9][0-9]*|)? # #(hh|h|l|ll|L|q|j|z|t) # [diouxXeEfgGcsb%] # # source://irb//lib/irb/output-method.rb#54 def parse_printf_format(format, opts); end # Prints the given +objs+ calling Object#inspect on each. # # See #puts for more detail. # # source://irb//lib/irb/output-method.rb#70 def pp(*objs); end # Prints the given +objs+ calling Object#inspect on each and appending the # given +prefix+. # # See #puts for more detail. # # source://irb//lib/irb/output-method.rb#78 def ppx(prefix, *objs); end # Open this method to implement your own output method, raises a # NotImplementedError if you don't define #print in your own class. # # @raise [NotImplementedError] # # source://irb//lib/irb/output-method.rb#26 def print(*opts); end # Extends IO#printf to format the given +opts+ for Kernel#sprintf using # #parse_printf_format # # source://irb//lib/irb/output-method.rb#37 def printf(format, *opts); end # Prints the given +opts+, with a newline delimiter. # # source://irb//lib/irb/output-method.rb#31 def printn(*opts); end # Calls #print on each element in the given +objs+, followed by a newline # character. # # source://irb//lib/irb/output-method.rb#60 def puts(*objs); end end # source://irb//lib/irb/output-method.rb#18 class IRB::OutputMethod::NotImplementedError < ::StandardError # @return [NotImplementedError] a new instance of NotImplementedError # # source://irb//lib/irb/output-method.rb#19 def initialize(val); end end