Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rb] Expand RBS typing support by replacing untypes with precise typing #13709

Merged
merged 26 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ec59a1e
Update atoms.rb signature types
aguspe Mar 19, 2024
38cea9c
Start adding bidi types
aguspe Mar 20, 2024
0c3188d
Extended types of devtools and edge
aguspe Mar 21, 2024
076df94
Merge branch 'trunk' into expand_rbs_type_checking
aguspe Mar 23, 2024
74c6000
Added firefox and safari types and removed unused signature
aguspe Mar 26, 2024
be3887e
Merge branch 'expand_rbs_type_checking' of github.com:aguspe/selenium…
aguspe Mar 26, 2024
dbee5f9
Merge branch 'trunk' into expand_rbs_type_checking
aguspe Mar 26, 2024
e5e2d41
Merge branch 'trunk' into expand_rbs_type_checking
aguspe Mar 29, 2024
6cb1eca
Update chrome features with type and remove Safari error
aguspe Mar 30, 2024
77563a7
Update server and remove unused signature
aguspe Mar 31, 2024
447a2c6
Merge branch 'trunk' into expand_rbs_type_checking
aguspe Apr 5, 2024
b0295de
Expand Server type signature
aguspe Apr 5, 2024
841e148
Merge branch 'expand_rbs_type_checking' of github.com:aguspe/selenium…
aguspe Apr 5, 2024
e819592
expanding type support on options
aguspe Apr 10, 2024
7ae628c
Merge branch 'trunk' into expand_rbs_type_checking
aguspe Apr 10, 2024
66a8e62
Expand options types
aguspe Apr 13, 2024
ab76a40
Merge branch 'trunk' into expand_rbs_type_checking
aguspe Apr 13, 2024
3d5361b
Merge branch 'trunk' into expand_rbs_type_checking
aguspe Apr 19, 2024
68757f0
add extra options support
aguspe Apr 19, 2024
ddd43cd
Merge branch 'trunk' into expand_rbs_type_checking
aguspe Apr 19, 2024
fc858f2
Merge branch 'trunk' into expand_rbs_type_checking
aguspe Apr 21, 2024
7bcf60b
Expand options support
aguspe Apr 21, 2024
01ddcf7
Merge branch 'expand_rbs_type_checking' of github.com:aguspe/selenium…
aguspe Apr 21, 2024
ecf5687
Merge branch 'trunk' into expand_rbs_type_checking
aguspe Jun 2, 2024
23908a5
Merge branch 'trunk' into expand_rbs_type_checking
aguspe Jun 4, 2024
f51e5b7
Merge branch 'trunk' into expand_rbs_type_checking
aguspe Jun 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions rb/sig/lib/selenium/server.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ module Selenium

self.@available_assets: untyped

@jar: untyped
@jar: String

@host: untyped
@host: String

@role: untyped
@role: String

@port: untyped
@port: Integer

@timeout: untyped
@timeout: Integer

@background: untyped
@background: bool

@additional_args: untyped
@additional_args: Integer | bool | Array[untyped]

@log: untyped
@log: String | bool

@log_file: untyped

@process: untyped

@socket: untyped
@socket: WebDriver::SocketPoller

class Error < StandardError
end

CL_RESET: untyped

def self.get: (?Symbol required_version, ?Hash[untyped, untyped] opts) -> untyped
def self.get: (Symbol | String required_version, ?Hash[untyped, untyped] opts) -> Server

def self.download: (?Symbol required_version) -> untyped
def self.download: (Symbol | String required_version) -> String

def self.latest: () -> untyped

Expand All @@ -55,7 +55,7 @@ module Selenium

attr_accessor log: untyped

def initialize: (untyped jar, ?Hash[untyped, untyped] opts) -> void
def initialize: (String jar, ?Hash[String | Symbol, Integer | bool] opts) -> void

def start: () -> untyped

Expand Down
4 changes: 2 additions & 2 deletions rb/sig/lib/selenium/webdriver/atoms.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ module Selenium
include _Bridge
include _ExecuteScript

def atom_script: (untyped) -> untyped
def atom_script: (Symbol) -> String

private

def read_atom: (Symbol function) -> String

def execute_atom: (Symbol function_name, *untyped arguments) -> untyped
def execute_atom: (Symbol function_name, [Element | String | Symbol] arguments) -> [Element | Integer | Float | bool | nil | String | Array[untyped]]
end
end
end
14 changes: 7 additions & 7 deletions rb/sig/lib/selenium/webdriver/bidi.rbs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
module Selenium
module WebDriver
class BiDi
@ws: untyped
@ws: WebSocketConnection

@session: untyped
@session: Session

def initialize: (url: untyped) -> void
def initialize: (url: String) -> void

def close: () -> untyped
def close: () -> nil

def callbacks: () -> untyped
def callbacks: () -> Hash[untyped, untyped]

def session: () -> untyped
def session: () -> Session

def send_cmd: (untyped method, **untyped params) -> untyped

def error_message: (untyped message) -> ::String
def error_message: (Hash[String,String] message) -> String
end
end
end
6 changes: 3 additions & 3 deletions rb/sig/lib/selenium/webdriver/chrome/features.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ module Selenium
module Features
include WebDriver::Chromium::Features

CHROME_COMMANDS: untyped
COMMANDS: Array[Symbol | String]
CHROME_COMMANDS: Hash[Symbol, Array[Symbol | String]]
COMMANDS: Hash[Symbol, Array[Symbol | String]]

def command_list: -> untyped
def command_list: -> Hash[Symbol, Array[Symbol | String]]

def commands: (Symbol command) -> Array[Symbol | String]
end
Expand Down
35 changes: 18 additions & 17 deletions rb/sig/lib/selenium/webdriver/common/options.rbs
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
module Selenium
module WebDriver
class Options
@options: untyped
@options: Hash[String | Symbol, String | Numeric | bool?]

W3C_OPTIONS: Array[Symbol]

GRID_OPTIONS: Array[Symbol]

BROWSER: untyped
BROWSER: Symbol

KEY: untyped

CAPABILITIES: Hash[Symbol, String]
CAPABILITIES: Hash[String | Symbol, String | Numeric | bool?]

attr_reader self.driver_path: untyped
attr_reader self.driver_path: String

def self.chrome: (**untyped opts) -> untyped
def self.chrome: (**String | Symbol | Integer | bool opts) -> Chrome::Options

def self.firefox: (**untyped opts) -> untyped
def self.firefox: (**String | Symbol | Integer | bool opts) -> Firefox::Options

def self.ie: (**untyped opts) -> untyped
def self.ie: (**String | Symbol | Integer | bool opts) -> IE::Options

alias self.internet_explorer self.ie

def self.edge: (**untyped opts) -> untyped
def self.edge: (**String | Symbol | Integer | bool opts) -> Edge::Options

alias self.microsoftedge self.edge

def self.safari: (**untyped opts) -> untyped
def self.safari: (**String | Symbol | Integer | bool opts) -> Safari::Options

def self.set_capabilities: () -> untyped

attr_accessor options: untyped
attr_accessor options: Hash[String | Symbol, String | Numeric | bool?]

def initialize: (**untyped opts) -> void
def initialize: (Hash[String | Symbol, String | Numeric | bool] opts) -> void

def add_option: (untyped name, ?untyped? value) -> untyped
def add_option: (String | Symbol name, String | Numeric | bool? value) -> (String | Numeric | bool)?

def ==: (untyped other) -> (false | untyped)
def ==: (untyped other) -> bool

alias eql? ==

Expand All @@ -53,13 +53,14 @@ module Selenium

def camelize?: (untyped _key) -> true

def generate_as_json: (untyped value, ?camelize_keys: bool) -> untyped
def generate_as_json: (Array[untyped] | Hash[untyped, untyped] | String | Symbol value, ?camelize_keys: bool)
-> (Array[untyped] | Hash[untyped, untyped] | String | Symbol)

def process_json_hash: (untyped value, untyped camelize_keys) -> untyped
def process_json_hash: (Hash[untyped, untyped] value, bool camelize_keys) -> Hash[untyped, untyped]

def convert_json_key: (untyped key, ?camelize: bool) -> untyped
def convert_json_key: (String | Symbol key, camelize: bool) -> String

def camel_case: (untyped str) -> untyped
def camel_case: (String str) -> String
end
end
end
4 changes: 2 additions & 2 deletions rb/sig/lib/selenium/webdriver/common/target_locator.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ module Selenium

def parent_frame: () -> void

def new_window: (?::Symbol `type`) { (untyped) -> untyped } -> untyped
def new_window: (Symbol type) { (untyped) -> untyped } -> untyped

def window: (untyped id) ?{ () -> untyped } -> untyped
def window: (Integer id) ?{ () -> untyped } -> untyped

def active_element: () -> Element

Expand Down
4 changes: 2 additions & 2 deletions rb/sig/lib/selenium/webdriver/devtools.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Selenium

def initialize: (url: untyped) -> void

def close: () -> untyped
def close: () -> nil

def callbacks: () -> untyped

Expand All @@ -24,7 +24,7 @@ module Selenium

def start_session: () -> untyped

def error_message: (untyped error) -> untyped
def error_message: (Hash[untyped, untyped] error) -> String
end
end
end
6 changes: 3 additions & 3 deletions rb/sig/lib/selenium/webdriver/edge.rbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module Selenium
module WebDriver
module Edge
self.@path: untyped
@path: String?

def self.path=: (untyped path) -> untyped
def self.path=: (String path) -> String

def self.path: () -> untyped
def self.path: () -> String?
end
end
end
6 changes: 3 additions & 3 deletions rb/sig/lib/selenium/webdriver/firefox.rbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Selenium
module WebDriver
module Firefox
self.@path: untyped
@path: String?

DEFAULT_PORT: Integer

Expand All @@ -13,9 +13,9 @@ module Selenium

DEVTOOLS_VERSION: Integer

def self.path=: (untyped path) -> untyped
def self.path=: (String path) -> String

def self.path: () -> untyped
def self.path: () -> String?
end
end
end
15 changes: 7 additions & 8 deletions rb/sig/lib/selenium/webdriver/safari.rbs
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
module Selenium
module WebDriver
module Safari
self.@use_technology_preview: untyped
@use_technology_preview: bool?
@path: String?

self.@path: untyped

attr_accessor self.use_technology_preview: untyped
attr_accessor self.use_technology_preview: bool

def self.technology_preview: () -> String

def self.technology_preview!: () -> untyped
def self.technology_preview!: () -> bool

def self.technology_preview?: () -> untyped
def self.technology_preview?: () -> bool

def self.path=: (untyped path) -> untyped
def self.path=: (String) -> String

def self.path: () -> untyped
def self.path: () -> String
end
end
end
Empty file.
Empty file removed rb/sig/lib/selenium_webdriver.rbs
Empty file.
Loading