Skip to content

Commit 502fef8

Browse files
c-hardingvonovak
authored andcommitted
Add support for arrays of styles in TypeScript (#52)
1 parent e5781dc commit 502fef8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, ComponentType, ReactNode } from 'react';
2-
import { TextStyle, ViewStyle, View } from 'react-native';
2+
import { TextStyle, ViewStyle, View, StyleProp } from 'react-native';
33

44
export interface CommonHeaderButtonProps {
55
/**
@@ -25,11 +25,11 @@ export interface CommonHeaderButtonProps {
2525
/**
2626
* Style to apply to the button (icon and text).
2727
*/
28-
buttonStyle?: TextStyle | ViewStyle;
28+
buttonStyle?: StyleProp<TextStyle | ViewStyle>;
2929
/**
3030
* Style to apply to the touchable element that wraps the button.
3131
*/
32-
buttonWrapperStyle?: ViewStyle;
32+
buttonWrapperStyle?: StyleProp<ViewStyle>;
3333
/**
3434
* ID to locate the view in e2e tests.
3535
*/
@@ -73,8 +73,8 @@ export interface HeaderItemProps extends CommonHeaderButtonProps {
7373

7474
export interface onOverflowMenuPressParams {
7575
hiddenButtons: Array<ReactNode>;
76-
overflowButtonRef: ?View;
77-
cancelButtonLabel: ?string;
76+
overflowButtonRef?: View;
77+
cancelButtonLabel?: string;
7878
}
7979

8080
export interface HeaderButtonsProps {
@@ -102,7 +102,7 @@ export interface HeaderButtonsProps {
102102
*
103103
* There are some default styles set, as seen in `OverflowButton.js`
104104
*/
105-
overflowButtonWrapperStyle?: ViewStyle;
105+
overflowButtonWrapperStyle?: StyleProp<ViewStyle>;
106106
/**
107107
* Function that is called when overflow menu is pressed.
108108
*

0 commit comments

Comments
 (0)