Skip to content

Commit

Permalink
Fix index.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasjunior committed Jun 6, 2020
1 parent 1f67ba6 commit 4480356
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 32 deletions.
67 changes: 37 additions & 30 deletions react-native-simple-dialogs.d.ts → index.d.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
declare module 'react-native-simple-dialogs' {
import * as React from 'react';
import {
View,
ViewProps,
Text,
Button,
StyleProp,
ButtonProps,
ViewStyle,
TextStyle,
} from 'react-native';

type animationType = 'none' | 'slide' | 'fade';

type supportedOrientationsType =
| 'portrait'
| 'portrait-upside-down'
| 'landscape'
| 'landscape-left'
| 'landscape-right';
| 'portrait'
| 'portrait-upside-down'
| 'landscape'
| 'landscape-left'
| 'landscape-right';

type keyboardDismissModeType = 'none' | 'on-drag' | 'interactive';

type keyboardShouldPersistTapsType =
| 'always'
| 'never'
| 'handled'
| false
| true;
| 'always'
| 'never'
| 'handled'
| false
| true;

type activityIndicatorSizeType = 'small' | 'large';

Expand All @@ -38,33 +35,43 @@ declare module 'react-native-simple-dialogs' {
supportedOrientations?: supportedOrientationsType;
onTouchOutside?: () => void;
title?: string;
titleStyle?: StyleProp<Text>;
dialogStyle?: StyleProp<View>;
contentStyle?: ViewProps<View>;
buttonsStyle?: StyleProp<View>;
overlayStyle?: StyleProp<View>;
buttons?: ButtonProps<Button>;
titleStyle?: StyleProp<TextStyle>;
dialogStyle?: StyleProp<ViewStyle>;
contentStyle?: StyleProp<ViewStyle>;
buttonsStyle?: StyleProp<ViewStyle>;
overlayStyle?: StyleProp<ViewStyle>;
buttons?: React.ComponentType<any>;
keyboardDismissMode?: keyboardDismissModeType;
keyboardShouldPersistTaps?: keyboardShouldPersistTapsType;
children: React.ComponentType<any>;
}

export interface ProgressDialogProps extends DialogProps {
message: string;
messageStyle?: StyleProp<Text>;
messageStyle?: StyleProp<TextStyle>;
activityIndicatorColor?: string;
activityIndicatorSize?: activityIndicatorSizeType;
activityIndicatorStyle?: StyleProp<View>;
activityIndicatorStyle?: StyleProp<ViewStyle>;
}

export interface ButtonProps {
title: string;
onPress: () => void;
disabled?: boolean;
titleStyle?: StyleProp<TextStyle>;
style?: StyleProp<ViewStyle>;
}

export interface ConfirmDialogProps extends DialogProps {
message?: string;
messageStyle?: StyleProp<Text>;
negativeButton?: ButtonProps<Button>;
positiveButton: ButtonProps<Button>;
messageStyle?: StyleProp<TextStyle>;
negativeButton?: ButtonProps;
positiveButton: ButtonProps;
children?: React.ComponentType<any>;
}

export class Dialog extends React.Component<DialogProps> {}
export class ProgressDialog extends React.Component<ProgressDialogProps> {}
export class ConfirmDialog extends React.Component<ConfirmDialogProps> {}
export class TouchableEffect extends React.Component<Props> {}
export class Dialog extends React.Component<DialogProps> { }
export class ProgressDialog extends React.Component<ProgressDialogProps> { }
export class ConfirmDialog extends React.Component<ConfirmDialogProps> { }
export class TouchableEffect extends React.Component<Props> { }
}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-simple-dialogs",
"version": "1.2.1",
"version": "1.3.0",
"description": "Cross-platform simple dialogs for React Native based on the Modal component. ⚛",
"private": false,
"repository": {
Expand Down Expand Up @@ -28,7 +28,6 @@
},
"dependencies": {},
"devDependencies": {
"babel-preset-react-native": "5.0.2",
"react": "16.4.1",
"react-native": "0.56.0"
},
Expand Down

0 comments on commit 4480356

Please sign in to comment.