interface _Symolize def to_sym: () -> ::Symbol end interface _Pluginable def name: () -> _Symolize def respond_to?: (::Symbol) -> bool end module ProconBypassMan class CouldNotLoadConfigError < StandardError end class FirstConnectionError < StandardError end class EternalConnectionError < StandardError end def self.configure: (?setting_path: untyped? setting_path) { () -> untyped } -> untyped def self.run: (?setting_path: untyped? setting_path) { () -> untyped } -> untyped def self.logger=: (untyped logger) -> untyped # @return [Logger] def self.logger: () -> untyped def self.pid_path: () -> untyped def self.reset!: () -> untyped def self.root: () -> untyped def self.root=: (untyped path) -> untyped def self.pid: () -> Integer def self.digest_path: () -> ::String def self.session_id: () -> ::String def self.device_id: () -> ::String end class ProconBypassMan::Bypass attr_accessor gadget: untyped attr_accessor procon: untyped attr_accessor monitor: untyped def initialize: (gadget: untyped gadget, procon: untyped procon, monitor: untyped monitor) -> untyped # ゆっくりでいい def send_gadget_to_procon!: () -> (nil | untyped) def send_procon_to_gadget!: () -> (nil | untyped) end class AnalogStickPosition attr_accessor x: Integer attr_accessor y: Integer def initialize: (x: Integer, y: Integer) -> untyped end module ProconBypassMan class ButtonsSettingConfiguration attr_accessor layers: untyped attr_accessor setting_path: untyped attr_accessor mode_plugins: untyped attr_accessor macro_plugins: untyped attr_accessor context: untyped attr_accessor current_context_key: untyped attr_accessor neutral_position: AnalogStickPosition def self.instance: () -> untyped def self.switch_new_context: (untyped key) { (untyped) -> untyped } -> untyped def initialize: () -> untyped MODES: ::Array[untyped] def layer: (untyped direction, ?mode: (_Pluginable) mode) { () -> untyped } -> untyped def install_mode_plugin: (untyped klass) -> untyped def install_macro_plugin: (untyped klass) -> untyped def prefix_keys_for_changing_layer: (untyped buttons) -> untyped def prefix_keys: () -> untyped def reset!: () -> untyped end end module ProconBypassMan class ButtonsSettingConfiguration class Layer attr_accessor mode: untyped attr_accessor flips: untyped attr_accessor macros: untyped attr_accessor remaps: untyped def initialize: (?mode: ::Symbol mode) -> untyped # @param [Symbol] button def flip: (untyped button, ?if_pressed: bool if_pressed, ?force_neutral: untyped? force_neutral, ?flip_interval: untyped? flip_interval) -> untyped PRESET_MACROS: ::Array[untyped] def macro: (untyped name, if_pressed: untyped if_pressed) -> untyped def remap: (untyped button, to: untyped to) -> untyped # @return [Array] def flip_buttons: () -> untyped def instance_eval: ()?{ () -> nil } -> untyped end end end module ProconBypassMan class ButtonsSettingConfiguration module Loader def self.load: (setting_path: untyped setting_path) -> untyped def self.reload_setting: () -> untyped end end end module ProconBypassMan class ButtonsSettingConfiguration class Validator def initialize: (untyped config) -> untyped # @return [Boolean] def valid?: () -> untyped # @return [Boolean] def invalid?: () -> untyped # @return [Hash] def errors: () -> untyped private def validate_config_of_button_lonely: () -> untyped def validate_require_prefix_keys: () -> untyped def validate_verify_button_existence: () -> untyped def validate_flip_and_remap_are_hate_each_other: () -> untyped end end end class ProconBypassMan::Configuration module ClassMethods def root: () -> String def logger: () -> Logger def error_logger: () -> untyped def pid_path: () -> String def digest_path: () -> String def cache: () -> ProconBypassMan::OnMemoryCache def config: () -> ProconBypassMan::Configuration def never_exit_accidentally: () -> bool end attr_reader api_server: untyped attr_reader api_servers: untyped attr_writer never_exit_accidentally: bool attr_accessor enable_critical_error_logging: bool def root=: (String path) -> ProconBypassMan::Configuration def root: () -> String def api_server=: (untyped api_server) -> untyped def logger=: (Logger logger) -> ProconBypassMan::Configuration def logger: () -> Logger def error_logger: () -> Logger def digest_path: () -> String # @return [String] pbm-webの接続先 def current_server: () -> String def current_ws_server: () -> (String | nil) def current_ws_server_url: () -> ::String def enable_ws?: () -> bool def server_pool: () -> untyped def internal_server_pool: () -> untyped def internal_servers: () -> ::Array[string | nil] def internal_api_servers: () -> ::Array[untyped] def raw_setting: () -> untyped def verbose_bypass_log: () -> bool def never_exit_accidentally: () -> bool end class ProconBypassMan::DeviceConnector class BytesMismatchError < StandardError end class Value attr_accessor read_from: untyped attr_accessor values: untyped def initialize: (values: untyped values, read_from: untyped read_from) -> untyped end PROCON_PATH: ::String PROCON2_PATH: ::String # 画面で再接続ができたが状況は変わらない def self.reset_connection!: () -> untyped def self.connect: () -> ::Array[untyped] def initialize: (?throw_error_if_timeout: bool throw_error_if_timeout, ?throw_error_if_mismatch: bool throw_error_if_mismatch, ?enable_at_exit: bool enable_at_exit) -> untyped def add: (untyped values, read_from: untyped read_from) -> untyped def drain_all: () -> untyped # switchに任意の命令を入力して、switchから読み取る def write_switch: (untyped data, ?only_write: bool only_write) -> untyped def write_procon: (untyped data, ?only_write: bool only_write) -> untyped def read_procon: (?only_read: bool only_read) -> untyped def read_switch: (?only_read: bool only_read) -> untyped def from_device: (untyped item) -> untyped # fromの対になる def to_device: (untyped item) -> untyped def switch: () -> untyped def procon: () -> untyped def is_available_device?: (untyped path) -> (::FalseClass | ::TrueClass | untyped) def to_bin: (untyped string) -> untyped def init_devices: () -> untyped end module ProconBypassMan class Counter attr_accessor label: untyped attr_accessor table: untyped attr_accessor previous_table: untyped def initialize: (label: untyped label) -> untyped # アクティブなバケットは1つだけ def record: (untyped event_name) -> untyped def formated_previous_table: () -> ::String end module IOMonitor def self.new: (label: untyped label) -> untyped # @return [Array] def self.targets: () -> untyped # ここで集計する def self.start!: () -> untyped def self.reset!: () -> untyped end end class ProconBypassMan::Processor # @return [String] binary def initialize: (untyped binary) -> untyped # @return [String] 加工後の入力データ def process: () -> untyped end class ProconBypassMan::Procon attr_accessor user_operation: untyped def self.reset!: () -> untyped def initialize: (untyped binary) -> untyped def status: () -> untyped def ongoing_macro: () -> untyped def ongoing_mode: () -> untyped def current_layer_key: () -> untyped def current_layer: () -> untyped def apply!: () -> (nil | untyped) # @return [String] def to_binary: () -> untyped private def method_missing: (untyped name) -> untyped end class ProconBypassMan::Procon::ButtonCollection class Button attr_accessor byte_position: untyped attr_accessor bit_position: untyped def initialize: (untyped key) -> untyped end # ) ZR R SR(right) SL(right) A B X Y # ) Grip (none) Cap Home ThumbL ThumbR + - # ) ZL L SL(left) SR(left) Left Right Up Down # ) analog[0] # ) analog[1] # ) analog[2] # ) analog[3] # ) analog[4] # ) analog[5] BYTES_MAP: untyped BUTTONS_MAP: untyped BUTTONS: untyped def self.load: (untyped button_key) -> untyped end class ProconBypassMan::Procon module Data NO_ACTION: untyped end end class ProconBypassMan::Procon class FlipCache def self.fetch: (key: untyped key, expires_in: untyped expires_in) { () -> untyped } -> untyped # for testing def self.reset!: () -> untyped end end module ProconBypassMan::Procon::LayerChangeable def next_layer_key: () -> untyped def change_layer?: () -> untyped def pressed_next_layer?: () -> untyped end class ProconBypassMan::Procon::MacroRegistry class Macro attr_accessor name: Symbol attr_accessor steps: untyped def initialize: (name: untyped Symbol, steps: Symbol) -> void def next_step: () -> Symbol def finished?: () -> bool def ongoing?: () -> bool end PRESETS: ::Hash[Symbol, Array[Symbol]] def self.install_plugin: (untyped klass) -> untyped def self.load: (Symbol name) -> untyped def self.reset!: () -> void def self.plugins: () -> ::Hash[Symbol, Array[Symbol]] end class ProconBypassMan::Procon::ModeRegistry class Mode attr_accessor name: Symbol attr_accessor binaries: Array[String] attr_accessor source_binaries: Array[String] def initialize: (name: Symbol, binaries: Array[String]) -> void def next_binary: () -> String end PRESETS: ::Hash[untyped, untyped] def self.install_plugin: (untyped klass) -> untyped def self.load: (untyped name) -> untyped def self.reset!: () -> untyped def self.plugins: () -> untyped end class ProconBypassMan::Procon class UserOperation include LayerChangeable attr_reader binary: untyped def initialize: (untyped binary) -> untyped ASCII_ENCODING: ::String # @depilicate def binary=: (untyped binary) -> untyped def set_no_action!: () -> void def unpress_button: (untyped button) -> untyped def press_button: (untyped button) -> untyped def press_button_only: (untyped button) -> untyped def merge: (target_binary: untyped target_binary) -> untyped end end class ProconBypassMan::Runner class InterruptForRestart < StandardError end def initialize: () -> untyped def run: () -> untyped private def main_loop: () -> untyped def first_negotiation: () -> untyped def handle_signal: (untyped sig) -> untyped # @return [void] def print_booted_message: () -> untyped end module ProconBypassMan class Timer class Timeout < StandardError end # 5秒後がタイムアウト def initialize: (?timeout: untyped timeout) -> void def throw_if_timeout!: () -> untyped end end module ProconBypassMan class Uptime # @return [Integer] def self.from_boot: () -> Integer # @param [String] uptime_cmd_result def initialize: (uptime_cmd_result: String) -> void # @return [Integer] def from_boot: () -> Integer end end module ProconBypassMan VERSION: ::String end module ProconBypassMan module Domains module Binary end end end class ProconBypassMan::Domains::Binary::Base # @param [String] binary def initialize: (binary: untyped binary) -> void # @return [String] バイナリ def binary: () -> untyped # @return [String] def raw: () -> ::String def unpack: () -> Array[::String] # @return [ProconBypassMan::ProconReader] def to_procon_reader: () -> untyped end module ProconBypassMan::Domains::HasImmutableBinary def binary: () -> untyped end module ProconBypassMan::Domains::HasMutableBinary def binary: () -> untyped end class ProconBypassMan::Domains::InboundProconBinary < ProconBypassMan::Domains::Binary::Base include ProconBypassMan::Domains::HasImmutableBinary # @return [Boolean] def user_operation_data?: () -> bool end # バイナリの書き換えのみをする class ProconBypassMan::Domains::ProcessingProconBinary < ProconBypassMan::Domains::Binary::Base include ProconBypassMan::Domains::HasMutableBinary ALL_ZERO_BIT: ::String def set_no_action!: () -> untyped # @param [ProconBypassMan::Domains::ProcessingProconBinary] # @return [ProconBypassMan::Domains::ProcessingProconBinary] # アナログスティックは上書きし、ボタンだけマージする def write_as_merge!: (untyped target_binary) -> ProconBypassMan::Domains::ProcessingProconBinary # @param [Symbol] button def write_as_press_button: (Symbol button) -> void # @param [Symbol] button def write_as_unpress_button: (Symbol button) -> void # @param [Symbol] button def write_as_press_button_only: (Symbol button) -> void # @param [Integer] cap def write_as_apply_left_analog_stick_cap: (cap: Integer cap) -> void end module ProconBypassMan class HttpClient @server_pool: untyped @uri: ::URI @retry_on_connection_error: false def initialize: (path: String, server_pool: untyped, ?retry_on_connection_error: false) -> void def get: -> nil def post: (request_body: untyped) -> nil def put: (request_body: untyped) -> nil private def process_response: (untyped response) -> untyped def handle_request: { -> bot } -> nil class HttpRequest class Get def self.request!: (uri: ::URI) -> untyped end class Post def self.request!: (uri: ::URI, ?request_body: Hash[untyped, untyped]) -> untyped end class Put def self.request!: (uri: ::URI, ?request_body: {hostname: String}) -> untyped end end end end module ProconBypassMan class SendDeviceStatsHttpClient def post: (status: ::Symbol, pbm_session_id: String) -> untyped end end module ProconBypassMan class ReportHttpClient def post: (body: Hash[untyped, untyped] | String, event_type: ::Symbol) -> untyped end end module ProconBypassMan class UpdateRemotePbmActionStatusHttpClient def post: (to_status: ::Symbol) -> untyped end end module ProconBypassMan class ServerPool @servers: Array[String] @index: Integer? def initialize: (servers: Array[String]) -> void def pick: -> String? def server: -> String? def next!: -> nil private def reset: -> Integer def inc_index: -> Integer end end module ProconBypassMan class CompressArray @array: [String] def initialize: ([String] array) -> void def compress: -> Array[String?] class CompressibleValue @prev: String? @current: String def initialize: (String? prev, String current) -> void def compress?: -> bool def to_s_with_mark: -> String? end end end module ProconBypassMan module Callbacks def run_callbacks: (untyped kind) -> untyped def get_callbacks: (untyped kind) -> untyped def set_callbacks: (untyped name, untyped callbacks) -> untyped class CallbacksChain @block: nil attr_accessor filter: untyped attr_accessor chain_method: untyped def initialize: (filter: untyped, chain_method: untyped, block: nil) -> void end module M end module ClassMethods def define_callbacks: (untyped name) -> untyped def set_callback: (untyped kind, untyped filter, untyped chain_method) -> CallbacksChain end end end