From 1aeb58a0f20963d1639e8ccb80f294f1ffc01986 Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Sun, 14 Jan 2018 20:13:26 -0200 Subject: [PATCH] Add TypeScript definitions Closes #87 --- react-native-safari-view.d.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 react-native-safari-view.d.ts diff --git a/react-native-safari-view.d.ts b/react-native-safari-view.d.ts new file mode 100644 index 0000000..e2928a0 --- /dev/null +++ b/react-native-safari-view.d.ts @@ -0,0 +1,18 @@ +declare module 'react-native-safari-view' { + import { EmitterSubscription } from 'react-native' + + export type Event = 'onShow' | 'onDismiss' + export interface SafaryOptions { + url: string + readerMode?: boolean + tintColor?: string + barTintColor?: string + fromBottom?: boolean + } + + export function show(options: SafaryOptions): void + export function dismiss(): void + export function isAvailable(): boolean + export function addEventListener(event: Event, listener: () => any): EmitterSubscription + export function removeEventListener(event: Event, listener: () => any): void +}