mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
bunch of lint fixes
This commit is contained in:
+39
-27
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user