Skip to content

Commit 82b091e

Browse files
authored
typescript definition
1 parent 3c94b61 commit 82b091e

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

index.d.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* typescript definition
3+
* @author wallel
4+
*/
5+
declare module "react-native-root-toast"{
6+
import * as React from 'react';
7+
import * as ReactNative from "react-native";
8+
import {TextStyle,StyleProp,ViewStyle} from "react-native";
9+
export interface ToastOptions {
10+
containerStyle?:StyleProp<ViewStyle>
11+
duration?:number
12+
visible?: boolean,
13+
position?: number,
14+
animation?:boolean,
15+
shadow?: boolean,
16+
backgroundColor?: string,
17+
opacity?: number,
18+
shadowColor?: string,
19+
textColor?: string,
20+
textStyle?: StyleProp<TextStyle>,
21+
delay?: number,
22+
hideOnPress?: boolean,
23+
onHide?: Function,
24+
onHidden?: Function,
25+
onShow?: Function,
26+
onShown?: Function
27+
}
28+
29+
export interface ToastProps extends ToastOptions,ReactNative.ViewProperties{
30+
}
31+
32+
export interface Durations {
33+
LONG:number,
34+
SHORT:number
35+
}
36+
export interface Positions {
37+
TOP:number,
38+
BOTTOM:number,
39+
CENTER:number,
40+
}
41+
export default class Toast extends React.Component<ToastProps>{
42+
static show:(message:string,options:ToastOptions)=>any;
43+
static hide:(toast:any)=>void;
44+
static durations:Durations;
45+
static positions:Positions;
46+
}
47+
}
48+
49+

0 commit comments

Comments
 (0)