Add moduleSuffixes to tsconfig
Resolve platform-specific modules native-first ([".ios", ".android", ".native", ""]) during typechecking, matching the react-native customConditions already set by the base config. Typecheck now sees the .native variants of web-only modules, so their throw-stubs gain real signatures (typed props, never return, error class exports) to keep their web consumers typechecking correctly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BCuMKXWHuyGoNhTVAHBMyk
This commit is contained in:
@@ -1,3 +1,23 @@
|
|||||||
export function VideoEmbedInnerWeb() {
|
import {type AppBskyEmbedVideo} from '@atproto/api'
|
||||||
|
|
||||||
|
export function VideoEmbedInnerWeb(_props: {
|
||||||
|
embed: AppBskyEmbedVideo.View
|
||||||
|
active: boolean
|
||||||
|
setActive: () => void
|
||||||
|
onScreen: boolean
|
||||||
|
lastKnownTime: React.RefObject<number | undefined>
|
||||||
|
}): never {
|
||||||
throw new Error('VideoEmbedInnerWeb may not be used on native.')
|
throw new Error('VideoEmbedInnerWeb may not be used on native.')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class HLSUnsupportedError extends Error {
|
||||||
|
constructor() {
|
||||||
|
super('HLS is not supported')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class VideoNotFoundError extends Error {
|
||||||
|
constructor() {
|
||||||
|
super('Video not found')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+17
-1
@@ -1,3 +1,19 @@
|
|||||||
export function Controls() {
|
import type Hls from 'hls.js'
|
||||||
|
|
||||||
|
export function Controls(_props: {
|
||||||
|
videoRef: React.RefObject<HTMLVideoElement | null>
|
||||||
|
hlsRef: React.RefObject<Hls | undefined | null>
|
||||||
|
active: boolean
|
||||||
|
setActive: () => void
|
||||||
|
focused: boolean
|
||||||
|
setFocused: (focused: boolean) => void
|
||||||
|
onScreen: boolean
|
||||||
|
fullscreenRef: React.RefObject<HTMLDivElement | null>
|
||||||
|
hlsLoading: boolean
|
||||||
|
hasSubtitleTrack: boolean
|
||||||
|
isGif: boolean
|
||||||
|
altText?: string
|
||||||
|
updateCuePositions: (controlsVisible?: boolean) => void
|
||||||
|
}): never {
|
||||||
throw new Error('VideoWebControls may not be used on native.')
|
throw new Error('VideoWebControls may not be used on native.')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
export function useWelcomeModal() {
|
export function useWelcomeModal(): {
|
||||||
|
isOpen: boolean
|
||||||
|
open: () => void
|
||||||
|
close: () => void
|
||||||
|
} {
|
||||||
throw new Error('useWelcomeModal is web only')
|
throw new Error('useWelcomeModal is web only')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export function Provider({children}: {children: React.ReactNode}) {
|
|||||||
return children
|
return children
|
||||||
}
|
}
|
||||||
|
|
||||||
const noop = () => {}
|
const noop = (_scope: string) => {}
|
||||||
|
|
||||||
export function useHotkeysContext() {
|
export function useHotkeysContext() {
|
||||||
return useMemo(
|
return useMemo(
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
export function SubtitleFilePicker() {
|
export function SubtitleFilePicker(_props: {
|
||||||
|
onSelectFile: (file: File) => void
|
||||||
|
disabled?: boolean
|
||||||
|
}): never {
|
||||||
throw new Error('SubtitleFilePicker is a web-only component')
|
throw new Error('SubtitleFilePicker is a web-only component')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
|
"moduleSuffixes": [".ios", ".android", ".native", ""],
|
||||||
"lib": ["dom", "esnext"],
|
"lib": ["dom", "esnext"],
|
||||||
"types": ["node", "jest"],
|
"types": ["node", "jest"],
|
||||||
"paths": {
|
"paths": {
|
||||||
|
|||||||
Reference in New Issue
Block a user