From 0278a498f759d98d164c5fabf002afff0a03b360 Mon Sep 17 00:00:00 2001 From: Krister Kari Date: Thu, 1 Aug 2019 22:38:05 +0300 Subject: [PATCH] [@types/react-native-actionsheet] Add missing ActionSheetCustom (#37240) * [@types/react-native-actionsheet] Add missing ActionSheetCustom * Add missing buttonUnderlayColor --- types/react-native-actionsheet/index.d.ts | 17 +++++++++++- .../react-native-actionsheet-tests.tsx | 26 ++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/types/react-native-actionsheet/index.d.ts b/types/react-native-actionsheet/index.d.ts index 8c6c4c8169..441c7f51ee 100644 --- a/types/react-native-actionsheet/index.d.ts +++ b/types/react-native-actionsheet/index.d.ts @@ -7,16 +7,31 @@ import * as React from 'react'; export interface ActionSheetProps { - options: React.ReactNode[]; + options: string[]; onPress: (index: number) => void; title?: string; message?: string; tintColor?: string; cancelButtonIndex?: number; destructiveButtonIndex?: number; +} + +export interface ActionSheetCustomProps { + options: React.ReactNode[]; + onPress: (index: number) => void; + title?: React.ReactNode; + message?: string; + tintColor?: string; + buttonUnderlayColor?: string; + cancelButtonIndex?: number; + destructiveButtonIndex?: number; styles?: object; } export default class ActionSheet extends React.Component { show: () => void; } + +export class ActionSheetCustom extends React.Component { + show: () => void; +} diff --git a/types/react-native-actionsheet/react-native-actionsheet-tests.tsx b/types/react-native-actionsheet/react-native-actionsheet-tests.tsx index 0e25c7877d..d18ecbb2c2 100644 --- a/types/react-native-actionsheet/react-native-actionsheet-tests.tsx +++ b/types/react-native-actionsheet/react-native-actionsheet-tests.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; -import ActionSheet from 'react-native-actionsheet'; +import { Text } from 'react-native'; +import ActionSheet, { ActionSheetCustom } from 'react-native-actionsheet'; class Example extends React.Component { render() { @@ -12,6 +13,29 @@ class Example extends React.Component { tintColor="white" cancelButtonIndex={0} destructiveButtonIndex={1} + /> + ); + } +} + +class CustomSheetExample extends React.Component { + render() { + return ( + Banana, + 'Watermelon', + Durian, + ]} + onPress={index => {}} + title={Which one do you like?} + message="Test" + tintColor="white" + buttonUnderlayColor="rebeccapurple" + cancelButtonIndex={0} + destructiveButtonIndex={1} styles={{}} /> );