Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// @flow
import { Platform } from 'react-native';
import { NativeModulesProxy, EventEmitter } from 'expo-core';
const MediaLibrary = NativeModulesProxy.ExponentMediaLibrary;
const eventEmitter = new EventEmitter(MediaLibrary);
type MediaTypeValue = 'audio' | 'photo' | 'video' | 'unknown';
type SortByKey =
| 'default'
| 'id'
| 'mediaType'
| 'width'
| 'height'
| 'creationTime'
| 'modificationTime'
| 'duration';
type SortByValue = [SortByKey, boolean] | SortByKey;
type MediaTypeObject = {
audio: 'audio',