mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 14:38:20 +08:00
(react-native-modalbox) Remove ViewProperties from main props (#25128)
This commit is contained in:
committed by
Ryan Cavanaugh
parent
9f74c6978a
commit
ebf96ffc55
301
types/react-native-modalbox/index.d.ts
vendored
301
types/react-native-modalbox/index.d.ts
vendored
@@ -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<ViewStyle>;
|
||||
|
||||
/**
|
||||
* 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<ModalProps> {
|
||||
/**
|
||||
* Open the modal
|
||||
*
|
||||
*
|
||||
*/
|
||||
open(): void;
|
||||
/**
|
||||
* Open the modal
|
||||
*
|
||||
*
|
||||
*/
|
||||
open(): void;
|
||||
|
||||
/**
|
||||
* Close the modal
|
||||
*
|
||||
*
|
||||
*/
|
||||
close(): void;
|
||||
/**
|
||||
* Close the modal
|
||||
*
|
||||
*
|
||||
*/
|
||||
close(): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user