stdlib/io-console/0/io-console.rbs in rbs-2.0.0 vs stdlib/io-console/0/io-console.rbs in rbs-2.1.0
- old
+ new
@@ -1,106 +1,283 @@
+%a{annotate:rdoc:skip}
class IO
class ConsoleMode
def echo=: (bool) -> bool
def raw: (?min: int, ?time: int, ?intr: bool) -> self
def raw!: (?min: int, ?time: int, ?intr: bool) -> self
end
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - IO.console -> #<File:/dev/tty>
+ # - IO.console(sym, *args)
+ # -->
# Returns an File instance opened console.
#
# If `sym` is given, it will be sent to the opened console with `args` and the
# result will be returned instead of the console IO itself.
+ #
+ # You must require 'io/console' to use this method.
+ #
def self.console: () -> File?
| (:close) -> nil
| (Symbol sym, *untyped args) -> untyped
- # returns console window size
+ # <!--
+ # rdoc-file=ext/io/console/lib/console/size.rb
+ # - console_size()
+ # -->
#
- # You must require 'io/console/size' to use this method.
- def self.console_size: () -> [Integer, Integer]
+ def self.console_size: () -> [ Integer, Integer ]
+ # <!--
+ # rdoc-file=ext/io/console/lib/console/size.rb
+ # - default_console_size()
+ # -->
# fallback to console window size
#
- # You must require 'io/console/size' to use this method.
- def self.default_console_size: -> [Integer, Integer]
+ def self.default_console_size: () -> [ Integer, Integer ]
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - beep()
+ # -->
+ #
def beep: () -> self
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - check_winsize_changed()
+ # -->
+ #
def check_winsize_changed: () { () -> void } -> self
+
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - clear_screen()
+ # -->
+ #
def clear_screen: () -> self
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.console_mode -> mode
+ # -->
# Returns a data represents the current console mode.
+ #
+ # You must require 'io/console' to use this method.
+ #
def console_mode: () -> IO::ConsoleMode
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.console_mode = mode
+ # -->
# Sets the console mode to `mode`.
+ #
+ # You must require 'io/console' to use this method.
+ #
def console_mode=: (IO::ConsoleMode mode) -> IO::ConsoleMode
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.cooked {|io| }
+ # -->
# Yields `self` within cooked mode.
#
# STDIN.cooked(&:gets)
#
# will read and return a line with echo back and line editing.
+ #
+ # You must require 'io/console' to use this method.
+ #
def cooked: [T] () { (self) -> T } -> T
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.cooked!
+ # -->
# Enables cooked mode.
#
# If the terminal mode needs to be back, use io.cooked { ... }.
+ #
+ # You must require 'io/console' to use this method.
+ #
def cooked!: () -> self
- def cursor: () -> [Integer, Integer]
- def cursor=: ([Integer, Integer]) -> [Integer, Integer]
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - cursor()
+ # -->
+ #
+ def cursor: () -> [ Integer, Integer ]
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - cursor=(p1)
+ # -->
+ #
+ def cursor=: ([ Integer, Integer ]) -> [ Integer, Integer ]
+
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - cursor_down(p1)
+ # -->
+ #
def cursor_down: (int) -> self
+
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - cursor_left(p1)
+ # -->
+ #
def cursor_left: (int) -> self
+
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - cursor_right(p1)
+ # -->
+ #
def cursor_right: (int) -> self
+
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - cursor_up(p1)
+ # -->
+ #
def cursor_up: (int) -> self
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.echo = flag
+ # -->
# Enables/disables echo back. On some platforms, all combinations of this flags
# and raw/cooked mode may not be valid.
+ #
+ # You must require 'io/console' to use this method.
+ #
def echo=: (bool flag) -> bool
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.echo? -> true or false
+ # -->
# Returns `true` if echo back is enabled.
+ #
+ # You must require 'io/console' to use this method.
+ #
def echo?: () -> bool
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - erase_line(p1)
+ # -->
+ #
def erase_line: (0 | 1 | 2 | nil) -> self
+
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - erase_screen(p1)
+ # -->
+ #
def erase_screen: (0 | 1 | 2 | 3 | nil) -> self
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.getch(min: nil, time: nil, intr: nil) -> char
+ # -->
# Reads and returns a character in raw mode.
#
# See IO#raw for details on the parameters.
+ #
+ # You must require 'io/console' to use this method.
+ #
def getch: (?min: int, ?time: int, ?intr: bool) -> String
- # Reads and returns a line without echo back.
- # Prints +prompt+ unless it is +nil+.
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.getpass(prompt=nil) -> string
+ # -->
+ # Reads and returns a line without echo back. Prints `prompt` unless it is
+ # `nil`.
#
- # The newline character that terminates the
- # read line is removed from the returned string,
- # see String#chomp!.
+ # The newline character that terminates the read line is removed from the
+ # returned string, see String#chomp!.
+ #
+ # You must require 'io/console' to use this method.
+ #
def getpass: (?String) -> String
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - goto(p1, p2)
+ # -->
+ #
def goto: (int, int) -> self
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - goto_column(p1)
+ # -->
+ #
def goto_column: (int) -> self
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.iflush
+ # -->
# Flushes input buffer in kernel.
+ #
+ # You must require 'io/console' to use this method.
+ #
def iflush: () -> self
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.ioflush
+ # -->
# Flushes input and output buffers in kernel.
+ #
+ # You must require 'io/console' to use this method.
+ #
def ioflush: () -> self
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.noecho {|io| }
+ # -->
# Yields `self` with disabling echo back.
#
# STDIN.noecho(&:gets)
#
# will read and return a line without echo back.
+ #
+ # You must require 'io/console' to use this method.
+ #
def noecho: [T] () { (self) -> T } -> T
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.oflush
+ # -->
# Flushes output buffer in kernel.
+ #
+ # You must require 'io/console' to use this method.
+ #
def oflush: () -> self
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - pressed?(p1)
+ # -->
+ #
def pressed?: (Integer | Symbol | String) -> bool
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.raw(min: nil, time: nil, intr: nil) {|io| }
+ # -->
# Yields `self` within raw mode, and returns the result of the block.
#
# STDIN.raw(&:gets)
#
# will read and return a line without echo back and line editing.
@@ -113,25 +290,60 @@
#
# If the parameter `intr` is `true`, enables break, interrupt, quit, and suspend
# special characters.
#
# Refer to the manual page of termios for further details.
+ #
+ # You must require 'io/console' to use this method.
+ #
def raw: [T] (?min: int, ?time: int, ?intr: bool) { (self) -> T } -> T
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.raw!(min: nil, time: nil, intr: nil) -> io
+ # -->
# Enables raw mode, and returns `io`.
#
# If the terminal mode needs to be back, use `io.raw { ... }`.
#
# See IO#raw for details on the parameters.
+ #
+ # You must require 'io/console' to use this method.
+ #
def raw!: (?min: int, ?time: int, ?intr: bool) -> self
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - scroll_backward(p1)
+ # -->
+ #
def scroll_backward: (int) -> self
+
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - scroll_forward(p1)
+ # -->
+ #
def scroll_forward: (int) -> self
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.winsize -> [rows, columns]
+ # -->
# Returns console size.
- def winsize: () -> [Integer, Integer]
+ #
+ # You must require 'io/console' to use this method.
+ #
+ def winsize: () -> [ Integer, Integer ]
+ # <!--
+ # rdoc-file=ext/io/console/console.c
+ # - io.winsize = [rows, columns]
+ # -->
# Tries to set console size. The effect depends on the platform and the running
# environment.
- def winsize=: ([Integer, Integer]) -> [Integer, Integer]
- | ([Integer, Integer, Integer, Integer]) -> [Integer, Integer, Integer, Integer]
+ #
+ # You must require 'io/console' to use this method.
+ #
+ def winsize=: ([ Integer, Integer ]) -> [ Integer, Integer ]
+ | ([ Integer, Integer, Integer, Integer ]) -> [ Integer, Integer, Integer, Integer ]
end