bidi2pdf 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.devcontainer/Dockerfile +53 -0
- data/.devcontainer/devcontainer.json +51 -0
- data/.devcontainer/docker-compose.yml +33 -0
- data/.ruby-gemset +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +46 -6
- data/README.md +12 -0
- data/docker/Dockerfile +1 -1
- data/docker/Dockerfile.slim +2 -2
- data/docker/chrome-driver/chrome.json +874 -0
- data/lib/bidi2pdf/bidi/browser_tab.rb +52 -0
- data/lib/bidi2pdf/bidi/commands/capture_screenshot.rb +33 -0
- data/lib/bidi2pdf/bidi/commands/set_viewport.rb +32 -0
- data/lib/bidi2pdf/bidi/commands.rb +2 -0
- data/lib/bidi2pdf/cli.rb +11 -1
- data/lib/bidi2pdf/launcher.rb +5 -3
- data/lib/bidi2pdf/test_helpers/images.rb +8 -0
- data/lib/bidi2pdf/test_helpers/pdf_reader_utils.rb +1 -2
- data/lib/bidi2pdf/test_helpers/pdf_text_sanitizer.rb +1 -2
- data/lib/bidi2pdf/test_helpers/testcontainers/chromedriver_container.rb +1 -1
- data/lib/bidi2pdf/test_helpers/testcontainers/chromedriver_test_helper.rb +18 -0
- data/lib/bidi2pdf/test_helpers/testcontainers/container_endpoint.rb +30 -0
- data/lib/bidi2pdf/test_helpers/testcontainers/testcontainers_refinement.rb +33 -0
- data/lib/bidi2pdf/test_helpers/testcontainers.rb +1 -0
- data/lib/bidi2pdf/version.rb +1 -1
- data/lib/bidi2pdf.rb +2 -0
- data/sig/bidi2pdf/bidi/add_headers_interceptor.rbs +16 -9
- data/sig/bidi2pdf/bidi/auth_interceptor.rbs +32 -7
- data/sig/bidi2pdf/bidi/browser.rbs +4 -31
- data/sig/bidi2pdf/bidi/browser_console_logger.rbs +59 -0
- data/sig/bidi2pdf/bidi/browser_tab.rbs +252 -25
- data/sig/bidi2pdf/bidi/client.rbs +95 -43
- data/sig/bidi2pdf/bidi/command_manager.rbs +5 -17
- data/sig/bidi2pdf/bidi/commands/add_intercept.rbs +16 -8
- data/sig/bidi2pdf/bidi/commands/base.rbs +49 -9
- data/sig/bidi2pdf/bidi/commands/browser_close.rbs +3 -1
- data/sig/bidi2pdf/bidi/commands/browser_create_user_context.rbs +2 -0
- data/sig/bidi2pdf/bidi/commands/browser_remove_user_context.rbs +19 -0
- data/sig/bidi2pdf/bidi/commands/browsing_context_close.rbs +8 -2
- data/sig/bidi2pdf/bidi/commands/browsing_context_navigate.rbs +12 -6
- data/sig/bidi2pdf/bidi/commands/browsing_context_print.rbs +10 -5
- data/sig/bidi2pdf/bidi/commands/cancel_auth.rbs +8 -2
- data/sig/bidi2pdf/bidi/commands/capture_screenshot.rbs +31 -0
- data/sig/bidi2pdf/bidi/commands/cdp_get_session.rbs +17 -0
- data/sig/bidi2pdf/bidi/commands/create_window.rbs +4 -0
- data/sig/bidi2pdf/bidi/commands/get_user_contexts.rbs +2 -0
- data/sig/bidi2pdf/bidi/commands/network_continue.rbs +4 -0
- data/sig/bidi2pdf/bidi/commands/page_print.rbs +28 -0
- data/sig/bidi2pdf/bidi/commands/print_parameters_validator.rbs +3 -0
- data/sig/bidi2pdf/bidi/commands/provide_credentials.rbs +12 -6
- data/sig/bidi2pdf/bidi/commands/script_evaluate.rbs +4 -0
- data/sig/bidi2pdf/bidi/commands/session_end.rbs +2 -0
- data/sig/bidi2pdf/bidi/commands/session_status.rbs +3 -1
- data/sig/bidi2pdf/bidi/commands/session_subscribe.rbs +4 -0
- data/sig/bidi2pdf/bidi/commands/set_tab_cookie.rbs +51 -23
- data/sig/bidi2pdf/bidi/commands/set_usercontext_cookie.rbs +17 -19
- data/sig/bidi2pdf/bidi/commands/set_viewport.rbs +31 -0
- data/sig/bidi2pdf/bidi/connection_manager.rbs +2 -1
- data/sig/bidi2pdf/bidi/event_manager.rbs +14 -19
- data/sig/bidi2pdf/bidi/interceptor.rbs +5 -0
- data/sig/bidi2pdf/bidi/js_logger_helper.rbs +9 -0
- data/sig/bidi2pdf/bidi/logger_events.rbs +21 -0
- data/sig/bidi2pdf/bidi/navigation_failed_events.rbs +17 -0
- data/sig/bidi2pdf/bidi/network_event.rbs +54 -46
- data/sig/bidi2pdf/bidi/network_event_formatters/network_event_console_formatter.rbs +63 -0
- data/sig/bidi2pdf/bidi/network_event_formatters/network_event_formatter_utils.rbs +15 -0
- data/sig/bidi2pdf/bidi/network_event_formatters/network_event_html_formatter.rbs +18 -0
- data/sig/bidi2pdf/bidi/network_event_formatters.rbs +6 -0
- data/sig/bidi2pdf/bidi/network_events.rbs +14 -39
- data/sig/bidi2pdf/bidi/session.rbs +144 -31
- data/sig/bidi2pdf/bidi/user_context.rbs +64 -45
- data/sig/bidi2pdf/bidi/web_socket_dispatcher.rbs +22 -30
- data/sig/bidi2pdf/chromedriver_manager.rbs +57 -22
- data/sig/bidi2pdf/cli.rbs +22 -2
- data/sig/bidi2pdf/dsl.rbs +34 -0
- data/sig/bidi2pdf/launcher.rbs +39 -1
- data/sig/bidi2pdf/notifications/event.rbs +40 -0
- data/sig/bidi2pdf/notifications/instrumenter.rbs +21 -0
- data/sig/bidi2pdf/notifications/logging_subscriber.rbs +41 -0
- data/sig/bidi2pdf/notifications.rbs +24 -0
- data/sig/bidi2pdf/process_tree.rbs +2 -2
- data/sig/bidi2pdf/session_runner.rbs +41 -1
- data/sig/bidi2pdf/test_helpers/configuration.rbs +51 -0
- data/sig/bidi2pdf/test_helpers/images/extractor.rbs +43 -0
- data/sig/bidi2pdf/test_helpers/images/image_similarity_checker.rbs +35 -0
- data/sig/bidi2pdf/test_helpers/images/tiff_helper.rbs +70 -0
- data/sig/bidi2pdf/test_helpers/images.rbs +0 -0
- data/sig/bidi2pdf/test_helpers/matchers/contains_pdf_image.rbs +0 -0
- data/sig/bidi2pdf/test_helpers/matchers/contains_pdf_text.rbs +0 -0
- data/sig/bidi2pdf/test_helpers/matchers/have_pdf_page_count.rbs +0 -0
- data/sig/bidi2pdf/test_helpers/matchers/match_pdf_text.rbs +0 -0
- data/sig/bidi2pdf/test_helpers/pdf_file_helper.rbs +23 -0
- data/sig/bidi2pdf/test_helpers/pdf_reader_utils.rbs +49 -0
- data/sig/bidi2pdf/test_helpers/pdf_text_sanitizer.rbs +38 -0
- data/sig/bidi2pdf/test_helpers/spec_paths_helper.rbs +35 -0
- data/sig/bidi2pdf/test_helpers/testcontainers/chromedriver_container.rbs +43 -0
- data/sig/bidi2pdf/test_helpers/testcontainers/chromedriver_test_helper.rbs +45 -0
- data/sig/bidi2pdf/test_helpers/testcontainers/container_endpoint.rbs +25 -0
- data/sig/bidi2pdf/test_helpers/testcontainers/shared_docker_network.rbs +3 -0
- data/sig/bidi2pdf/test_helpers/testcontainers/testcontainers_refinement.rbs +47 -0
- data/sig/bidi2pdf/test_helpers/testcontainers.rbs +6 -0
- data/sig/bidi2pdf/test_helpers.rbs +0 -0
- data/sig/bidi2pdf/verbose_logger.rbs +37 -0
- data/sig/bidi2pdf/version.rbs +3 -0
- data/sig/bidi2pdf.rbs +112 -2
- data/tasks/generate_rbs.rake +11 -11
- metadata +59 -7
- data/sig/bidi2pdf/utils.rbs +0 -5
|
@@ -2,9 +2,15 @@ module Bidi2pdf
|
|
|
2
2
|
module Bidi
|
|
3
3
|
module Commands
|
|
4
4
|
class BrowsingContextClose
|
|
5
|
-
|
|
5
|
+
@context: untyped
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
include Base
|
|
8
|
+
|
|
9
|
+
def initialize: (context: untyped) -> void
|
|
10
|
+
|
|
11
|
+
def params: () -> { context: untyped }
|
|
12
|
+
|
|
13
|
+
def method_name: () -> "browsingContext.close"
|
|
8
14
|
end
|
|
9
15
|
end
|
|
10
16
|
end
|
|
@@ -2,13 +2,19 @@ module Bidi2pdf
|
|
|
2
2
|
module Bidi
|
|
3
3
|
module Commands
|
|
4
4
|
class BrowsingContextNavigate
|
|
5
|
-
|
|
5
|
+
@url: untyped
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
@context: untyped
|
|
8
|
+
|
|
9
|
+
@wait: untyped
|
|
10
|
+
|
|
11
|
+
include Base
|
|
12
|
+
|
|
13
|
+
def initialize: (url: untyped, context: untyped, ?wait: ::String) -> void
|
|
14
|
+
|
|
15
|
+
def params: () -> { url: untyped, context: untyped, wait: untyped }
|
|
16
|
+
|
|
17
|
+
def method_name: () -> "browsingContext.navigate"
|
|
12
18
|
end
|
|
13
19
|
end
|
|
14
20
|
end
|
|
@@ -2,12 +2,17 @@ module Bidi2pdf
|
|
|
2
2
|
module Bidi
|
|
3
3
|
module Commands
|
|
4
4
|
class BrowsingContextPrint
|
|
5
|
-
|
|
5
|
+
@context: untyped
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
@print_options: untyped
|
|
8
|
+
|
|
9
|
+
include Base
|
|
10
|
+
|
|
11
|
+
def initialize: (context: untyped, print_options: untyped) -> void
|
|
12
|
+
|
|
13
|
+
def params: () -> untyped
|
|
14
|
+
|
|
15
|
+
def method_name: () -> "browsingContext.print"
|
|
11
16
|
end
|
|
12
17
|
end
|
|
13
18
|
end
|
|
@@ -2,9 +2,15 @@ module Bidi2pdf
|
|
|
2
2
|
module Bidi
|
|
3
3
|
module Commands
|
|
4
4
|
class CancelAuth
|
|
5
|
-
|
|
5
|
+
@request: untyped
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
include Base
|
|
8
|
+
|
|
9
|
+
def initialize: (request: untyped) -> void
|
|
10
|
+
|
|
11
|
+
def params: () -> { request: untyped, action: "cancel" }
|
|
12
|
+
|
|
13
|
+
def method_name: () -> "network.continueWithAuth"
|
|
8
14
|
end
|
|
9
15
|
end
|
|
10
16
|
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module Bidi2pdf
|
|
2
|
+
module Bidi
|
|
3
|
+
module Commands
|
|
4
|
+
class CaptureScreenshot
|
|
5
|
+
@context: untyped
|
|
6
|
+
|
|
7
|
+
@origin: untyped
|
|
8
|
+
|
|
9
|
+
@format: untyped
|
|
10
|
+
|
|
11
|
+
@clip: untyped
|
|
12
|
+
|
|
13
|
+
include Base
|
|
14
|
+
|
|
15
|
+
attr_reader context: untyped
|
|
16
|
+
|
|
17
|
+
attr_reader origin: untyped
|
|
18
|
+
|
|
19
|
+
attr_reader format: untyped
|
|
20
|
+
|
|
21
|
+
attr_reader clip: untyped
|
|
22
|
+
|
|
23
|
+
def initialize: (context: untyped, ?origin: ::String, ?format: untyped?, ?clip: untyped?) -> void
|
|
24
|
+
|
|
25
|
+
def method_name: () -> "browsingContext.captureScreenshot"
|
|
26
|
+
|
|
27
|
+
def params: () -> untyped
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Bidi2pdf
|
|
2
|
+
module Bidi
|
|
3
|
+
module Commands
|
|
4
|
+
class CdpGetSession
|
|
5
|
+
@context: untyped
|
|
6
|
+
|
|
7
|
+
include Base
|
|
8
|
+
|
|
9
|
+
def initialize: (context: untyped) -> void
|
|
10
|
+
|
|
11
|
+
def params: () -> { context: untyped }
|
|
12
|
+
|
|
13
|
+
def method_name: () -> "goog:cdp.getSession"
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Bidi2pdf
|
|
2
|
+
module Bidi
|
|
3
|
+
module Commands
|
|
4
|
+
class PagePrint
|
|
5
|
+
@cdp_session: untyped
|
|
6
|
+
|
|
7
|
+
@print_options: untyped
|
|
8
|
+
|
|
9
|
+
include Base
|
|
10
|
+
|
|
11
|
+
def initialize: (cdp_session: untyped, print_options: untyped) -> void
|
|
12
|
+
|
|
13
|
+
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
|
14
|
+
def params: () -> { method: "Page.printToPDF", session: untyped, params: untyped }
|
|
15
|
+
|
|
16
|
+
def method_name: () -> "goog:cdp.sendCommand"
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
|
|
20
|
+
# rubocop:disable Naming/MethodParameterName
|
|
21
|
+
def cm_to_inch: (untyped cm) -> (nil | untyped)
|
|
22
|
+
|
|
23
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
|
24
|
+
def page_ranges_to_string: (untyped input) -> (nil | untyped)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -15,6 +15,7 @@ module Bidi2pdf
|
|
|
15
15
|
# },
|
|
16
16
|
# orientation: "portrait" or "landscape" (optional, default: "portrait"),
|
|
17
17
|
# page: {
|
|
18
|
+
# format: String (optional, use either format or width/height),
|
|
18
19
|
# width: Float >= 0.0352 (optional, default: 21.59),
|
|
19
20
|
# height: Float >= 0.0352 (optional, default: 27.94)
|
|
20
21
|
# },
|
|
@@ -32,6 +33,7 @@ module Bidi2pdf
|
|
|
32
33
|
|
|
33
34
|
def initialize: (untyped params) -> void
|
|
34
35
|
|
|
36
|
+
# rubocop:disable Naming/PredicateMethod
|
|
35
37
|
def validate!: () -> true
|
|
36
38
|
|
|
37
39
|
private
|
|
@@ -46,6 +48,7 @@ module Bidi2pdf
|
|
|
46
48
|
|
|
47
49
|
def validate_margin: () -> (nil | untyped)
|
|
48
50
|
|
|
51
|
+
# rubocop: disable Metrics/CyclomaticComplexity
|
|
49
52
|
def validate_page_size: () -> (nil | untyped)
|
|
50
53
|
end
|
|
51
54
|
end
|
|
@@ -2,13 +2,19 @@ module Bidi2pdf
|
|
|
2
2
|
module Bidi
|
|
3
3
|
module Commands
|
|
4
4
|
class ProvideCredentials
|
|
5
|
-
|
|
5
|
+
@request: untyped
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
@username: untyped
|
|
8
|
+
|
|
9
|
+
@password: untyped
|
|
10
|
+
|
|
11
|
+
include Base
|
|
12
|
+
|
|
13
|
+
def initialize: (request: untyped, username: untyped, password: untyped) -> void
|
|
14
|
+
|
|
15
|
+
def params: () -> { request: untyped, action: "provideCredentials", credentials: { type: "password", username: untyped, password: untyped } }
|
|
16
|
+
|
|
17
|
+
def method_name: () -> "network.continueWithAuth"
|
|
12
18
|
end
|
|
13
19
|
end
|
|
14
20
|
end
|
|
@@ -11,6 +11,10 @@ module Bidi2pdf
|
|
|
11
11
|
include Base
|
|
12
12
|
|
|
13
13
|
def initialize: (expression: untyped, context: untyped, ?await_promise: bool) -> void
|
|
14
|
+
|
|
15
|
+
def params: () -> { expression: untyped, target: { context: untyped }, awaitPromise: untyped }
|
|
16
|
+
|
|
17
|
+
def method_name: () -> "script.evaluate"
|
|
14
18
|
end
|
|
15
19
|
end
|
|
16
20
|
end
|
|
@@ -2,29 +2,57 @@ module Bidi2pdf
|
|
|
2
2
|
module Bidi
|
|
3
3
|
module Commands
|
|
4
4
|
class SetTabCookie
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
5
|
+
self.@time_provider: untyped
|
|
6
|
+
|
|
7
|
+
@name: untyped
|
|
8
|
+
|
|
9
|
+
@value: untyped
|
|
10
|
+
|
|
11
|
+
@domain: untyped
|
|
12
|
+
|
|
13
|
+
@path: untyped
|
|
14
|
+
|
|
15
|
+
@secure: untyped
|
|
16
|
+
|
|
17
|
+
@http_only: untyped
|
|
18
|
+
|
|
19
|
+
@same_site: untyped
|
|
20
|
+
|
|
21
|
+
@ttl: untyped
|
|
22
|
+
|
|
23
|
+
@browsing_context_id: untyped
|
|
24
|
+
|
|
25
|
+
include Base
|
|
26
|
+
|
|
27
|
+
attr_writer self.time_provider: untyped
|
|
28
|
+
|
|
29
|
+
def self.time_provider: () -> untyped
|
|
30
|
+
|
|
31
|
+
attr_reader name: untyped
|
|
32
|
+
|
|
33
|
+
attr_reader value: untyped
|
|
34
|
+
|
|
35
|
+
attr_reader domain: untyped
|
|
36
|
+
|
|
37
|
+
attr_reader path: untyped
|
|
38
|
+
|
|
39
|
+
attr_reader secure: untyped
|
|
40
|
+
|
|
41
|
+
attr_reader http_only: untyped
|
|
42
|
+
|
|
43
|
+
attr_reader same_site: untyped
|
|
44
|
+
|
|
45
|
+
attr_reader ttl: untyped
|
|
46
|
+
|
|
47
|
+
attr_reader browsing_context_id: untyped
|
|
48
|
+
|
|
49
|
+
def initialize: (name: untyped, value: untyped, domain: untyped, browsing_context_id: untyped, ?path: ::String, ?secure: bool, ?http_only: bool, ?same_site: ::String, ?ttl: ::Integer) -> void
|
|
50
|
+
|
|
51
|
+
def expiry: () -> untyped
|
|
52
|
+
|
|
53
|
+
def method_name: () -> "storage.setCookie"
|
|
54
|
+
|
|
55
|
+
def params: () -> untyped
|
|
28
56
|
end
|
|
29
57
|
end
|
|
30
58
|
end
|
|
@@ -2,25 +2,23 @@ module Bidi2pdf
|
|
|
2
2
|
module Bidi
|
|
3
3
|
module Commands
|
|
4
4
|
class SetUsercontextCookie < SetTabCookie
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def expiry: () -> Integer
|
|
5
|
+
@user_context_id: untyped
|
|
6
|
+
|
|
7
|
+
@source_origin: untyped
|
|
8
|
+
|
|
9
|
+
include Base
|
|
10
|
+
|
|
11
|
+
attr_reader user_context_id: untyped
|
|
12
|
+
|
|
13
|
+
attr_reader source_origin: untyped
|
|
14
|
+
|
|
15
|
+
def initialize: (name: untyped, value: untyped, domain: untyped, user_context_id: untyped, source_origin: untyped, ?path: ::String, ?secure: bool, ?http_only: bool, ?same_site: ::String, ?ttl: ::Integer) -> void
|
|
16
|
+
|
|
17
|
+
def expiry: () -> untyped
|
|
18
|
+
|
|
19
|
+
def method_name: () -> "storage.setCookie"
|
|
20
|
+
|
|
21
|
+
def params: () -> untyped
|
|
24
22
|
end
|
|
25
23
|
end
|
|
26
24
|
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module Bidi2pdf
|
|
2
|
+
module Bidi
|
|
3
|
+
module Commands
|
|
4
|
+
class SetViewport
|
|
5
|
+
@context: untyped
|
|
6
|
+
|
|
7
|
+
@width: untyped
|
|
8
|
+
|
|
9
|
+
@height: untyped
|
|
10
|
+
|
|
11
|
+
@device_pixel_ratio: untyped
|
|
12
|
+
|
|
13
|
+
include Base
|
|
14
|
+
|
|
15
|
+
attr_reader context: untyped
|
|
16
|
+
|
|
17
|
+
attr_reader width: untyped
|
|
18
|
+
|
|
19
|
+
attr_reader height: untyped
|
|
20
|
+
|
|
21
|
+
attr_reader device_pixel_ratio: untyped
|
|
22
|
+
|
|
23
|
+
def initialize: (context: untyped, width: untyped, height: untyped, ?device_pixel_ratio: untyped?) -> void
|
|
24
|
+
|
|
25
|
+
def method_name: () -> "browsingContext.setViewport"
|
|
26
|
+
|
|
27
|
+
def params: () -> untyped
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -5,12 +5,13 @@ module Bidi2pdf
|
|
|
5
5
|
|
|
6
6
|
@connected: untyped
|
|
7
7
|
|
|
8
|
-
@
|
|
8
|
+
@connection_latch: untyped
|
|
9
9
|
|
|
10
10
|
def initialize: (logger: untyped) -> void
|
|
11
11
|
|
|
12
12
|
def mark_connected: () -> (nil | untyped)
|
|
13
13
|
|
|
14
|
+
# rubocop:disable Naming/PredicateMethod
|
|
14
15
|
def wait_until_open: (timeout: untyped) -> true
|
|
15
16
|
end
|
|
16
17
|
end
|
|
@@ -1,35 +1,30 @@
|
|
|
1
1
|
module Bidi2pdf
|
|
2
2
|
module Bidi
|
|
3
3
|
class EventManager
|
|
4
|
-
|
|
5
|
-
attr_reader block: untyped
|
|
6
|
-
attr_reader id: String
|
|
4
|
+
@listeners: untyped
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
@type: untyped
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
Listener: untyped
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
attr_reader type: untyped
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
def initialize: (untyped type) -> void
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
end
|
|
14
|
+
def on: (*untyped event_names) { (?) -> untyped } -> untyped
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
@type: untyped
|
|
21
|
-
|
|
22
|
-
attr_reader type: untyped
|
|
16
|
+
def off: (untyped event_name, untyped listener) -> untyped
|
|
23
17
|
|
|
24
|
-
def
|
|
18
|
+
def dispatch: (untyped event_name, *untyped args) -> untyped
|
|
25
19
|
|
|
26
|
-
def
|
|
20
|
+
def clear: (?untyped? event_name) -> untyped
|
|
27
21
|
|
|
28
|
-
|
|
22
|
+
private
|
|
29
23
|
|
|
30
|
-
def
|
|
24
|
+
def log_msg: (untyped prefix, untyped data) -> untyped
|
|
31
25
|
|
|
32
|
-
|
|
26
|
+
# rubocop: disable all
|
|
27
|
+
def truncate_large_values: (untyped org, ?::Integer max_length, ?::Integer max_depth, ?::Integer current_depth) -> ("...(too deep)..." | untyped)
|
|
33
28
|
end
|
|
34
29
|
end
|
|
35
|
-
end
|
|
30
|
+
end
|
|
@@ -3,6 +3,8 @@ module Bidi2pdf
|
|
|
3
3
|
module Interceptor
|
|
4
4
|
@client: untyped
|
|
5
5
|
|
|
6
|
+
@handle_event_listener: untyped
|
|
7
|
+
|
|
6
8
|
def self.included: (untyped base) -> untyped
|
|
7
9
|
|
|
8
10
|
module ClassMethods
|
|
@@ -19,6 +21,9 @@ module Bidi2pdf
|
|
|
19
21
|
|
|
20
22
|
def register_with_client: (client: untyped) -> untyped
|
|
21
23
|
|
|
24
|
+
def unregister_with_client: (client: untyped) -> (nil | untyped)
|
|
25
|
+
|
|
26
|
+
# rubocop: disable Metrics/AbcSize
|
|
22
27
|
def handle_event: (untyped response) -> untyped
|
|
23
28
|
|
|
24
29
|
def interceptor_id: () -> untyped
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Bidi2pdf
|
|
2
|
+
module Bidi
|
|
3
|
+
class LoggerEvents
|
|
4
|
+
@context_id: untyped
|
|
5
|
+
|
|
6
|
+
@browser_console_logger: untyped
|
|
7
|
+
|
|
8
|
+
attr_reader context_id: untyped
|
|
9
|
+
|
|
10
|
+
attr_reader browser_console_logger: untyped
|
|
11
|
+
|
|
12
|
+
def initialize: (untyped context_id) -> void
|
|
13
|
+
|
|
14
|
+
def handle_event: (untyped data) -> untyped
|
|
15
|
+
|
|
16
|
+
def handle_response: (untyped _method, untyped event) -> untyped
|
|
17
|
+
|
|
18
|
+
def resolve_log_level: (untyped js_level) -> untyped
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Bidi2pdf
|
|
2
|
+
module Bidi
|
|
3
|
+
class NavigationFailedEvents
|
|
4
|
+
@context_id: untyped
|
|
5
|
+
|
|
6
|
+
attr_reader context_id: untyped
|
|
7
|
+
|
|
8
|
+
attr_reader browser_console_logger: untyped
|
|
9
|
+
|
|
10
|
+
def initialize: (untyped context_id) -> void
|
|
11
|
+
|
|
12
|
+
def handle_event: (untyped data) -> untyped
|
|
13
|
+
|
|
14
|
+
def handle_response: (untyped _method, untyped event) -> untyped
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|