From cb5a8c2c850019cc9c087e50b048dc1f09ebffb4 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Sun, 3 Mar 2024 20:35:04 +0800 Subject: [PATCH] enable exactOptionalPropertyTypes --- src/App.tsx | 3 ++- src/MediaSourcePlayer.tsx | 8 ++++---- src/components/CaptureFormatButton.tsx | 2 +- src/components/CopyClipboardButton.tsx | 6 +++--- src/components/OutSegTemplateEditor.tsx | 2 +- src/components/OutputFormatSelect.tsx | 2 +- src/components/PlaybackStreamSelector.tsx | 12 ++++++------ src/components/SegmentCutpointButton.tsx | 2 +- src/components/Working.tsx | 2 +- src/dialogs/html5ify.tsx | 2 +- src/dialogs/index.tsx | 9 ++++++++- src/dialogs/parameters.tsx | 3 ++- src/edlStore.ts | 6 +++--- src/hooks/useFrameCapture.ts | 2 +- src/hooks/useNativeMenu.ts | 1 + src/hooks/useSegments.ts | 2 +- src/types.ts | 2 +- src/util.ts | 13 +++++++------ src/util/duration.ts | 2 +- src/util/streams.ts | 2 +- tsconfig.web.json | 1 - 21 files changed, 47 insertions(+), 37 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 574c96a4..7ac455ef 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -111,7 +111,7 @@ function App() { const [ffmpegCommandLog, setFfmpegCommandLog] = useState([]); const [previewFilePath, setPreviewFilePath] = useState(); - const [working, setWorkingState] = useState<{ text: string, abortController?: AbortController }>(); + const [working, setWorkingState] = useState<{ text: string, abortController?: AbortController | undefined }>(); const [usingDummyVideo, setUsingDummyVideo] = useState(false); const [playing, setPlaying] = useState(false); const [compatPlayerEventId, setCompatPlayerEventId] = useState(0); @@ -879,6 +879,7 @@ function App() { setTotalProgress(); } + // @ts-expect-error todo // eslint-disable-next-line @typescript-eslint/no-explicit-any if (failedFiles.length > 0) toast.fire({ title: `${i18n.t('Failed to convert files:')} ${failedFiles.join(' ')}`, timer: null as any as undefined, showConfirmButton: true }); } catch (err) { diff --git a/src/MediaSourcePlayer.tsx b/src/MediaSourcePlayer.tsx index 2a781e1a..3d37952f 100644 --- a/src/MediaSourcePlayer.tsx +++ b/src/MediaSourcePlayer.tsx @@ -11,15 +11,15 @@ const { createMediaSourceStream, readOneJpegFrame } = remote.require('./compatPl async function startPlayback({ path, video, videoStreamIndex, audioStreamIndex, seekTo, signal, playSafe, onCanPlay, getTargetTime, size, fps }: { path: string, video: HTMLVideoElement, - videoStreamIndex?: number, - audioStreamIndex?: number, + videoStreamIndex?: number | undefined, + audioStreamIndex?: number | undefined, seekTo: number, signal: AbortSignal, playSafe: () => void, onCanPlay: () => void, getTargetTime: () => number, - size?: number, - fps?: number, + size?: number | undefined, + fps?: number | undefined, }) { let canPlay = false; let bufferEndTime: number | undefined; diff --git a/src/components/CaptureFormatButton.tsx b/src/components/CaptureFormatButton.tsx index c153e291..a323f629 100644 --- a/src/components/CaptureFormatButton.tsx +++ b/src/components/CaptureFormatButton.tsx @@ -11,7 +11,7 @@ const CaptureFormatButton = memo(({ showIcon = false, ...props }: { showIcon?: b const { captureFormat, toggleCaptureFormat } = useUserSettings(); return (