Skip to content

Commit 927679d

Browse files
Darmody蔡寰宇
authored andcommitted
fix typescript type definition
1 parent 7eaeb78 commit 927679d

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

index.d.ts

Lines changed: 16 additions & 3 deletions
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)