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:
Claude
2026-07-11 19:38:43 +00:00
committed by Samuel Newman
parent f9384e44c7
commit 47293de3ac
6 changed files with 49 additions and 5 deletions
@@ -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.')
}
export class HLSUnsupportedError extends Error {
constructor() {
super('HLS is not supported')
}
}
export class VideoNotFoundError extends Error {
constructor() {
super('Video not found')
}
}
@@ -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.')
}
@@ -1,3 +1,7 @@
export function useWelcomeModal() {
export function useWelcomeModal(): {
isOpen: boolean
open: () => void
close: () => void
} {
throw new Error('useWelcomeModal is web only')
}
+1 -1
View File
@@ -4,7 +4,7 @@ export function Provider({children}: {children: React.ReactNode}) {
return children
}
const noop = () => {}
const noop = (_scope: string) => {}
export function useHotkeysContext() {
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')
}
+1
View File
@@ -3,6 +3,7 @@
"compilerOptions": {
"jsx": "react-jsx",
"module": "esnext",
"moduleSuffixes": [".ios", ".android", ".native", ""],
"lib": ["dom", "esnext"],
"types": ["node", "jest"],
"paths": {