@remotion/renderer 4.0.0-preload.17 → 4.0.0-skia.20
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.
- package/dist/assets/calculate-asset-positions.d.ts +2 -2
- package/dist/assets/calculate-asset-positions.d.ts.map +1 -0
- package/dist/assets/calculate-asset-positions.js.map +1 -0
- package/dist/assets/calculate-atempo.d.ts.map +1 -0
- package/dist/assets/calculate-atempo.js.map +1 -0
- package/dist/assets/cleanup-assets.d.ts +2 -0
- package/dist/assets/cleanup-assets.js +2 -0
- package/dist/assets/convert-assets-to-file-urls.d.ts +2 -2
- package/dist/assets/convert-assets-to-file-urls.d.ts.map +1 -0
- package/dist/assets/convert-assets-to-file-urls.js.map +1 -0
- package/dist/assets/download-and-map-assets-to-file.d.ts +11 -9
- package/dist/assets/download-and-map-assets-to-file.d.ts.map +1 -0
- package/dist/assets/download-and-map-assets-to-file.js +80 -39
- package/dist/assets/download-and-map-assets-to-file.js.map +1 -0
- package/dist/assets/download-file.d.ts +10 -5
- package/dist/assets/download-file.d.ts.map +1 -0
- package/dist/assets/download-file.js +18 -5
- package/dist/assets/download-file.js.map +1 -0
- package/dist/assets/ffmpeg-volume-expression.d.ts +2 -3
- package/dist/assets/ffmpeg-volume-expression.d.ts.map +1 -0
- package/dist/assets/ffmpeg-volume-expression.js +2 -3
- package/dist/assets/ffmpeg-volume-expression.js.map +1 -0
- package/dist/assets/flatten-volume-array.d.ts +1 -1
- package/dist/assets/flatten-volume-array.d.ts.map +1 -0
- package/dist/assets/flatten-volume-array.js.map +1 -0
- package/dist/assets/get-audio-channels.d.ts +5 -2
- package/dist/assets/get-audio-channels.d.ts.map +1 -0
- package/dist/assets/get-audio-channels.js +15 -4
- package/dist/assets/get-audio-channels.js.map +1 -0
- package/dist/assets/read-file.d.ts.map +1 -0
- package/dist/assets/read-file.js +4 -1
- package/dist/assets/read-file.js.map +1 -0
- package/dist/assets/round-volume-to-avoid-stack-overflow.d.ts.map +1 -0
- package/dist/assets/round-volume-to-avoid-stack-overflow.js.map +1 -0
- package/dist/assets/sanitize-filename.d.ts.map +1 -0
- package/dist/assets/sanitize-filename.js.map +1 -0
- package/dist/assets/sanitize-filepath.d.ts.map +1 -0
- package/dist/assets/sanitize-filepath.js.map +1 -0
- package/dist/assets/truncate-utf8-bytes.d.ts.map +1 -0
- package/dist/assets/truncate-utf8-bytes.js.map +1 -0
- package/dist/assets/types.d.ts +1 -1
- package/dist/assets/types.d.ts.map +1 -0
- package/dist/assets/types.js.map +1 -0
- package/dist/browser/Accessibility.d.ts +175 -0
- package/dist/browser/Accessibility.js +423 -0
- package/dist/browser/AriaQueryHandler.d.ts +20 -0
- package/dist/browser/AriaQueryHandler.js +108 -0
- package/dist/browser/Browser.d.ts +60 -0
- package/dist/browser/Browser.js +218 -0
- package/dist/browser/BrowserConnector.d.ts +19 -0
- package/dist/browser/BrowserConnector.js +17 -0
- package/dist/browser/BrowserFetcher.d.ts +89 -0
- package/dist/browser/BrowserFetcher.js +510 -0
- package/dist/browser/BrowserPage.d.ts +74 -0
- package/dist/browser/BrowserPage.js +283 -0
- package/dist/browser/BrowserRunner.d.ts +39 -0
- package/dist/browser/BrowserRunner.js +308 -0
- package/dist/browser/Connection.d.ts +42 -0
- package/dist/browser/Connection.js +242 -0
- package/dist/browser/ConnectionTransport.d.ts +21 -0
- package/dist/browser/ConnectionTransport.js +17 -0
- package/dist/browser/ConsoleMessage.d.ts +31 -0
- package/dist/browser/ConsoleMessage.js +48 -0
- package/dist/browser/Coverage.d.ts +180 -0
- package/dist/browser/Coverage.js +371 -0
- package/dist/browser/DOMWorld.d.ts +52 -0
- package/dist/browser/DOMWorld.js +272 -0
- package/dist/browser/Debug.d.ts +19 -0
- package/dist/browser/Debug.js +42 -0
- package/dist/browser/DeviceDescriptors.d.ts +40 -0
- package/dist/browser/DeviceDescriptors.js +1407 -0
- package/dist/browser/EmulationManager.d.ts +7 -0
- package/dist/browser/EmulationManager.js +40 -0
- package/dist/browser/Errors.d.ts +25 -0
- package/dist/browser/Errors.js +35 -0
- package/dist/browser/EvalTypes.d.ts +27 -0
- package/dist/browser/EvalTypes.js +17 -0
- package/dist/browser/EventEmitter.d.ts +23 -0
- package/dist/browser/EventEmitter.js +53 -0
- package/dist/browser/ExecutionContext.d.ts +34 -0
- package/dist/browser/ExecutionContext.js +174 -0
- package/dist/browser/FileChooser.d.ts +56 -0
- package/dist/browser/FileChooser.js +86 -0
- package/dist/browser/FrameManager.d.ts +93 -0
- package/dist/browser/FrameManager.js +496 -0
- package/dist/browser/HTTPRequest.d.ts +28 -0
- package/dist/browser/HTTPRequest.js +37 -0
- package/dist/browser/HTTPResponse.d.ts +21 -0
- package/dist/browser/HTTPResponse.js +41 -0
- package/dist/browser/Input.d.ts +355 -0
- package/dist/browser/Input.js +592 -0
- package/dist/browser/JSHandle.d.ts +35 -0
- package/dist/browser/JSHandle.js +90 -0
- package/dist/browser/LaunchOptions.d.ts +37 -0
- package/dist/browser/LaunchOptions.js +17 -0
- package/dist/browser/Launcher.d.ts +9 -0
- package/dist/browser/Launcher.js +504 -0
- package/dist/browser/LifecycleWatcher.d.ts +29 -0
- package/dist/browser/LifecycleWatcher.js +180 -0
- package/dist/browser/NetworkConditions.d.ts +26 -0
- package/dist/browser/NetworkConditions.js +33 -0
- package/dist/browser/NetworkEventManager.d.ts +33 -0
- package/dist/browser/NetworkEventManager.js +81 -0
- package/dist/browser/NetworkManager.d.ts +34 -0
- package/dist/browser/NetworkManager.js +235 -0
- package/dist/browser/NodeWebSocketTransport.d.ts +17 -0
- package/dist/browser/NodeWebSocketTransport.js +87 -0
- package/dist/browser/PDFOptions.d.ts +165 -0
- package/dist/browser/PDFOptions.js +34 -0
- package/dist/browser/PipeTransport.d.ts +10 -0
- package/dist/browser/PipeTransport.js +86 -0
- package/dist/browser/Product.d.ts +16 -0
- package/dist/browser/Product.js +17 -0
- package/dist/browser/Puppeteer.d.ts +35 -0
- package/dist/browser/Puppeteer.js +17 -0
- package/dist/browser/PuppeteerNode.d.ts +40 -0
- package/dist/browser/PuppeteerNode.js +81 -0
- package/dist/browser/PuppeteerViewport.d.ts +5 -0
- package/dist/browser/PuppeteerViewport.js +2 -0
- package/dist/browser/QueryHandler.d.ts +64 -0
- package/dist/browser/QueryHandler.js +183 -0
- package/dist/browser/ScreenshotOptions.d.ts +14 -0
- package/dist/browser/ScreenshotOptions.js +2 -0
- package/dist/browser/SecurityDetails.d.ts +55 -0
- package/dist/browser/SecurityDetails.js +95 -0
- package/dist/browser/Target.d.ts +61 -0
- package/dist/browser/Target.js +146 -0
- package/dist/browser/TaskQueue.d.ts +20 -0
- package/dist/browser/TaskQueue.js +47 -0
- package/dist/browser/TimeoutSettings.d.ts +23 -0
- package/dist/browser/TimeoutSettings.js +62 -0
- package/dist/browser/Tracing.d.ts +45 -0
- package/dist/browser/Tracing.js +136 -0
- package/dist/browser/USKeyboardLayout.d.ts +39 -0
- package/dist/browser/USKeyboardLayout.js +406 -0
- package/dist/browser/WebWorker.d.ts +96 -0
- package/dist/browser/WebWorker.js +122 -0
- package/dist/browser/assert.d.ts +1 -0
- package/dist/browser/assert.js +9 -0
- package/dist/browser/compat.d.ts +2 -0
- package/dist/browser/compat.js +17 -0
- package/dist/browser/create-browser-fetcher.d.ts +17 -0
- package/dist/browser/create-browser-fetcher.js +119 -0
- package/dist/browser/devtools-commands.d.ts +270 -0
- package/dist/browser/devtools-commands.js +2 -0
- package/dist/browser/devtools-types.d.ts +1122 -0
- package/dist/browser/devtools-types.js +2 -0
- package/dist/browser/dialog.d.ts +70 -0
- package/dist/browser/dialog.js +114 -0
- package/dist/browser/environment.d.ts +16 -0
- package/dist/browser/environment.js +19 -0
- package/dist/browser/fetch.d.ts +16 -0
- package/dist/browser/fetch.js +46 -0
- package/dist/browser/find-up.d.ts +4 -0
- package/dist/browser/find-up.js +85 -0
- package/dist/browser/get-download-destination.d.ts +1 -0
- package/dist/browser/get-download-destination.js +38 -0
- package/dist/browser/mitt/index.d.ts +22 -0
- package/dist/browser/mitt/index.js +49 -0
- package/dist/browser/node.d.ts +2 -0
- package/dist/browser/node.js +9 -0
- package/dist/browser/page.d.ts +74 -0
- package/dist/browser/page.js +283 -0
- package/dist/browser/pkg-dir.d.ts +3 -0
- package/dist/browser/pkg-dir.js +13 -0
- package/dist/browser/revisions.d.ts +21 -0
- package/dist/browser/revisions.js +22 -0
- package/dist/browser/util.d.ts +47 -0
- package/dist/browser/util.js +169 -0
- package/dist/browser-log.d.ts +1 -1
- package/dist/browser-log.d.ts.map +1 -0
- package/dist/browser-log.js.map +1 -0
- package/dist/calculate-ffmpeg-filters.d.ts +1 -1
- package/dist/calculate-ffmpeg-filters.d.ts.map +1 -0
- package/dist/calculate-ffmpeg-filters.js +2 -2
- package/dist/calculate-ffmpeg-filters.js.map +1 -0
- package/dist/calculate-sar-dar-pixels.d.ts +9 -0
- package/dist/calculate-sar-dar-pixels.js +19 -0
- package/dist/can-use-parallel-encoding.d.ts +1 -1
- package/dist/can-use-parallel-encoding.d.ts.map +1 -0
- package/dist/can-use-parallel-encoding.js.map +1 -0
- package/dist/chunk.d.ts.map +1 -0
- package/dist/chunk.js.map +1 -0
- package/dist/combine-videos.d.ts +3 -2
- package/dist/combine-videos.d.ts.map +1 -0
- package/dist/combine-videos.js +6 -1
- package/dist/combine-videos.js.map +1 -0
- package/dist/convert-to-pcm.d.ts +1 -1
- package/dist/convert-to-pcm.d.ts.map +1 -0
- package/dist/convert-to-pcm.js.map +1 -0
- package/dist/create-ffmpeg-complex-filter.d.ts.map +1 -0
- package/dist/create-ffmpeg-complex-filter.js.map +1 -0
- package/dist/create-ffmpeg-merge-filter.d.ts.map +1 -0
- package/dist/create-ffmpeg-merge-filter.js.map +1 -0
- package/dist/create-silent-audio.d.ts +1 -1
- package/dist/create-silent-audio.d.ts.map +1 -0
- package/dist/create-silent-audio.js.map +1 -0
- package/dist/cycle-browser-tabs.d.ts +3 -2
- package/dist/cycle-browser-tabs.d.ts.map +1 -0
- package/dist/cycle-browser-tabs.js +9 -2
- package/dist/cycle-browser-tabs.js.map +1 -0
- package/dist/delay-render-embedded-stack.d.ts +1 -1
- package/dist/delay-render-embedded-stack.d.ts.map +1 -0
- package/dist/delay-render-embedded-stack.js.map +1 -0
- package/dist/delete-directory.d.ts.map +1 -0
- package/dist/delete-directory.js.map +1 -0
- package/dist/ensure-frames-in-order.d.ts.map +1 -0
- package/dist/ensure-frames-in-order.js.map +1 -0
- package/dist/ensure-output-directory.d.ts.map +1 -0
- package/dist/ensure-output-directory.js.map +1 -0
- package/dist/ensure-presentation-timestamp.d.ts +1 -0
- package/dist/ensure-presentation-timestamp.js +57 -0
- package/dist/error-handling/handle-javascript-exception.d.ts +2 -2
- package/dist/error-handling/handle-javascript-exception.d.ts.map +1 -0
- package/dist/error-handling/handle-javascript-exception.js +3 -4
- package/dist/error-handling/handle-javascript-exception.js.map +1 -0
- package/dist/error-handling/symbolicate-error.d.ts +1 -1
- package/dist/error-handling/symbolicate-error.d.ts.map +1 -0
- package/dist/error-handling/symbolicate-error.js.map +1 -0
- package/dist/error-handling/symbolicateable-error.d.ts +1 -1
- package/dist/error-handling/symbolicateable-error.d.ts.map +1 -0
- package/dist/error-handling/symbolicateable-error.js.map +1 -0
- package/dist/extract-frame-from-video.d.ts +5 -9
- package/dist/extract-frame-from-video.js +158 -43
- package/dist/ffmpeg-filter-file.d.ts.map +1 -0
- package/dist/ffmpeg-filter-file.js.map +1 -0
- package/dist/ffmpeg-flags.d.ts.map +1 -0
- package/dist/ffmpeg-flags.js.map +1 -0
- package/dist/get-audio-codec-name.d.ts +1 -1
- package/dist/get-audio-codec-name.d.ts.map +1 -0
- package/dist/get-audio-codec-name.js.map +1 -0
- package/dist/get-browser-instance.d.ts +4 -3
- package/dist/get-browser-instance.d.ts.map +1 -0
- package/dist/get-browser-instance.js.map +1 -0
- package/dist/get-codec-name.d.ts +1 -1
- package/dist/get-codec-name.d.ts.map +1 -0
- package/dist/get-codec-name.js.map +1 -0
- package/dist/get-compositions.d.ts +6 -5
- package/dist/get-compositions.d.ts.map +1 -0
- package/dist/get-compositions.js +7 -5
- package/dist/get-compositions.js.map +1 -0
- package/dist/get-concurrency.d.ts.map +1 -0
- package/dist/get-concurrency.js.map +1 -0
- package/dist/get-duration-from-frame-range.d.ts +1 -1
- package/dist/get-duration-from-frame-range.d.ts.map +1 -0
- package/dist/get-duration-from-frame-range.js.map +1 -0
- package/dist/get-duration-of-asset.d.ts +7 -0
- package/dist/get-duration-of-asset.js +36 -0
- package/dist/get-extension-from-codec.d.ts +2 -2
- package/dist/get-extension-from-codec.d.ts.map +1 -0
- package/dist/get-extension-from-codec.js.map +1 -0
- package/dist/get-format-for-codec.d.ts +2 -0
- package/dist/get-format-for-codec.js +34 -0
- package/dist/get-frame-to-render.d.ts +1 -1
- package/dist/get-frame-to-render.d.ts.map +1 -0
- package/dist/get-frame-to-render.js.map +1 -0
- package/dist/get-local-browser-executable.d.ts +1 -1
- package/dist/get-local-browser-executable.d.ts.map +1 -0
- package/dist/get-local-browser-executable.js +7 -5
- package/dist/get-local-browser-executable.js.map +1 -0
- package/dist/get-port.d.ts.map +1 -0
- package/dist/get-port.js +30 -37
- package/dist/get-port.js.map +1 -0
- package/dist/get-prores-profile-name.d.ts +1 -1
- package/dist/get-prores-profile-name.d.ts.map +1 -0
- package/dist/get-prores-profile-name.js.map +1 -0
- package/dist/get-video-info.d.ts +8 -0
- package/dist/get-video-info.js +50 -0
- package/dist/guess-extension-for-media.d.ts +1 -0
- package/dist/guess-extension-for-media.js +27 -0
- package/dist/image-format.d.ts +1 -1
- package/dist/image-format.d.ts.map +1 -0
- package/dist/image-format.js.map +1 -0
- package/dist/index.d.ts +41 -8
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -0
- package/dist/is-beyond-last-frame.d.ts +2 -0
- package/dist/is-beyond-last-frame.js +12 -0
- package/dist/is-serve-url.d.ts.map +1 -0
- package/dist/is-serve-url.js.map +1 -0
- package/dist/is-vp9-video.d.ts +3 -0
- package/dist/is-vp9-video.js +24 -0
- package/dist/last-frame-from-video-cache.d.ts +15 -0
- package/dist/last-frame-from-video-cache.js +55 -0
- package/dist/legacy-webpack-config.d.ts.map +1 -0
- package/dist/legacy-webpack-config.js.map +1 -0
- package/dist/make-assets-download-dir.d.ts.map +1 -0
- package/dist/make-assets-download-dir.js +6 -1
- package/dist/make-assets-download-dir.js.map +1 -0
- package/dist/make-cancel-signal.d.ts +7 -0
- package/dist/make-cancel-signal.js +25 -0
- package/dist/merge-audio-track.d.ts +1 -1
- package/dist/merge-audio-track.d.ts.map +1 -0
- package/dist/merge-audio-track.js +2 -2
- package/dist/merge-audio-track.js.map +1 -0
- package/dist/mime-db.d.ts +6 -0
- package/dist/mime-db.js +8636 -0
- package/dist/mime-types.d.ts +2 -0
- package/dist/mime-types.js +89 -0
- package/dist/normalize-serve-url.d.ts.map +1 -0
- package/dist/normalize-serve-url.js.map +1 -0
- package/dist/offthread-video-server.d.ts +6 -4
- package/dist/offthread-video-server.js +20 -10
- package/dist/open-browser.d.ts +9 -7
- package/dist/open-browser.d.ts.map +1 -0
- package/dist/open-browser.js +11 -11
- package/dist/open-browser.js.map +1 -0
- package/dist/p-limit.d.ts.map +1 -0
- package/dist/p-limit.js.map +1 -0
- package/dist/parse-browser-error-stack.d.ts.map +1 -0
- package/dist/parse-browser-error-stack.js.map +1 -0
- package/dist/parse-ffmpeg-progress.d.ts.map +1 -0
- package/dist/parse-ffmpeg-progress.js.map +1 -0
- package/dist/pool.d.ts.map +1 -0
- package/dist/pool.js.map +1 -0
- package/dist/prepare-server.d.ts +4 -3
- package/dist/prepare-server.d.ts.map +1 -0
- package/dist/prepare-server.js +19 -3
- package/dist/prepare-server.js.map +1 -0
- package/dist/preprocess-audio-track.d.ts +3 -2
- package/dist/preprocess-audio-track.d.ts.map +1 -0
- package/dist/preprocess-audio-track.js +2 -2
- package/dist/preprocess-audio-track.js.map +1 -0
- package/dist/prespawn-ffmpeg.d.ts +3 -1
- package/dist/prespawn-ffmpeg.d.ts.map +1 -0
- package/dist/prespawn-ffmpeg.js +3 -0
- package/dist/prespawn-ffmpeg.js.map +1 -0
- package/dist/provide-screenshot.d.ts +4 -4
- package/dist/provide-screenshot.d.ts.map +1 -0
- package/dist/provide-screenshot.js +1 -2
- package/dist/provide-screenshot.js.map +1 -0
- package/dist/puppeteer-evaluate.d.ts +1 -1
- package/dist/puppeteer-evaluate.d.ts.map +1 -0
- package/dist/puppeteer-evaluate.js +3 -4
- package/dist/puppeteer-evaluate.js.map +1 -0
- package/dist/puppeteer-screenshot.d.ts +3 -2
- package/dist/puppeteer-screenshot.d.ts.map +1 -0
- package/dist/puppeteer-screenshot.js +7 -5
- package/dist/puppeteer-screenshot.js.map +1 -0
- package/dist/render-frames.d.ts +11 -8
- package/dist/render-frames.d.ts.map +1 -0
- package/dist/render-frames.js +99 -55
- package/dist/render-frames.js.map +1 -0
- package/dist/render-media.d.ts +18 -9
- package/dist/render-media.d.ts.map +1 -0
- package/dist/render-media.js +131 -56
- package/dist/render-media.js.map +1 -0
- package/dist/render-still.d.ts +12 -7
- package/dist/render-still.d.ts.map +1 -0
- package/dist/render-still.js +34 -14
- package/dist/render-still.js.map +1 -0
- package/dist/resolve-asset-src.d.ts.map +1 -0
- package/dist/resolve-asset-src.js.map +1 -0
- package/dist/sample-rate.d.ts.map +1 -0
- package/dist/sample-rate.js.map +1 -0
- package/dist/screenshot-dom-element.d.ts +6 -7
- package/dist/screenshot-dom-element.d.ts.map +1 -0
- package/dist/screenshot-dom-element.js +3 -6
- package/dist/screenshot-dom-element.js.map +1 -0
- package/dist/screenshot-task.d.ts +3 -2
- package/dist/screenshot-task.d.ts.map +1 -0
- package/dist/screenshot-task.js +3 -5
- package/dist/screenshot-task.js.map +1 -0
- package/dist/seek-to-frame.d.ts +2 -2
- package/dist/seek-to-frame.d.ts.map +1 -0
- package/dist/seek-to-frame.js +2 -2
- package/dist/seek-to-frame.js.map +1 -0
- package/dist/serve-handler/glob-slash.d.ts +1 -0
- package/dist/serve-handler/glob-slash.js +12 -0
- package/dist/serve-handler/index.d.ts +4 -0
- package/dist/serve-handler/index.js +204 -0
- package/dist/serve-handler/is-path-inside.d.ts +1 -0
- package/dist/serve-handler/is-path-inside.js +27 -0
- package/dist/serve-handler/range-parser.d.ts +13 -0
- package/dist/serve-handler/range-parser.js +57 -0
- package/dist/serve-static.d.ts +3 -2
- package/dist/serve-static.d.ts.map +1 -0
- package/dist/serve-static.js +6 -4
- package/dist/serve-static.js.map +1 -0
- package/dist/set-props-and-env.d.ts +3 -2
- package/dist/set-props-and-env.d.ts.map +1 -0
- package/dist/set-props-and-env.js +26 -2
- package/dist/set-props-and-env.js.map +1 -0
- package/dist/stitch-frames-to-video.d.ts +9 -5
- package/dist/stitch-frames-to-video.d.ts.map +1 -0
- package/dist/stitch-frames-to-video.js +56 -18
- package/dist/stitch-frames-to-video.js.map +1 -0
- package/dist/stringify-ffmpeg-filter.d.ts +2 -2
- package/dist/stringify-ffmpeg-filter.d.ts.map +1 -0
- package/dist/stringify-ffmpeg-filter.js +9 -7
- package/dist/stringify-ffmpeg-filter.js.map +1 -0
- package/dist/symbolicate-stacktrace.d.ts +1 -1
- package/dist/symbolicate-stacktrace.d.ts.map +1 -0
- package/dist/symbolicate-stacktrace.js.map +1 -0
- package/dist/tmp-dir.d.ts.map +1 -0
- package/dist/tmp-dir.js +5 -1
- package/dist/tmp-dir.js.map +1 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js.map +1 -0
- package/dist/validate-even-dimensions-with-codec.d.ts +1 -1
- package/dist/validate-even-dimensions-with-codec.d.ts.map +1 -0
- package/dist/validate-even-dimensions-with-codec.js.map +1 -0
- package/dist/validate-ffmpeg.d.ts.map +1 -0
- package/dist/validate-ffmpeg.js.map +1 -0
- package/dist/validate-fps-for-gif.d.ts +2 -0
- package/dist/validate-fps-for-gif.js +9 -0
- package/dist/validate-output-filename.d.ts +1 -1
- package/dist/validate-puppeteer-timeout.d.ts.map +1 -0
- package/dist/validate-puppeteer-timeout.js.map +1 -0
- package/dist/validate-scale.d.ts.map +1 -0
- package/dist/validate-scale.js.map +1 -0
- package/dist/wait-for-symbolication-error-to-be-done.d.ts +3 -0
- package/dist/wait-for-symbolication-error-to-be-done.js +34 -0
- package/dist/ws/ws-types.d.ts +14 -0
- package/dist/ws/ws-types.js +10 -0
- package/package.json +9 -9
- package/tsconfig.json +0 -1
- package/types/ws/index.d.ts +509 -0
- package/dist/offthread/index.d.ts +0 -0
- package/dist/offthread/index.js +0 -1
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _Connection_instances, _Connection_transport, _Connection_lastId, _Connection_sessions, _Connection_closed, _Connection_callbacks, _Connection_onMessage, _Connection_onClose, _CDPSession_sessionId, _CDPSession_targetType, _CDPSession_callbacks, _CDPSession_connection;
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CDPSession = exports.CDPSessionEmittedEvents = exports.Connection = void 0;
|
|
16
|
+
/**
|
|
17
|
+
* Copyright 2017 Google Inc. All rights reserved.
|
|
18
|
+
*
|
|
19
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
20
|
+
* you may not use this file except in compliance with the License.
|
|
21
|
+
* You may obtain a copy of the License at
|
|
22
|
+
*
|
|
23
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
+
*
|
|
25
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
26
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
27
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
28
|
+
* See the License for the specific language governing permissions and
|
|
29
|
+
* limitations under the License.
|
|
30
|
+
*/
|
|
31
|
+
const assert_1 = require("./assert");
|
|
32
|
+
const Errors_1 = require("./Errors");
|
|
33
|
+
const EventEmitter_1 = require("./EventEmitter");
|
|
34
|
+
const ConnectionEmittedEvents = {
|
|
35
|
+
Disconnected: Symbol('Connection.Disconnected'),
|
|
36
|
+
};
|
|
37
|
+
class Connection extends EventEmitter_1.EventEmitter {
|
|
38
|
+
constructor(transport) {
|
|
39
|
+
super();
|
|
40
|
+
_Connection_instances.add(this);
|
|
41
|
+
_Connection_transport.set(this, void 0);
|
|
42
|
+
_Connection_lastId.set(this, 0);
|
|
43
|
+
_Connection_sessions.set(this, new Map());
|
|
44
|
+
_Connection_closed.set(this, false);
|
|
45
|
+
_Connection_callbacks.set(this, new Map());
|
|
46
|
+
__classPrivateFieldSet(this, _Connection_transport, transport, "f");
|
|
47
|
+
__classPrivateFieldGet(this, _Connection_transport, "f").onmessage = __classPrivateFieldGet(this, _Connection_instances, "m", _Connection_onMessage).bind(this);
|
|
48
|
+
__classPrivateFieldGet(this, _Connection_transport, "f").onclose = __classPrivateFieldGet(this, _Connection_instances, "m", _Connection_onClose).bind(this);
|
|
49
|
+
}
|
|
50
|
+
static fromSession(session) {
|
|
51
|
+
return session.connection();
|
|
52
|
+
}
|
|
53
|
+
session(sessionId) {
|
|
54
|
+
return __classPrivateFieldGet(this, _Connection_sessions, "f").get(sessionId) || null;
|
|
55
|
+
}
|
|
56
|
+
send(method, ...paramArgs) {
|
|
57
|
+
// There is only ever 1 param arg passed, but the Protocol defines it as an
|
|
58
|
+
// array of 0 or 1 items See this comment:
|
|
59
|
+
// https://github.com/ChromeDevTools/devtools-protocol/pull/113#issuecomment-412603285
|
|
60
|
+
// which explains why the protocol defines the params this way for better
|
|
61
|
+
// type-inference.
|
|
62
|
+
// So now we check if there are any params or not and deal with them accordingly.
|
|
63
|
+
const params = paramArgs.length ? paramArgs[0] : undefined;
|
|
64
|
+
const id = this._rawSend({ method, params });
|
|
65
|
+
return new Promise((resolve, reject) => {
|
|
66
|
+
__classPrivateFieldGet(this, _Connection_callbacks, "f").set(id, {
|
|
67
|
+
resolve,
|
|
68
|
+
reject,
|
|
69
|
+
error: new Errors_1.ProtocolError(),
|
|
70
|
+
method,
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
_rawSend(message) {
|
|
75
|
+
var _a;
|
|
76
|
+
const id = __classPrivateFieldSet(this, _Connection_lastId, (_a = __classPrivateFieldGet(this, _Connection_lastId, "f"), ++_a), "f");
|
|
77
|
+
const stringifiedMessage = JSON.stringify({ ...message, id });
|
|
78
|
+
__classPrivateFieldGet(this, _Connection_transport, "f").send(stringifiedMessage);
|
|
79
|
+
return id;
|
|
80
|
+
}
|
|
81
|
+
dispose() {
|
|
82
|
+
__classPrivateFieldGet(this, _Connection_instances, "m", _Connection_onClose).call(this);
|
|
83
|
+
__classPrivateFieldGet(this, _Connection_transport, "f").close();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @param targetInfo - The target info
|
|
87
|
+
* @returns The CDP session that is created
|
|
88
|
+
*/
|
|
89
|
+
async createSession(targetInfo) {
|
|
90
|
+
const { sessionId } = await this.send('Target.attachToTarget', {
|
|
91
|
+
targetId: targetInfo.targetId,
|
|
92
|
+
flatten: true,
|
|
93
|
+
});
|
|
94
|
+
const session = __classPrivateFieldGet(this, _Connection_sessions, "f").get(sessionId);
|
|
95
|
+
if (!session) {
|
|
96
|
+
throw new Error('CDPSession creation failed.');
|
|
97
|
+
}
|
|
98
|
+
return session;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.Connection = Connection;
|
|
102
|
+
_Connection_transport = new WeakMap(), _Connection_lastId = new WeakMap(), _Connection_sessions = new WeakMap(), _Connection_closed = new WeakMap(), _Connection_callbacks = new WeakMap(), _Connection_instances = new WeakSet(), _Connection_onMessage = function _Connection_onMessage(message) {
|
|
103
|
+
const object = JSON.parse(message);
|
|
104
|
+
if (object.method === 'Target.attachedToTarget') {
|
|
105
|
+
const { sessionId } = object.params;
|
|
106
|
+
const session = new CDPSession(this, object.params.targetInfo.type, sessionId);
|
|
107
|
+
__classPrivateFieldGet(this, _Connection_sessions, "f").set(sessionId, session);
|
|
108
|
+
this.emit('sessionattached', session);
|
|
109
|
+
const parentSession = __classPrivateFieldGet(this, _Connection_sessions, "f").get(object.sessionId);
|
|
110
|
+
if (parentSession) {
|
|
111
|
+
parentSession.emit('sessionattached', session);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
else if (object.method === 'Target.detachedFromTarget') {
|
|
115
|
+
const session = __classPrivateFieldGet(this, _Connection_sessions, "f").get(object.params.sessionId);
|
|
116
|
+
if (session) {
|
|
117
|
+
session._onClosed();
|
|
118
|
+
__classPrivateFieldGet(this, _Connection_sessions, "f").delete(object.params.sessionId);
|
|
119
|
+
this.emit('sessiondetached', session);
|
|
120
|
+
const parentSession = __classPrivateFieldGet(this, _Connection_sessions, "f").get(object.sessionId);
|
|
121
|
+
if (parentSession) {
|
|
122
|
+
parentSession.emit('sessiondetached', session);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (object.sessionId) {
|
|
127
|
+
const session = __classPrivateFieldGet(this, _Connection_sessions, "f").get(object.sessionId);
|
|
128
|
+
if (session) {
|
|
129
|
+
session._onMessage(object);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else if (object.id) {
|
|
133
|
+
const callback = __classPrivateFieldGet(this, _Connection_callbacks, "f").get(object.id);
|
|
134
|
+
// Callbacks could be all rejected if someone has called `.dispose()`.
|
|
135
|
+
if (callback) {
|
|
136
|
+
__classPrivateFieldGet(this, _Connection_callbacks, "f").delete(object.id);
|
|
137
|
+
if (object.error) {
|
|
138
|
+
callback.reject(createProtocolError(callback.error, callback.method, object));
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
callback.resolve(object.result);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
this.emit(object.method, object.params);
|
|
147
|
+
}
|
|
148
|
+
}, _Connection_onClose = function _Connection_onClose() {
|
|
149
|
+
if (__classPrivateFieldGet(this, _Connection_closed, "f")) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
__classPrivateFieldGet(this, _Connection_transport, "f").onmessage = undefined;
|
|
153
|
+
__classPrivateFieldGet(this, _Connection_transport, "f").onclose = undefined;
|
|
154
|
+
for (const callback of __classPrivateFieldGet(this, _Connection_callbacks, "f").values()) {
|
|
155
|
+
callback.reject(rewriteError(callback.error, `Protocol error (${callback.method}): Target closed. https://www.remotion.dev/docs/target-closed`));
|
|
156
|
+
}
|
|
157
|
+
__classPrivateFieldGet(this, _Connection_callbacks, "f").clear();
|
|
158
|
+
for (const session of __classPrivateFieldGet(this, _Connection_sessions, "f").values()) {
|
|
159
|
+
session._onClosed();
|
|
160
|
+
}
|
|
161
|
+
__classPrivateFieldGet(this, _Connection_sessions, "f").clear();
|
|
162
|
+
this.emit(ConnectionEmittedEvents.Disconnected);
|
|
163
|
+
};
|
|
164
|
+
exports.CDPSessionEmittedEvents = {
|
|
165
|
+
Disconnected: Symbol('CDPSession.Disconnected'),
|
|
166
|
+
};
|
|
167
|
+
class CDPSession extends EventEmitter_1.EventEmitter {
|
|
168
|
+
constructor(connection, targetType, sessionId) {
|
|
169
|
+
super();
|
|
170
|
+
_CDPSession_sessionId.set(this, void 0);
|
|
171
|
+
_CDPSession_targetType.set(this, void 0);
|
|
172
|
+
_CDPSession_callbacks.set(this, new Map());
|
|
173
|
+
_CDPSession_connection.set(this, void 0);
|
|
174
|
+
__classPrivateFieldSet(this, _CDPSession_connection, connection, "f");
|
|
175
|
+
__classPrivateFieldSet(this, _CDPSession_targetType, targetType, "f");
|
|
176
|
+
__classPrivateFieldSet(this, _CDPSession_sessionId, sessionId, "f");
|
|
177
|
+
}
|
|
178
|
+
connection() {
|
|
179
|
+
return __classPrivateFieldGet(this, _CDPSession_connection, "f");
|
|
180
|
+
}
|
|
181
|
+
send(method, ...paramArgs) {
|
|
182
|
+
if (!__classPrivateFieldGet(this, _CDPSession_connection, "f")) {
|
|
183
|
+
return Promise.reject(new Error(`Protocol error (${method}): Session closed. Most likely the ${__classPrivateFieldGet(this, _CDPSession_targetType, "f")} has been closed.`));
|
|
184
|
+
}
|
|
185
|
+
// See the comment in Connection#send explaining why we do this.
|
|
186
|
+
const params = paramArgs.length ? paramArgs[0] : undefined;
|
|
187
|
+
const id = __classPrivateFieldGet(this, _CDPSession_connection, "f")._rawSend({
|
|
188
|
+
sessionId: __classPrivateFieldGet(this, _CDPSession_sessionId, "f"),
|
|
189
|
+
method,
|
|
190
|
+
params,
|
|
191
|
+
});
|
|
192
|
+
return new Promise((resolve, reject) => {
|
|
193
|
+
__classPrivateFieldGet(this, _CDPSession_callbacks, "f").set(id, {
|
|
194
|
+
resolve,
|
|
195
|
+
reject,
|
|
196
|
+
error: new Errors_1.ProtocolError(),
|
|
197
|
+
method,
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
_onMessage(object) {
|
|
202
|
+
const callback = object.id ? __classPrivateFieldGet(this, _CDPSession_callbacks, "f").get(object.id) : undefined;
|
|
203
|
+
if (object.id && callback) {
|
|
204
|
+
__classPrivateFieldGet(this, _CDPSession_callbacks, "f").delete(object.id);
|
|
205
|
+
if (object.error) {
|
|
206
|
+
callback.reject(createProtocolError(callback.error, callback.method, object));
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
callback.resolve(object.result);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
(0, assert_1.assert)(!object.id);
|
|
214
|
+
this.emit(object.method, object.params);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
_onClosed() {
|
|
218
|
+
for (const callback of __classPrivateFieldGet(this, _CDPSession_callbacks, "f").values()) {
|
|
219
|
+
callback.reject(rewriteError(callback.error, `Protocol error (${callback.method}): Target closed. https://www.remotion.dev/docs/target-closed`));
|
|
220
|
+
}
|
|
221
|
+
__classPrivateFieldGet(this, _CDPSession_callbacks, "f").clear();
|
|
222
|
+
__classPrivateFieldSet(this, _CDPSession_connection, undefined, "f");
|
|
223
|
+
this.emit(exports.CDPSessionEmittedEvents.Disconnected);
|
|
224
|
+
}
|
|
225
|
+
id() {
|
|
226
|
+
return __classPrivateFieldGet(this, _CDPSession_sessionId, "f");
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
exports.CDPSession = CDPSession;
|
|
230
|
+
_CDPSession_sessionId = new WeakMap(), _CDPSession_targetType = new WeakMap(), _CDPSession_callbacks = new WeakMap(), _CDPSession_connection = new WeakMap();
|
|
231
|
+
function createProtocolError(error, method, object) {
|
|
232
|
+
let message = `Protocol error (${method}): ${object.error.message}`;
|
|
233
|
+
if ('data' in object.error) {
|
|
234
|
+
message += ` ${object.error.data}`;
|
|
235
|
+
}
|
|
236
|
+
return rewriteError(error, message, object.error.message);
|
|
237
|
+
}
|
|
238
|
+
function rewriteError(error, message, originalMessage) {
|
|
239
|
+
error.message = message;
|
|
240
|
+
error.originalMessage = originalMessage !== null && originalMessage !== void 0 ? originalMessage : error.originalMessage;
|
|
241
|
+
return error;
|
|
242
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2020 Google Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export interface ConnectionTransport {
|
|
17
|
+
send(message: string): void;
|
|
18
|
+
close(): void;
|
|
19
|
+
onmessage?: (message: string) => void;
|
|
20
|
+
onclose?: () => void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2020 Google Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2020 Google Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { JSHandle } from './JSHandle';
|
|
17
|
+
export interface ConsoleMessageLocation {
|
|
18
|
+
url?: string;
|
|
19
|
+
lineNumber?: number;
|
|
20
|
+
columnNumber?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare type ConsoleMessageType = 'log' | 'debug' | 'info' | 'error' | 'warning' | 'dir' | 'dirxml' | 'table' | 'trace' | 'clear' | 'startGroup' | 'startGroupCollapsed' | 'endGroup' | 'assert' | 'profile' | 'profileEnd' | 'count' | 'timeEnd' | 'verbose';
|
|
23
|
+
export declare class ConsoleMessage {
|
|
24
|
+
#private;
|
|
25
|
+
type: ConsoleMessageType;
|
|
26
|
+
text: string;
|
|
27
|
+
args: JSHandle[];
|
|
28
|
+
constructor(type: ConsoleMessageType, text: string, args: JSHandle[], stackTraceLocations: ConsoleMessageLocation[]);
|
|
29
|
+
location(): ConsoleMessageLocation;
|
|
30
|
+
stackTrace(): ConsoleMessageLocation[];
|
|
31
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2020 Google Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
18
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
19
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
20
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
21
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
22
|
+
};
|
|
23
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
24
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
25
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
26
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
27
|
+
};
|
|
28
|
+
var _ConsoleMessage_stackTraceLocations;
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.ConsoleMessage = void 0;
|
|
31
|
+
class ConsoleMessage {
|
|
32
|
+
constructor(type, text, args, stackTraceLocations) {
|
|
33
|
+
_ConsoleMessage_stackTraceLocations.set(this, void 0);
|
|
34
|
+
this.type = type;
|
|
35
|
+
this.text = text;
|
|
36
|
+
this.args = args;
|
|
37
|
+
__classPrivateFieldSet(this, _ConsoleMessage_stackTraceLocations, stackTraceLocations, "f");
|
|
38
|
+
}
|
|
39
|
+
location() {
|
|
40
|
+
var _a;
|
|
41
|
+
return (_a = __classPrivateFieldGet(this, _ConsoleMessage_stackTraceLocations, "f")[0]) !== null && _a !== void 0 ? _a : {};
|
|
42
|
+
}
|
|
43
|
+
stackTrace() {
|
|
44
|
+
return __classPrivateFieldGet(this, _ConsoleMessage_stackTraceLocations, "f");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.ConsoleMessage = ConsoleMessage;
|
|
48
|
+
_ConsoleMessage_stackTraceLocations = new WeakMap();
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2017 Google Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Protocol } from 'devtools-protocol';
|
|
17
|
+
import { CDPSession } from './Connection';
|
|
18
|
+
import { PuppeteerEventListener } from './util';
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export { PuppeteerEventListener };
|
|
23
|
+
/**
|
|
24
|
+
* The CoverageEntry class represents one entry of the coverage report.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export interface CoverageEntry {
|
|
28
|
+
/**
|
|
29
|
+
* The URL of the style sheet or script.
|
|
30
|
+
*/
|
|
31
|
+
url: string;
|
|
32
|
+
/**
|
|
33
|
+
* The content of the style sheet or script.
|
|
34
|
+
*/
|
|
35
|
+
text: string;
|
|
36
|
+
/**
|
|
37
|
+
* The covered range as start and end positions.
|
|
38
|
+
*/
|
|
39
|
+
ranges: Array<{
|
|
40
|
+
start: number;
|
|
41
|
+
end: number;
|
|
42
|
+
}>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The CoverageEntry class for JavaScript
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
48
|
+
export interface JSCoverageEntry extends CoverageEntry {
|
|
49
|
+
/**
|
|
50
|
+
* Raw V8 script coverage entry.
|
|
51
|
+
*/
|
|
52
|
+
rawScriptCoverage?: Protocol.Profiler.ScriptCoverage;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Set of configurable options for JS coverage.
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
export interface JSCoverageOptions {
|
|
59
|
+
/**
|
|
60
|
+
* Whether to reset coverage on every navigation.
|
|
61
|
+
*/
|
|
62
|
+
resetOnNavigation?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Whether anonymous scripts generated by the page should be reported.
|
|
65
|
+
*/
|
|
66
|
+
reportAnonymousScripts?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Whether the result includes raw V8 script coverage entries.
|
|
69
|
+
*/
|
|
70
|
+
includeRawScriptCoverage?: boolean;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Set of configurable options for CSS coverage.
|
|
74
|
+
* @public
|
|
75
|
+
*/
|
|
76
|
+
export interface CSSCoverageOptions {
|
|
77
|
+
/**
|
|
78
|
+
* Whether to reset coverage on every navigation.
|
|
79
|
+
*/
|
|
80
|
+
resetOnNavigation?: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The Coverage class provides methods to gathers information about parts of
|
|
84
|
+
* JavaScript and CSS that were used by the page.
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* To output coverage in a form consumable by {@link https://github.com/istanbuljs | Istanbul},
|
|
88
|
+
* see {@link https://github.com/istanbuljs/puppeteer-to-istanbul | puppeteer-to-istanbul}.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* An example of using JavaScript and CSS coverage to get percentage of initially
|
|
92
|
+
* executed code:
|
|
93
|
+
* ```js
|
|
94
|
+
* // Enable both JavaScript and CSS coverage
|
|
95
|
+
* await Promise.all([
|
|
96
|
+
* page.coverage.startJSCoverage(),
|
|
97
|
+
* page.coverage.startCSSCoverage()
|
|
98
|
+
* ]);
|
|
99
|
+
* // Navigate to page
|
|
100
|
+
* await page.goto('https://example.com');
|
|
101
|
+
* // Disable both JavaScript and CSS coverage
|
|
102
|
+
* const [jsCoverage, cssCoverage] = await Promise.all([
|
|
103
|
+
* page.coverage.stopJSCoverage(),
|
|
104
|
+
* page.coverage.stopCSSCoverage(),
|
|
105
|
+
* ]);
|
|
106
|
+
* let totalBytes = 0;
|
|
107
|
+
* let usedBytes = 0;
|
|
108
|
+
* const coverage = [...jsCoverage, ...cssCoverage];
|
|
109
|
+
* for (const entry of coverage) {
|
|
110
|
+
* totalBytes += entry.text.length;
|
|
111
|
+
* for (const range of entry.ranges)
|
|
112
|
+
* usedBytes += range.end - range.start - 1;
|
|
113
|
+
* }
|
|
114
|
+
* console.log(`Bytes used: ${usedBytes / totalBytes * 100}%`);
|
|
115
|
+
* ```
|
|
116
|
+
* @public
|
|
117
|
+
*/
|
|
118
|
+
export declare class Coverage {
|
|
119
|
+
#private;
|
|
120
|
+
constructor(client: CDPSession);
|
|
121
|
+
/**
|
|
122
|
+
* @param options - Set of configurable options for coverage defaults to
|
|
123
|
+
* `resetOnNavigation : true, reportAnonymousScripts : false`
|
|
124
|
+
* @returns Promise that resolves when coverage is started.
|
|
125
|
+
*
|
|
126
|
+
* @remarks
|
|
127
|
+
* Anonymous scripts are ones that don't have an associated url. These are
|
|
128
|
+
* scripts that are dynamically created on the page using `eval` or
|
|
129
|
+
* `new Function`. If `reportAnonymousScripts` is set to `true`, anonymous
|
|
130
|
+
* scripts will have `pptr://__puppeteer_evaluation_script__` as their URL.
|
|
131
|
+
*/
|
|
132
|
+
startJSCoverage(options?: JSCoverageOptions): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* @returns Promise that resolves to the array of coverage reports for
|
|
135
|
+
* all scripts.
|
|
136
|
+
*
|
|
137
|
+
* @remarks
|
|
138
|
+
* JavaScript Coverage doesn't include anonymous scripts by default.
|
|
139
|
+
* However, scripts with sourceURLs are reported.
|
|
140
|
+
*/
|
|
141
|
+
stopJSCoverage(): Promise<JSCoverageEntry[]>;
|
|
142
|
+
/**
|
|
143
|
+
* @param options - Set of configurable options for coverage, defaults to
|
|
144
|
+
* `resetOnNavigation : true`
|
|
145
|
+
* @returns Promise that resolves when coverage is started.
|
|
146
|
+
*/
|
|
147
|
+
startCSSCoverage(options?: CSSCoverageOptions): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* @returns Promise that resolves to the array of coverage reports
|
|
150
|
+
* for all stylesheets.
|
|
151
|
+
* @remarks
|
|
152
|
+
* CSS Coverage doesn't include dynamically injected style tags
|
|
153
|
+
* without sourceURLs.
|
|
154
|
+
*/
|
|
155
|
+
stopCSSCoverage(): Promise<CoverageEntry[]>;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* @public
|
|
159
|
+
*/
|
|
160
|
+
export declare class JSCoverage {
|
|
161
|
+
#private;
|
|
162
|
+
constructor(client: CDPSession);
|
|
163
|
+
start(options?: {
|
|
164
|
+
resetOnNavigation?: boolean;
|
|
165
|
+
reportAnonymousScripts?: boolean;
|
|
166
|
+
includeRawScriptCoverage?: boolean;
|
|
167
|
+
}): Promise<void>;
|
|
168
|
+
stop(): Promise<JSCoverageEntry[]>;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
173
|
+
export declare class CSSCoverage {
|
|
174
|
+
#private;
|
|
175
|
+
constructor(client: CDPSession);
|
|
176
|
+
start(options?: {
|
|
177
|
+
resetOnNavigation?: boolean;
|
|
178
|
+
}): Promise<void>;
|
|
179
|
+
stop(): Promise<CoverageEntry[]>;
|
|
180
|
+
}
|