remotion 4.0.0-oops.3 → 4.0.0-prefetch.10

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.
Files changed (191) hide show
  1. package/.turbo/turbo-build.log +5 -5
  2. package/README.md +30 -19
  3. package/dist/AbsoluteFill.d.ts +6 -2
  4. package/dist/AbsoluteFill.js +7 -3
  5. package/dist/CanUseRemotionHooks.d.ts +5 -0
  6. package/dist/CanUseRemotionHooks.js +10 -0
  7. package/dist/Composition.d.ts +3 -6
  8. package/dist/Composition.js +40 -28
  9. package/dist/CompositionManager.d.ts +7 -12
  10. package/dist/CompositionManager.js +15 -5
  11. package/dist/Folder.d.ts +15 -0
  12. package/dist/Folder.js +33 -0
  13. package/dist/IFrame.js +1 -1
  14. package/dist/Img.js +33 -16
  15. package/dist/RemotionRoot.js +5 -4
  16. package/dist/{sequencing/index.d.ts → Sequence.d.ts} +13 -3
  17. package/dist/{sequencing/index.js → Sequence.js} +40 -34
  18. package/dist/Still.d.ts +1 -1
  19. package/dist/Still.js +1 -1
  20. package/dist/asset-types.d.ts +1 -4
  21. package/dist/audio/Audio.d.ts +2 -2
  22. package/dist/audio/Audio.js +5 -5
  23. package/dist/audio/AudioForDevelopment.d.ts +3 -2
  24. package/dist/audio/AudioForDevelopment.js +19 -6
  25. package/dist/audio/AudioForRendering.d.ts +5 -2
  26. package/dist/audio/AudioForRendering.js +15 -8
  27. package/dist/audio/index.js +5 -1
  28. package/dist/audio/props.d.ts +1 -1
  29. package/dist/audio/shared-audio-tags.d.ts +4 -3
  30. package/dist/audio/shared-audio-tags.js +115 -42
  31. package/dist/audio/use-audio-frame.js +4 -4
  32. package/dist/config/bundle-out-dir.d.ts +2 -0
  33. package/dist/config/bundle-out-dir.js +12 -0
  34. package/dist/config/input-props.js +12 -14
  35. package/dist/config/public-path.d.ts +2 -0
  36. package/dist/config/public-path.js +12 -0
  37. package/dist/{config/index.d.ts → config.d.ts} +70 -22
  38. package/dist/config.js +21 -0
  39. package/dist/default-css.d.ts +1 -0
  40. package/dist/default-css.js +9 -2
  41. package/dist/delay-render.d.ts +1 -1
  42. package/dist/delay-render.js +4 -4
  43. package/dist/freeze.d.ts +2 -2
  44. package/dist/freeze.js +2 -2
  45. package/dist/get-timeline-clip-name.js +2 -1
  46. package/dist/index.d.ts +23 -8
  47. package/dist/index.js +18 -8
  48. package/dist/internals.d.ts +35 -101
  49. package/dist/internals.js +18 -94
  50. package/dist/{interpolateColors.d.ts → interpolate-colors.d.ts} +0 -0
  51. package/dist/{interpolateColors.js → interpolate-colors.js} +0 -0
  52. package/dist/loading-indicator.d.ts +2 -0
  53. package/dist/loading-indicator.js +35 -0
  54. package/dist/loop/index.js +5 -4
  55. package/dist/multiple-versions-warning.js +18 -4
  56. package/dist/play-and-handle-not-allowed-error.d.ts +1 -1
  57. package/dist/portal-node.d.ts +1 -0
  58. package/dist/portal-node.js +23 -0
  59. package/dist/preload-state.d.ts +13 -0
  60. package/dist/preload-state.js +26 -0
  61. package/dist/preload.d.ts +7 -0
  62. package/dist/preload.js +83 -0
  63. package/dist/register-root.d.ts +2 -1
  64. package/dist/register-root.js +20 -5
  65. package/dist/series/index.d.ts +2 -2
  66. package/dist/series/index.js +4 -4
  67. package/dist/spring/index.d.ts +8 -4
  68. package/dist/spring/index.js +21 -6
  69. package/dist/spring/measure-spring.d.ts +1 -1
  70. package/dist/spring/measure-spring.js +1 -1
  71. package/dist/static-file.js +6 -0
  72. package/dist/timeline-position-state.d.ts +1 -1
  73. package/dist/{use-frame.d.ts → use-current-frame.d.ts} +0 -1
  74. package/dist/use-current-frame.js +28 -0
  75. package/dist/use-lazy-component.d.ts +3 -3
  76. package/dist/use-lazy-component.js +5 -1
  77. package/dist/use-media-in-timeline.d.ts +2 -2
  78. package/dist/use-media-in-timeline.js +10 -7
  79. package/dist/use-media-playback.d.ts +3 -2
  80. package/dist/use-media-playback.js +9 -6
  81. package/dist/use-media-tag-volume.d.ts +1 -1
  82. package/dist/use-sync-volume-with-media-tag.d.ts +2 -2
  83. package/dist/use-unsafe-video-config.d.ts +1 -1
  84. package/dist/use-unsafe-video-config.js +2 -2
  85. package/dist/use-video-config.d.ts +1 -1
  86. package/dist/use-video-config.js +6 -0
  87. package/dist/use-video.d.ts +13 -1
  88. package/dist/use-video.js +16 -3
  89. package/dist/validate-media-props.d.ts +4 -3
  90. package/dist/validation/validate-fps.d.ts +1 -1
  91. package/dist/validation/validate-fps.js +4 -1
  92. package/dist/validation/validate-offthreadvideo-image-format.d.ts +1 -0
  93. package/dist/validation/validate-offthreadvideo-image-format.js +15 -0
  94. package/dist/validation/validation-spring-duration.d.ts +1 -0
  95. package/dist/validation/validation-spring-duration.js +21 -0
  96. package/dist/version.d.ts +1 -0
  97. package/dist/version.js +5 -0
  98. package/dist/video/OffthreadVideo.d.ts +3 -0
  99. package/dist/video/OffthreadVideo.js +27 -0
  100. package/dist/video/OffthreadVideoForRendering.d.ts +3 -0
  101. package/dist/video/OffthreadVideoForRendering.js +101 -0
  102. package/dist/video/Video.d.ts +3 -3
  103. package/dist/video/Video.js +4 -4
  104. package/dist/video/VideoForDevelopment.d.ts +7 -2
  105. package/dist/video/VideoForDevelopment.js +28 -4
  106. package/dist/video/VideoForRendering.d.ts +5 -2
  107. package/dist/video/VideoForRendering.js +62 -40
  108. package/dist/video/get-current-time.d.ts +7 -1
  109. package/dist/video/get-current-time.js +17 -9
  110. package/dist/video/index.d.ts +3 -2
  111. package/dist/video/index.js +5 -12
  112. package/dist/video/props.d.ts +13 -2
  113. package/dist/volume-prop.js +1 -1
  114. package/dist/warn-about-non-seekable-media.d.ts +1 -1
  115. package/dist/warn-about-non-seekable-media.js +14 -2
  116. package/dist/wrap-remotion-context.d.ts +2 -1
  117. package/dist/wrap-remotion-context.js +12 -4
  118. package/ensure-correct-version.js +24 -0
  119. package/package.json +10 -11
  120. package/version.d.ts +1 -0
  121. package/version.js +1 -0
  122. package/dist/compress-assets.d.ts +0 -7
  123. package/dist/compress-assets.js +0 -25
  124. package/dist/config/browser-executable.d.ts +0 -3
  125. package/dist/config/browser-executable.js +0 -12
  126. package/dist/config/browser.d.ts +0 -4
  127. package/dist/config/browser.js +0 -19
  128. package/dist/config/chromium-flags.d.ts +0 -10
  129. package/dist/config/chromium-flags.js +0 -34
  130. package/dist/config/codec.d.ts +0 -17
  131. package/dist/config/codec.js +0 -103
  132. package/dist/config/concurrency.d.ts +0 -3
  133. package/dist/config/concurrency.js +0 -15
  134. package/dist/config/crf.d.ts +0 -9
  135. package/dist/config/crf.js +0 -83
  136. package/dist/config/env-file.d.ts +0 -2
  137. package/dist/config/env-file.js +0 -10
  138. package/dist/config/ffmpeg-executable.d.ts +0 -3
  139. package/dist/config/ffmpeg-executable.js +0 -12
  140. package/dist/config/frame-range.d.ts +0 -5
  141. package/dist/config/frame-range.js +0 -80
  142. package/dist/config/image-format.d.ts +0 -8
  143. package/dist/config/image-format.js +0 -37
  144. package/dist/config/image-sequence.d.ts +0 -3
  145. package/dist/config/image-sequence.js +0 -15
  146. package/dist/config/index.js +0 -175
  147. package/dist/config/log.d.ts +0 -7
  148. package/dist/config/log.js +0 -25
  149. package/dist/config/max-timeline-tracks.d.ts +0 -2
  150. package/dist/config/max-timeline-tracks.js +0 -24
  151. package/dist/config/override-webpack.d.ts +0 -12
  152. package/dist/config/override-webpack.js +0 -14
  153. package/dist/config/overwrite.d.ts +0 -3
  154. package/dist/config/overwrite.js +0 -14
  155. package/dist/config/pixel-format.d.ts +0 -8
  156. package/dist/config/pixel-format.js +0 -38
  157. package/dist/config/preview-server.d.ts +0 -2
  158. package/dist/config/preview-server.js +0 -20
  159. package/dist/config/prores-profile.d.ts +0 -7
  160. package/dist/config/prores-profile.js +0 -32
  161. package/dist/config/quality.d.ts +0 -2
  162. package/dist/config/quality.js +0 -17
  163. package/dist/config/scale.d.ts +0 -3
  164. package/dist/config/scale.js +0 -15
  165. package/dist/config/still-frame.d.ts +0 -2
  166. package/dist/config/still-frame.js +0 -12
  167. package/dist/config/timeout.d.ts +0 -2
  168. package/dist/config/timeout.js +0 -17
  169. package/dist/config/webpack-caching.d.ts +0 -3
  170. package/dist/config/webpack-caching.js +0 -16
  171. package/dist/feature-flags.d.ts +0 -1
  172. package/dist/feature-flags.js +0 -7
  173. package/dist/initial-frame.d.ts +0 -2
  174. package/dist/initial-frame.js +0 -12
  175. package/dist/is-audio-codec.d.ts +0 -2
  176. package/dist/is-audio-codec.js +0 -7
  177. package/dist/perf/index.d.ts +0 -5
  178. package/dist/perf/index.js +0 -33
  179. package/dist/timeline-inout-position-state.d.ts +0 -12
  180. package/dist/timeline-inout-position-state.js +0 -23
  181. package/dist/timeout.d.ts +0 -2
  182. package/dist/timeout.js +0 -12
  183. package/dist/use-frame.js +0 -25
  184. package/dist/validation/validate-frame.d.ts +0 -1
  185. package/dist/validation/validate-frame.js +0 -24
  186. package/dist/validation/validate-image-format.d.ts +0 -2
  187. package/dist/validation/validate-image-format.js +0 -9
  188. package/dist/validation/validate-opengl-renderer.d.ts +0 -4
  189. package/dist/validation/validate-opengl-renderer.js +0 -14
  190. package/dist/validation/validate-quality.d.ts +0 -1
  191. package/dist/validation/validate-quality.js +0 -21
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateSelectedCodecAndProResCombination = exports.setProResProfile = exports.getProResProfile = void 0;
4
- const proResProfileOptions = [
5
- '4444-xq',
6
- '4444',
7
- 'hq',
8
- 'standard',
9
- 'light',
10
- 'proxy',
11
- ];
12
- let proResProfile;
13
- const getProResProfile = () => {
14
- return proResProfile;
15
- };
16
- exports.getProResProfile = getProResProfile;
17
- const setProResProfile = (profile) => {
18
- proResProfile = profile;
19
- };
20
- exports.setProResProfile = setProResProfile;
21
- const validateSelectedCodecAndProResCombination = (actualCodec, actualProResProfile) => {
22
- if (typeof actualProResProfile !== 'undefined' && actualCodec !== 'prores') {
23
- throw new TypeError('You have set a ProRes profile but the codec is not "prores". Set the codec to "prores" or remove the ProRes profile.');
24
- }
25
- if (actualProResProfile !== undefined &&
26
- !proResProfileOptions.includes(actualProResProfile)) {
27
- throw new TypeError(`The ProRes profile "${actualProResProfile}" is not valid. Valid options are ${proResProfileOptions
28
- .map((p) => `"${p}"`)
29
- .join(', ')}`);
30
- }
31
- };
32
- exports.validateSelectedCodecAndProResCombination = validateSelectedCodecAndProResCombination;
@@ -1,2 +0,0 @@
1
- export declare const setQuality: (q: number | undefined) => void;
2
- export declare const getQuality: () => number | undefined;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getQuality = exports.setQuality = void 0;
4
- const validate_quality_1 = require("../validation/validate-quality");
5
- const defaultValue = undefined;
6
- let quality = defaultValue;
7
- const setQuality = (q) => {
8
- (0, validate_quality_1.validateQuality)(q);
9
- if (q === 0 || q === undefined) {
10
- quality = defaultValue;
11
- return;
12
- }
13
- quality = q;
14
- };
15
- exports.setQuality = setQuality;
16
- const getQuality = () => quality;
17
- exports.getQuality = getQuality;
@@ -1,3 +0,0 @@
1
- export declare type Scale = number;
2
- export declare const setScale: (newScale: Scale) => void;
3
- export declare const getScale: () => number;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getScale = exports.setScale = void 0;
4
- let currentScale = 1;
5
- const setScale = (newScale) => {
6
- if (typeof newScale !== 'number') {
7
- throw new Error('--scale flag must be a number.');
8
- }
9
- currentScale = newScale;
10
- };
11
- exports.setScale = setScale;
12
- const getScale = () => {
13
- return currentScale;
14
- };
15
- exports.getScale = getScale;
@@ -1,2 +0,0 @@
1
- export declare const setStillFrame: (frame: number) => void;
2
- export declare const getStillFrame: () => number;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getStillFrame = exports.setStillFrame = void 0;
4
- const validate_frame_1 = require("../validation/validate-frame");
5
- let stillFrame = 0;
6
- const setStillFrame = (frame) => {
7
- (0, validate_frame_1.validateFrame)(frame, Infinity);
8
- stillFrame = frame;
9
- };
10
- exports.setStillFrame = setStillFrame;
11
- const getStillFrame = () => stillFrame;
12
- exports.getStillFrame = getStillFrame;
@@ -1,2 +0,0 @@
1
- export declare const setPuppeteerTimeout: (newPuppeteerTimeout: number) => void;
2
- export declare const getCurrentPuppeteerTimeout: () => number;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCurrentPuppeteerTimeout = exports.setPuppeteerTimeout = void 0;
4
- const timeout_1 = require("../timeout");
5
- let currentTimeout = timeout_1.DEFAULT_PUPPETEER_TIMEOUT;
6
- const setPuppeteerTimeout = (newPuppeteerTimeout) => {
7
- if (typeof newPuppeteerTimeout !== 'number') {
8
- throw new Error('--timeout flag / setTimeoutInMilliseconds() must be a number, but got ' +
9
- JSON.stringify(newPuppeteerTimeout));
10
- }
11
- currentTimeout = newPuppeteerTimeout;
12
- };
13
- exports.setPuppeteerTimeout = setPuppeteerTimeout;
14
- const getCurrentPuppeteerTimeout = () => {
15
- return currentTimeout;
16
- };
17
- exports.getCurrentPuppeteerTimeout = getCurrentPuppeteerTimeout;
@@ -1,3 +0,0 @@
1
- export declare const DEFAULT_WEBPACK_CACHE_ENABLED = true;
2
- export declare const setWebpackCaching: (flag: boolean) => void;
3
- export declare const getWebpackCaching: () => boolean;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getWebpackCaching = exports.setWebpackCaching = exports.DEFAULT_WEBPACK_CACHE_ENABLED = void 0;
4
- exports.DEFAULT_WEBPACK_CACHE_ENABLED = true;
5
- let webpackCaching = exports.DEFAULT_WEBPACK_CACHE_ENABLED;
6
- const setWebpackCaching = (flag) => {
7
- if (typeof flag !== 'boolean') {
8
- throw new TypeError('Caching flag must be a boolean.');
9
- }
10
- webpackCaching = flag;
11
- };
12
- exports.setWebpackCaching = setWebpackCaching;
13
- const getWebpackCaching = () => {
14
- return webpackCaching;
15
- };
16
- exports.getWebpackCaching = getWebpackCaching;
@@ -1 +0,0 @@
1
- export declare const FEATURE_FLAG_FIREFOX_SUPPORT = false;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FEATURE_FLAG_FIREFOX_SUPPORT = void 0;
4
- // There is no Firefox support yet, the waitForFunction method
5
- // does not yet work and downloading has a bug.
6
- // Disabling this for now!
7
- exports.FEATURE_FLAG_FIREFOX_SUPPORT = false;
@@ -1,2 +0,0 @@
1
- export declare const INITIAL_FRAME_LOCAL_STORAGE_KEY = "remotion.initialFrame";
2
- export declare const setupInitialFrame: () => void;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setupInitialFrame = exports.INITIAL_FRAME_LOCAL_STORAGE_KEY = void 0;
4
- exports.INITIAL_FRAME_LOCAL_STORAGE_KEY = 'remotion.initialFrame';
5
- const getInitialFrame = () => {
6
- const param = localStorage.getItem(exports.INITIAL_FRAME_LOCAL_STORAGE_KEY);
7
- return param ? Number(param) : 0;
8
- };
9
- const setupInitialFrame = () => {
10
- window.remotion_initialFrame = getInitialFrame();
11
- };
12
- exports.setupInitialFrame = setupInitialFrame;
@@ -1,2 +0,0 @@
1
- import { Codec } from './config';
2
- export declare const isAudioCodec: (codec: Codec | undefined) => boolean;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isAudioCodec = void 0;
4
- const isAudioCodec = (codec) => {
5
- return codec === 'mp3' || codec === 'aac' || codec === 'wav';
6
- };
7
- exports.isAudioCodec = isAudioCodec;
@@ -1,5 +0,0 @@
1
- declare type PerfId = 'activate-target' | 'capture' | 'save';
2
- export declare const startPerfMeasure: (marker: PerfId) => number;
3
- export declare const stopPerfMeasure: (id: number) => void;
4
- export declare const logPerf: () => void;
5
- export {};
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.logPerf = exports.stopPerfMeasure = exports.startPerfMeasure = void 0;
4
- const perf = {
5
- 'activate-target': [],
6
- capture: [],
7
- save: [],
8
- };
9
- const map = {};
10
- const startPerfMeasure = (marker) => {
11
- const id = Math.random();
12
- map[id] = {
13
- id,
14
- marker,
15
- start: Date.now(),
16
- };
17
- return id;
18
- };
19
- exports.startPerfMeasure = startPerfMeasure;
20
- const stopPerfMeasure = (id) => {
21
- const now = Date.now();
22
- const diff = now - map[id].start;
23
- perf[map[id].marker].push(diff);
24
- delete map[id];
25
- };
26
- exports.stopPerfMeasure = stopPerfMeasure;
27
- const logPerf = () => {
28
- console.log('Render performance:');
29
- Object.keys(perf).forEach((p) => {
30
- console.log(` ${p} => ${perf[p].reduce((a, b) => a + b, 0) / perf[p].length} (n = ${perf[p].length})`);
31
- });
32
- };
33
- exports.logPerf = logPerf;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- export declare type TimelineInOutContextValue = {
3
- inFrame: number | null;
4
- outFrame: number | null;
5
- };
6
- export declare type SetTimelineInOutContextValue = {
7
- setInAndOutFrames: (u: React.SetStateAction<TimelineInOutContextValue>) => void;
8
- };
9
- export declare const TimelineInOutContext: React.Context<TimelineInOutContextValue>;
10
- export declare const SetTimelineInOutContext: React.Context<SetTimelineInOutContextValue>;
11
- export declare const useTimelineInOutFramePosition: () => TimelineInOutContextValue;
12
- export declare const useTimelineSetInOutFramePosition: () => SetTimelineInOutContextValue;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useTimelineSetInOutFramePosition = exports.useTimelineInOutFramePosition = exports.SetTimelineInOutContext = exports.TimelineInOutContext = void 0;
4
- const react_1 = require("react");
5
- exports.TimelineInOutContext = (0, react_1.createContext)({
6
- inFrame: null,
7
- outFrame: null,
8
- });
9
- exports.SetTimelineInOutContext = (0, react_1.createContext)({
10
- setInAndOutFrames: () => {
11
- throw new Error('default');
12
- },
13
- });
14
- const useTimelineInOutFramePosition = () => {
15
- const state = (0, react_1.useContext)(exports.TimelineInOutContext);
16
- return state;
17
- };
18
- exports.useTimelineInOutFramePosition = useTimelineInOutFramePosition;
19
- const useTimelineSetInOutFramePosition = () => {
20
- const { setInAndOutFrames } = (0, react_1.useContext)(exports.SetTimelineInOutContext);
21
- return { setInAndOutFrames };
22
- };
23
- exports.useTimelineSetInOutFramePosition = useTimelineSetInOutFramePosition;
package/dist/timeout.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const DEFAULT_PUPPETEER_TIMEOUT = 30000;
2
- export declare const setupPuppeteerTimeout: () => void;
package/dist/timeout.js DELETED
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setupPuppeteerTimeout = exports.DEFAULT_PUPPETEER_TIMEOUT = void 0;
4
- exports.DEFAULT_PUPPETEER_TIMEOUT = 30000;
5
- const getPuppeteerTimeout = () => {
6
- const param = window.remotion_puppeteerTimeout;
7
- return param ? Number(param) : exports.DEFAULT_PUPPETEER_TIMEOUT;
8
- };
9
- const setupPuppeteerTimeout = () => {
10
- window.remotion_puppeteerTimeout = getPuppeteerTimeout();
11
- };
12
- exports.setupPuppeteerTimeout = setupPuppeteerTimeout;
package/dist/use-frame.js DELETED
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useCurrentFrame = exports.useAbsoluteCurrentFrame = void 0;
4
- const react_1 = require("react");
5
- const sequencing_1 = require("./sequencing");
6
- const timeline_position_state_1 = require("./timeline-position-state");
7
- const useAbsoluteCurrentFrame = () => {
8
- const timelinePosition = (0, timeline_position_state_1.useTimelinePosition)();
9
- return timelinePosition;
10
- };
11
- exports.useAbsoluteCurrentFrame = useAbsoluteCurrentFrame;
12
- /**
13
- * Get the current frame of the video.
14
- * Frames are 0-indexed, meaning the first frame is 0, the last frame is the duration of the composition in frames minus one.
15
- * @link https://www.remotion.dev/docs/use-current-frame
16
- */
17
- const useCurrentFrame = () => {
18
- const frame = (0, exports.useAbsoluteCurrentFrame)();
19
- const context = (0, react_1.useContext)(sequencing_1.SequenceContext);
20
- const contextOffset = context
21
- ? context.cumulatedFrom + context.relativeFrom
22
- : 0;
23
- return frame - contextOffset;
24
- };
25
- exports.useCurrentFrame = useCurrentFrame;
@@ -1 +0,0 @@
1
- export declare const validateFrame: (frame: number, durationInFrames: number) => void;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateFrame = void 0;
4
- const validateFrame = (frame, durationInFrames) => {
5
- if (typeof frame === 'undefined') {
6
- throw new TypeError(`Argument missing for parameter "frame"`);
7
- }
8
- if (typeof frame !== 'number') {
9
- throw new TypeError(`Argument passed for "frame" is not a number: ${frame}`);
10
- }
11
- if (frame < 0) {
12
- throw new RangeError(`Frame ${frame} cannot be negative`);
13
- }
14
- if (!Number.isFinite(frame)) {
15
- throw new RangeError(`Frame ${frame} is not finite`);
16
- }
17
- if (frame % 1 !== 0) {
18
- throw new RangeError(`Argument for frame must be an integer, but got ${frame}`);
19
- }
20
- if (frame > durationInFrames - 1) {
21
- throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
22
- }
23
- };
24
- exports.validateFrame = validateFrame;
@@ -1,2 +0,0 @@
1
- import { ImageFormat } from '../config';
2
- export declare const validateNonNullImageFormat: (imageFormat: ImageFormat) => void;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateNonNullImageFormat = void 0;
4
- const validateNonNullImageFormat = (imageFormat) => {
5
- if (imageFormat !== 'jpeg' && imageFormat !== 'png') {
6
- throw new TypeError('Image format should be either "png" or "jpeg"');
7
- }
8
- };
9
- exports.validateNonNullImageFormat = validateNonNullImageFormat;
@@ -1,4 +0,0 @@
1
- declare const validRenderers: readonly ["angle", "egl", "swiftshader"];
2
- export declare type OpenGlRenderer = typeof validRenderers[number];
3
- export declare const validateOpenGlRenderer: (option: OpenGlRenderer | null) => OpenGlRenderer | null;
4
- export {};
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateOpenGlRenderer = void 0;
4
- const validRenderers = ['angle', 'egl', 'swiftshader'];
5
- const validateOpenGlRenderer = (option) => {
6
- if (option === null) {
7
- return null;
8
- }
9
- if (!validRenderers.includes(option)) {
10
- throw new TypeError(`${option} is not a valid GL backend. Accepted values: ${validRenderers.join(', ')}`);
11
- }
12
- return option;
13
- };
14
- exports.validateOpenGlRenderer = validateOpenGlRenderer;
@@ -1 +0,0 @@
1
- export declare const validateQuality: (q: number | undefined) => void;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateQuality = void 0;
4
- const validateQuality = (q) => {
5
- if (typeof q !== 'undefined' && typeof q !== 'number') {
6
- throw new Error(`Quality option must be a number or undefined. Got ${typeof q} (${JSON.stringify(q)})`);
7
- }
8
- if (typeof q === 'undefined') {
9
- return;
10
- }
11
- if (!Number.isFinite(q)) {
12
- throw new RangeError(`Quality must be a finite number, but is ${q}`);
13
- }
14
- if (Number.isNaN(q)) {
15
- throw new RangeError(`Quality is NaN, but must be a real number`);
16
- }
17
- if (q > 100 || q < 0) {
18
- throw new RangeError('Quality option must be between 0 and 100.');
19
- }
20
- };
21
- exports.validateQuality = validateQuality;