Skip to content

Commit acce734

Browse files
committed
Improve typing
1 parent bbd7bcc commit acce734

File tree

9 files changed

+34
-36
lines changed

9 files changed

+34
-36
lines changed

rb/lib/selenium/webdriver/bidi/network/intercepted_request.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class InterceptedRequest < InterceptedItem
2929

3030
def initialize(network, request)
3131
super
32-
# We now rely on the modules above to initialize @headers and @cookies as Hashes
3332
@method = nil
3433
@url = nil
3534
@body = nil

rb/sig/lib/selenium/webdriver/bidi/network/cookies.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ module Selenium
22
module WebDriver
33
class BiDi
44
class Cookies
5-
def initialize: (untyped cookies) -> void
5+
def initialize: (Hash[Symbol, String] cookies) -> void
66

7-
def serialize: () -> untyped
7+
def serialize: () -> Hash[Symbol, String]
88
end
99
end
1010
end

rb/sig/lib/selenium/webdriver/bidi/network/credentials.rbs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ module Selenium
22
module WebDriver
33
class BiDi
44
class Credentials
5-
@username: untyped
5+
@username: String
66

7-
@password: untyped
7+
@password: String
88

9-
attr_accessor username: untyped
9+
attr_accessor username: String
1010

11-
attr_accessor password: untyped
11+
attr_accessor password: String
1212

13-
def initialize: (?username: untyped?, ?password: untyped?) -> void
13+
def initialize: (?username: String?, ?password: String?) -> void
1414

15-
def serialize: () -> (nil | { type: "password", username: untyped, password: untyped })
15+
def serialize: () -> Hash[Symbol, String]?
1616
end
1717
end
1818
end

rb/sig/lib/selenium/webdriver/bidi/network/headers.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Selenium
44
class Headers
55
def initialize: () -> void
66

7-
def serialize: () -> untyped
7+
def serialize: () -> Array[Hash[Symbol, String]]
88
end
99
end
1010
end

rb/sig/lib/selenium/webdriver/bidi/network/intercepted_auth.rbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ module Selenium
22
module WebDriver
33
class BiDi
44
class InterceptedAuth < InterceptedItem
5-
def authenticate: (untyped username, untyped password) -> untyped
5+
def authenticate: (String username, String password) -> Hash[nil, nil]
66

7-
def skip: () -> untyped
7+
def skip: () -> Hash[nil, nil]
88

9-
def cancel: () -> untyped
9+
def cancel: () -> Hash[nil, nil]
1010
end
1111
end
1212
end

rb/sig/lib/selenium/webdriver/bidi/network/intercepted_item.rbs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ module Selenium
22
module WebDriver
33
class BiDi
44
class InterceptedItem
5-
@network: untyped
5+
@network: Network
66

77
@request: untyped
88

9-
@id: untyped
9+
@id: Integer
1010

11-
attr_reader network: untyped
11+
attr_reader network: Network
1212

1313
attr_reader request: untyped
1414

15-
def initialize: (untyped network, untyped request) -> void
15+
def initialize: (Network network, Hash[untyped, untyped] request) -> void
1616

17-
def id: () -> untyped
17+
def id: () -> Integer
1818
end
1919
end
2020
end

rb/sig/lib/selenium/webdriver/bidi/network/intercepted_request.rbs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,33 @@ module Selenium
22
module WebDriver
33
class BiDi
44
class InterceptedRequest < InterceptedItem
5-
# We now rely on the modules above to initialize @headers and @cookies as Hashes
6-
@method: untyped
5+
@method: String
76

8-
@url: untyped
7+
@url: String
98

10-
@body: untyped
9+
@body: Hash[untyped, untyped]
1110

12-
@headers: untyped
11+
@headers: Hash[untyped, untyped]
1312

14-
@cookies: untyped
13+
@cookies: Hash[untyped, untyped]
1514

16-
attr_accessor method: untyped
15+
attr_accessor method: String
1716

18-
attr_accessor url: untyped
17+
attr_accessor url: String
1918

20-
attr_reader body: untyped
19+
attr_reader body: Hash[untyped, untyped]
2120

22-
def initialize: (untyped network, untyped request) -> void
21+
def initialize: (Network network, Hash[untyped, untyped] request) -> void
2322

24-
def continue: () -> untyped
23+
def continue: () -> Hash[nil, nil]
2524

26-
def fail: () -> untyped
25+
def fail: () -> Hash[nil, nil]
2726

28-
def body=: (untyped value) -> untyped
27+
def body=: (Hash[untyped, untyped] value) -> Hash[untyped, untyped]
2928

30-
def headers: () -> untyped
29+
def headers: () -> Hash[untyped, untyped]
3130

32-
def cookies: () -> untyped
31+
def cookies: () -> Hash[untyped, untyped]
3332
end
3433
end
3534
end

rb/sig/lib/selenium/webdriver/bidi/network/set_cookie_headers.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ module Selenium
22
module WebDriver
33
class BiDi
44
class SetCookieHeaders
5-
def initialize: (untyped set_cookie_headers) -> void
5+
def initialize: (Hash[Symbol, untyped] set_cookie_headers) -> void
66

7-
def serialize: () -> (Array[untyped] | untyped)
7+
def serialize: () -> Array[Hash[Symbol, untyped]]
88
end
99
end
1010
end

rb/sig/lib/selenium/webdriver/common/network.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module Selenium
2525

2626
private
2727

28-
def add_handler: (Symbol event_type, String phase, BiDi::InterceptedItem intercept_type, Array[String] filter, ?pattern_type: Symbol?) { (untyped) -> untyped } -> untyped
28+
def add_handler: (Symbol event_type, String phase, BiDi::InterceptedRequest | BiDi::InterceptedAuth | BiDi::InterceptedResponse intercept_type, Array[String] filter, ?pattern_type: Symbol?) { (untyped) -> untyped } -> untyped
2929
end
3030
end
3131
end

0 commit comments

Comments
 (0)