DefinitelyTyped/types/react-native-safari-view/index.d.ts
Ferdy Budhidharma bc0c933415 feat(react-dependents): update to TS 2.8 (part 2 of 2) (#27744)
* feat(react-dependents): update to ts 2.8

* fix version mismatches

* remove package.json

* post merge updates

* add package.json back again
2018-08-06 06:28:42 +01:00

63 lines
1.6 KiB
TypeScript

// Type definitions for react-native-safari-view 2.0
// Project: https://github.com/naoufal/react-native-safari-view
// Definitions by: Michael Randolph <https://github.com/mrand01>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import { EmitterSubscription } from 'react-native';
export interface SafariViewOptions {
/**
* A String containing the url you want to load in the Safari View
*
*/
url: string;
/**
* A Boolean indicating to use Safari's Reader Mode if available
*
*/
readerMode?: boolean;
/**
* A String containing a hex or rgba color to use for the browser controls
*
*/
tintColor?: string;
/**
* A String containing a hex or rgba color to use for the background of the browser controls (only available on iOS 10 and higher)
*
*/
barTintColor?: string;
/**
* A Boolean indicating to open the Safari View from the bottom
*
*/
fromBottom?: boolean;
}
declare namespace SafariView {
/**
* Displays a Safari View with the provided URL
*
*/
function show(options: SafariViewOptions): Promise<boolean>;
/**
* Dismisses the currently active Safari View
*/
function dismiss(): void;
/**
* Checks if Safari View is available on the device
*/
function isAvailable(): Promise<boolean>;
function addEventListener(event: string, listener: () => void): EmitterSubscription;
function removeEventListener(event: string, listener: () => void): void;
}
export default SafariView;