No Description

index.js 506B

123456789101112131415161718192021222324
  1. //@flow
  2. import { NativeModules, findNodeHandle } from "react-native";
  3. const { RNViewShot } = NativeModules;
  4. export function takeSnapshot(
  5. view: number | ReactElement<any>,
  6. options ?: {
  7. width ?: number;
  8. height ?: number;
  9. format ?: "png" | "jpg" | "jpeg" | "webm";
  10. quality ?: number;
  11. base64 ?: bool;
  12. }
  13. ): Promise<string> {
  14. if (typeof view !== "number") {
  15. view = findNodeHandle(view);
  16. }
  17. return RNViewShot.takeSnapshot(view, options);
  18. }
  19. export default { takeSnapshot };