summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2025-08-30 20:45:47 +0200
committerMaze Winther <mazewinther@gmail.com>2025-08-30 20:45:47 +0200
commite98e40028ee3f9b074688fc54a1a1cae3caec63d (patch)
tree0c8ba04c6438c64a5a51fef1ae1172abdd48a81f /apps
parent454a308644dba6d79b74790a8632caf4fe66979c (diff)
downloadopencut-e98e40028ee3f9b074688fc54a1a1cae3caec63d.tar.gz
typescript: fix any types
Diffstat (limited to 'apps')
-rw-r--r--apps/web/src/lib/export.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/web/src/lib/export.ts b/apps/web/src/lib/export.ts
index f25f5f6b..d2593879 100644
--- a/apps/web/src/lib/export.ts
+++ b/apps/web/src/lib/export.ts
@@ -16,6 +16,8 @@ import { useMediaStore } from "@/stores/media-store";
import { useProjectStore } from "@/stores/project-store";
import { DEFAULT_FPS } from "@/stores/project-store";
import { ExportOptions, ExportResult } from "@/types/export";
+import { TimelineTrack } from "@/types/timeline";
+import { MediaFile } from "@/types/media";
export const DEFAULT_EXPORT_OPTIONS: ExportOptions = {
format: "mp4",
@@ -40,8 +42,8 @@ interface AudioElement {
}
async function createTimelineAudioBuffer(
- tracks: any[],
- mediaFiles: any[],
+ tracks: TimelineTrack[],
+ mediaFiles: MediaFile[],
duration: number,
sampleRate: number = 44100
): Promise<AudioBuffer | null> {
@@ -51,7 +53,7 @@ async function createTimelineAudioBuffer(
// Collect all audio elements from timeline
const audioElements: AudioElement[] = [];
- const mediaMap = new Map(mediaFiles.map((m) => [m.id, m]));
+ const mediaMap = new Map<string, MediaFile>(mediaFiles.map((m) => [m.id, m]));
for (const track of tracks) {
if (track.muted) continue;
@@ -59,7 +61,7 @@ async function createTimelineAudioBuffer(
for (const element of track.elements) {
if (element.type !== "media") continue;
- const mediaItem = mediaMap.get(element.mediaId);
+ const mediaItem = element.type === "media" ? mediaMap.get(element.mediaId) : null;
if (!mediaItem || mediaItem.type !== "audio") continue;
const visibleDuration =