diff --git a/types/react-native-modalbox/index.d.ts b/types/react-native-modalbox/index.d.ts index 683773e995..84461471f2 100644 --- a/types/react-native-modalbox/index.d.ts +++ b/types/react-native-modalbox/index.d.ts @@ -5,176 +5,181 @@ // TypeScript Version: 2.6 import * as React from 'react'; -import { ViewProperties } from 'react-native'; +import { StyleProp, ViewStyle } from 'react-native'; -export interface ModalProps extends ViewProperties { - /** - * Checks if the modal is open - * - * Default is false - * - */ - isOpen?: boolean; +export interface ModalProps { + /** + * Checks if the modal is open + * + * Default is false + * + */ + isOpen?: boolean; - /** - * Checks if the modal is disabled - * - * Default is false - * - */ - isDisabled?: boolean; + /** + * Checks if the modal is disabled + * + * Default is false + * + */ + isDisabled?: boolean; - /** - * If the modal can be closed by pressing on the backdrop - * - * Default is true - * - */ - backdropPressToClose?: boolean; + /** + * If the modal can be closed by pressing on the backdrop + * + * Default is true + * + */ + backdropPressToClose?: boolean; - /** - * If the modal can be closed by swiping - * - * Default is true - * - */ - swipeToClose?: boolean; + /** + * If the modal can be closed by swiping + * + * Default is true + * + */ + swipeToClose?: boolean; - /** - * The threshold to reach in pixels to close the modal - * - * Default is 50 - * - */ - swipeThreshold?: number; + /** + * The threshold to reach in pixels to close the modal + * + * Default is 50 + * + */ + swipeThreshold?: number; - /** - * The height in pixels of the swipeable area - * - * Default is the Window Height - * - */ - swipeArea?: number; + /** + * The height in pixels of the swipeable area + * + * Default is the Window Height + * + */ + swipeArea?: number; - /** - * The final position of the modal. - * Accepts top, center or bottom - * - * Default is center - * - */ - position?: 'top' | 'center' | 'bottom' | string; + /** + * The final position of the modal. + * Accepts top, center or bottom + * + * Default is center + * + */ + position?: 'top' | 'center' | 'bottom' | string; - /** - * The direction modal enters from - * - * Default is bottom - * - */ - entry?: 'top' | 'bottom' | string; + /** + * The direction modal enters from + * + * Default is bottom + * + */ + entry?: 'top' | 'bottom' | string; - /** - * If a backdrop is displayed behind the modal - * - * Default is true - * - */ - backdrop?: boolean; + /** + * If a backdrop is displayed behind the modal + * + * Default is true + * + */ + backdrop?: boolean; - /** - * Opacity of the backdrop - * - * Default is 0.5 - * - */ - backdropOpacity?: number; + /** + * Opacity of the backdrop + * + * Default is 0.5 + * + */ + backdropOpacity?: number; - /** - * Background color of the backdrop - * - * Default is black - * - */ - backdropColor?: string; + /** + * Background color of the backdrop + * + * Default is black + * + */ + backdropColor?: string; - /** - * Add an element in the backdrop (a close button for example) - * - * Default is null - * - */ - backdropContent?: React.ReactNode; + /** + * Add an element in the backdrop (a close button for example) + * + * Default is null + * + */ + backdropContent?: React.ReactNode; - /** - * Duration of the animation - * - * Default is 400ms - * - */ - animationDuration?: number; + /** + * Duration of the animation + * + * Default is 400ms + * + */ + animationDuration?: number; - /** - * (Android only) Close modal when receiving back button event - * - * Default is false - * - */ - backButtonClose?: boolean; + /** + * (Android only) Close modal when receiving back button event + * + * Default is false + * + */ + backButtonClose?: boolean; - /** - * - * Default is false - */ - coverScreen?: boolean; + /** + * + * Default is false + */ + coverScreen?: boolean; - /** - * If the modal should appear open without animation upon first mount - * - * Default is false - * - */ - startOpen?: boolean; + /** + * If the modal should appear open without animation upon first mount + * + * Default is false + * + */ + startOpen?: boolean; - /** - * This property prevent the modal to cover the ios status bar when the modal is scrolling up because the keyboard is opening - * - * Default is ios:22, android:0 - */ - keyboardTopOffset?: number; + /** + * This property prevent the modal to cover the ios status bar when the modal is scrolling up because the keyboard is opening + * + * Default is ios:22, android:0 + */ + keyboardTopOffset?: number; - /** - * Event fired when the modal is closed and the animation is complete - * - */ - onClosed?(): void; + /** + * Custom styling for the content area + */ + style?: StyleProp; - /** - * Event fired when the modal is opened and the animation is complete - * - */ - onOpened?(): void; + /** + * Event fired when the modal is closed and the animation is complete + * + */ + onClosed?(): void; - /** - * When the state of the swipe to close feature has changed - * (useful to change the content of the modal, display a message for example) - * - * - */ - onClosingState?(state: boolean): void; + /** + * Event fired when the modal is opened and the animation is complete + * + */ + onOpened?(): void; + + /** + * When the state of the swipe to close feature has changed + * (useful to change the content of the modal, display a message for example) + * + * + */ + onClosingState?(state: boolean): void; } export default class Modal extends React.Component { - /** - * Open the modal - * - * - */ - open(): void; + /** + * Open the modal + * + * + */ + open(): void; - /** - * Close the modal - * - * - */ - close(): void; + /** + * Close the modal + * + * + */ + close(): void; }