-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.ts
More file actions
28 lines (23 loc) · 773 Bytes
/
index.ts
File metadata and controls
28 lines (23 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Platform detection
const isExpo = (() => {
try {
const ExpoConstants = require("expo-constants").default;
return !!ExpoConstants.manifest || !!ExpoConstants.expoConfig;
} catch {
return false;
}
})();
// Export main SDK class
export { Rowt } from "./Rowt";
// Export types
export * from "./types";
// Export the appropriate hook based on platform
export const useDeepLink = isExpo
? require("./expo/hooks").useDeepLink
: require("./native/hooks").useDeepLink;
// Optional: Export platform-specific implementations for advanced users
export const PlatformImplementation = isExpo
? require("./expo").ExpoRowtConsole
: require("./native").NativeRowtConsole;
// Export platform detection utility
export const isExpoEnvironment = () => isExpo;