Installation
npm install --save @types/react-native-modal-dropdown
Summary
This package contains type definitions for react-native-modal-dropdown (https://github.com/sohobloo/react-native-modal-dropdown).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-native-modal-dropdown.
import * as React from 'react';
import { StyleProp, TextStyle, ViewProps, ViewStyle, Constructor, NativeMethodsMixin } from 'react-native';
export interface PositionStyle {
top?: number | undefined;
left?: number | undefined;
right?: number | undefined;
width?: number | undefined;
height?: number | undefined;
}
export interface ModalDropdownProps<T = any> extends ViewProps {
disabled?: boolean | undefined;
defaultIndex?: number | undefined;
defaultValue?: string | undefined;
options?: T[] | undefined;
animated?: boolean | undefined;
scrollEnabled?: boolean | undefined;
showsVerticalScrollIndicator?: boolean | undefined;
textStyle?: StyleProp<TextStyle> | undefined;
dropdownStyle?: StyleProp<ViewStyle> | undefined;
dropdownTextStyle?: StyleProp<TextStyle> | undefined;
dropdownTextHighlightStyle?: StyleProp<TextStyle> | undefined;
adjustFrame?: ((positionStyle: PositionStyle) => PositionStyle) | undefined;
renderRow?: ((option: T, index: string, isSelected: boolean) => React.ReactNode) | undefined;
renderSeparator?: ((sectionID: string, index: string, adjacentRowHighlighted: boolean) => React.ReactNode) | undefined;
renderButtonText?: ((text: string) => string) | undefined;
onDropdownWillShow?: (() => void | boolean) | undefined;
onDropdownWillHide?: (() => void | boolean) | undefined;
onSelect?: ((index: string, option: T) => void | boolean) | undefined;
accessible?: boolean | undefined;
keyboardShouldPersistTaps?: 'always' | 'never' | 'handled' | undefined;
}
export default class ModalDropdown<T = any> extends React.Component<ModalDropdownProps<T>> {
show(): void;
hide(): void;
select(index: number): void;
}
Additional Details
Credits
These definitions were written by Carlos Li, and Ruslan Yurchenko.