INNER CODE UNIT · TypeScript

resolveModule

codedogQBY/ReadAny · packages/app-expo/modules/system-tts-synthesis/index.ts:31

function resolveModule(): SystemTtsSynthesisModule {
  if (Platform.OS !== "android" && Platform.OS !== "ios") return noop;
  try {
    return requireNativeModule<SystemTtsSynthesisModule>("SystemTtsSynthesis");
  } catch {
    return noop;
  }
}

const mod = resolveModule();

export function isSystemTtsSynthesisAvailable(): boolean {
  return (Platform.OS === "android" || Platform.OS === "ios") && mod !== noop;
}

export default mod;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…