From 0d655e6f883e5682175c60fabea209e0e1d0642f Mon Sep 17 00:00:00 2001 From: npeter83 Date: Tue, 28 Jul 2026 00:24:38 +0200 Subject: [PATCH] fix(api): un-export types used only within their own module (knip gate) The S3b api.ts split introduced 5 exported-but-never-imported types (PlaylistKind/PlaylistSource, DownloadJobKind, YT internal option/data shapes). The publish gate's knip lane flagged them (my per-step checks ran tsc/eslint/ prettier/vitest but not knip). They're used inside their own modules by the interfaces, so make them local (consumers compare against literals, never name the type). --- frontend/src/lib/api.ts | 6 ++++-- frontend/src/lib/api/downloads.ts | 3 ++- frontend/src/lib/youtube.ts | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index baf0105..10115c2 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -159,8 +159,10 @@ export interface FeedResponse { // or optional (dead surface). Re-add if a consumer ever needs it. } -export type PlaylistKind = "user" | "watch_later"; -export type PlaylistSource = "local" | "youtube"; +// Not exported: consumers compare `playlist.kind`/`.source` against string literals, they never +// name these types — keeping them local satisfies the no-unused-exports gate (knip). +type PlaylistKind = "user" | "watch_later"; +type PlaylistSource = "local" | "youtube"; export interface Playlist { id: number; diff --git a/frontend/src/lib/api/downloads.ts b/frontend/src/lib/api/downloads.ts index 3cb220b..c3340e1 100644 --- a/frontend/src/lib/api/downloads.ts +++ b/frontend/src/lib/api/downloads.ts @@ -41,7 +41,8 @@ interface DownloadAsset { export type DownloadStatus = "queued" | "running" | "paused" | "done" | "error" | "canceled"; // "download" (default) or "edit" (a per-user trim/crop derivative cut from another job). -export type DownloadJobKind = "download" | "edit"; +// Local (not exported): consumers compare `job.job_kind` against literals, never name the type. +type DownloadJobKind = "download" | "edit"; // Phase-2 editor recipe. A single `trim` (one output file) or a `segments` cut-list joined into // one file. `accurate` re-encodes for a frame-accurate cut (a crop always re-encodes). diff --git a/frontend/src/lib/youtube.ts b/frontend/src/lib/youtube.ts index 82c087c..adc9ce7 100644 --- a/frontend/src/lib/youtube.ts +++ b/frontend/src/lib/youtube.ts @@ -3,7 +3,7 @@ // @types/youtube we declare just the methods/events PlayerModal calls, so tsc flags any new call // that isn't covered here. See [[reference-yt-iframe-api-remote-control-map]] for what's driveable. -export interface YTVideoData { +interface YTVideoData { title: string; author: string; video_id?: string; @@ -34,7 +34,7 @@ export interface YTPlayerEvent { target: YTPlayer; } -export interface YTPlayerOptions { +interface YTPlayerOptions { width?: string | number; height?: string | number; videoId?: string;