Skip to content

Commit 02fe132

Browse files
committed
chore: Refine RBS type signatures for improved accuracy and consistency across multiple files
1 parent 739fc38 commit 02fe132

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

sig/ferrum/browser.rbs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ module Ferrum
2626

2727
def default_user_agent=: (String) -> String
2828

29-
def create_page: (?new_context: bool, ?proxy: Hash[Symbol, (String | ::Integer)]?) ?{ (Page) -> void } -> Page
29+
def create_page: (?new_context: bool, ?proxy: Hash[Symbol, (String | ::Integer)]?) -> Page
30+
| [T] (?new_context: bool, ?proxy: Hash[Symbol, (String | ::Integer)]?) { (Page) -> T } -> T
3031

3132
def extensions: () -> ::Array[String]
3233

sig/ferrum/client.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module Ferrum
1010

1111
def initialize: (Client client, String session_id) -> void
1212

13-
def command: (String method, ?async: bool, **untyped params) -> Hash[String, untyped]
13+
def command: (String method, ?async: bool, **untyped params) -> (bool | Hash[String, untyped])
1414

1515
def on: (String event) { (Hash[String, untyped]) -> void } -> Integer
1616

@@ -48,7 +48,7 @@ module Ferrum
4848

4949
def initialize: ((String | ::Addressable::URI) ws_url, Browser::Options options) -> void
5050

51-
def command: (String method, ?async: bool, **untyped params) -> Hash[String, untyped]
51+
def command: (String method, ?async: bool, **untyped params) -> (bool | Hash[String, untyped])
5252

5353
def send_message: (Hash[Symbol, untyped] message, async: bool) -> (bool | Hash[String, untyped])
5454

sig/ferrum/context.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module Ferrum
3838

3939
def close_targets_connection: () -> void
4040

41-
def dispose: () -> Hash[String, untyped]
41+
def dispose: () -> bool
4242

4343
def target?: (String target_id) -> bool
4444

sig/ferrum/network/auth_request.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module Ferrum
1313

1414
def navigation_request?: () -> bool
1515

16-
def auth_challenge?: (::String source) -> bool
16+
def auth_challenge?: ((::String | ::Symbol) source) -> bool
1717

1818
def match?: (Regexp regexp) -> bool
1919

sig/ferrum/page.rbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ module Ferrum
8484

8585
def subscribed?: (String event) -> bool
8686

87-
def use_proxy?: () -> bool
87+
def use_proxy?: () -> boolish
8888

89-
def use_authorized_proxy?: () -> bool
89+
def use_authorized_proxy?: () -> boolish
9090

9191
def timeout: () -> ::Numeric
9292

@@ -104,7 +104,7 @@ module Ferrum
104104

105105
def combine_url!: (String? url) -> String
106106

107-
def document_node_id: () -> ::Integer
107+
def document_node_id: (?async: bool) -> (::Integer | bool)
108108

109109
def proxy=: ({ host: String, port: ::Integer, user: String?, password: String? }? proxy) -> void
110110
end

sig/ferrum/utils/attempt.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Ferrum
22
module Utils
33
module Attempt
4-
def self?.with_retry: (errors: Array[Exception] | Exception, max: Integer, wait: Integer) { () -> untyped } -> untyped
4+
def self?.with_retry: (errors: (Array[Class] | Class), max: Integer, wait: Numeric) { () -> untyped } -> untyped
55
end
66
end
77
end

0 commit comments

Comments
 (0)