diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx
index 79c80aa29d..6a1f17ae3f 100644
--- a/types/expo/expo-tests.tsx
+++ b/types/expo/expo-tests.tsx
@@ -1,4 +1,5 @@
import * as React from 'react';
+import { Text } from 'react-native';
import {
Accelerometer,
@@ -12,6 +13,7 @@ import {
BlurView,
Brightness,
Camera,
+ CameraObject,
DocumentPicker,
Facebook,
FacebookAds,
@@ -19,7 +21,13 @@ import {
ImagePicker,
ImageManipulator,
FaceDetector,
- Svg
+ Svg,
+ IntentLauncherAndroid,
+ KeepAwake,
+ LinearGradient,
+ Permissions,
+ registerRootComponent,
+ ScreenOrientation
} from 'expo';
Accelerometer.addListener((obj) => {
@@ -36,7 +44,7 @@ Amplitude.setUserProperties({key: 1});
Amplitude.clearUserProperties();
Amplitude.logEvent('name');
Amplitude.logEventWithProperties('event', {key: 'value'});
-Amplitude.setGroup('type', {key: 'value'});
+Amplitude.setGroup('type', ['value']);
const asset = Asset.fromModule(1);
asset.downloadAsync();
@@ -86,8 +94,83 @@ Audio.setAudioModeAsync({
allowsRecordingIOS: true
});
Audio.setIsEnabledAsync(true);
+
+Audio.INTERRUPTION_MODE_IOS_MIX_WITH_OTHERS === 0;
+Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX === 1;
+Audio.INTERRUPTION_MODE_IOS_DUCK_OTHERS === 2;
+
+Audio.INTERRUPTION_MODE_ANDROID_DO_NOT_MIX === 1;
+Audio.INTERRUPTION_MODE_ANDROID_DUCK_OTHERS === 2;
+
+Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_DEFAULT === 0;
+Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_THREE_GPP === 1;
+Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG_4 === 2;
+Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_NB === 3;
+Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_WB === 4;
+Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADIF === 5;
+Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADTS === 6;
+Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_RTP_AVP === 7;
+Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG2TS === 8;
+Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_WEBM === 9;
+
+Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_DEFAULT === 0;
+Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_NB === 1;
+Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_WB === 2;
+Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC === 3;
+Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_HE_AAC === 4;
+Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC_ELD === 5;
+Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_VORBIS === 6;
+
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_LINEARPCM === 'lpcm';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AC3 === 'ac-3';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_60958AC3 === 'cac3';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLEIMA4 === 'ima4';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC === 'aac ';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4CELP === 'celp';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4HVXC === 'hvxc';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4TWINVQ === 'twvq';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE3 === 'MAC3';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE6 === 'MAC6';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ULAW === 'ulaw';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ALAW === 'alaw';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN === 'QDMC';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN2 === 'QDM2';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_QUALCOMM === 'Qclp';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER1 === '.mp1';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER2 === '.mp2';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER3 === '.mp3';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLELOSSLESS === 'alac';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE === 'aach';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_LD === 'aacl';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD === 'aace';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_SBR === 'aacf';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_V2 === 'aacg';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE_V2 === 'aacp';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_SPATIAL === 'aacs';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR === 'samr';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR_WB === 'sawb';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AUDIBLE === 'AUDB';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ILBC === 'ilbc';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_DVIINTELIMA === 0x6d730011;
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MICROSOFTGSM === 0x6d730031;
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AES3 === 'aes3';
+Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ENHANCEDAC3 === 'ec-3';
+
+Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MIN === 0;
+Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_LOW === 0x20;
+Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MEDIUM === 0x40;
+Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_HIGH === 0x60;
+Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MAX === 0x7f;
+
+Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_CONSTANT === 0;
+Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_LONG_TERM_AVERAGE === 1;
+Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE_CONSTRAINED === 2;
+Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE === 3;
+
+Audio.RECORDING_OPTIONS_PRESET_HIGH_QUALITY;
+Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY;
async () => {
- const result = await Audio.Sound.create('uri', {
+ const result = await Audio.Sound.create({uri: 'uri'}, {
volume: 0.5,
rate: 0.6
}, null, true);
@@ -103,7 +186,7 @@ async () => {
}
const _status = await sound.getStatusAsync();
- await sound.loadAsync('uri');
+ await sound.loadAsync({uri: 'uri'});
};
() => (
@@ -344,3 +427,124 @@ async () => {
);
+
+IntentLauncherAndroid.ACTION_ACCESSIBILITY_SETTINGS === 'android.settings.ACCESSIBILITY_SETTINGS';
+IntentLauncherAndroid.ACTION_APP_NOTIFICATION_REDACTION === 'android.settings.ACTION_APP_NOTIFICATION_REDACTION';
+IntentLauncherAndroid.ACTION_CONDITION_PROVIDER_SETTINGS === 'android.settings.ACTION_CONDITION_PROVIDER_SETTINGS';
+IntentLauncherAndroid.ACTION_NOTIFICATION_LISTENER_SETTINGS === 'android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS';
+IntentLauncherAndroid.ACTION_PRINT_SETTINGS === 'android.settings.ACTION_PRINT_SETTINGS';
+IntentLauncherAndroid.ACTION_ADD_ACCOUNT_SETTINGS === 'android.settings.ADD_ACCOUNT_SETTINGS';
+IntentLauncherAndroid.ACTION_AIRPLANE_MODE_SETTINGS === 'android.settings.AIRPLANE_MODE_SETTINGS';
+IntentLauncherAndroid.ACTION_APN_SETTINGS === 'android.settings.APN_SETTINGS';
+IntentLauncherAndroid.ACTION_APPLICATION_DETAILS_SETTINGS === 'android.settings.APPLICATION_DETAILS_SETTINGS';
+IntentLauncherAndroid.ACTION_APPLICATION_DEVELOPMENT_SETTINGS === 'android.settings.APPLICATION_DEVELOPMENT_SETTINGS';
+IntentLauncherAndroid.ACTION_APPLICATION_SETTINGS === 'android.settings.APPLICATION_SETTINGS';
+IntentLauncherAndroid.ACTION_APP_NOTIFICATION_SETTINGS === 'android.settings.APP_NOTIFICATION_SETTINGS';
+IntentLauncherAndroid.ACTION_APP_OPS_SETTINGS === 'android.settings.APP_OPS_SETTINGS';
+IntentLauncherAndroid.ACTION_BATTERY_SAVER_SETTINGS === 'android.settings.BATTERY_SAVER_SETTINGS';
+IntentLauncherAndroid.ACTION_BLUETOOTH_SETTINGS === 'android.settings.BLUETOOTH_SETTINGS';
+IntentLauncherAndroid.ACTION_CAPTIONING_SETTINGS === 'android.settings.CAPTIONING_SETTINGS';
+IntentLauncherAndroid.ACTION_CAST_SETTINGS === 'android.settings.CAST_SETTINGS';
+IntentLauncherAndroid.ACTION_DATA_ROAMING_SETTINGS === 'android.settings.DATA_ROAMING_SETTINGS';
+IntentLauncherAndroid.ACTION_DATE_SETTINGS === 'android.settings.DATE_SETTINGS';
+IntentLauncherAndroid.ACTION_DEVICE_INFO_SETTINGS === 'android.settings.DEVICE_INFO_SETTINGS';
+IntentLauncherAndroid.ACTION_DEVICE_NAME === 'android.settings.DEVICE_NAME';
+IntentLauncherAndroid.ACTION_DISPLAY_SETTINGS === 'android.settings.DISPLAY_SETTINGS';
+IntentLauncherAndroid.ACTION_DREAM_SETTINGS === 'android.settings.DREAM_SETTINGS';
+IntentLauncherAndroid.ACTION_HARD_KEYBOARD_SETTINGS === 'android.settings.HARD_KEYBOARD_SETTINGS';
+IntentLauncherAndroid.ACTION_HOME_SETTINGS === 'android.settings.HOME_SETTINGS';
+IntentLauncherAndroid.ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS === 'android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS';
+IntentLauncherAndroid.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS === 'android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS';
+IntentLauncherAndroid.ACTION_INPUT_METHOD_SETTINGS === 'android.settings.INPUT_METHOD_SETTINGS';
+IntentLauncherAndroid.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS === 'android.settings.INPUT_METHOD_SUBTYPE_SETTINGS';
+IntentLauncherAndroid.ACTION_INTERNAL_STORAGE_SETTINGS === 'android.settings.INTERNAL_STORAGE_SETTINGS';
+IntentLauncherAndroid.ACTION_LOCALE_SETTINGS === 'android.settings.LOCALE_SETTINGS';
+IntentLauncherAndroid.ACTION_LOCATION_SOURCE_SETTINGS === 'android.settings.LOCATION_SOURCE_SETTINGS';
+IntentLauncherAndroid.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS === 'android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS';
+IntentLauncherAndroid.ACTION_MANAGE_APPLICATIONS_SETTINGS === 'android.settings.MANAGE_APPLICATIONS_SETTINGS';
+IntentLauncherAndroid.ACTION_MANAGE_DEFAULT_APPS_SETTINGS === 'android.settings.MANAGE_DEFAULT_APPS_SETTINGS';
+IntentLauncherAndroid.ACTION_MEMORY_CARD_SETTINGS === 'android.settings.MEMORY_CARD_SETTINGS';
+IntentLauncherAndroid.ACTION_MONITORING_CERT_INFO === 'android.settings.MONITORING_CERT_INFO';
+IntentLauncherAndroid.ACTION_NETWORK_OPERATOR_SETTINGS === 'android.settings.NETWORK_OPERATOR_SETTINGS';
+IntentLauncherAndroid.ACTION_NFCSHARING_SETTINGS === 'android.settings.NFCSHARING_SETTINGS';
+IntentLauncherAndroid.ACTION_NFC_PAYMENT_SETTINGS === 'android.settings.NFC_PAYMENT_SETTINGS';
+IntentLauncherAndroid.ACTION_NFC_SETTINGS === 'android.settings.NFC_SETTINGS';
+IntentLauncherAndroid.ACTION_NIGHT_DISPLAY_SETTINGS === 'android.settings.NIGHT_DISPLAY_SETTINGS';
+IntentLauncherAndroid.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS === 'android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS';
+IntentLauncherAndroid.ACTION_NOTIFICATION_SETTINGS === 'android.settings.NOTIFICATION_SETTINGS';
+IntentLauncherAndroid.ACTION_PAIRING_SETTINGS === 'android.settings.PAIRING_SETTINGS';
+IntentLauncherAndroid.ACTION_PRIVACY_SETTINGS === 'android.settings.PRIVACY_SETTINGS';
+IntentLauncherAndroid.ACTION_QUICK_LAUNCH_SETTINGS === 'android.settings.QUICK_LAUNCH_SETTINGS';
+IntentLauncherAndroid.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS === 'android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS';
+IntentLauncherAndroid.ACTION_SECURITY_SETTINGS === 'android.settings.SECURITY_SETTINGS';
+IntentLauncherAndroid.ACTION_SETTINGS === 'android.settings.SETTINGS';
+IntentLauncherAndroid.ACTION_SHOW_ADMIN_SUPPORT_DETAILS === 'android.settings.SHOW_ADMIN_SUPPORT_DETAILS';
+IntentLauncherAndroid.ACTION_SHOW_INPUT_METHOD_PICKER === 'android.settings.SHOW_INPUT_METHOD_PICKER';
+IntentLauncherAndroid.ACTION_SHOW_REGULATORY_INFO === 'android.settings.SHOW_REGULATORY_INFO';
+IntentLauncherAndroid.ACTION_SHOW_REMOTE_BUGREPORT_DIALOG === 'android.settings.SHOW_REMOTE_BUGREPORT_DIALOG';
+IntentLauncherAndroid.ACTION_SOUND_SETTINGS === 'android.settings.SOUND_SETTINGS';
+IntentLauncherAndroid.ACTION_STORAGE_MANAGER_SETTINGS === 'android.settings.STORAGE_MANAGER_SETTINGS';
+IntentLauncherAndroid.ACTION_SYNC_SETTINGS === 'android.settings.SYNC_SETTINGS';
+IntentLauncherAndroid.ACTION_SYSTEM_UPDATE_SETTINGS === 'android.settings.SYSTEM_UPDATE_SETTINGS';
+IntentLauncherAndroid.ACTION_TETHER_PROVISIONING_UI === 'android.settings.TETHER_PROVISIONING_UI';
+IntentLauncherAndroid.ACTION_TRUSTED_CREDENTIALS_USER === 'android.settings.TRUSTED_CREDENTIALS_USER';
+IntentLauncherAndroid.ACTION_USAGE_ACCESS_SETTINGS === 'android.settings.USAGE_ACCESS_SETTINGS';
+IntentLauncherAndroid.ACTION_USER_DICTIONARY_INSERT === 'android.settings.USER_DICTIONARY_INSERT';
+IntentLauncherAndroid.ACTION_USER_DICTIONARY_SETTINGS === 'android.settings.USER_DICTIONARY_SETTINGS';
+IntentLauncherAndroid.ACTION_USER_SETTINGS === 'android.settings.USER_SETTINGS';
+IntentLauncherAndroid.ACTION_VOICE_CONTROL_AIRPLANE_MODE === 'android.settings.VOICE_CONTROL_AIRPLANE_MODE';
+IntentLauncherAndroid.ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE === 'android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE';
+IntentLauncherAndroid.ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE === 'android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE';
+IntentLauncherAndroid.ACTION_VOICE_INPUT_SETTINGS === 'android.settings.VOICE_INPUT_SETTINGS';
+IntentLauncherAndroid.ACTION_VPN_SETTINGS === 'android.settings.VPN_SETTINGS';
+IntentLauncherAndroid.ACTION_VR_LISTENER_SETTINGS === 'android.settings.VR_LISTENER_SETTINGS';
+IntentLauncherAndroid.ACTION_WEBVIEW_SETTINGS === 'android.settings.WEBVIEW_SETTINGS';
+IntentLauncherAndroid.ACTION_WIFI_IP_SETTINGS === 'android.settings.WIFI_IP_SETTINGS';
+IntentLauncherAndroid.ACTION_WIFI_SETTINGS === 'android.settings.WIFI_SETTINGS';
+IntentLauncherAndroid.ACTION_WIRELESS_SETTINGS === 'android.settings.WIRELESS_SETTINGS';
+IntentLauncherAndroid.ACTION_ZEN_MODE_AUTOMATION_SETTINGS === 'android.settings.ZEN_MODE_AUTOMATION_SETTINGS';
+IntentLauncherAndroid.ACTION_ZEN_MODE_EVENT_RULE_SETTINGS === 'android.settings.ZEN_MODE_EVENT_RULE_SETTINGS';
+IntentLauncherAndroid.ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS === 'android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS';
+IntentLauncherAndroid.ACTION_ZEN_MODE_PRIORITY_SETTINGS === 'android.settings.ZEN_MODE_PRIORITY_SETTINGS';
+IntentLauncherAndroid.ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS === 'android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS';
+IntentLauncherAndroid.ACTION_ZEN_MODE_SETTINGS === 'android.settings.ZEN_MODE_SETTINGS';
+
+KeepAwake.activate();
+KeepAwake.deactivate();
+
+() => (
+
+);
+
+Permissions.CAMERA === 'camera';
+Permissions.CAMERA_ROLL === 'cameraRoll';
+Permissions.AUDIO_RECORDING === 'audioRecording';
+Permissions.CONTACTS === 'contacts';
+Permissions.NOTIFICATIONS === 'remoteNotifications';
+Permissions.REMOTE_NOTIFICATIONS === 'remoteNotifications';
+Permissions.SYSTEM_BRIGHTNESS === 'systemBrightness';
+async () => {
+ const result = await Permissions.askAsync(Permissions.CAMERA);
+
+ result.status === 'granted';
+ result.status === 'denied';
+ result.status === 'undetermined';
+
+ result.expires === 'never';
+};
+
+ScreenOrientation.Orientation.ALL;
+ScreenOrientation.allow(ScreenOrientation.Orientation.ALL);
+
+class __TestEntry__ extends React.Component {
+ render() {
+ return(
+ test
+ );
+ }
+}
+registerRootComponent(__TestEntry__);
diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts
index 9a583b830c..ae7e45841d 100644
--- a/types/expo/index.d.ts
+++ b/types/expo/index.d.ts
@@ -2,36 +2,37 @@
// Project: https://github.com/expo/expo-sdk
// Definitions by: Konstantin Kai
// Martynas Kadiša
+// Jan Aagaard
// Sergio Sánchez
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
import { EventSubscription } from 'fbemitter';
-import { Component, ComponentClass, Ref } from 'react';
+import { Component, ComponentClass, Ref, ComponentType } from 'react';
import {
- ViewStyle,
- ViewProperties,
ColorPropType,
+ ImageRequireSource,
ImageURISource,
NativeEventEmitter,
- ImageRequireSource
+ ViewProperties,
+ ViewStyle,
+ Permission
} from 'react-native';
-export type URISource = ImageURISource;
+export type Axis = number;
+export type BarCodeReadCallback = (params: { type: string; data: string; }) => void;
+export type FloatFromZeroToOne = 0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1;
+export type Md5 = string;
+export type Orientation = 'portrait' | 'landscape';
export type RequireSource = ImageRequireSource;
export type ResizeModeContain = 'contain';
export type ResizeModeCover = 'cover';
export type ResizeModeStretch = 'stretch';
-export type Orientation = 'portrait' | 'landscape';
-export type Axis = number;
-export interface HashMap { [key: string]: any; }
-export type FloatFromZeroToOne = 0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1;
-export type BarCodeReadCallback = (params: { type: string; data: string; }) => void;
-export type Md5 = string;
+export type URISource = ImageURISource;
-/**
- * Accelerometer
- */
+export interface HashMap { [key: string]: any; }
+
+/** Access the device accelerometer sensor(s) to respond to changes in acceleration in 3d space. */
export namespace Accelerometer {
interface AccelerometerObject {
x: Axis;
@@ -39,27 +40,88 @@ export namespace Accelerometer {
z: Axis;
}
+ /**
+ * Subscribe for updates to the accelerometer.
+ * @param listener A callback that is invoked when an accelerometer update is available. When invoked, the listener is provided a single argumument that is an object containing keys x, y, z.
+ * @returns An EventSubscription object that you can call remove() on when you would like to unsubscribe the listener.
+ */
function addListener(listener: (obj: AccelerometerObject) => any): EventSubscription;
+
+ /** Remove all listeners. */
function removeAllListeners(): void;
+
+ /**
+ * Subscribe for updates to the accelerometer.
+ * @param intervalMs Desired interval in milliseconds between accelerometer updates.
+ */
function setUpdateInterval(intervalMs: number): void;
}
/**
- * Amplitude
+ * Provides access to Amplitude mobile analytics which basically lets you log various events to the Cloud. This module wraps Amplitude’s iOS and Android SDKs.
+ *
+ * Note: Session tracking may not work correctly when running Experiences in the main Expo app. It will work correctly if you create a standalone app.
*/
export namespace Amplitude {
+ /** Initializes Amplitude with your Amplitude API key. */
function initialize(apiKey: string): void;
+
+ /** Assign a user ID to the current user. If you don’t have a system for user IDs you don’t need to call this. */
function setUserId(userId: string): void;
+
+ /** Set properties for the current user. */
function setUserProperties(userProperties: HashMap): void;
+
+ /** Clear properties set by `setUserProperties()`. */
function clearUserProperties(): void;
+
+ /** Log an event to Amplitude. */
function logEvent(eventName: string): void;
- function logEventWithProperties(eventName: string, properties: HashMap): void;
- function setGroup(groupType: string, groupNames: HashMap): void;
+
+ /** Log an event to Amplitude with custom properties. */
+ function logEventWithProperties(
+ eventName: string,
+
+ /** A map of custom properties. */
+ properties: HashMap
+ ): void;
+
+ /** Add the current user to a group. */
+ function setGroup(
+ /** The group name, e.g. `'sports'`. */
+ groupType: string,
+
+ /** An array of group names, e.g. `['tennis', 'soccer']`. */
+ groupNames: string[]
+ ): void;
}
+// #region AppLoading
+/** The following props are recommended, but optional for the sake of backwards compatibility (they were introduced in SDK21). If you do not provide any props, you are responsible for coordinating loading assets, handling errors, and updating state to unmount the `AppLoading` component. */
+export type AppLoadingProps = {
+ /** A `function` that returns a `Promise`. The `Promise` should resolve when the app is done loading data and assets. */
+ startAsync: () => Promise;
+
+ /** Required if you provide `startAsync`. Called when `startAsync` resolves or rejects. This should be used to set state and unmount the `AppLoading` component. */
+ onFinish: () => void;
+
+ /** If `startAsync` throws an error, it is caught and passed into the function provided to `onError`. */
+ onError?: (error: Error) => void;
+} | {
+ startAsync: null;
+ onFinish: null;
+ onError?: null;
+};
+
/**
- * Asset
+ * A React component that tells Expo to keep the app loading screen open if it is the first and only component rendered in your app. When it is removed, the loading screen will disappear and your app will be visible.
+ *
+ * This is incredibly useful to let you download and cache fonts, logo and icon images and other assets that you want to be sure the user has on their device for an optimal experience before rendering they start using the app.
*/
+export class AppLoading extends Component { }
+// #endregion AppLoading
+
+/** This module provides an interface to Expo’s asset system. An asset is any file that lives alongside the source code of your app that the app needs at runtime. Examples include images, fonts and sounds. Expo’s asset system integrates with React Native’s, so that you can refer to files with require('path/to/file'). This is how you refer to static image files in React Native for use in an Image component, for example. */
export class Asset {
constructor({ name, type, hash, uri, width, height }: {
name: string;
@@ -69,116 +131,142 @@ export class Asset {
width?: number;
height?: number;
});
+
+ /** The MD5 hash of the asset’s data. */
+ hash: Md5;
+
+ /** The name of the asset file without the extension. Also without the part from @ onward in the filename (used to specify scale factor for images). */
name: string;
+
+ /** The extension of the asset filename. */
type: string;
- hash: string;
+
+ /** A URI that points to the asset’s data on the remote server. When running the published version of your app, this refers to the the location on Expo’s asset server where Expo has stored your asset. When running the app from XDE during development, this URI points to XDE’s server running on your computer and the asset is served directly from your computer. */
uri: string;
+
+ /** If the asset has been downloaded (by calling `downloadAsync()`), the `file://` URI pointing to the local file on the device that contains the asset data. */
localUri: string;
+
+ /** If the asset is an image, the width of the image data divided by the scale factor. The scale factor is the number after `@` in the filename, or `1` if not present. */
width?: number;
+
+ /** If the asset is an image, the height of the image data divided by the scale factor. The scale factor is the number after `@` in the filename, or `1` if not present. */
height?: number;
downloading: boolean;
downloaded: boolean;
downloadCallbacks: Array<{ resolve: () => any, reject: (e?: any) => any }>;
+ /** Downloads the asset data to a local file in the device’s cache directory. Once the returned promise is fulfilled without error, the localUri field of this asset points to a local file containing the asset data. The asset is only downloaded if an up-to-date local file for the asset isn’t already present due to an earlier download. */
downloadAsync(): Promise;
+ /** Returns the `Expo.Asset` instance representing an asset given its module. */
static fromModule(module: RequireSource): Asset;
+
+ /**
+ * A helper that wraps `Expo.Asset.fromModule(module).downloadAsync` for convenience.
+ * @param moduleIds An array of `require('path/to/file')`. Can also be just one module without an Array.
+ */
static loadAsync(module: RequireSource[] | RequireSource): Promise;
}
/**
- * AuthSession
+ * Provides basic sample playback and recording.
+ *
+ * Note that Expo does not yet support backgrounding, so audio is not available to play in the background of your experience. Audio also automatically stops if headphones / bluetooth audio devices are disconnected.
*/
-export namespace AuthSession {
- function startAsync(options: { authUrl: string; returnUrl?: string; }): Promise<{
- type: 'cancel';
- } | {
- type: 'dismissed';
- } | {
- type: 'success';
- params: HashMap;
- event: HashMap;
- } | {
- type: 'error';
- params: HashMap;
- errorCode: string;
- event: HashMap;
- }>;
- function dismiss(): void;
- function getRedirectUrl(): string;
-}
-
-/**
- * AV
- */
-export type PlaybackStatus = {
- isLoaded: false;
- androidImplementation?: string;
- error?: string;
-} | {
- isLoaded: true;
- androidImplementation?: string;
- uri: string;
- progressUpdateIntervalMillis: number;
- durationMillis?: number;
- positionMillis: number;
- playableDurationMillis?: number;
- shouldPlay: boolean;
- isPlaying: boolean;
- isBuffering: boolean;
- rate: number;
- shouldCorrectPitch: boolean;
- volume: number;
- isMuted: boolean;
- isLooping: boolean;
- didJustFinish: boolean;
-};
-
-export interface PlaybackStatusToSet {
- androidImplementation?: string;
- progressUpdateIntervalMillis?: number;
- positionMillis?: number;
- shouldPlay?: boolean;
- rate?: FloatFromZeroToOne;
- shouldCorrectPitch?: boolean;
- volume?: FloatFromZeroToOne;
- isMuted?: boolean;
- isLooping?: boolean;
-}
-
-export type Source = string | RequireSource | Asset;
-
-export class PlaybackObject {
- loadAsync(source: Source, initialStatus?: PlaybackStatusToSet, downloadFirst?: boolean): Promise;
- unloadAsync(): Promise;
- getStatusAsync(): Promise;
- setOnPlaybackStatusUpdate(onPlaybackStatusUpdate: (status: PlaybackStatus) => void): void;
- setStatusAsync(status: PlaybackStatusToSet): Promise;
- playAsync(): Promise;
- playFromPositionAsync(positionMillis: number): Promise;
- pauseAsync(): Promise;
- stopAsync(): Promise;
- setPositionAsync(positionMillis: number): Promise;
- setRateAsync(rate: number, shouldCorrectPitch: boolean): Promise;
- setVolumeAsync(volume: number): Promise;
- setIsMutedAsync(isMuted: boolean): Promise;
- setIsLoopingAsync(isLooping: boolean): Promise;
- setProgressUpdateIntervalAsync(progressUpdateIntervalMillis: number): Promise;
-}
-
export namespace Audio {
- enum InterruptionModeIOS {
+ enum InterruptionModeIos {
+ /** This is the default option. If this option is set, your experience’s audio is mixed with audio playing in background apps. */
INTERRUPTION_MODE_IOS_MIX_WITH_OTHERS = 0,
+
+ /** If this option is set, your experience’s audio interrupts audio from other apps. */
INTERRUPTION_MODE_IOS_DO_NOT_MIX = 1,
+
+ /** If this option is set, your experience’s audio lowers the volume ("ducks") of audio from other apps while your audio plays. */
INTERRUPTION_MODE_IOS_DUCK_OTHERS = 2
}
+ const INTERRUPTION_MODE_IOS_MIX_WITH_OTHERS: 0;
+ const INTERRUPTION_MODE_IOS_DO_NOT_MIX: 1;
+ const INTERRUPTION_MODE_IOS_DUCK_OTHERS: 2;
+
enum InterruptionModeAndroid {
+ /** If this option is set, your experience’s audio interrupts audio from other apps. */
INTERRUPTION_MODE_ANDROID_DO_NOT_MIX = 1,
+
+ /** This is the default option. If this option is set, your experience’s audio lowers the volume ("ducks") of audio from other apps while your audio plays. */
INTERRUPTION_MODE_ANDROID_DUCK_OTHERS = 2
}
+ const INTERRUPTION_MODE_ANDROID_DO_NOT_MIX: 1;
+ const INTERRUPTION_MODE_ANDROID_DUCK_OTHERS: 2;
+
+ const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_DEFAULT: 0;
+ const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_THREE_GPP: 1;
+ const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG_4: 2;
+ const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_NB: 3;
+ const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_WB: 4;
+ const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADIF: 5;
+ const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADTS: 6;
+ const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_RTP_AVP: 7;
+ const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG2TS: 8;
+ const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_WEBM: 9;
+
+ const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_DEFAULT: 0;
+ const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_NB: 1;
+ const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_WB: 2;
+ const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC: 3;
+ const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_HE_AAC: 4;
+ const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC_ELD: 5;
+ const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_VORBIS: 6;
+
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_LINEARPCM: 'lpcm';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_AC3: 'ac-3';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_60958AC3: 'cac3';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLEIMA4: 'ima4';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC: 'aac ';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4CELP: 'celp';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4HVXC: 'hvxc';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4TWINVQ: 'twvq';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE3: 'MAC3';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE6: 'MAC6';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_ULAW: 'ulaw';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_ALAW: 'alaw';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN: 'QDMC';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN2: 'QDM2';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_QUALCOMM: 'Qclp';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER1: '.mp1';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER2: '.mp2';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER3: '.mp3';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLELOSSLESS: 'alac';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE: 'aach';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_LD: 'aacl';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD: 'aace';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_SBR: 'aacf';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_V2: 'aacg';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE_V2: 'aacp';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_SPATIAL: 'aacs';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR: 'samr';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR_WB: 'sawb';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_AUDIBLE: 'AUDB';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_ILBC: 'ilbc';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_DVIINTELIMA: 0x6d730011;
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MICROSOFTGSM: 0x6d730031;
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_AES3: 'aes3';
+ const RECORDING_OPTION_IOS_OUTPUT_FORMAT_ENHANCEDAC3: 'ec-3';
+
+ const RECORDING_OPTION_IOS_AUDIO_QUALITY_MIN: 0;
+ const RECORDING_OPTION_IOS_AUDIO_QUALITY_LOW: 0x20;
+ const RECORDING_OPTION_IOS_AUDIO_QUALITY_MEDIUM: 0x40;
+ const RECORDING_OPTION_IOS_AUDIO_QUALITY_HIGH: 0x60;
+ const RECORDING_OPTION_IOS_AUDIO_QUALITY_MAX: 0x7f;
+
+ const RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_CONSTANT: 0;
+ const RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_LONG_TERM_AVERAGE: 1;
+ const RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE_CONSTRAINED: 2;
+ const RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE: 3;
+
type RecordingStatus = {
canRecord: false,
isDoneRecording: false
@@ -192,27 +280,8 @@ export namespace Audio {
durationMillis: number
};
- interface AudioMode {
- playsInSilentModeIOS: boolean;
- allowsRecordingIOS: boolean;
- interruptionModeIOS: InterruptionModeIOS;
- shouldDuckAndroid: boolean;
- interruptionModeAndroid: InterruptionModeAndroid;
- }
-
- function setIsEnabledAsync(value: boolean): Promise;
- function setAudioModeAsync(mode: AudioMode): Promise;
-
- class Sound extends PlaybackObject {
- constructor();
-
- static create(
- source: Source,
- initialStatus?: PlaybackStatusToSet,
- onPlaybackStatusUpdate?: ((status: PlaybackStatus) => void) | null,
- downloadFirst?: boolean
- ): Promise<{ sound: Sound, status: PlaybackStatus }>;
- }
+ const RECORDING_OPTIONS_PRESET_HIGH_QUALITY: RecordingOptions;
+ const RECORDING_OPTIONS_PRESET_LOW_QUALITY: RecordingOptions;
interface RecordingOptions {
android: {
@@ -239,110 +308,320 @@ export namespace Audio {
};
}
+ interface AudioMode {
+ /** Boolean selecting if your experience’s audio should play in silent mode on iOS. This value defaults to `false`. */
+ playsInSilentModeIOS: boolean;
+
+ /** Boolean selecting if recording is enabled on iOS. This value defaults to `false`. NOTE: when this flag is set to true, playback may be routed to the phone receiver instead of to the speaker. */
+ allowsRecordingIOS: boolean;
+
+ /** Enum selecting how your experience’s audio should interact with the audio from other apps on iOS. */
+ interruptionModeIOS: InterruptionModeIos;
+
+ /** Boolean selecting if your experience’s audio should automatically be lowered in volume ("duck") if audio from another app interrupts your experience. This value defaults to true. If false, audio from other apps will pause your audio. */
+ shouldDuckAndroid: boolean;
+
+ /** an enum selecting how your experience’s audio should interact with the audio from other apps on Android: */
+ interruptionModeAndroid: InterruptionModeAndroid;
+ }
+
+ function setIsEnabledAsync(value: boolean): Promise;
+ function setAudioModeAsync(mode: AudioMode): Promise;
+
+ /** This class represents a sound corresponding to an Asset or URL. */
+ class Sound extends PlaybackObject {
+ constructor();
+
+ /**
+ * Creates and loads a sound from source, with optional `initialStatus`, `onPlaybackStatusUpdate`, and `downloadFirst`.
+ *
+ * @returns A `Promise` that is rejected if creation failed, or fulfilled with the following dictionary if creation succeeded:
+ * - `sound`: The newly created and loaded Sound object.
+ * - `status`: The PlaybackStatus of the Sound object. See the AV documentation for further information.
+ */
+ static create(
+ /**
+ * The source of the sound. The following forms are supported:
+ *
+ * - A dictionary of the form `{ uri: 'http://path/to/file' }` with a network URL pointing to an audio file on the web.
+ * - `require('path/to/file')` for an audio file asset in the source code directory.
+ * - An `Expo.Asset` object for an audio file asset.
+ */
+ source: PlaybackSource,
+
+ /** The initial intended PlaybackStatusToSet of the sound, whose values will override the default initial playback status. This value defaults to `{}` if no parameter is passed. */
+ initialStatus?: PlaybackStatusToSet,
+
+ /** A function taking a single parameter PlaybackStatus. This value defaults to `null` if no parameter is passed. */
+ onPlaybackStatusUpdate?: ((status: PlaybackStatus) => void) | null,
+
+ /** If set to true, the system will attempt to download the resource to the device before loading. This value defaults to `true`. Note that at the moment, this will only work for `source`s of the form `require('path/to/file')` or `Asset` objects. */
+ downloadFirst?: boolean
+ ): Promise<{ sound: Sound, status: PlaybackStatus }>;
+ }
+
class Recording {
constructor();
+ /** Gets the `status` of the `Recording`. */
getStatusAsync(): Promise;
- setOnRecordingStatusUpdate(onRecordingStatusUpdate: (status: RecordingStatus) => void): void;
- setProgressUpdateInterval(miliss: number): void;
- prepareToRecordAsync(options: Recording): Promise;
- isPreparedToRecord(): boolean;
+
+ /** Sets a function to be called regularly with the `status` of the `Recording`. */
+ setOnRecordingStatusUpdate(onRecordingStatusUpdate?: (status: RecordingStatus) => void): void;
+
+ /** Sets the interval with which onRecordingStatusUpdate is called while the recording can record. This value defaults to 500 milliseconds. */
+ setProgressUpdateInterval(progressUpdateIntervalMillis: number): void;
+
+ /** Loads the recorder into memory and prepares it for recording. This must be called before calling `startAsync()`. This method can only be called if the `Recording` instance has never yet been prepared. */
+ prepareToRecordAsync(
+ /** Options for the recording, including sample rate, bitrate, channels, format, encoder, and extension. If no options are passed to `prepareToRecordAsync()`, the recorder will be created with options `Expo.Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY`. */
+ options?: RecordingOptions
+ ): Promise;
+
+ /** Begins recording. This method can only be called if the `Recording` has been prepared. */
startAsync(): Promise;
+
+ /**
+ * Pauses recording. This method can only be called if the Recording has been prepared.
+ *
+ * NOTE: This is only available on Android API version 24 and later.
+ */
pauseAsync(): Promise;
+
+ /** Stops the recording and deallocates the recorder from memory. This reverts the Recording instance to an unprepared state, and another Recording instance must be created in order to record again. This method can only be called if the `Recording` has been prepared. */
stopAndUnloadAsync(): Promise;
- getURI(): string | undefined;
- createNewLoadedSound(initialStatus: PlaybackStatusToSet, onPlaybackStatusUpdate: (status: PlaybackStatus) => void): Promise<{ sound: Sound, status: PlaybackStatus }>;
+
+ /**
+ * Gets the local URI of the Recording. Note that this will only succeed once the Recording is prepared to record.
+ *
+ * @returns A string with the local URI of the `Recording`, or `null` if the `Recording` is not prepared to record.
+ */
+ getURI(): string | null | undefined;
+
+ /**
+ * Creates and loads a new `Sound` object to play back the `Recording`. Note that this will only succeed once the `Recording` is done recording (once `stopAndUnloadAsync()` has been called).
+ *
+ * @returns A Promise that is rejected if creation failed, or fulfilled with the following dictionary if creation succeeded:
+ * - `sound`: the newly created and loaded Sound object.
+ * - `status`: the PlaybackStatus of the Sound object.
+ */
+ createNewLoadedSound(
+ /** The initial intended `PlaybackStatusToSet` of the sound, whose values will override the default initial playback status. This value defaults to `{}` if no parameter is passed. */
+ initialStatus?: PlaybackStatusToSet,
+
+ /** A function taking a single parameter `PlaybackStatus`. This value defaults to `null` if no parameter is passed. */
+ onPlaybackStatusUpdate?: ((status: PlaybackStatus) => void) | null
+ ): Promise<{ sound: Sound, status: PlaybackStatus }>;
}
}
/**
- * Expo Video
+ * AuthSession
*/
-export interface NaturalSize {
- width: number;
- height: number;
- orientation: Orientation;
+export namespace AuthSession {
+ type StartAsyncResponse = {
+ type: 'cancel';
+ } | {
+ type: 'dismissed';
+ } | {
+ type: 'success';
+ params: HashMap;
+ event: HashMap;
+ } | {
+ type: 'error';
+ params: HashMap;
+ errorCode: string;
+ event: HashMap;
+ };
+
+ function startAsync(options: { authUrl: string; returnUrl?: string; }): Promise;
+ function dismiss(): void;
+ function getRedirectUrl(): string;
}
-export interface ReadyForDisplayEvent {
- naturalSize: NaturalSize;
- status: PlaybackStatus;
-}
+// #region AV
+/**
+ * AV
+ */
+export type PlaybackStatus = {
+ isLoaded: false;
+ androidImplementation?: string;
-export enum FullscreenUpdateVariants {
- IOS_FULLSCREEN_UPDATE_PLAYER_WILL_PRESENT = 0,
- IOS_FULLSCREEN_UPDATE_PLAYER_DID_PRESENT = 1,
- IOS_FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS = 2,
- IOS_FULLSCREEN_UPDATE_PLAYER_DID_DISMISS = 3
-}
+ /** Populated exactly once when an error forces the object to unload. */
+ error?: string;
+} | {
+ isLoaded: true;
+ androidImplementation?: string;
+ uri: string;
+ progressUpdateIntervalMillis: number;
+ durationMillis?: number;
+ positionMillis: number;
+ playableDurationMillis?: number;
+ shouldPlay: boolean;
+ isPlaying: boolean;
+ isBuffering: boolean;
+ rate: number;
+ shouldCorrectPitch: boolean;
+ volume: number;
+ isMuted: boolean;
+ isLooping: boolean;
-export interface FullscreenUpdateEvent {
- fullscreenUpdate: FullscreenUpdateVariants;
- status: PlaybackStatus;
-}
+ /** True exactly once when the track plays to finish. */
+ didJustFinish: boolean;
+};
-export interface VideoProps {
- source?: Source | null;
- posterSource?: URISource | RequireSource;
-
- resizeMode?: ResizeModeContain | ResizeModeCover | ResizeModeStretch;
- useNativeControls?: boolean;
- usePoster?: boolean;
-
- onPlaybackStatusUpdate?: (status: PlaybackStatus) => void;
- onReadyForDisplay?: (event: ReadyForDisplayEvent) => void;
- onIOSFullscreenUpdate?: (event: FullscreenUpdateEvent) => void;
-
- onLoadStart?: () => void;
- onLoad?: (status: PlaybackStatus) => void;
- onError?: (error: string) => void;
-
- status?: PlaybackStatusToSet;
+export interface PlaybackStatusToSet {
+ androidImplementation?: string;
progressUpdateIntervalMillis?: number;
positionMillis?: number;
shouldPlay?: boolean;
- rate?: number;
+ rate?: FloatFromZeroToOne;
shouldCorrectPitch?: boolean;
- volume?: number;
+ volume?: FloatFromZeroToOne;
isMuted?: boolean;
isLooping?: boolean;
-
- scaleX?: number;
- scaleY?: number;
- translateX?: number;
- translateY?: number;
- rotation?: number;
- ref?: Ref;
}
-export interface VideoState {
- showPoster: boolean;
+export type PlaybackSource = RequireSource | { uri: string } | Asset;
+
+export class PlaybackObject {
+ /**
+ * Gets the `PlaybackStatus` of the `playbackObject`.
+ *
+ * Returns a `Promise` that is fulfilled with the `PlaybackStatus` of the `playbackObject`.
+ */
+ getStatusAsync(): Promise;
+
+ /**
+ * Loads the media from source into memory and prepares it for playing. This must be called before calling setStatusAsync() or any of the convenience set status methods. This method can only be called if the playbackObject is in an unloaded state.
+ *
+ * Returns a `Promise` that is fulfilled with the `PlaybackStatus` of the `playbackObject` once it is loaded, or rejects if loading failed. The `Promise` will also reject if the `playbackObject` was already loaded. See below for details on `PlaybackStatus`.
+ */
+ loadAsync(
+ /**
+ * The source of the media. The following forms are supported:
+ * - A dictionary of the form `{ uri: 'http://path/to/file' }` with a network URL pointing to a media file on the web.
+ * - `require('path/to/file')` for a media file asset in the source code directory.
+ * - An `Expo.Asset object` for a media file asset.
+ */
+ source: PlaybackSource,
+
+ /** The initial intended `PlaybackStatusToSet` of the `playbackObject`, whose values will override the default initial playback status. This value defaults to `{}` if no parameter is passed. See below for details on `PlaybackStatusToSet` and the default initial playback status. */
+ initialStatus?: PlaybackStatusToSet,
+
+ /** If set to `true`, the system will attempt to download the resource to the device before loading. This value defaults to true. Note that at the moment, this will only work for sources of the form `require('path/to/file')` or `Expo.Asset` objects. */
+ downloadFirst?: boolean
+ ): Promise;
+
+ /** This is equivalent to `playbackObject.setStatusAsync({ shouldPlay: false })`. */
+ pauseAsync(): Promise;
+
+ /**
+ * This is equivalent to `playbackObject.setStatusAsync({ shouldPlay: true })`.
+ *
+ * Playback may not start immediately after calling this function for reasons such as buffering. Make sure to update your UI based on the `isPlaying` and `isBuffering` properties of the `PlaybackStatus`.
+ */
+ playAsync(): Promise;
+
+ /**
+ * This is equivalent to `playbackObject.setStatusAsync({ shouldPlay: true, positionMillis: millis })`.
+ *
+ * Playback may not start immediately after calling this function for reasons such as buffering. Make sure to update your UI based on the isPlaying and `isBuffering` properties of the `PlaybackStatus`.
+ */
+ playFromPositionAsync(
+ /** The desired position of playback in milliseconds. */
+ positionMillis: number,
+
+ /** This is equivalent to `playbackObject.setStatusAsync({ positionMillis: millis, seekMillisToleranceBefore: toleranceMillisBefore, seekMillisToleranceAfter: toleranceMillisAfter })`. The tolerances are used only on iOS. */
+ tolerances?: {
+ toleranceMillisBefore: number,
+ toleranceMillisAfter: number
+ }
+ ): Promise;
+
+ /**
+ * Replays the item. When using `playFromPositionAsync(0)` the item is seeked to the position at `0` ms. On iOS this method uses internal implementation of the player and is able to play the item from the beginning immediately.
+ *
+ * Returns a `Promise` that is fulfilled with the `PlaybackStatus` of the `playbackObject` once the new status has been set successfully, or rejects if setting the new status failed.
+ */
+ replayAsync(
+ /** The new `PlaybackStatusToSet` of the `playbackObject`, whose values will override the current playback status. */
+ status: PlaybackStatusToSet
+ ): Promise;
+
+ /** This is equivalent to `playbackObject.setStatusAsync({ isLooping: value })`. */
+ setIsLoopingAsync(
+ /** A boolean describing if the media should play once (`false`) or loop indefinitely (`true`). */
+ isLooping: boolean
+ ): Promise;
+
+ /** This is equivalent to `playbackObject.setStatusAsync({ isMuted: value })`. */
+ setIsMutedAsync(
+ /** A boolean describing if the audio of this media should be muted. */
+ isMuted: boolean
+ ): Promise;
+
+ /**
+ * Sets a function to be called regularly with the `PlaybackStatus` of the `playbackObject`. See below for details on `PlaybackStatus` and an example use case of this function.
+ *
+ * `onPlaybackStatusUpdate` will be called whenever a call to the API for this `playbackObject` completes (such as `setStatusAsync()`, `getStatusAsync()`, or `unloadAsync()`), and will also be called at regular intervals while the media is in the loaded state. Set `progressUpdateIntervalMillis` via `setStatusAsync()` or `setProgressUpdateIntervalAsync()` to modify the interval with which `onPlaybackStatusUpdate` is called while loaded.
+ */
+ setOnPlaybackStatusUpdate(
+ /** A function taking a single parameter `PlaybackStatus`. */
+ onPlaybackStatusUpdate?: (status: PlaybackStatus) => void
+ ): void;
+
+ /** This is equivalent to `playbackObject.setStatusAsync({ positionMillis: millis })`. */
+ setPositionAsync(
+ positionMillis: number,
+
+ /** This is equivalent to `playbackObject.setStatusAsync({ positionMillis: millis, seekMillisToleranceBefore: toleranceMillisBefore, seekMillisToleranceAfter: toleranceMillisAfter })`. The tolerances are used only on iOS. */
+ tolerances?: {
+ toleranceMillisBefore: number,
+ toleranceMillisAfter: number
+ }
+ ): Promise;
+
+ /** This is equivalent to `playbackObject.setStatusAsync({ progressUpdateIntervalMillis: millis })`. */
+ setProgressUpdateIntervalAsync(
+ /** The new minimum interval in milliseconds between calls of `onPlaybackStatusUpdate`. */
+ progressUpdateIntervalMillis: number
+ ): Promise;
+
+ /** This is equivalent to `playbackObject.setStatusAsync({ rate: value, shouldCorrectPitch: shouldCorrectPitch })`. */
+ setRateAsync(
+ /** The desired playback rate of the media. This value must be between `0.0` and `32.0`. Only available on Android API version 23 and later and iOS. */
+ rate: number,
+
+ /** A boolean describing if we should correct the pitch for a changed rate. If set to `true`, the pitch of the audio will be corrected (so a rate different than `1.0` will timestretch the audio). */
+ shouldCorrectPitch: boolean
+ ): Promise;
+
+ /** Sets a new `PlaybackStatusToSet` on the `playbackObject`. This method can only be called if the media has been loaded. Return a `Promise` that is fulfilled with the `PlaybackStatus` of the `playbackObject` once the new status has been set successfully, or rejects if setting the new status failed. */
+ setStatusAsync(
+ /** The new `PlaybackStatusToSet` of the `playbackObject`, whose values will override the current playback status. */
+ status: PlaybackStatusToSet
+ ): Promise;
+
+ /** This is equivalent to `playbackObject.setStatusAsync({ volume: value })`. */
+ setVolumeAsync(
+ /** A number between `0.0` (silence) and `1.0` (maximum volume). */
+ volume: number
+ ): Promise;
+
+ /** This is equivalent to `playbackObject.setStatusAsync({ shouldPlay: false, positionMillis: 0 })`. */
+ stopAsync(): Promise;
+
+ /**
+ * Unloads the media from memory. `loadAsync()` must be called again in order to be able to play the media.
+ *
+ * Returns a `Promise` that is fulfilled with the `PlaybackStatus` of the `playbackObject` once it is unloaded, or rejects if unloading failed. See below for details on `PlaybackStatus`.
+ */
+ unloadAsync(): Promise;
}
+// #endregion
-export class Video extends Component {
- static RESIZE_MODE_CONTAIN: ResizeModeContain;
- static RESIZE_MODE_COVER: ResizeModeCover;
- static RESIZE_MODE_STRETCH: ResizeModeStretch;
- static IOS_FULLSCREEN_UPDATE_PLAYER_WILL_PRESENT: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_WILL_PRESENT;
- static IOS_FULLSCREEN_UPDATE_PLAYER_DID_PRESENT: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_DID_PRESENT;
- static IOS_FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS;
- static IOS_FULLSCREEN_UPDATE_PLAYER_DID_DISMISS: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_DID_DISMISS;
-}
-
-/**
- * AppLoading
- */
-export type AppLoadingProperties = {
- startAsync: () => Promise;
- onFinish: () => void;
- onError?: (error: Error) => void;
-} | {
- startAsync: null;
- onFinish: null;
- onError?: null;
-};
-export class AppLoading extends Component { }
-
+// #region BarCodeScanner
/**
* BarCodeScanner
*/
@@ -354,7 +633,9 @@ export interface BarCodeScannerProps extends ViewProperties {
}
export class BarCodeScanner extends Component { }
+// #endregion
+// #region BlurView
/**
* BlurView
*/
@@ -363,6 +644,7 @@ export interface BlurViewProps extends ViewProperties {
intensity: number;
}
export class BlurView extends Component { }
+// #endregion
/**
* Brightness
@@ -374,14 +656,14 @@ export namespace Brightness {
function setSystemBrightnessAsync(brightnessValue: FloatFromZeroToOne): Promise;
}
+// #region Camera
/**
* Camera
*/
-export interface TakePictureOptions {
+export interface PictureOptions {
quality?: number;
- base64?: boolean;
- exif?: boolean;
}
+
export interface PictureResponse {
uri: string;
width: number;
@@ -389,19 +671,21 @@ export interface PictureResponse {
exif: string;
base64: string;
}
-export interface RecordOptions {
- quality?: string;
+
+export interface RecordingOptions {
+ quality?: string | number;
maxDuration?: number;
maxFileSize?: number;
- mute?: boolean;
}
+
export class CameraObject {
- takePictureAsync(options: TakePictureOptions): Promise;
- recordAsync(options: RecordOptions): Promise<{ uri: string; }>;
+ takePictureAsync(options: PictureOptions): Promise;
+ recordAsync(options: RecordingOptions): Promise<{ uri: string; }>;
stopRecording(): void;
getSupportedRatiosAsync(): Promise; // Android only
}
-export interface CameraProperties extends ViewProperties {
+
+export interface CameraProps extends ViewProperties {
flashMode?: string | number;
type?: string | number;
ratio?: string;
@@ -415,6 +699,7 @@ export interface CameraProperties extends ViewProperties {
onBarCodeRead?: BarCodeReadCallback;
ref?: Ref;
}
+
export interface CameraConstants {
readonly Type: string;
readonly FlashMode: string;
@@ -423,9 +708,11 @@ export interface CameraConstants {
readonly VideoQuality: string;
readonly BarCodeType: string;
}
-export class Camera extends Component {
+
+export class Camera extends Component {
static readonly Constants: CameraConstants;
}
+// #endregion
/**
* Constants
@@ -702,6 +989,7 @@ export namespace DocumentPicker {
interface Options {
type?: string;
}
+
type Response = {
type: 'success';
uri: string;
@@ -797,6 +1085,75 @@ export namespace FacebookAds {
}
}
+/**
+ * FaceDetector
+ */
+export namespace FaceDetector {
+ interface Point {
+ x: Axis;
+ y: Axis;
+ }
+ interface FaceFeature {
+ bounds: {
+ size: {
+ width: number;
+ height: number;
+ },
+ origin: Point;
+ };
+ smilingProbability?: number;
+ leftEarPosition?: Point;
+ rightEarPosition?: Point;
+ leftEyePosition?: Point;
+ leftEyeOpenProbability?: number;
+ rightEyePosition?: Point;
+ rightEyeOpenProbability?: number;
+ leftCheekPosition?: Point;
+ rightCheekPosition?: Point;
+ leftMouthPosition?: Point;
+ mouthPosition?: Point;
+ rightMouthPosition?: Point;
+ bottomMouthPosition?: Point;
+ noseBasePosition?: Point;
+ yawAngle?: number;
+ rollAngle?: number;
+ }
+ interface DetectFaceResult {
+ faces: FaceFeature[];
+ image: {
+ uri: string;
+ width: number;
+ height: number;
+ orientation: number;
+ };
+ }
+ interface Mode {
+ fast: 'fast';
+ accurate: 'accurate';
+ }
+ interface _Shared {
+ all: 'all';
+ none: 'none';
+ }
+ type Landmarks = _Shared;
+ type Classifications = _Shared;
+ interface _Constants {
+ Mode: Mode;
+ Landmarks: Landmarks;
+ Classifications: Classifications;
+ }
+
+ const Constants: _Constants;
+
+ interface DetectionOptions {
+ mode?: keyof Mode;
+ detectLandmarks?: keyof Landmarks;
+ runClassifications?: keyof Classifications;
+ }
+
+ function detectFaces(uri: string, options?: DetectionOptions): Promise;
+}
+
/**
* FileSystem
*/
@@ -875,15 +1232,31 @@ export namespace FileSystem {
}
}
-/**
- * Fingerprint
- */
+/** Use TouchID/FaceID (iOS) or the Fingerprint API (Android) to authenticate the user with a fingerprint scan. */
export namespace Fingerprint {
- type FingerprintAuthenticationResult = { success: true } | { success: false, error: string };
+ type FingerprintAuthenticationResult = {
+ success: true
+ } | {
+ success: false,
+ /** Error code in the case where authentication fails. */
+ error: string
+ };
+
+ /** Determine whether the Fingerprint scanner is available on the device. */
function hasHardwareAsync(): Promise;
+
+ /** Determine whether the device has saved fingerprints to use for authentication. */
function isEnrolledAsync(): Promise;
+
+ /**
+ * Attempts to authenticate via Fingerprint. Android: When using the fingerprint module on Android, you need to provide a UI component to prompt the user to scan their fingerprint, as the OS has no default alert for it.
+ *
+ * @param promptMessage A message that is shown alongside the TouchID/FaceID prompt. (iOS only)
+ */
function authenticateAsync(promptMessageIOS?: string): Promise;
+
+ /** Cancels the fingerprint authentication flow. (Android only) */
function cancelAuthenticate(): void;
}
@@ -899,6 +1272,7 @@ export namespace Font {
function loadAsync(map: FontMap): Promise;
}
+// #region GLView
/**
* GLView
*/
@@ -906,7 +1280,9 @@ export interface GLViewProps extends ViewProperties {
onContextCreate(): void;
msaaSamples: number;
}
+
export class GLView extends Component { }
+// #endregion
/**
* Google
@@ -943,9 +1319,7 @@ export namespace Google {
function logInAsync(config: LogInConfig): Promise;
}
-/**
- * Gyroscope
- */
+/** Access the device gyroscope sensor to respond to changes in rotation in 3d space. */
export namespace Gyroscope {
interface GyroscopeObject {
x: Axis;
@@ -953,11 +1327,50 @@ export namespace Gyroscope {
z: Axis;
}
+ /** A callback that is invoked when an gyroscope update is available. */
function addListener(listener: (obj: GyroscopeObject) => any): EventSubscription;
+
+ /** Remove all listeners. */
function removeAllListeners(): void;
+
+ /** Subscribe for updates to the gyroscope. */
function setUpdateInterval(intervalMs: number): void;
}
+/**
+ * ImageManipulator
+ */
+export namespace ImageManipulator {
+ interface ImageResult {
+ uri: string;
+ width: number;
+ height: number;
+ base64?: string;
+ }
+
+ interface SaveOptions {
+ base64?: boolean;
+ compress?: FloatFromZeroToOne;
+ format?: 'jpeg' | 'png';
+ }
+
+ interface CropParameters {
+ originX: number;
+ originY: number;
+ width: number;
+ height: number;
+ }
+
+ interface ImageManipulationOptions {
+ resize?: { width?: number; height?: number };
+ rotate?: number;
+ flip?: { vertical?: boolean; horizontal?: boolean };
+ crop?: CropParameters;
+ }
+
+ function manipulate(uri: string, actions: ImageManipulationOptions, saveOptions?: SaveOptions): Promise;
+}
+
/**
* Image Picker
*/
@@ -992,6 +1405,7 @@ export namespace ImagePicker {
aspect?: [number, number];
quality?: number;
}
+
function launchCameraAsync(options?: CameraOptions): Promise;
}
@@ -999,86 +1413,86 @@ export namespace ImagePicker {
* IntentLauncherAndroid
*/
export namespace IntentLauncherAndroid {
- const ACTION_ACCESSIBILITY_SETTINGS: string;
- const ACTION_APP_NOTIFICATION_REDACTION: string;
- const ACTION_CONDITION_PROVIDER_SETTINGS: string;
- const ACTION_NOTIFICATION_LISTENER_SETTINGS: string;
- const ACTION_PRINT_SETTINGS: string;
- const ACTION_ADD_ACCOUNT_SETTINGS: string;
- const ACTION_AIRPLANE_MODE_SETTINGS: string;
- const ACTION_APN_SETTINGS: string;
- const ACTION_APPLICATION_DETAILS_SETTINGS: string;
- const ACTION_APPLICATION_DEVELOPMENT_SETTINGS: string;
- const ACTION_APPLICATION_SETTINGS: string;
- const ACTION_APP_NOTIFICATION_SETTINGS: string;
- const ACTION_APP_OPS_SETTINGS: string;
- const ACTION_BATTERY_SAVER_SETTINGS: string;
- const ACTION_BLUETOOTH_SETTINGS: string;
- const ACTION_CAPTIONING_SETTINGS: string;
- const ACTION_CAST_SETTINGS: string;
- const ACTION_DATA_ROAMING_SETTINGS: string;
- const ACTION_DATE_SETTINGS: string;
- const ACTION_DEVICE_INFO_SETTINGS: string;
- const ACTION_DEVICE_NAME: string;
- const ACTION_DISPLAY_SETTINGS: string;
- const ACTION_DREAM_SETTINGS: string;
- const ACTION_HARD_KEYBOARD_SETTINGS: string;
- const ACTION_HOME_SETTINGS: string;
- const ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS: string;
- const ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS: string;
- const ACTION_INPUT_METHOD_SETTINGS: string;
- const ACTION_INPUT_METHOD_SUBTYPE_SETTINGS: string;
- const ACTION_INTERNAL_STORAGE_SETTINGS: string;
- const ACTION_LOCALE_SETTINGS: string;
- const ACTION_LOCATION_SOURCE_SETTINGS: string;
- const ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS: string;
- const ACTION_MANAGE_APPLICATIONS_SETTINGS: string;
- const ACTION_MANAGE_DEFAULT_APPS_SETTINGS: string;
- const ACTION_MEMORY_CARD_SETTINGS: string;
- const ACTION_MONITORING_CERT_INFO: string;
- const ACTION_NETWORK_OPERATOR_SETTINGS: string;
- const ACTION_NFCSHARING_SETTINGS: string;
- const ACTION_NFC_PAYMENT_SETTINGS: string;
- const ACTION_NFC_SETTINGS: string;
- const ACTION_NIGHT_DISPLAY_SETTINGS: string;
- const ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS: string;
- const ACTION_NOTIFICATION_SETTINGS: string;
- const ACTION_PAIRING_SETTINGS: string;
- const ACTION_PRIVACY_SETTINGS: string;
- const ACTION_QUICK_LAUNCH_SETTINGS: string;
- const ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS: string;
- const ACTION_SECURITY_SETTINGS: string;
- const ACTION_SETTINGS: string;
- const ACTION_SHOW_ADMIN_SUPPORT_DETAILS: string;
- const ACTION_SHOW_INPUT_METHOD_PICKER: string;
- const ACTION_SHOW_REGULATORY_INFO: string;
- const ACTION_SHOW_REMOTE_BUGREPORT_DIALOG: string;
- const ACTION_SOUND_SETTINGS: string;
- const ACTION_STORAGE_MANAGER_SETTINGS: string;
- const ACTION_SYNC_SETTINGS: string;
- const ACTION_SYSTEM_UPDATE_SETTINGS: string;
- const ACTION_TETHER_PROVISIONING_UI: string;
- const ACTION_TRUSTED_CREDENTIALS_USER: string;
- const ACTION_USAGE_ACCESS_SETTINGS: string;
- const ACTION_USER_DICTIONARY_INSERT: string;
- const ACTION_USER_DICTIONARY_SETTINGS: string;
- const ACTION_USER_SETTINGS: string;
- const ACTION_VOICE_CONTROL_AIRPLANE_MODE: string;
- const ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE: string;
- const ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE: string;
- const ACTION_VOICE_INPUT_SETTINGS: string;
- const ACTION_VPN_SETTINGS: string;
- const ACTION_VR_LISTENER_SETTINGS: string;
- const ACTION_WEBVIEW_SETTINGS: string;
- const ACTION_WIFI_IP_SETTINGS: string;
- const ACTION_WIFI_SETTINGS: string;
- const ACTION_WIRELESS_SETTINGS: string;
- const ACTION_ZEN_MODE_AUTOMATION_SETTINGS: string;
- const ACTION_ZEN_MODE_EVENT_RULE_SETTINGS: string;
- const ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS: string;
- const ACTION_ZEN_MODE_PRIORITY_SETTINGS: string;
- const ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS: string;
- const ACTION_ZEN_MODE_SETTINGS: string;
+ const ACTION_ACCESSIBILITY_SETTINGS: 'android.settings.ACCESSIBILITY_SETTINGS';
+ const ACTION_APP_NOTIFICATION_REDACTION: 'android.settings.ACTION_APP_NOTIFICATION_REDACTION';
+ const ACTION_CONDITION_PROVIDER_SETTINGS: 'android.settings.ACTION_CONDITION_PROVIDER_SETTINGS';
+ const ACTION_NOTIFICATION_LISTENER_SETTINGS: 'android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS';
+ const ACTION_PRINT_SETTINGS: 'android.settings.ACTION_PRINT_SETTINGS';
+ const ACTION_ADD_ACCOUNT_SETTINGS: 'android.settings.ADD_ACCOUNT_SETTINGS';
+ const ACTION_AIRPLANE_MODE_SETTINGS: 'android.settings.AIRPLANE_MODE_SETTINGS';
+ const ACTION_APN_SETTINGS: 'android.settings.APN_SETTINGS';
+ const ACTION_APPLICATION_DETAILS_SETTINGS: 'android.settings.APPLICATION_DETAILS_SETTINGS';
+ const ACTION_APPLICATION_DEVELOPMENT_SETTINGS: 'android.settings.APPLICATION_DEVELOPMENT_SETTINGS';
+ const ACTION_APPLICATION_SETTINGS: 'android.settings.APPLICATION_SETTINGS';
+ const ACTION_APP_NOTIFICATION_SETTINGS: 'android.settings.APP_NOTIFICATION_SETTINGS';
+ const ACTION_APP_OPS_SETTINGS: 'android.settings.APP_OPS_SETTINGS';
+ const ACTION_BATTERY_SAVER_SETTINGS: 'android.settings.BATTERY_SAVER_SETTINGS';
+ const ACTION_BLUETOOTH_SETTINGS: 'android.settings.BLUETOOTH_SETTINGS';
+ const ACTION_CAPTIONING_SETTINGS: 'android.settings.CAPTIONING_SETTINGS';
+ const ACTION_CAST_SETTINGS: 'android.settings.CAST_SETTINGS';
+ const ACTION_DATA_ROAMING_SETTINGS: 'android.settings.DATA_ROAMING_SETTINGS';
+ const ACTION_DATE_SETTINGS: 'android.settings.DATE_SETTINGS';
+ const ACTION_DEVICE_INFO_SETTINGS: 'android.settings.DEVICE_INFO_SETTINGS';
+ const ACTION_DEVICE_NAME: 'android.settings.DEVICE_NAME';
+ const ACTION_DISPLAY_SETTINGS: 'android.settings.DISPLAY_SETTINGS';
+ const ACTION_DREAM_SETTINGS: 'android.settings.DREAM_SETTINGS';
+ const ACTION_HARD_KEYBOARD_SETTINGS: 'android.settings.HARD_KEYBOARD_SETTINGS';
+ const ACTION_HOME_SETTINGS: 'android.settings.HOME_SETTINGS';
+ const ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS: 'android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS';
+ const ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS: 'android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS';
+ const ACTION_INPUT_METHOD_SETTINGS: 'android.settings.INPUT_METHOD_SETTINGS';
+ const ACTION_INPUT_METHOD_SUBTYPE_SETTINGS: 'android.settings.INPUT_METHOD_SUBTYPE_SETTINGS';
+ const ACTION_INTERNAL_STORAGE_SETTINGS: 'android.settings.INTERNAL_STORAGE_SETTINGS';
+ const ACTION_LOCALE_SETTINGS: 'android.settings.LOCALE_SETTINGS';
+ const ACTION_LOCATION_SOURCE_SETTINGS: 'android.settings.LOCATION_SOURCE_SETTINGS';
+ const ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS: 'android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS';
+ const ACTION_MANAGE_APPLICATIONS_SETTINGS: 'android.settings.MANAGE_APPLICATIONS_SETTINGS';
+ const ACTION_MANAGE_DEFAULT_APPS_SETTINGS: 'android.settings.MANAGE_DEFAULT_APPS_SETTINGS';
+ const ACTION_MEMORY_CARD_SETTINGS: 'android.settings.MEMORY_CARD_SETTINGS';
+ const ACTION_MONITORING_CERT_INFO: 'android.settings.MONITORING_CERT_INFO';
+ const ACTION_NETWORK_OPERATOR_SETTINGS: 'android.settings.NETWORK_OPERATOR_SETTINGS';
+ const ACTION_NFCSHARING_SETTINGS: 'android.settings.NFCSHARING_SETTINGS';
+ const ACTION_NFC_PAYMENT_SETTINGS: 'android.settings.NFC_PAYMENT_SETTINGS';
+ const ACTION_NFC_SETTINGS: 'android.settings.NFC_SETTINGS';
+ const ACTION_NIGHT_DISPLAY_SETTINGS: 'android.settings.NIGHT_DISPLAY_SETTINGS';
+ const ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS: 'android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS';
+ const ACTION_NOTIFICATION_SETTINGS: 'android.settings.NOTIFICATION_SETTINGS';
+ const ACTION_PAIRING_SETTINGS: 'android.settings.PAIRING_SETTINGS';
+ const ACTION_PRIVACY_SETTINGS: 'android.settings.PRIVACY_SETTINGS';
+ const ACTION_QUICK_LAUNCH_SETTINGS: 'android.settings.QUICK_LAUNCH_SETTINGS';
+ const ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS: 'android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS';
+ const ACTION_SECURITY_SETTINGS: 'android.settings.SECURITY_SETTINGS';
+ const ACTION_SETTINGS: 'android.settings.SETTINGS';
+ const ACTION_SHOW_ADMIN_SUPPORT_DETAILS: 'android.settings.SHOW_ADMIN_SUPPORT_DETAILS';
+ const ACTION_SHOW_INPUT_METHOD_PICKER: 'android.settings.SHOW_INPUT_METHOD_PICKER';
+ const ACTION_SHOW_REGULATORY_INFO: 'android.settings.SHOW_REGULATORY_INFO';
+ const ACTION_SHOW_REMOTE_BUGREPORT_DIALOG: 'android.settings.SHOW_REMOTE_BUGREPORT_DIALOG';
+ const ACTION_SOUND_SETTINGS: 'android.settings.SOUND_SETTINGS';
+ const ACTION_STORAGE_MANAGER_SETTINGS: 'android.settings.STORAGE_MANAGER_SETTINGS';
+ const ACTION_SYNC_SETTINGS: 'android.settings.SYNC_SETTINGS';
+ const ACTION_SYSTEM_UPDATE_SETTINGS: 'android.settings.SYSTEM_UPDATE_SETTINGS';
+ const ACTION_TETHER_PROVISIONING_UI: 'android.settings.TETHER_PROVISIONING_UI';
+ const ACTION_TRUSTED_CREDENTIALS_USER: 'android.settings.TRUSTED_CREDENTIALS_USER';
+ const ACTION_USAGE_ACCESS_SETTINGS: 'android.settings.USAGE_ACCESS_SETTINGS';
+ const ACTION_USER_DICTIONARY_INSERT: 'android.settings.USER_DICTIONARY_INSERT';
+ const ACTION_USER_DICTIONARY_SETTINGS: 'android.settings.USER_DICTIONARY_SETTINGS';
+ const ACTION_USER_SETTINGS: 'android.settings.USER_SETTINGS';
+ const ACTION_VOICE_CONTROL_AIRPLANE_MODE: 'android.settings.VOICE_CONTROL_AIRPLANE_MODE';
+ const ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE: 'android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE';
+ const ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE: 'android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE';
+ const ACTION_VOICE_INPUT_SETTINGS: 'android.settings.VOICE_INPUT_SETTINGS';
+ const ACTION_VPN_SETTINGS: 'android.settings.VPN_SETTINGS';
+ const ACTION_VR_LISTENER_SETTINGS: 'android.settings.VR_LISTENER_SETTINGS';
+ const ACTION_WEBVIEW_SETTINGS: 'android.settings.WEBVIEW_SETTINGS';
+ const ACTION_WIFI_IP_SETTINGS: 'android.settings.WIFI_IP_SETTINGS';
+ const ACTION_WIFI_SETTINGS: 'android.settings.WIFI_SETTINGS';
+ const ACTION_WIRELESS_SETTINGS: 'android.settings.WIRELESS_SETTINGS';
+ const ACTION_ZEN_MODE_AUTOMATION_SETTINGS: 'android.settings.ZEN_MODE_AUTOMATION_SETTINGS';
+ const ACTION_ZEN_MODE_EVENT_RULE_SETTINGS: 'android.settings.ZEN_MODE_EVENT_RULE_SETTINGS';
+ const ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS: 'android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS';
+ const ACTION_ZEN_MODE_PRIORITY_SETTINGS: 'android.settings.ZEN_MODE_PRIORITY_SETTINGS';
+ const ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS: 'android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS';
+ const ACTION_ZEN_MODE_SETTINGS: 'android.settings.ZEN_MODE_SETTINGS';
function startActivityAsync(activity: string, data?: HashMap): Promise;
}
@@ -1091,6 +1505,7 @@ export class KeepAwake extends Component {
static deactivate(): void;
}
+// #region LinearGradient
/**
* LinearGradient
*/
@@ -1102,6 +1517,7 @@ export interface LinearGradientProps {
}
export class LinearGradient extends Component { }
+// #endregion
/**
* Location
@@ -1243,12 +1659,15 @@ export namespace Permissions {
'camera' | 'contacts' | 'audioRecording';
type PermissionStatus = 'undetermined' | 'granted' | 'denied';
type PermissionExpires = 'never';
+
interface PermissionDetailsLocationIOS {
scope: 'whenInUse' | 'always';
}
+
interface PermissionDetailsLocationAndroid {
scope: 'fine' | 'coarse' | 'none';
}
+
interface PermissionResponse {
status: PermissionStatus;
expires: PermissionExpires;
@@ -1259,25 +1678,28 @@ export namespace Permissions {
function getAsync(type: PermissionType): Promise;
function askAsync(type: PermissionType): Promise;
- const CAMERA: string;
- const CAMERA_ROLL: string;
- const AUDIO_RECORDING: string;
- const LOCATION: string;
- const REMOTE_NOTIFICATIONS: string;
- const NOTIFICATIONS: string;
- const CONTACTS: string;
+ type RemoteNotificationPermission = 'remoteNotifications';
+
+ const CAMERA: 'camera';
+ const CAMERA_ROLL: 'cameraRoll';
+ const AUDIO_RECORDING: 'audioRecording';
+ const LOCATION: 'location';
+ const REMOTE_NOTIFICATIONS: RemoteNotificationPermission;
+ const NOTIFICATIONS: RemoteNotificationPermission;
+ const CONTACTS: 'contacts';
+ const SYSTEM_BRIGHTNESS: 'systemBrightness';
}
/**
* Register Root Component
*/
-export function registerRootComponent(component: Component): Component;
+export function registerRootComponent(component: ComponentType): void;
/**
* ScreenOrientation
*/
export namespace ScreenOrientation {
- interface Orientation {
+ interface Orientations {
ALL: 'ALL';
ALL_BUT_UPSIDE_DOWN: 'ALL_BUT_UPSIDE_DOWN';
PORTRAIT: 'PORTRAIT';
@@ -1287,8 +1709,10 @@ export namespace ScreenOrientation {
LANDSCAPE_LEFT: 'LANDSCAPE_LEFT';
LANDSCAPE_RIGHT: 'LANDSCAPE_RIGHT';
}
- const Orientation: Orientation;
- function allow(orientation: string): void;
+
+ const Orientation: Orientations;
+
+ function allow(orientation: keyof Orientations): void;
}
/**
@@ -1299,6 +1723,7 @@ export namespace SecureStore {
keychainService?: string;
keychainAccessible?: number;
}
+
function setItemAsync(key: string, value: string, options?: SecureStoreOptions): Promise;
function getItemAsync(key: string, options?: SecureStoreOptions): Promise;
function deleteItemAsync(key: string, options?: SecureStoreOptions): Promise;
@@ -1389,6 +1814,7 @@ export namespace SQLite {
): any;
}
+// #region Svg
/**
* Svg
*/
@@ -1507,7 +1933,7 @@ export interface SvgStopProps extends SvgCommonProps {
export class Svg extends Component<{ width: number, height: number }> {
static Circle: ComponentClass;
static ClipPath: ComponentClass;
- static Defs: ComponentClass<{ }>;
+ static Defs: ComponentClass;
static Ellipse: ComponentClass;
static G: ComponentClass;
static Line: ComponentClass;
@@ -1524,6 +1950,7 @@ export class Svg extends Component<{ width: number, height: number }> {
static TSpan: ComponentClass;
static Use: ComponentClass;
}
+// #endregion
/**
* Take Snapshot
@@ -1539,19 +1966,102 @@ export function takeSnapshotAsync(
}
): Promise;
-/**
- * Util
- */
+/** Helpful utility functions that don’t fit anywhere else, including some localization and internationalization methods. */
export namespace Util {
- function getCurrentDeviceCountryAsync(): Promise;
+ /** Returns the current device country code. */
+ function getCurrentDeviceCountryAsync(): Promise;
+
+ /** Returns the current device locale as a string. */
function getCurrentLocaleAsync(): Promise;
+
+ /** Returns the current device time zone name. */
function getCurrentTimeZoneAsync(): Promise;
+
+ /** Reloads the current experience. This will fetch and load the newest available JavaScript supported by the device’s Expo environment. This is useful for triggering an update of your experience if you have published a new version. */
function reload(): void;
+
+ /** _Android only_. Invokes a callback when a new version of your app is successfully downloaded in the background. */
function addNewVersionListenerExperimental(listener: (event: {
manifest: object;
- }) => void): { remove(): void; }; // Android only
+ }) => void): { remove(): void; };
}
+// #region Video
+/**
+ * Expo Video
+ */
+export interface NaturalSize {
+ width: number;
+ height: number;
+ orientation: Orientation;
+}
+
+export interface ReadyForDisplayEvent {
+ naturalSize: NaturalSize;
+ status: PlaybackStatus;
+}
+
+export enum FullscreenUpdateVariants {
+ IOS_FULLSCREEN_UPDATE_PLAYER_WILL_PRESENT = 0,
+ IOS_FULLSCREEN_UPDATE_PLAYER_DID_PRESENT = 1,
+ IOS_FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS = 2,
+ IOS_FULLSCREEN_UPDATE_PLAYER_DID_DISMISS = 3
+}
+
+export interface FullscreenUpdateEvent {
+ fullscreenUpdate: FullscreenUpdateVariants;
+ status: PlaybackStatus;
+}
+
+export interface VideoProps {
+ source?: PlaybackSource | null;
+ posterSource?: URISource | RequireSource;
+
+ resizeMode?: ResizeModeContain | ResizeModeCover | ResizeModeStretch;
+ useNativeControls?: boolean;
+ usePoster?: boolean;
+
+ onPlaybackStatusUpdate?: (status: PlaybackStatus) => void;
+ onReadyForDisplay?: (event: ReadyForDisplayEvent) => void;
+ onIOSFullscreenUpdate?: (event: FullscreenUpdateEvent) => void;
+
+ onLoadStart?: () => void;
+ onLoad?: (status: PlaybackStatus) => void;
+ onError?: (error: string) => void;
+
+ status?: PlaybackStatusToSet;
+ progressUpdateIntervalMillis?: number;
+ positionMillis?: number;
+ shouldPlay?: boolean;
+ rate?: number;
+ shouldCorrectPitch?: boolean;
+ volume?: number;
+ isMuted?: boolean;
+ isLooping?: boolean;
+
+ scaleX?: number;
+ scaleY?: number;
+ translateX?: number;
+ translateY?: number;
+ rotation?: number;
+ ref?: Ref;
+}
+
+export interface VideoState {
+ showPoster: boolean;
+}
+
+export class Video extends Component {
+ static RESIZE_MODE_CONTAIN: ResizeModeContain;
+ static RESIZE_MODE_COVER: ResizeModeCover;
+ static RESIZE_MODE_STRETCH: ResizeModeStretch;
+ static IOS_FULLSCREEN_UPDATE_PLAYER_WILL_PRESENT: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_WILL_PRESENT;
+ static IOS_FULLSCREEN_UPDATE_PLAYER_DID_PRESENT: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_DID_PRESENT;
+ static IOS_FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS;
+ static IOS_FULLSCREEN_UPDATE_PLAYER_DID_DISMISS: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_DID_DISMISS;
+}
+// #endregion
+
/**
* Web Browser
*/
@@ -1560,102 +2070,3 @@ export namespace WebBrowser {
function openAuthSessionAsync(url: string, redirectUrl?: string): Promise<{ type: 'cancelled' | 'dismissed' }>;
function dismissBrowser(): Promise<{ type: 'dismissed' }>;
}
-
-/**
- * ImageManipulator
- */
-export namespace ImageManipulator {
- interface ImageResult {
- uri: string;
- width: number;
- height: number;
- base64?: string;
- }
- interface SaveOptions {
- base64?: boolean;
- compress?: FloatFromZeroToOne;
- format?: 'jpeg' | 'png';
- }
- interface CropParameters {
- originX: number;
- originY: number;
- width: number;
- height: number;
- }
- interface ImageManipulationOptions {
- resize?: { width?: number; height?: number };
- rotate?: number;
- flip?: { vertical?: boolean; horizontal?: boolean };
- crop?: CropParameters;
- }
- function manipulate(uri: string, actions: ImageManipulationOptions, saveOptions?: SaveOptions): Promise;
-}
-
-/**
- * FaceDetector
- */
-export namespace FaceDetector {
- interface Point {
- x: Axis;
- y: Axis;
- }
- interface Face {
- bounds: {
- size: {
- width: number;
- height: number;
- },
- origin: Point;
- };
- smilingProbability?: number;
- leftEarPosition?: Point;
- rightEarPosition?: Point;
- leftEyePosition?: Point;
- leftEyeOpenProbability?: number;
- rightEyePosition?: Point;
- rightEyeOpenProbability?: number;
- leftCheekPosition?: Point;
- rightCheekPosition?: Point;
- leftMouthPosition?: Point;
- mouthPosition?: Point;
- rightMouthPosition?: Point;
- bottomMouthPosition?: Point;
- noseBasePosition?: Point;
- yawAngle?: number;
- rollAngle?: number;
- }
- interface DetectFaceResult {
- faces: Face[];
- image: {
- uri: string;
- width: number;
- height: number;
- orientation: number;
- };
- }
- interface Mode {
- fast: 'fast';
- accurate: 'accurate';
- }
- interface _Shared {
- all: 'all';
- none: 'none';
- }
- type Landmarks = _Shared;
- type Classifications = _Shared;
- interface _Constants {
- Mode: Mode;
- Landmarks: Landmarks;
- Classifications: Classifications;
- }
-
- const Constants: _Constants;
-
- interface Options {
- mode?: keyof Mode;
- detectLandmarks?: keyof Landmarks;
- runClassifications?: keyof Classifications;
- }
-
- function detectFaces(uri: string, options?: Options): Promise;
-}
diff --git a/types/expo/tslint.json b/types/expo/tslint.json
index 3db14f85ea..8270136207 100644
--- a/types/expo/tslint.json
+++ b/types/expo/tslint.json
@@ -1 +1,7 @@
-{ "extends": "dtslint/dt.json" }
+{
+ "extends": "dtslint/dt.json",
+ "rules": {
+ "void-return": false,
+ "max-line-length": false
+ }
+}