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',
photo: 'photo',
// @flow
'use strict';
import { NativeModulesProxy, EventEmitter } from 'expo-core';
import { Platform } from 'react-native';
import type { EmitterSubscription } from 'react-native';
const AdMobInterstitialManager: Object = NativeModulesProxy.ExpoAdsAdMobInterstitialManager;
const adMobInterstitialEmitter = new EventEmitter(AdMobInterstitialManager);
const eventNames = [
'interstitialDidLoad',
'interstitialDidFailToLoad',
'interstitialDidOpen',
'interstitialDidClose',
'interstitialWillLeaveApplication',
];
type EventNameType =
| 'interstitialDidLoad'
| 'interstitialDidFailToLoad'
| 'interstitialDidOpen'
| 'interstitialDidClose'
| 'interstitialWillLeaveApplication';
// @flow
import invariant from 'invariant';
import { NativeModulesProxy, EventEmitter } from 'expo-core';
import { Platform } from 'react-native';
const { ExpoLocation: Location } = NativeModulesProxy;
const LocationEventEmitter = new EventEmitter(Location);
type ProviderStatus = {
locationServicesEnabled: boolean,
gpsAvailable: ?boolean,
networkAvailable: ?boolean,
passiveAvailable: ?boolean,
};
type LocationOptions = {
enableHighAccuracy?: boolean,
timeInterval?: number,
distanceInterval?: number,
};
type LocationTaskOptions = {
type: string,
// @flow
'use strict';
import { NativeModulesProxy, EventEmitter } from 'expo-core';
import { Platform } from 'react-native';
const AdMobRewardedVideoAdManager: Object = NativeModulesProxy.ExpoAdsAdMobRewardedVideoAdManager;
const adMobRewardedEventEmitter = new EventEmitter(AdMobRewardedVideoAdManager);
const eventNames = [
'rewardedVideoDidRewardUser',
'rewardedVideoDidLoad',
'rewardedVideoDidFailToLoad',
'rewardedVideoDidOpen',
'rewardedVideoDidStart',
'rewardedVideoDidClose',
'rewardedVideoWillLeaveApplication',
];
type EventNameType =
| 'rewardedVideoDidRewardUser'
| 'rewardedVideoDidLoad'
| 'rewardedVideoDidFailToLoad'
| 'rewardedVideoDidOpen'
};
interface PermissionResult {
status: string,
};
class GeocoderError extends Error {
code: string;
constructor() {
super('Geocoder service is not available for this device.');
this.code = 'E_NO_GEOCODER';
}
}
const emitter = new EventEmitter({} as any);
function positionToJSON(position: any): Position | null {
if (!position) return null;
const { coords = {}, timestamp } = position;
return {
coords: {
latitude: coords.latitude,
longitude: coords.longitude,
altitude: coords.altitude,
accuracy: coords.accuracy,
altitudeAccuracy: coords.altitudeAccuracy,
heading: coords.heading,
speed: coords.speed,
},
timestamp,
import { EventEmitter, Platform } from 'expo-core';
import invariant from 'invariant';
import ExpoLocation from './ExpoLocation';
const LocationEventEmitter = new EventEmitter(ExpoLocation);
interface ProviderStatus {
locationServicesEnabled: boolean,
gpsAvailable?: boolean,
networkAvailable?: boolean,
passiveAvailable?: boolean,
};
interface LocationOptions {
accuracy?: LocationAccuracy,
enableHighAccuracy?: boolean,
timeInterval?: number,
distanceInterval?: number,
timeout?: number,
};
import { EventEmitter, Platform } from 'expo-core';
import invariant from 'invariant';
import ExpoLocation from './ExpoLocation';
const LocationEventEmitter = new EventEmitter(ExpoLocation);
interface ProviderStatus {
locationServicesEnabled: boolean,
gpsAvailable?: boolean,
networkAvailable?: boolean,
passiveAvailable?: boolean,
};
interface LocationOptions {
accuracy?: LocationAccuracy,
enableHighAccuracy?: boolean,
timeInterval?: number,
distanceInterval?: number,
timeout?: number,
mayShowUserSettingsDialog?: boolean,
};
constructor(
url: string,
fileUri: string,
options: DownloadOptions = {},
callback: ?DownloadProgressCallback,
resumeData: ?string
) {
this._uuid = UUID.create(4).toString();
this._url = url;
this._fileUri = fileUri;
this._options = options;
this._resumeData = resumeData;
this._callback = callback;
this._subscription = null;
this._emitter = new EventEmitter(FS);
}
constructor(
url: string,
fileUri: string,
options: DownloadOptions = {},
callback: ?DownloadProgressCallback,
resumeData: ?string
) {
this._uuid = UUID.create(4).toString();
this._url = url;
this._fileUri = fileUri;
this._options = options;
this._resumeData = resumeData;
this._callback = callback;
this._subscription = null;
this._emitter = new EventEmitter(FS);
}