Skip to content

Commit f3f3266

Browse files
mstlaurent-paradigmferrao
authored andcommitted
Adding Typescript definition file, adding to build (#31)
* Adding Typescript definition file, adding to build * Updateing Typescript definition according to latest version of react-semantic-toast
1 parent caf98ed commit f3f3266

File tree

3 files changed

+383
-52
lines changed

3 files changed

+383
-52
lines changed

lib/index.d.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
declare module 'react-semantic-toasts' {
2+
import { SemanticICONS } from 'semantic-ui-react'
3+
type ContainerPosition = 'top-right' | 'top-center' | 'top-left' | 'bottom-right' | 'bottom-center' | 'bottom-left'
4+
type SemanticAnimation = 'scale' | 'zoom' | 'fade' | 'fade up' | 'fade down' | 'fade left' | 'fade right' | 'horizontal flip' | 'vertical flip' | 'drop' |
5+
'fly left' | 'fly right' | 'fly down' | 'fly up' | 'swing left' | 'swing right' | 'swing up' | 'swing down' | 'browse' | 'browse right' | 'slide down' |
6+
'slide up' | 'slide left' | 'slide right' | 'jiggle' | 'flash' | 'shake' | 'pulse' | 'tada' | 'bounce' | 'glow'
7+
type ToastType = 'info' | 'success' | 'warning' | 'error'
8+
type SemanticMessageSize = 'mini' | 'tiny' | 'small' | 'large' | 'big' | 'huge' | 'massive'
9+
10+
const SemanticToastContainer: (
11+
props: {
12+
position?: ContainerPosition
13+
animation?: SemanticAnimation
14+
className?: string
15+
}
16+
) => JSX.Element
17+
18+
const toast: (
19+
options: {
20+
type: ToastType
21+
title: string
22+
description: string | string[] | React.ReactNode
23+
icon?: SemanticICONS
24+
size?: SemanticMessageSize
25+
color?: string
26+
animation?: SemanticAnimation
27+
time?: number
28+
},
29+
onClose?: () => void,
30+
onClick?: () => void
31+
) => void
32+
33+
export { SemanticToastContainer, toast }
34+
};

0 commit comments

Comments
 (0)