UNPKG

1.23 kBTypeScriptView Raw
1import type * as React from 'react';
2import type { NativeSyntheticEvent, ViewProps } from 'react-native';
3import NativeSafeAreaView from './specs/NativeSafeAreaView';
4export type Edge = 'top' | 'right' | 'bottom' | 'left';
5export type EdgeMode = 'off' | 'additive' | 'maximum';
6export type EdgeRecord = Partial<Record<Edge, EdgeMode>>;
7export type Edges = readonly Edge[] | Readonly<EdgeRecord>;
8export interface EdgeInsets {
9 top: number;
10 right: number;
11 bottom: number;
12 left: number;
13}
14export interface Rect {
15 x: number;
16 y: number;
17 width: number;
18 height: number;
19}
20export interface Metrics {
21 insets: EdgeInsets;
22 frame: Rect;
23}
24export type InsetChangedEvent = NativeSyntheticEvent<Metrics>;
25export type InsetChangeNativeCallback = (event: InsetChangedEvent) => void;
26export interface NativeSafeAreaProviderProps extends ViewProps {
27 children?: React.ReactNode;
28 onInsetsChange: InsetChangeNativeCallback;
29}
30export interface NativeSafeAreaViewProps extends ViewProps {
31 children?: React.ReactNode;
32 mode?: 'padding' | 'margin';
33 edges?: Edges;
34}
35export type NativeSafeAreaViewInstance = InstanceType<typeof NativeSafeAreaView>;
36//# sourceMappingURL=SafeArea.types.d.ts.map
\No newline at end of file