Skip to content

Commit 1b7d5e9

Browse files
authored
Merge pull request #68 from Darmody/fix-typescript-type-definition
fix typescript type definition
2 parents 0c0c955 + 927679d commit 1b7d5e9

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

index.d.ts

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
11
import { Component, ReactNode } from "react";
22

3+
interface ToastComponentProps {
4+
position?: "bottom" | "center" | "top";
5+
textStyle?: {};
6+
positionValue?: number;
7+
fadeInDuration?: number;
8+
fadeOutDuration?: number;
9+
opacity?: number;
10+
}
11+
312
declare module "react-native-easy-toast" {
4-
export interface DURATION {
13+
interface IDuration {
514
LENGTH_SHORT: number;
615
FOREVER: number;
716
}
8-
export default class Toast extends Component {
17+
18+
export var DURATION: IDuration;
19+
20+
export default class Toast extends Component<ToastComponentProps> {
921
show: (
1022
text: string | ReactNode,
1123
duration?: number,
12-
callback?: (() => void)
24+
callback?: () => void
1325
) => void;
1426
close: (duration?: number) => void;
1527
}
1628
}
29+

0 commit comments

Comments
 (0)