From 11de1241356b14827e1e38476435266d3474abd9 Mon Sep 17 00:00:00 2001 From: Dan Maas Date: Mon, 27 Jan 2020 14:59:06 -0800 Subject: [PATCH] adjust type for AwesomeButtonProps.onPress `onPress()` takes an optional "after press" parameter that is a function that accepts a callback. Update the TypeScript types to reflect this. --- index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 38c6d79..2c09ae2 100644 --- a/index.d.ts +++ b/index.d.ts @@ -7,6 +7,8 @@ declare module "react-native-really-awesome-button" { import React, { Component } from "react"; import { ViewStyle } from "react-native"; + type AfterPressFn = (callback: () => void) => void; + export interface AwesomeButtonProps { activityColor?: string; backgroundActive?: string; @@ -39,7 +41,7 @@ declare module "react-native-really-awesome-button" { textSize?: number; textFamily?: string; width?: number; - onPress?(): void; + onPress?: (afterPressFn?: AfterPressFn) => void; } export default class AwesomeButton extends Component<