Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasjunior committed Oct 9, 2020
1 parent 85b2b39 commit 9136d5d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ declare module 'react-native-simple-dialogs' {

type activityIndicatorSizeType = 'small' | 'large' | number;

export interface DialogProps {
export interface BaseProps {
visible?: boolean;
onRequestClose?: () => void;
animationType?: animationType;
Expand All @@ -40,13 +40,17 @@ declare module 'react-native-simple-dialogs' {
contentStyle?: StyleProp<ViewStyle>;
buttonsStyle?: StyleProp<ViewStyle>;
overlayStyle?: StyleProp<ViewStyle>;
buttons?: React.ReactNode;
buttons?: React.ReactNode | React.ReactNode[] | JSX.Element
keyboardDismissMode?: keyboardDismissModeType;
keyboardShouldPersistTaps?: keyboardShouldPersistTapsType;
contentInsetAdjustmentBehavior?: 'automatic' | 'scrollableAxes' | 'never' | 'always';
}

export interface ProgressDialogProps extends DialogProps {
export interface DialogProps extends BaseProps {
children?: React.ReactNode | React.ReactNode[] | JSX.Element
}

export interface ProgressDialogProps extends BaseProps {
message: string;
messageStyle?: StyleProp<TextStyle>;
activityIndicatorColor?: string;
Expand All @@ -62,11 +66,12 @@ declare module 'react-native-simple-dialogs' {
style?: StyleProp<ViewStyle>;
}

export interface ConfirmDialogProps extends DialogProps {
export interface ConfirmDialogProps extends BaseProps {
message?: string;
messageStyle?: StyleProp<TextStyle>;
negativeButton?: ButtonProps;
positiveButton: ButtonProps;
children?: React.ReactNode | React.ReactNode[] | JSX.Element
}

export class Dialog extends React.Component<DialogProps> { }
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-simple-dialogs",
"version": "1.3.0",
"version": "1.4.0",
"description": "Cross-platform simple dialogs for React Native based on the Modal component. ⚛",
"private": false,
"repository": {
Expand Down

0 comments on commit 9136d5d

Please sign in to comment.