@remotion/renderer 4.0.0-webhook.26 → 4.1.0-alpha1
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/LICENSE.md +8 -8
- package/README.md +9 -0
- package/client.d.ts +1 -0
- package/client.js +1 -0
- package/dist/assets/calculate-asset-positions.d.ts +0 -0
- package/dist/assets/calculate-asset-positions.js +1 -0
- package/dist/assets/calculate-atempo.d.ts +0 -0
- package/dist/assets/calculate-atempo.js +0 -0
- package/dist/assets/convert-assets-to-file-urls.d.ts +0 -0
- package/dist/assets/convert-assets-to-file-urls.js +0 -0
- package/dist/assets/download-and-map-assets-to-file.d.ts +6 -4
- package/dist/assets/download-and-map-assets-to-file.js +49 -19
- package/dist/assets/download-file.d.ts +8 -5
- package/dist/assets/download-file.js +71 -8
- package/dist/assets/download-map.d.ts +8 -29
- package/dist/assets/download-map.js +15 -16
- package/dist/assets/ffmpeg-volume-expression.d.ts +4 -3
- package/dist/assets/ffmpeg-volume-expression.js +5 -3
- package/dist/assets/flatten-volume-array.d.ts +0 -0
- package/dist/assets/flatten-volume-array.js +0 -0
- package/dist/assets/get-audio-channels.d.ts +2 -2
- package/dist/assets/get-audio-channels.js +14 -12
- package/dist/assets/read-file.d.ts +1 -1
- package/dist/assets/read-file.js +5 -7
- package/dist/assets/round-volume-to-avoid-stack-overflow.d.ts +0 -0
- package/dist/assets/round-volume-to-avoid-stack-overflow.js +0 -0
- package/dist/assets/sanitize-filename.d.ts +0 -0
- package/dist/assets/sanitize-filename.js +0 -0
- package/dist/assets/sanitize-filepath.d.ts +0 -0
- package/dist/assets/sanitize-filepath.js +2 -2
- package/dist/assets/truncate-utf8-bytes.d.ts +0 -0
- package/dist/assets/truncate-utf8-bytes.js +0 -0
- package/dist/assets/types.d.ts +5 -4
- package/dist/assets/types.js +0 -0
- package/dist/audio-codec.d.ts +28 -0
- package/dist/audio-codec.js +83 -0
- package/dist/browser/Browser.d.ts +16 -14
- package/dist/browser/Browser.js +69 -72
- package/dist/browser/BrowserConnector.d.ts +0 -0
- package/dist/browser/BrowserConnector.js +0 -0
- package/dist/browser/BrowserFetcher.d.ts +16 -64
- package/dist/browser/BrowserFetcher.js +147 -235
- package/dist/browser/BrowserPage.d.ts +21 -6
- package/dist/browser/BrowserPage.js +54 -22
- package/dist/browser/BrowserRunner.d.ts +1 -1
- package/dist/browser/BrowserRunner.js +32 -22
- package/dist/browser/Connection.d.ts +0 -0
- package/dist/browser/Connection.js +1 -1
- package/dist/browser/ConsoleMessage.d.ts +1 -1
- package/dist/browser/ConsoleMessage.js +0 -0
- package/dist/browser/DOMWorld.d.ts +5 -4
- package/dist/browser/DOMWorld.js +16 -9
- package/dist/browser/Errors.d.ts +0 -0
- package/dist/browser/Errors.js +0 -0
- package/dist/browser/EvalTypes.d.ts +7 -7
- package/dist/browser/EvalTypes.js +0 -0
- package/dist/browser/EventEmitter.d.ts +0 -0
- package/dist/browser/EventEmitter.js +0 -0
- package/dist/browser/ExecutionContext.d.ts +0 -0
- package/dist/browser/ExecutionContext.js +0 -0
- package/dist/browser/FrameManager.d.ts +0 -2
- package/dist/browser/FrameManager.js +13 -17
- package/dist/browser/HTTPRequest.d.ts +0 -0
- package/dist/browser/HTTPRequest.js +0 -0
- package/dist/browser/HTTPResponse.d.ts +0 -0
- package/dist/browser/HTTPResponse.js +0 -0
- package/dist/browser/JSHandle.d.ts +0 -0
- package/dist/browser/JSHandle.js +14 -14
- package/dist/browser/LaunchOptions.d.ts +2 -2
- package/dist/browser/LaunchOptions.js +0 -0
- package/dist/browser/Launcher.d.ts +9 -3
- package/dist/browser/Launcher.js +16 -29
- package/dist/browser/LifecycleWatcher.d.ts +1 -1
- package/dist/browser/LifecycleWatcher.js +0 -0
- package/dist/browser/NetworkEventManager.d.ts +4 -4
- package/dist/browser/NetworkEventManager.js +0 -0
- package/dist/browser/NetworkManager.d.ts +0 -0
- package/dist/browser/NetworkManager.js +0 -0
- package/dist/browser/NodeWebSocketTransport.d.ts +0 -0
- package/dist/browser/NodeWebSocketTransport.js +21 -21
- package/dist/browser/Product.d.ts +1 -1
- package/dist/browser/Product.js +0 -0
- package/dist/browser/PuppeteerNode.d.ts +2 -5
- package/dist/browser/PuppeteerNode.js +2 -11
- package/dist/browser/PuppeteerViewport.d.ts +0 -0
- package/dist/browser/PuppeteerViewport.js +0 -0
- package/dist/browser/ScreenshotOptions.d.ts +0 -14
- package/dist/browser/ScreenshotOptions.js +0 -1
- package/dist/browser/Target.d.ts +4 -3
- package/dist/browser/Target.js +8 -2
- package/dist/browser/TaskQueue.d.ts +0 -0
- package/dist/browser/TaskQueue.js +0 -0
- package/dist/browser/TimeoutSettings.d.ts +0 -0
- package/dist/browser/TimeoutSettings.js +0 -0
- package/dist/browser/assert.d.ts +0 -0
- package/dist/browser/assert.js +0 -0
- package/dist/browser/create-browser-fetcher.d.ts +0 -0
- package/dist/browser/create-browser-fetcher.js +34 -48
- package/dist/browser/devtools-commands.d.ts +5 -1
- package/dist/browser/devtools-commands.js +0 -0
- package/dist/browser/devtools-types.d.ts +92 -10
- package/dist/browser/devtools-types.js +0 -0
- package/dist/browser/get-download-destination.d.ts +0 -0
- package/dist/browser/get-download-destination.js +8 -8
- package/dist/browser/is-target-closed-err.d.ts +1 -0
- package/dist/browser/is-target-closed-err.js +9 -0
- package/dist/browser/mitt/index.d.ts +6 -6
- package/dist/browser/mitt/index.js +0 -0
- package/dist/browser/node.d.ts +0 -0
- package/dist/browser/node.js +0 -0
- package/dist/browser/revisions.d.ts +1 -1
- package/dist/browser/revisions.js +0 -0
- package/dist/browser/should-log-message.d.ts +24 -0
- package/dist/browser/should-log-message.js +72 -0
- package/dist/browser/util.d.ts +2 -2
- package/dist/browser/util.js +0 -0
- package/dist/browser-executable.d.ts +1 -1
- package/dist/browser-executable.js +0 -0
- package/dist/browser-log.d.ts +1 -1
- package/dist/browser-log.js +0 -0
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +0 -0
- package/dist/calculate-ffmpeg-filters.d.ts +2 -1
- package/dist/calculate-ffmpeg-filters.js +1 -0
- package/dist/call-ffmpeg.d.ts +14 -0
- package/dist/call-ffmpeg.js +42 -0
- package/dist/can-use-parallel-encoding.d.ts +0 -0
- package/dist/can-use-parallel-encoding.js +0 -0
- package/dist/chalk/index.d.ts +54 -0
- package/dist/chalk/index.js +135 -0
- package/dist/chalk/is-color-supported.d.ts +1 -0
- package/dist/chalk/is-color-supported.js +37 -0
- package/dist/check-apple-silicon.d.ts +1 -1
- package/dist/check-apple-silicon.js +8 -47
- package/dist/chunk.d.ts +0 -0
- package/dist/chunk.js +0 -0
- package/dist/client.d.ts +204 -0
- package/dist/client.js +49 -0
- package/dist/codec-supports-media.d.ts +3 -2
- package/dist/codec-supports-media.js +20 -5
- package/dist/codec.d.ts +2 -2
- package/dist/codec.js +0 -0
- package/dist/combine-videos.d.ts +6 -2
- package/dist/combine-videos.js +17 -17
- package/dist/compositor/compose.d.ts +26 -0
- package/dist/compositor/compose.js +82 -0
- package/dist/compositor/compositor.d.ts +11 -0
- package/dist/compositor/compositor.js +219 -0
- package/dist/compositor/get-executable-path.d.ts +1 -0
- package/dist/compositor/get-executable-path.js +57 -0
- package/dist/compositor/make-nonce.d.ts +1 -0
- package/dist/compositor/make-nonce.js +8 -0
- package/dist/compositor/payloads.d.ts +68 -0
- package/dist/{ffmpeg-executable.js → compositor/payloads.js} +0 -0
- package/dist/compress-assets.d.ts +0 -0
- package/dist/compress-assets.js +0 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.d.ts +0 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.js +0 -0
- package/dist/convert-to-positive-frame-index.d.ts +0 -0
- package/dist/convert-to-positive-frame-index.js +0 -0
- package/dist/create-ffmpeg-complex-filter.d.ts +5 -1
- package/dist/create-ffmpeg-complex-filter.js +6 -4
- package/dist/create-ffmpeg-merge-filter.d.ts +5 -1
- package/dist/create-ffmpeg-merge-filter.js +21 -13
- package/dist/create-silent-audio.d.ts +1 -3
- package/dist/create-silent-audio.js +3 -6
- package/dist/crf.d.ts +6 -2
- package/dist/crf.js +41 -8
- package/dist/cycle-browser-tabs.d.ts +2 -5
- package/dist/cycle-browser-tabs.js +5 -5
- package/dist/delay-render-embedded-stack.d.ts +0 -0
- package/dist/delay-render-embedded-stack.js +0 -0
- package/dist/delete-directory.d.ts +1 -1
- package/dist/delete-directory.js +43 -17
- package/dist/does-have-m2-bug.d.ts +3 -0
- package/dist/does-have-m2-bug.js +12 -0
- package/dist/ensure-frames-in-order.d.ts +0 -0
- package/dist/ensure-frames-in-order.js +0 -0
- package/dist/ensure-output-directory.d.ts +0 -0
- package/dist/ensure-output-directory.js +5 -5
- package/dist/error-handling/handle-javascript-exception.d.ts +0 -0
- package/dist/error-handling/handle-javascript-exception.js +10 -0
- package/dist/error-handling/symbolicate-error.d.ts +0 -0
- package/dist/error-handling/symbolicate-error.js +6 -3
- package/dist/error-handling/symbolicateable-error.d.ts +0 -0
- package/dist/error-handling/symbolicateable-error.js +0 -0
- package/dist/ffmpeg-filter-file.d.ts +6 -1
- package/dist/ffmpeg-filter-file.js +40 -8
- package/dist/ffmpeg-override.d.ts +1 -1
- package/dist/ffmpeg-override.js +0 -0
- package/dist/file-extensions.d.ts +14 -0
- package/dist/file-extensions.js +76 -0
- package/dist/find-closest-package-json.d.ts +2 -0
- package/dist/find-closest-package-json.js +31 -0
- package/dist/frame-range.d.ts +1 -1
- package/dist/frame-range.js +0 -0
- package/dist/get-browser-instance.d.ts +8 -3
- package/dist/get-browser-instance.js +10 -5
- package/dist/get-codec-name.d.ts +0 -0
- package/dist/get-codec-name.js +0 -0
- package/dist/get-compositions.d.ts +27 -14
- package/dist/get-compositions.js +72 -39
- package/dist/get-concurrency.d.ts +1 -1
- package/dist/get-concurrency.js +11 -4
- package/dist/get-duration-from-frame-range.d.ts +0 -0
- package/dist/get-duration-from-frame-range.js +0 -0
- package/dist/get-extension-from-codec.d.ts +5 -1
- package/dist/get-extension-from-codec.js +56 -32
- package/dist/get-extension-of-filename.d.ts +0 -0
- package/dist/get-extension-of-filename.js +5 -1
- package/dist/get-frame-padded-index.d.ts +3 -2
- package/dist/get-frame-padded-index.js +3 -2
- package/dist/get-frame-to-render.d.ts +0 -0
- package/dist/get-frame-to-render.js +1 -1
- package/dist/get-local-browser-executable.d.ts +0 -0
- package/dist/get-local-browser-executable.js +7 -15
- package/dist/get-port.d.ts +4 -1
- package/dist/get-port.js +8 -8
- package/dist/get-prores-profile-name.d.ts +0 -0
- package/dist/get-prores-profile-name.js +0 -0
- package/dist/get-video-threads-flag.d.ts +0 -0
- package/dist/get-video-threads-flag.js +3 -3
- package/dist/guess-extension-for-media.d.ts +3 -1
- package/dist/guess-extension-for-media.js +4 -7
- package/dist/image-format.d.ts +12 -6
- package/dist/image-format.js +19 -13
- package/dist/index.d.ts +368 -49
- package/dist/index.js +68 -46
- package/dist/is-audio-codec.d.ts +0 -0
- package/dist/is-audio-codec.js +0 -0
- package/dist/is-serve-url.d.ts +0 -0
- package/dist/is-serve-url.js +0 -0
- package/dist/jpeg-quality.d.ts +2 -0
- package/dist/jpeg-quality.js +22 -0
- package/dist/locks.d.ts +7 -0
- package/dist/locks.js +44 -0
- package/dist/log-level.d.ts +1 -1
- package/dist/log-level.js +0 -0
- package/dist/logger.d.ts +24 -0
- package/dist/logger.js +68 -0
- package/dist/make-cancel-signal.d.ts +13 -2
- package/dist/make-cancel-signal.js +24 -1
- package/dist/merge-audio-track.d.ts +4 -4
- package/dist/merge-audio-track.js +38 -33
- package/dist/mime-db.d.ts +0 -0
- package/dist/mime-db.js +0 -0
- package/dist/mime-types.d.ts +0 -0
- package/dist/mime-types.js +3 -3
- package/dist/normalize-serve-url.d.ts +0 -0
- package/dist/normalize-serve-url.js +0 -0
- package/dist/offthread-video-server.d.ts +47 -11
- package/dist/offthread-video-server.js +111 -58
- package/dist/open-browser.d.ts +21 -6
- package/dist/open-browser.js +37 -16
- package/dist/options/audio-bitrate.d.ts +2 -0
- package/dist/options/audio-bitrate.js +11 -0
- package/dist/options/crf.d.ts +2 -0
- package/dist/options/crf.js +11 -0
- package/dist/options/enforce-audio.d.ts +2 -0
- package/dist/options/enforce-audio.js +11 -0
- package/dist/options/jpeg-quality.d.ts +2 -0
- package/dist/options/jpeg-quality.js +11 -0
- package/dist/options/mute.d.ts +2 -0
- package/dist/options/mute.js +11 -0
- package/dist/options/option.d.ts +8 -0
- package/dist/options/option.js +2 -0
- package/dist/options/scale.d.ts +2 -0
- package/dist/options/scale.js +11 -0
- package/dist/options/video-bitrate.d.ts +2 -0
- package/dist/options/video-bitrate.js +11 -0
- package/dist/options/video-codec.d.ts +2 -0
- package/dist/options/video-codec.js +11 -0
- package/dist/overwrite.d.ts +0 -0
- package/dist/overwrite.js +0 -0
- package/dist/p-limit.d.ts +0 -0
- package/dist/p-limit.js +0 -0
- package/dist/parse-browser-error-stack.d.ts +1 -1
- package/dist/parse-browser-error-stack.js +0 -0
- package/dist/parse-ffmpeg-progress.d.ts +0 -0
- package/dist/parse-ffmpeg-progress.js +0 -0
- package/dist/perf.d.ts +2 -2
- package/dist/perf.js +9 -7
- package/dist/pixel-format.d.ts +2 -2
- package/dist/pixel-format.js +3 -0
- package/dist/pool.d.ts +0 -0
- package/dist/pool.js +0 -0
- package/dist/prepare-server.d.ts +25 -10
- package/dist/prepare-server.js +71 -18
- package/dist/preprocess-audio-track.d.ts +7 -5
- package/dist/preprocess-audio-track.js +7 -8
- package/dist/prespawn-ffmpeg.d.ts +20 -10
- package/dist/prespawn-ffmpeg.js +67 -29
- package/dist/prestitcher-memory-usage.d.ts +0 -4
- package/dist/prestitcher-memory-usage.js +4 -5
- package/dist/prores-profile.d.ts +6 -4
- package/dist/prores-profile.js +8 -8
- package/dist/provide-screenshot.d.ts +8 -4
- package/dist/provide-screenshot.js +5 -2
- package/dist/puppeteer-evaluate.d.ts +0 -0
- package/dist/puppeteer-evaluate.js +20 -12
- package/dist/puppeteer-screenshot.d.ts +12 -2
- package/dist/puppeteer-screenshot.js +18 -45
- package/dist/redirect-status-codes.d.ts +1 -0
- package/dist/redirect-status-codes.js +6 -0
- package/dist/render-frames.d.ts +52 -35
- package/dist/render-frames.js +248 -143
- package/dist/render-media.d.ts +76 -29
- package/dist/render-media.js +324 -195
- package/dist/render-still.d.ts +46 -19
- package/dist/render-still.js +128 -69
- package/dist/replace-browser.d.ts +6 -0
- package/dist/replace-browser.js +47 -0
- package/dist/resolve-asset-src.d.ts +0 -0
- package/dist/resolve-asset-src.js +2 -2
- package/dist/sample-rate.d.ts +0 -0
- package/dist/sample-rate.js +0 -0
- package/dist/screenshot-dom-element.d.ts +8 -4
- package/dist/screenshot-dom-element.js +15 -4
- package/dist/screenshot-task.d.ts +11 -2
- package/dist/screenshot-task.js +43 -13
- package/dist/seek-to-frame.d.ts +1 -0
- package/dist/seek-to-frame.js +49 -3
- package/dist/select-composition.d.ts +41 -0
- package/dist/select-composition.js +156 -0
- package/dist/serve-handler/index.d.ts +1 -1
- package/dist/serve-handler/index.js +21 -19
- package/dist/serve-handler/is-path-inside.d.ts +0 -0
- package/dist/serve-handler/is-path-inside.js +3 -3
- package/dist/serve-handler/range-parser.d.ts +0 -0
- package/dist/serve-handler/range-parser.js +0 -0
- package/dist/serve-static.d.ts +8 -6
- package/dist/serve-static.js +85 -59
- package/dist/set-props-and-env.d.ts +5 -3
- package/dist/set-props-and-env.js +18 -10
- package/dist/stitch-frames-to-video.d.ts +39 -16
- package/dist/stitch-frames-to-video.js +210 -121
- package/dist/stringify-ffmpeg-filter.d.ts +10 -2
- package/dist/stringify-ffmpeg-filter.js +37 -34
- package/dist/symbolicate-stacktrace.d.ts +16 -3
- package/dist/symbolicate-stacktrace.js +49 -24
- package/dist/take-frame-and-compose.d.ts +22 -0
- package/dist/take-frame-and-compose.js +103 -0
- package/dist/tmp-dir.d.ts +0 -0
- package/dist/tmp-dir.js +7 -8
- package/dist/truthy.d.ts +1 -1
- package/dist/truthy.js +0 -0
- package/dist/types.d.ts +2 -2
- package/dist/types.js +0 -0
- package/dist/validate-concurrency.d.ts +2 -0
- package/dist/validate-concurrency.js +21 -10
- package/dist/validate-even-dimensions-with-codec.d.ts +0 -0
- package/dist/validate-even-dimensions-with-codec.js +0 -0
- package/dist/validate-every-nth-frame.d.ts +2 -1
- package/dist/validate-every-nth-frame.js +8 -1
- package/dist/validate-ffmpeg-override.d.ts +0 -0
- package/dist/validate-ffmpeg-override.js +0 -0
- package/dist/validate-number-of-gif-loops.d.ts +2 -0
- package/dist/validate-number-of-gif-loops.js +24 -0
- package/dist/validate-opengl-renderer.d.ts +2 -3
- package/dist/validate-opengl-renderer.js +9 -4
- package/dist/validate-output-filename.d.ts +7 -2
- package/dist/validate-output-filename.js +20 -51
- package/dist/validate-puppeteer-timeout.d.ts +0 -0
- package/dist/validate-puppeteer-timeout.js +1 -0
- package/dist/validate-scale.d.ts +0 -0
- package/dist/validate-scale.js +0 -0
- package/dist/validate-videobitrate.d.ts +1 -0
- package/dist/validate-videobitrate.js +20 -0
- package/dist/wait-for-symbolication-error-to-be-done.d.ts +0 -0
- package/dist/wait-for-symbolication-error-to-be-done.js +5 -31
- package/dist/ws/ws-types.d.ts +0 -0
- package/dist/ws/ws-types.js +2 -1
- package/install-toolchain.mjs +36 -0
- package/package.json +70 -60
- package/types/ws/index.d.ts +5 -5
- package/.prettierrc.js +0 -14
- package/dist/assets/dl-browser.d.ts +0 -1
- package/dist/assets/dl-browser.js +0 -38
- package/dist/assets/get-video-stream-duration.d.ts +0 -4
- package/dist/assets/get-video-stream-duration.js +0 -59
- package/dist/calculate-sar-dar-pixels.d.ts +0 -9
- package/dist/calculate-sar-dar-pixels.js +0 -19
- package/dist/convert-to-pcm.d.ts +0 -6
- package/dist/convert-to-pcm.js +0 -20
- package/dist/ensure-presentation-timestamp.d.ts +0 -2
- package/dist/ensure-presentation-timestamp.js +0 -69
- package/dist/extract-frame-from-video.d.ts +0 -16
- package/dist/extract-frame-from-video.js +0 -277
- package/dist/ffmpeg-executable.d.ts +0 -1
- package/dist/ffmpeg-flags.d.ts +0 -12
- package/dist/ffmpeg-flags.js +0 -45
- package/dist/frame-to-ffmpeg-timestamp.d.ts +0 -1
- package/dist/frame-to-ffmpeg-timestamp.js +0 -8
- package/dist/get-audio-codec-name.d.ts +0 -2
- package/dist/get-audio-codec-name.js +0 -28
- package/dist/get-video-info.d.ts +0 -3
- package/dist/get-video-info.js +0 -49
- package/dist/is-beyond-last-frame.d.ts +0 -3
- package/dist/is-beyond-last-frame.js +0 -12
- package/dist/last-frame-from-video-cache.d.ts +0 -17
- package/dist/last-frame-from-video-cache.js +0 -55
- package/dist/legacy-webpack-config.d.ts +0 -9
- package/dist/legacy-webpack-config.js +0 -13
- package/dist/quality.d.ts +0 -1
- package/dist/quality.js +0 -21
- package/dist/validate-ffmpeg.d.ts +0 -2
- package/dist/validate-ffmpeg.js +0 -72
- package/dist/validate-frame.d.ts +0 -1
- package/dist/validate-frame.js +0 -24
- package/tsconfig.json +0 -10
- package/vitest.config.ts +0 -8
|
@@ -28,26 +28,10 @@ exports.NodeWebSocketTransport = void 0;
|
|
|
28
28
|
* See the License for the specific language governing permissions and
|
|
29
29
|
* limitations under the License.
|
|
30
30
|
*/
|
|
31
|
-
const
|
|
32
|
-
const
|
|
31
|
+
const node_dns_1 = require("node:dns");
|
|
32
|
+
const node_url_1 = require("node:url");
|
|
33
33
|
const ws_types_1 = require("../ws/ws-types");
|
|
34
34
|
class NodeWebSocketTransport {
|
|
35
|
-
constructor(ws) {
|
|
36
|
-
_NodeWebSocketTransport_ws.set(this, void 0);
|
|
37
|
-
__classPrivateFieldSet(this, _NodeWebSocketTransport_ws, ws, "f");
|
|
38
|
-
__classPrivateFieldGet(this, _NodeWebSocketTransport_ws, "f").addEventListener('message', (event) => {
|
|
39
|
-
if (this.onmessage) {
|
|
40
|
-
this.onmessage.call(null, event.data);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
__classPrivateFieldGet(this, _NodeWebSocketTransport_ws, "f").addEventListener('close', () => {
|
|
44
|
-
if (this.onclose) {
|
|
45
|
-
this.onclose.call(null);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
// Silently ignore all errors - we don't know what to do with them.
|
|
49
|
-
__classPrivateFieldGet(this, _NodeWebSocketTransport_ws, "f").addEventListener('error', () => undefined);
|
|
50
|
-
}
|
|
51
35
|
static async create(urlString) {
|
|
52
36
|
// Starting in Node 17, IPv6 is favoured over IPv4 due to a change
|
|
53
37
|
// in a default option:
|
|
@@ -56,16 +40,16 @@ class NodeWebSocketTransport {
|
|
|
56
40
|
// manually with the previous behavior according to:
|
|
57
41
|
// - https://nodejs.org/api/dns.html#dnslookuphostname-options-callback
|
|
58
42
|
// because of https://bugzilla.mozilla.org/show_bug.cgi?id=1769994.
|
|
59
|
-
const url = new
|
|
43
|
+
const url = new node_url_1.URL(urlString);
|
|
60
44
|
if (url.hostname === 'localhost') {
|
|
61
|
-
const { address } = await
|
|
45
|
+
const { address } = await node_dns_1.promises.lookup(url.hostname, { verbatim: false });
|
|
62
46
|
url.hostname = address;
|
|
63
47
|
}
|
|
64
48
|
return new Promise((resolve, reject) => {
|
|
65
49
|
const ws = new ws_types_1.ws(url, [], {
|
|
66
50
|
followRedirects: true,
|
|
67
51
|
perMessageDeflate: false,
|
|
68
|
-
maxPayload:
|
|
52
|
+
maxPayload: 1024 * 1024 * 1024,
|
|
69
53
|
headers: {
|
|
70
54
|
'User-Agent': `Remotion CLI`,
|
|
71
55
|
},
|
|
@@ -76,6 +60,22 @@ class NodeWebSocketTransport {
|
|
|
76
60
|
ws.addEventListener('error', reject);
|
|
77
61
|
});
|
|
78
62
|
}
|
|
63
|
+
constructor(ws) {
|
|
64
|
+
_NodeWebSocketTransport_ws.set(this, void 0);
|
|
65
|
+
__classPrivateFieldSet(this, _NodeWebSocketTransport_ws, ws, "f");
|
|
66
|
+
__classPrivateFieldGet(this, _NodeWebSocketTransport_ws, "f").addEventListener('message', (event) => {
|
|
67
|
+
if (this.onmessage) {
|
|
68
|
+
this.onmessage.call(null, event.data);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
__classPrivateFieldGet(this, _NodeWebSocketTransport_ws, "f").addEventListener('close', () => {
|
|
72
|
+
if (this.onclose) {
|
|
73
|
+
this.onclose.call(null);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
// Silently ignore all errors - we don't know what to do with them.
|
|
77
|
+
__classPrivateFieldGet(this, _NodeWebSocketTransport_ws, "f").addEventListener('error', () => undefined);
|
|
78
|
+
}
|
|
79
79
|
send(message) {
|
|
80
80
|
__classPrivateFieldGet(this, _NodeWebSocketTransport_ws, "f").send(message);
|
|
81
81
|
}
|
package/dist/browser/Product.js
CHANGED
|
File without changes
|
|
@@ -13,10 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type {
|
|
16
|
+
import type { HeadlessBrowser } from './Browser';
|
|
17
17
|
import type { BrowserConnectOptions } from './BrowserConnector';
|
|
18
|
-
import type { BrowserFetcherOptions } from './BrowserFetcher';
|
|
19
|
-
import { BrowserFetcher } from './BrowserFetcher';
|
|
20
18
|
import type { ProductLauncher } from './Launcher';
|
|
21
19
|
import type { BrowserLaunchArgumentOptions, LaunchOptions } from './LaunchOptions';
|
|
22
20
|
import type { Product } from './Product';
|
|
@@ -31,10 +29,9 @@ export declare class PuppeteerNode {
|
|
|
31
29
|
preferredRevision: string;
|
|
32
30
|
productName?: Product;
|
|
33
31
|
});
|
|
34
|
-
launch(options: PuppeteerLaunchOptions): Promise<
|
|
32
|
+
launch(options: PuppeteerLaunchOptions): Promise<HeadlessBrowser>;
|
|
35
33
|
executablePath(channel?: string): string;
|
|
36
34
|
get _launcher(): ProductLauncher;
|
|
37
35
|
get product(): string;
|
|
38
|
-
createBrowserFetcher(options: BrowserFetcherOptions): BrowserFetcher;
|
|
39
36
|
}
|
|
40
37
|
export {};
|
|
@@ -25,14 +25,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
25
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
26
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
27
27
|
};
|
|
28
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
-
};
|
|
31
28
|
var _PuppeteerNode_lazyLauncher, _PuppeteerNode_productName;
|
|
32
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
30
|
exports.PuppeteerNode = void 0;
|
|
34
|
-
const
|
|
35
|
-
const Launcher_1 = __importDefault(require("./Launcher"));
|
|
31
|
+
const Launcher_1 = require("./Launcher");
|
|
36
32
|
const revisions_1 = require("./revisions");
|
|
37
33
|
class PuppeteerNode {
|
|
38
34
|
constructor(settings) {
|
|
@@ -43,7 +39,6 @@ class PuppeteerNode {
|
|
|
43
39
|
this._preferredRevision = preferredRevision;
|
|
44
40
|
this.launch = this.launch.bind(this);
|
|
45
41
|
this.executablePath = this.executablePath.bind(this);
|
|
46
|
-
this.createBrowserFetcher = this.createBrowserFetcher.bind(this);
|
|
47
42
|
}
|
|
48
43
|
launch(options) {
|
|
49
44
|
if (options.product) {
|
|
@@ -62,17 +57,13 @@ class PuppeteerNode {
|
|
|
62
57
|
default:
|
|
63
58
|
this._preferredRevision = revisions_1.PUPPETEER_REVISIONS.chromium;
|
|
64
59
|
}
|
|
65
|
-
|
|
66
|
-
__classPrivateFieldSet(this, _PuppeteerNode_lazyLauncher, (0, Launcher_1.default)(this._preferredRevision), "f");
|
|
60
|
+
__classPrivateFieldSet(this, _PuppeteerNode_lazyLauncher, new Launcher_1.ChromeLauncher(this._preferredRevision), "f");
|
|
67
61
|
}
|
|
68
62
|
return __classPrivateFieldGet(this, _PuppeteerNode_lazyLauncher, "f");
|
|
69
63
|
}
|
|
70
64
|
get product() {
|
|
71
65
|
return this._launcher.product;
|
|
72
66
|
}
|
|
73
|
-
createBrowserFetcher(options) {
|
|
74
|
-
return new BrowserFetcher_1.BrowserFetcher(options);
|
|
75
|
-
}
|
|
76
67
|
}
|
|
77
68
|
exports.PuppeteerNode = PuppeteerNode;
|
|
78
69
|
_PuppeteerNode_lazyLauncher = new WeakMap(), _PuppeteerNode_productName = new WeakMap();
|
|
File without changes
|
|
File without changes
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
interface ScreenshotClip {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
}
|
|
7
|
-
export interface ScreenshotOptions {
|
|
8
|
-
type: 'png' | 'jpeg';
|
|
9
|
-
path?: string;
|
|
10
|
-
clip?: ScreenshotClip;
|
|
11
|
-
quality?: number;
|
|
12
|
-
omitBackground: boolean;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
package/dist/browser/Target.d.ts
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type {
|
|
16
|
+
import type { AnySourceMapConsumer } from '../symbolicate-stacktrace';
|
|
17
|
+
import type { BrowserContext, HeadlessBrowser } from './Browser';
|
|
17
18
|
import { Page } from './BrowserPage';
|
|
18
19
|
import type { CDPSession } from './Connection';
|
|
19
20
|
import type { TargetInfo } from './devtools-types';
|
|
@@ -35,7 +36,7 @@ export declare class Target {
|
|
|
35
36
|
/**
|
|
36
37
|
* If the target is not of type `"page"` or `"background_page"`, returns `null`.
|
|
37
38
|
*/
|
|
38
|
-
page(): Promise<Page | null>;
|
|
39
|
+
page(sourcemapContext: AnySourceMapConsumer | null): Promise<Page | null>;
|
|
39
40
|
url(): string;
|
|
40
41
|
/**
|
|
41
42
|
* Identifies what kind of target this is.
|
|
@@ -48,7 +49,7 @@ export declare class Target {
|
|
|
48
49
|
/**
|
|
49
50
|
* Get the browser the target belongs to.
|
|
50
51
|
*/
|
|
51
|
-
browser():
|
|
52
|
+
browser(): HeadlessBrowser;
|
|
52
53
|
/**
|
|
53
54
|
* Get the browser context the target belongs to.
|
|
54
55
|
*/
|
package/dist/browser/Target.js
CHANGED
|
@@ -79,12 +79,18 @@ class Target {
|
|
|
79
79
|
/**
|
|
80
80
|
* If the target is not of type `"page"` or `"background_page"`, returns `null`.
|
|
81
81
|
*/
|
|
82
|
-
async page() {
|
|
82
|
+
async page(sourcemapContext) {
|
|
83
83
|
var _a;
|
|
84
84
|
if (isPagetTarget(__classPrivateFieldGet(this, _Target_targetInfo, "f")) && !__classPrivateFieldGet(this, _Target_pagePromise, "f")) {
|
|
85
85
|
__classPrivateFieldSet(this, _Target_pagePromise, __classPrivateFieldGet(this, _Target_sessionFactory, "f").call(this).then((client) => {
|
|
86
86
|
var _a;
|
|
87
|
-
return BrowserPage_1.Page._create(
|
|
87
|
+
return BrowserPage_1.Page._create({
|
|
88
|
+
client,
|
|
89
|
+
target: this,
|
|
90
|
+
defaultViewport: (_a = __classPrivateFieldGet(this, _Target_defaultViewport, "f")) !== null && _a !== void 0 ? _a : null,
|
|
91
|
+
browser: this.browser(),
|
|
92
|
+
sourcemapContext,
|
|
93
|
+
});
|
|
88
94
|
}), "f");
|
|
89
95
|
}
|
|
90
96
|
return (_a = (await __classPrivateFieldGet(this, _Target_pagePromise, "f"))) !== null && _a !== void 0 ? _a : null;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/browser/assert.d.ts
CHANGED
|
File without changes
|
package/dist/browser/assert.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -16,62 +16,48 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.downloadBrowser = void 0;
|
|
19
|
-
const
|
|
19
|
+
const BrowserFetcher_1 = require("./BrowserFetcher");
|
|
20
20
|
const revisions_1 = require("./revisions");
|
|
21
21
|
const supportedProducts = {
|
|
22
22
|
chrome: 'Chromium',
|
|
23
23
|
firefox: 'Firefox Nightly',
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
path: null,
|
|
29
|
-
platform: null,
|
|
30
|
-
});
|
|
31
|
-
const revision = await getRevision();
|
|
32
|
-
await fetchBinary(revision);
|
|
33
|
-
function getRevision() {
|
|
34
|
-
if (product === 'chrome') {
|
|
35
|
-
return revisions_1.PUPPETEER_REVISIONS.chromium;
|
|
36
|
-
}
|
|
37
|
-
throw new Error(`Unsupported product ${product}`);
|
|
25
|
+
function getRevision(product) {
|
|
26
|
+
if (product === 'chrome') {
|
|
27
|
+
return revisions_1.PUPPETEER_REVISIONS.chromium;
|
|
38
28
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
function onProgress(downloadedBytes, totalBytes) {
|
|
62
|
-
console.log('Downloading', supportedProducts[product], toMegabytes(downloadedBytes) + '/' + toMegabytes(totalBytes));
|
|
63
|
-
}
|
|
64
|
-
return browserFetcher
|
|
65
|
-
.download(revisionInfo.revision, onProgress)
|
|
66
|
-
.then(() => {
|
|
67
|
-
return browserFetcher.localRevisions();
|
|
29
|
+
throw new Error(`Unsupported product ${product}`);
|
|
30
|
+
}
|
|
31
|
+
async function downloadBrowser(product) {
|
|
32
|
+
const revision = getRevision(product);
|
|
33
|
+
const revisionInfo = (0, BrowserFetcher_1.getRevisionInfo)(revision, product);
|
|
34
|
+
try {
|
|
35
|
+
await (0, BrowserFetcher_1.download)({
|
|
36
|
+
revision: revisionInfo.revision,
|
|
37
|
+
progressCallback: (downloadedBytes, totalBytes) => {
|
|
38
|
+
console.log('Downloading', supportedProducts[product], toMegabytes(downloadedBytes) + '/' + toMegabytes(totalBytes));
|
|
39
|
+
},
|
|
40
|
+
product,
|
|
41
|
+
platform: (0, BrowserFetcher_1.getPlatform)(product),
|
|
42
|
+
downloadHost: (0, BrowserFetcher_1.getDownloadHost)(product),
|
|
43
|
+
downloadsFolder: (0, BrowserFetcher_1.getDownloadsFolder)(product),
|
|
44
|
+
});
|
|
45
|
+
const _localRevisions = await (0, BrowserFetcher_1.localRevisions)((0, BrowserFetcher_1.getDownloadsFolder)(product), product, (0, BrowserFetcher_1.getPlatform)(product));
|
|
46
|
+
console.log(`${supportedProducts[product]} (${revisionInfo.revision}) downloaded to ${revisionInfo.folderPath}`);
|
|
47
|
+
await Promise.all(_localRevisions
|
|
48
|
+
.filter((__revision) => {
|
|
49
|
+
return __revision !== revisionInfo.revision;
|
|
68
50
|
})
|
|
69
|
-
.
|
|
70
|
-
.
|
|
51
|
+
.map((__revision) => {
|
|
52
|
+
return (0, BrowserFetcher_1.removeBrowser)(__revision, (0, BrowserFetcher_1.getFolderPath)(revision, (0, BrowserFetcher_1.getDownloadsFolder)(product), (0, BrowserFetcher_1.getPlatform)(product)));
|
|
53
|
+
}));
|
|
71
54
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return `${Math.round(mb * 10) / 10} Mb`;
|
|
55
|
+
catch (err) {
|
|
56
|
+
throw new Error(`Failed to set up ${supportedProducts[product]} r${revision}! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.`);
|
|
75
57
|
}
|
|
76
58
|
}
|
|
77
59
|
exports.downloadBrowser = downloadBrowser;
|
|
60
|
+
function toMegabytes(bytes) {
|
|
61
|
+
const mb = bytes / 1024 / 1024;
|
|
62
|
+
return `${Math.round(mb * 10) / 10} Mb`;
|
|
63
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActivateTargetRequest, AddScriptToEvaluateOnNewDocumentRequest, AddScriptToEvaluateOnNewDocumentResponse, CallFunctionOnRequest, CallFunctionOnResponse, CaptureScreenshotRequest, CaptureScreenshotResponse, CloseTargetRequest, CloseTargetResponse, CreateIsolatedWorldRequest, CreateIsolatedWorldResponse, DetachFromTargetRequest, DevtoolsRemoteObject, EnableRequest, ExceptionDetails, GetFrameTreeResponse, NavigateRequest, NavigateResponse, ReleaseObjectRequest, SetAutoAttachRequest, SetDefaultBackgroundColorOverrideRequest, SetDeviceMetricsOverrideRequest, SetLifecycleEventsEnabledRequest } from './devtools-types';
|
|
1
|
+
import type { ActivateTargetRequest, AddScriptToEvaluateOnNewDocumentRequest, AddScriptToEvaluateOnNewDocumentResponse, CallFunctionOnRequest, CallFunctionOnResponse, CaptureScreenshotRequest, CaptureScreenshotResponse, CloseTargetRequest, CloseTargetResponse, CreateIsolatedWorldRequest, CreateIsolatedWorldResponse, DetachFromTargetRequest, DevtoolsRemoteObject, EnableRequest, ExceptionDetails, GetFrameTreeResponse, NavigateRequest, NavigateResponse, PrintPDFRequest, PrintPDFResponse, ReleaseObjectRequest, SetAutoAttachRequest, SetDefaultBackgroundColorOverrideRequest, SetDeviceMetricsOverrideRequest, SetLifecycleEventsEnabledRequest } from './devtools-types';
|
|
2
2
|
export interface Commands {
|
|
3
3
|
/**
|
|
4
4
|
* Does nothing.
|
|
@@ -216,6 +216,10 @@ export interface Commands {
|
|
|
216
216
|
paramsType: [CaptureScreenshotRequest?];
|
|
217
217
|
returnType: CaptureScreenshotResponse;
|
|
218
218
|
};
|
|
219
|
+
'Page.printToPDF': {
|
|
220
|
+
paramsType: [PrintPDFRequest];
|
|
221
|
+
returnType: PrintPDFResponse;
|
|
222
|
+
};
|
|
219
223
|
'Target.activateTarget': {
|
|
220
224
|
paramsType: [ActivateTargetRequest];
|
|
221
225
|
returnType: void;
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type RemoteObjectId = string;
|
|
2
2
|
interface WebDriverValue {
|
|
3
3
|
/**
|
|
4
4
|
* (WebDriverValueType enum)
|
|
@@ -7,7 +7,7 @@ interface WebDriverValue {
|
|
|
7
7
|
value?: any;
|
|
8
8
|
objectId?: string;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
type UnserializableValue = string;
|
|
11
11
|
export interface DevtoolsRemoteObject {
|
|
12
12
|
/**
|
|
13
13
|
* Object type. (RemoteObjectType enum)
|
|
@@ -45,7 +45,7 @@ export interface DevtoolsRemoteObject {
|
|
|
45
45
|
*/
|
|
46
46
|
objectId?: RemoteObjectId;
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
type TargetID = string;
|
|
49
49
|
export interface TargetInfo {
|
|
50
50
|
targetId: TargetID;
|
|
51
51
|
type: string;
|
|
@@ -264,7 +264,7 @@ export interface CallFunctionOnResponse {
|
|
|
264
264
|
*/
|
|
265
265
|
exceptionDetails?: ExceptionDetails;
|
|
266
266
|
}
|
|
267
|
-
|
|
267
|
+
type ExecutionContextId = number;
|
|
268
268
|
export interface EvaluateResponse {
|
|
269
269
|
/**
|
|
270
270
|
* Evaluation result.
|
|
@@ -291,8 +291,8 @@ export interface FrameTree {
|
|
|
291
291
|
*/
|
|
292
292
|
childFrames?: FrameTree[];
|
|
293
293
|
}
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
type FrameId = string;
|
|
295
|
+
type LoaderId = string;
|
|
296
296
|
export interface Frame {
|
|
297
297
|
/**
|
|
298
298
|
* Frame unique identifier.
|
|
@@ -419,7 +419,7 @@ export interface AttachedToTargetEvent {
|
|
|
419
419
|
targetInfo: TargetInfo;
|
|
420
420
|
waitingForDebugger: boolean;
|
|
421
421
|
}
|
|
422
|
-
|
|
422
|
+
type SessionID = string;
|
|
423
423
|
export interface DetachedFromTargetEvent {
|
|
424
424
|
/**
|
|
425
425
|
* Detached session identifier.
|
|
@@ -462,7 +462,7 @@ export interface AddScriptToEvaluateOnNewDocumentResponse {
|
|
|
462
462
|
*/
|
|
463
463
|
identifier: ScriptIdentifier;
|
|
464
464
|
}
|
|
465
|
-
|
|
465
|
+
type ScriptIdentifier = string;
|
|
466
466
|
export interface CreateIsolatedWorldRequest {
|
|
467
467
|
/**
|
|
468
468
|
* Id of the frame in which the isolated world should be created.
|
|
@@ -526,6 +526,10 @@ export interface CaptureScreenshotRequest {
|
|
|
526
526
|
* Capture the screenshot beyond the viewport. Defaults to false.
|
|
527
527
|
*/
|
|
528
528
|
captureBeyondViewport?: boolean;
|
|
529
|
+
/**
|
|
530
|
+
* Optimize image encoding for speed, not for resulting size (defaults to false) EXPERIMENTAL
|
|
531
|
+
*/
|
|
532
|
+
optimizeForSpeed?: boolean;
|
|
529
533
|
}
|
|
530
534
|
export interface CaptureScreenshotResponse {
|
|
531
535
|
/**
|
|
@@ -533,6 +537,84 @@ export interface CaptureScreenshotResponse {
|
|
|
533
537
|
*/
|
|
534
538
|
data: string;
|
|
535
539
|
}
|
|
540
|
+
export interface PrintPDFRequest {
|
|
541
|
+
/**
|
|
542
|
+
* Paper orientation. Defaults to false.
|
|
543
|
+
*/
|
|
544
|
+
landscape?: boolean;
|
|
545
|
+
/**
|
|
546
|
+
* Display header and footer. Defaults to false.
|
|
547
|
+
*/
|
|
548
|
+
displayHeaderFooter?: boolean;
|
|
549
|
+
/**
|
|
550
|
+
* Print background graphics. Defaults to false.
|
|
551
|
+
*/
|
|
552
|
+
printBackground?: boolean;
|
|
553
|
+
/**
|
|
554
|
+
* Scale of the webpage rendering. Defaults to 1.
|
|
555
|
+
*/
|
|
556
|
+
scale?: number;
|
|
557
|
+
/**
|
|
558
|
+
* Paper width in inches. Defaults to 8.5 inches.
|
|
559
|
+
*/
|
|
560
|
+
paperWidth?: number;
|
|
561
|
+
/**
|
|
562
|
+
* Paper height in inches. Defaults to 11 inches.
|
|
563
|
+
*/
|
|
564
|
+
paperHeight?: number;
|
|
565
|
+
/**
|
|
566
|
+
* Top margin in inches. Defaults to 1cm (~0.4 inches).
|
|
567
|
+
*/
|
|
568
|
+
marginTop?: number;
|
|
569
|
+
/**
|
|
570
|
+
* Bottom margin in inches. Defaults to 1cm (~0.4 inches).
|
|
571
|
+
*/
|
|
572
|
+
marginBottom?: number;
|
|
573
|
+
/**
|
|
574
|
+
* Left margin in inches. Defaults to 1cm (~0.4 inches).
|
|
575
|
+
*/
|
|
576
|
+
marginLeft?: number;
|
|
577
|
+
/**
|
|
578
|
+
* Right margin in inches. Defaults to 1cm (~0.4 inches).
|
|
579
|
+
*/
|
|
580
|
+
marginRight?: number;
|
|
581
|
+
/**
|
|
582
|
+
* Paper ranges to print, one based, e.g., '1-5, 8, 11-13'.
|
|
583
|
+
* Pages are printed in the document order, not in the order specified,
|
|
584
|
+
* and no more than once. Defaults to empty string,
|
|
585
|
+
* which implies the entire document is printed.
|
|
586
|
+
* The page numbers are quietly capped to actual page count of the document,
|
|
587
|
+
* and ranges beyond the end of the document are ignored.
|
|
588
|
+
* If this results in no pages to print, an error is reported.
|
|
589
|
+
* It is an error to specify a range with start greater than end.
|
|
590
|
+
*/
|
|
591
|
+
pageRanges?: string;
|
|
592
|
+
/**
|
|
593
|
+
* HTML template for the print header.
|
|
594
|
+
* Should be valid HTML markup with following classes used to inject printing values into them:
|
|
595
|
+
* date: formatted print date
|
|
596
|
+
* title: document title
|
|
597
|
+
* url: document location
|
|
598
|
+
* pageNumber: current page number
|
|
599
|
+
* totalPages: total pages in the document
|
|
600
|
+
* For example, <span class=title></span> would generate span containing the title.
|
|
601
|
+
*/
|
|
602
|
+
headerTemplate?: string;
|
|
603
|
+
/**
|
|
604
|
+
* HTML template for the print footer. Should use the same format as the headerTemplate.
|
|
605
|
+
*/
|
|
606
|
+
footerTemplate?: string;
|
|
607
|
+
/**
|
|
608
|
+
* Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
|
|
609
|
+
*/
|
|
610
|
+
preferCSSPageSize?: boolean;
|
|
611
|
+
}
|
|
612
|
+
export interface PrintPDFResponse {
|
|
613
|
+
/**
|
|
614
|
+
* Base64-encoded pdf data. Empty if |returnAsStream| is specified. (Encoded as a base64 string when passed over JSON)
|
|
615
|
+
*/
|
|
616
|
+
data: string;
|
|
617
|
+
}
|
|
536
618
|
export interface RequestWillBeSentEvent {
|
|
537
619
|
/**
|
|
538
620
|
* Request identifier.
|
|
@@ -613,8 +695,8 @@ interface Initiator {
|
|
|
613
695
|
*/
|
|
614
696
|
requestId?: RequestId;
|
|
615
697
|
}
|
|
616
|
-
|
|
617
|
-
|
|
698
|
+
type ResourceType = 'Document' | 'Stylesheet' | 'Image' | 'Media' | 'Font' | 'Script' | 'TextTrack' | 'XHR' | 'Fetch' | 'EventSource' | 'WebSocket' | 'Manifest' | 'SignedExchange' | 'Ping' | 'CSPViolationReport' | 'Preflight' | 'Other';
|
|
699
|
+
type RequestId = string;
|
|
618
700
|
export interface ActivateTargetRequest {
|
|
619
701
|
targetId: TargetID;
|
|
620
702
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -4,20 +4,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getDownloadsCacheDir = void 0;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const getDownloadsCacheDir = () => {
|
|
10
10
|
const cwd = process.cwd();
|
|
11
11
|
let dir = cwd;
|
|
12
12
|
for (;;) {
|
|
13
13
|
try {
|
|
14
|
-
if (
|
|
14
|
+
if (node_fs_1.default.statSync(node_path_1.default.join(dir, 'package.json')).isFile()) {
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
17
17
|
// eslint-disable-next-line no-empty
|
|
18
18
|
}
|
|
19
19
|
catch (e) { }
|
|
20
|
-
const parent =
|
|
20
|
+
const parent = node_path_1.default.dirname(dir);
|
|
21
21
|
if (dir === parent) {
|
|
22
22
|
dir = undefined;
|
|
23
23
|
break;
|
|
@@ -25,14 +25,14 @@ const getDownloadsCacheDir = () => {
|
|
|
25
25
|
dir = parent;
|
|
26
26
|
}
|
|
27
27
|
if (!dir) {
|
|
28
|
-
return
|
|
28
|
+
return node_path_1.default.resolve(cwd, '.remotion');
|
|
29
29
|
}
|
|
30
30
|
if (process.versions.pnp === '1') {
|
|
31
|
-
return
|
|
31
|
+
return node_path_1.default.resolve(dir, '.pnp/.remotion');
|
|
32
32
|
}
|
|
33
33
|
if (process.versions.pnp === '3') {
|
|
34
|
-
return
|
|
34
|
+
return node_path_1.default.resolve(dir, '.yarn/.remotion');
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return node_path_1.default.resolve(dir, 'node_modules/.remotion');
|
|
37
37
|
};
|
|
38
38
|
exports.getDownloadsCacheDir = getDownloadsCacheDir;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isTargetClosedErr: (error: Error | undefined) => boolean | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTargetClosedErr = void 0;
|
|
4
|
+
const isTargetClosedErr = (error) => {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
return (((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('Target closed')) ||
|
|
7
|
+
((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.includes('Session closed')));
|
|
8
|
+
};
|
|
9
|
+
exports.isTargetClosedErr = isTargetClosedErr;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export type EventType = string | symbol;
|
|
2
|
+
export type Handler<T = any> = (event?: T) => void;
|
|
3
|
+
type WildcardHandler = (type: EventType, event?: any) => void;
|
|
4
|
+
type EventHandlerList = Array<Handler>;
|
|
5
|
+
type WildCardEventHandlerList = Array<WildcardHandler>;
|
|
6
|
+
type EventHandlerMap = Map<EventType, EventHandlerList | WildCardEventHandlerList>;
|
|
7
7
|
export interface Emitter {
|
|
8
8
|
all: EventHandlerMap;
|
|
9
9
|
on<T = any>(type: EventType, handler: Handler<T>): void;
|
|
File without changes
|
package/dist/browser/node.d.ts
CHANGED
|
File without changes
|
package/dist/browser/node.js
CHANGED
|
File without changes
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
type Revisions = Readonly<{
|
|
17
17
|
readonly chromium: string;
|
|
18
18
|
}>;
|
|
19
19
|
export declare const PUPPETEER_REVISIONS: Revisions;
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const shouldLogBrowserMessage: (message: string) => boolean;
|
|
2
|
+
type ParsedBrowserLogMessage = {
|
|
3
|
+
day: number;
|
|
4
|
+
month: number;
|
|
5
|
+
hour: number;
|
|
6
|
+
minute: number;
|
|
7
|
+
seconds: number;
|
|
8
|
+
microseconds: number;
|
|
9
|
+
level: string;
|
|
10
|
+
location: string;
|
|
11
|
+
lineNumber: number;
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const parseBrowserLogMessage: (input: string) => ParsedBrowserLogMessage | null;
|
|
15
|
+
export declare const formatChromeMessage: (input: string) => {
|
|
16
|
+
output: string;
|
|
17
|
+
tag: string;
|
|
18
|
+
} | null;
|
|
19
|
+
type ChromeLogLocation = {
|
|
20
|
+
location: string;
|
|
21
|
+
lineNumber: number;
|
|
22
|
+
};
|
|
23
|
+
export declare const parseChromeLogLocation: (message: string) => ChromeLogLocation | null;
|
|
24
|
+
export {};
|