UNPKG

react-native-devtools-sync

Version:

A tool for syncing React Query state to an external Dev Tools

26 lines (25 loc) 1.08 kB
/** * Platform and storage utilities that work across different environments (React Native, web, etc.) */ /** * Valid platform operating systems that can be used with React Native * @see https://reactnative.dev/docs/platform */ export type PlatformOS = "ios" | "android" | "web" | "windows" | "macos" | "native" | "tv" | "tvos" | "visionos" | "maccatalyst"; export interface StorageInterface { getItem: (key: string) => Promise<string | null>; setItem: (key: string, value: string) => Promise<void>; removeItem: (key: string) => Promise<void>; } export declare const isReactNative: () => boolean; /** * Get platform-specific URL for socket connection * On Android emulator, we need to replace localhost with 10.0.2.2 */ export declare const getPlatformSpecificURL: (baseUrl: string, platform: PlatformOS) => string; export declare const getStorage: () => StorageInterface; /** * Set a custom storage implementation * Use this if you need to provide your own storage solution */ export declare const setCustomStorage: (storage: StorageInterface | null) => void;