Share platform-split module types via .shared.ts files
Extract the prop/control types (and the video error classes) that were duplicated between web implementations and their native throw-stubs into sibling .shared.ts files, so both variants reference one definition and cannot drift. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BCuMKXWHuyGoNhTVAHBMyk
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
export function SubtitleFilePicker(_props: {
|
||||
onSelectFile: (file: File) => void
|
||||
disabled?: boolean
|
||||
}): never {
|
||||
import {type SubtitleFilePickerProps} from './SubtitleFilePicker.shared'
|
||||
|
||||
export function SubtitleFilePicker(_props: SubtitleFilePickerProps): never {
|
||||
throw new Error('SubtitleFilePicker is a web-only component')
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export type SubtitleFilePickerProps = {
|
||||
onSelectFile: (file: File) => void
|
||||
disabled?: boolean
|
||||
}
|
||||
@@ -9,14 +9,12 @@ import {atoms as a} from '#/alf'
|
||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||
import {CC_Stroke2_Corner0_Rounded as CCIcon} from '#/components/icons/CC'
|
||||
import * as Toast from '#/components/Toast'
|
||||
import {type SubtitleFilePickerProps} from './SubtitleFilePicker.shared'
|
||||
|
||||
export function SubtitleFilePicker({
|
||||
onSelectFile,
|
||||
disabled,
|
||||
}: {
|
||||
onSelectFile: (file: File) => void
|
||||
disabled?: boolean
|
||||
}) {
|
||||
}: SubtitleFilePickerProps) {
|
||||
const {_} = useLingui()
|
||||
const ref = useRef<HTMLInputElement>(null)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user