import type { HybridObject } from 'react-native-nitro-modules' import type { OptionalAsyncOptions } from './OptionalWebLoader' import type { EncodedImageData, Image, RawPixelData } from './specs/Image.nitro' import type { ImageLoader } from './specs/ImageLoader.nitro' export type RequireType = number export type AsyncImageSource = | Image | ImageLoader | { filePath: string } | { rawPixelData: RawPixelData } | { encodedImageData: EncodedImageData } | { resource: string } | { symbolName: string } | { url: string; options?: OptionalAsyncOptions } | RequireType // @ts-expect-error i know what I'm doing export function isHybridObject(obj: T): obj is HybridObject { // @ts-expect-error return typeof obj === 'object' && obj != null && obj.dispose != null } // @ts-expect-error i know what I'm doing export function isHybridImage(obj: T): obj is Image { // @ts-expect-error return typeof obj === 'object' && obj != null && obj.toRawPixelData != null } export function isHybridImageLoader( obj: T, // @ts-expect-error i know what I'm doing ): obj is ImageLoader { // @ts-expect-error return typeof obj === 'object' && obj != null && obj.loadImage != null }