-
Notifications
You must be signed in to change notification settings - Fork 127
/
index.d.ts
66 lines (59 loc) · 2.13 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import React from 'react'
import { ViewStyle, TextStyle, StyleProp, Animated } from 'react-native'
declare module 'react-native-material-bottom-navigation' {
export interface TabConfig {
key: number | string
barColor?: string
pressColor?: string
}
export type AnimationDefinition = (progress: Animated.Value) => any
export type EasingFunction = (t: number) => number
export interface BottomNavigationProps {
tabs: { [index: number]: TabConfig }
renderTab: ({ tab: TabConfig, isActive: boolean }) => JSX.Element
activeTab?: number | string
onTabPress?: (newTab: TabConfig, oldTab: TabConfig) => void
useLayoutAnimation?: boolean
style?: StyleProp<ViewStyle>
viewportHeight?: number
}
export interface IconTabProps {
isActive: boolean
style?: StyleProp<ViewStyle>
renderIcon: ({ isActive: boolean }) => JSX.Element
renderBadge?: ({ isActive: boolean }) => JSX.Element
showBadge?: boolean
badgeSlotStyle?: StyleProp<ViewStyle>
animationDuration?: number
animationEasing?: EasingFunction
iconAnimation?: AnimationDefinition
badgeAnimation?: AnimationDefinition
}
export interface FullTabProps {
isActive: boolean
style?: StyleProp<ViewStyle>
renderIcon: ({ isActive: boolean }) => JSX.Element
renderBadge?: ({ isActive: boolean }) => JSX.Element
showBadge?: boolean
badgeSlotStyle?: StyleProp<ViewStyle>
label: string
labelStyle?: StyleProp<TextStyle>
animationDuration?: number
animationEasing?: EasingFunction
iconAnimation?: AnimationDefinition
labelAnimation?: AnimationDefinition
badgeAnimation?: AnimationDefinition
}
export interface BadgeProps {
children?: JSX.Element | string | number
style?: StyleProp<ViewStyle>
textStyle?: StyleProp<TextStyle>
}
export default class BottomNavigation extends React.Component<
BottomNavigationProps
> {}
export class IconTab extends React.Component<IconTabProps> {}
export class FullTab extends React.Component<FullTabProps> {}
export class ShiftingTab extends React.Component<FullTabProps> {}
export class Badge extends React.Component<BadgeProps> {}
}