bunch of lint fixes

This commit is contained in:
Pavlos Vinieratos
2018-11-21 11:55:28 +01:00
parent 572eae2e09
commit 7a449c042e
2 changed files with 41 additions and 29 deletions
+39 -27
View File
@@ -2,35 +2,47 @@
// Project: https://github.com/miyabi/react-native-safe-area#readme
// Definitions by: Pavlos Vinieratos <https://github.com/pvinis>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
// TypeScript Version: 2.8
/// <reference types="react" />
declare module 'react-native-safe-area' {
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';
import { EmitterSubscription } from 'react-native';
export function withSafeArea(
WrappedComponent: React.ComponentType<any>,
applyTo: 'margin' | 'padding' | 'absolutePosition' | 'contentInset' = 'margin',
direction: Direction = 'all',
): React.ComponentType<any>;
// from `TypeDefinition.js`
export interface SafeAreaInsets { top: number; left: number; bottom: number; right: number; }
// from `SafeArea.[ios|android].js`
declare namespace SafeArea {
function getSafeAreaInsetsForRootView(): Promise<{ safeAreaInsets: SafeAreaInsets }>;
function addEventListener(eventType: string, listener: (...args: any[]) => any, context?: any): EmitterSubscription;
function removeEventListener(eventType: string, listener: (...args: any[]) => any): void;
}
export default SafeArea;
// from `withSafeArea.js`
export 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(
WrappedComponent: React.ComponentType<any>,
applyTo: 'margin' | 'padding' | 'absolutePosition' | 'contentInset' = 'margin',
direction: Direction = 'all',
): React.ComponentType<any>;
@@ -1,4 +1,4 @@
import { View } from 'react-native'
import { View } from 'react-native';
import { withSafeArea } from 'react-native-safe-area';
const SafeAreaView = withSafeArea(View)
const SafeAreaView = withSafeArea(View);