-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathindex.d.ts
52 lines (45 loc) · 1.52 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
declare module 'react-native-safe-area' {
import { ComponentType } from 'react'
// from `TypeDefinition.js`
type SafeAreaInsets = { top: number; left: number; bottom: number; right: number };
type EventType = 'safeAreaInsetsForRootViewDidChange'
type EventPayload = { safeAreaInsets: SafeAreaInsets }
// from `SafeArea.[ios|android].js`
export default class SafeArea {
static getSafeAreaInsetsForRootView(): Promise<EventPayload>
static addEventListener(eventType: EventType, listener: (payload: EventPayload) => void): void
static removeEventListener(eventType: EventType, listener: (payload: EventPayload) => void): void
}
// from `withSafeArea.js`
type Direction =
| 'top'
| 'bottom'
| 'left'
| 'right'
| 'topLeft' // DEPRECATED
| 'topAndLeft'
| 'topRight' // DEPRECATED
| 'topAndRight'
| 'bottomLeft' // DEPRECATED
| 'bottomAndLeft'
| 'bottomRight' // DEPRECATED
| 'bottomAndRight'
| 'vertical'
| 'horizontal'
| 'verticalAndLeft'
| 'verticalAndRight'
| 'horizontalAndTop'
| 'horizontalAndBottom'
| 'all';
export function withSafeArea<P>(
WrappedComponent: React.ComponentType<P>,
/**
* @default 'margin'
*/
applyTo: 'margin' | 'padding' | 'absolutePosition' | 'contentInset',
/**
* @default 'all'
*/
direction: Direction,
): ComponentType<P>;
}