MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / createMockTimeline

Function createMockTimeline

packages/core/src/runtime/init.test.ts:6–34  ·  view source on GitHub ↗
(duration: number)

Source from the content-addressed store, hash-verified

4import type { RuntimeTimelineLike } from "./types";
5
6function createMockTimeline(duration: number): RuntimeTimelineLike {
7 const state = { time: 0, paused: true, duration };
8 return {
9 play: () => {
10 state.paused = false;
11 },
12 pause: () => {
13 state.paused = true;
14 },
15 seek: (time: number) => {
16 state.time = time;
17 },
18 totalTime: (time: number) => {
19 state.time = time;
20 },
21 time: () => state.time,
22 duration: () => state.duration,
23 add: () => {},
24 paused: (value?: boolean) => {
25 if (typeof value === "boolean") {
26 state.paused = value;
27 }
28 return state.paused;
29 },
30 timeScale: () => {},
31 set: () => {},
32 getChildren: () => [],
33 };
34}
35
36function createPaddableMockTimeline(duration: number): RuntimeTimelineLike {
37 const timeline = createMockTimeline(duration) as RuntimeTimelineLike & {

Callers 2

init.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected