//@flow import { NativeModules, findNodeHandle } from "react-native"; const { RNViewShot } = NativeModules; export function takeSnapshot( view: number | ReactElement, options ?: { width ?: number; height ?: number; format ?: "png" | "jpg" | "jpeg" | "webm"; quality ?: number; } ): Promise { if (typeof view !== "number") { view = findNodeHandle(view); } return RNViewShot.takeSnapshot(view, options); } export default { takeSnapshot };