// Type definitions for react-native-popup-dialog 0.16 // Project: https://github.com/jacklam718/react-native-popup-dialog/blob/master/README.md // Definitions by: Paito Anderson // connectdotz // Michele Bombardi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import * as React from 'react'; import { GestureResponderEvent, StyleProp, ViewStyle, TextStyle } from 'react-native'; export type AlignTypes = 'left' | 'right' | 'center'; export type OverlayPointerEventTypes = 'auto' | 'none'; export type SlideFromTypes = 'top' | 'bottom' | 'left' | 'right'; export interface DialogContentProps { style?: StyleProp; } export interface DialogFooterProps { bordered?: boolean; style?: StyleProp; } export interface DialogButtonProps { text: string; align?: AlignTypes; onPress?: (event: GestureResponderEvent) => void; textStyle?: StyleProp; style?: StyleProp; disabled?: boolean; activeOpacity?: number; bordered?: boolean; } export interface DialogTitleProps { title: string; style?: StyleProp; textStyle?: StyleProp; align?: AlignTypes; hasTitleBar?: boolean; } export interface OverlayProps { visible?: boolean; onPress: (event: GestureResponderEvent) => void; backgroundColor?: string; opacity?: number; animationDuration?: number; showOverlay?: boolean; pointerEvents?: string; useNativeDriver?: boolean; } export interface DialogProps { dialogTitle?: any; width?: number; height?: number; dialogAnimation?: FadeAnimation | ScaleAnimation | SlideAnimation; dialogStyle?: StyleProp; containerStyle?: StyleProp; animationDuration?: number; hasOverlay?: boolean; overlayPointerEvents?: OverlayPointerEventTypes; overlayBackgroundColor?: string; overlayOpacity?: number; visible?: boolean; rounded?: boolean; onShow?: () => void; onDismiss?: () => void; onTouchOutside?: () => void; onHardwareBackPress?: () => boolean; footer?: any; useNativeDriver?: boolean; } export class FadeAnimation { constructor(toValue?: number); constructor(params: { toValue?: number, animationDuration?: number }); toValue(toValue: number): void; createAnimations(): object; } export class ScaleAnimation { constructor(toValue?: number); toValue(toValue: number): void; createAnimations(): object; } export class SlideAnimation { constructor(toValue?: number); constructor(params: { toValue?: number, slideFrom?: SlideFromTypes }); toValue(toValue: number): void; createAnimations(): object; } export class DialogContent extends React.Component { } export class DialogFooter extends React.Component { } export class DialogButton extends React.Component { } export class DialogTitle extends React.Component { } export class Overlay extends React.Component { } export default class Dialog extends React.Component { show(onShown?: () => void): void; dismiss(onDismissed?: () => void): void; }