mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-19 01:24:18 +00:00
@uppy/audio: remove unused component props (#5209)
This commit is contained in:
parent
c58e2c3644
commit
3cb0385fbf
5 changed files with 7 additions and 9 deletions
|
|
@ -23,10 +23,11 @@ export interface AudioOptions extends UIPluginOptions {
|
|||
interface AudioState {
|
||||
audioReady: boolean
|
||||
recordingLengthSeconds: number
|
||||
recordedAudio: string | null | undefined
|
||||
hasAudio: boolean
|
||||
cameraError: null
|
||||
audioSources: MediaDeviceInfo[]
|
||||
currentDeviceId?: null | string | MediaStreamTrack
|
||||
currentDeviceId: string | MediaStreamTrack | null | undefined
|
||||
isRecording: boolean
|
||||
showAudioSourceDropdown: boolean
|
||||
[id: string]: unknown
|
||||
|
|
@ -130,7 +131,7 @@ export default class Audio<M extends Meta, B extends Body> extends UIPlugin<
|
|||
.then((stream) => {
|
||||
this.#stream = stream
|
||||
|
||||
let currentDeviceId = null
|
||||
let currentDeviceId: AudioState['currentDeviceId'] = null
|
||||
const tracks = stream.getAudioTracks()
|
||||
|
||||
if (!options?.deviceId) {
|
||||
|
|
@ -368,9 +369,6 @@ export default class Audio<M extends Meta, B extends Body> extends UIPlugin<
|
|||
<RecordingScreen
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...audioState}
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore TODO: remove unused
|
||||
audioActive={this.#audioActive}
|
||||
onChangeSource={this.#changeSource}
|
||||
onStartRecording={this.#startRecording}
|
||||
onStopRecording={this.#stopRecording}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { h } from 'preact'
|
||||
|
||||
export interface AudioSourceSelectProps {
|
||||
currentDeviceId: string
|
||||
currentDeviceId: string | MediaStreamTrack | null | undefined
|
||||
audioSources: MediaDeviceInfo[]
|
||||
onChangeSource: (value: string) => void
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import DiscardButton from './DiscardButton.tsx'
|
|||
|
||||
interface RecordingScreenProps extends AudioSourceSelectProps {
|
||||
stream: MediaStream | null | undefined
|
||||
recordedAudio: string
|
||||
recordedAudio: string | null | undefined
|
||||
recording: boolean
|
||||
supportsRecording: boolean
|
||||
showAudioSourceDropdown: boolean | undefined
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { h, type ComponentChild } from 'preact'
|
||||
|
||||
export interface VideoSourceSelectProps {
|
||||
currentDeviceId: string | null
|
||||
currentDeviceId: string | MediaStreamTrack | null | undefined
|
||||
videoSources: MediaDeviceInfo[]
|
||||
onChangeVideoSource: (deviceId: string) => void
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ interface WebcamState {
|
|||
cameraError: null
|
||||
recordingLengthSeconds: number
|
||||
videoSources: MediaDeviceInfo[]
|
||||
currentDeviceId: null | string
|
||||
currentDeviceId: string | MediaStreamTrack | null | undefined
|
||||
isRecording: boolean
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue