/** * TypeScript declaration for https://github.com/instea/react-native-popup-menu * * @author Wang Guan */ declare module "react-native-popup-menu" { import * as React from "react"; import { StyleProp, ViewStyle } from "react-native"; /** * MenuProvider * @see https://github.com/instea/react-native-popup-menu/blob/master/doc/api.md#menuprovider */ interface MenuProviderProps { style?: StyleProp; customStyles?: { menuProviderWrapper?: StyleProp; backdrop?: StyleProp; }; backHandler?: boolean | Function; } interface MenuProviderStatic extends React.ComponentClass { // FIXME: these methods does not get included in ref, unlike WebView in react-native.d.ts open(name: string): Promise; toggleMenu(name: string): Promise; close(): Promise; } export const MenuProvider: MenuProviderStatic; /** * Menu * @see https://github.com/instea/react-native-popup-menu/blob/master/doc/api.md#menu */ interface MenuProps { name?: string; opened?: boolean; renderer?: Function; rendererProps?: any; onSelect?(optionValue: any): any; onOpen?(): void; onClose?(): void; onBackdropPress?(): void; } interface MenuStatic { debug: boolean; setDefaultRenderer(renderer: Function): void; setDefaultRendererProps(defaultRendererProps: any): void; } export const Menu: React.ComponentClass & MenuStatic; /** * MenuTrigger * @see https://github.com/instea/react-native-popup-menu/blob/master/doc/api.md#menutrigger */ interface MenuTriggerProps { disabled?: boolean; text?: string; customStyles?: { triggerOuterWrapper?: StyleProp; triggerWrapper?: StyleProp; triggerText?: StyleProp; TriggerTouchableComponent?: Function; triggerTouchable?: {}; }; onPress?(): void; } export const MenuTrigger: React.ComponentClass; /** * MenuOptions * @see https://github.com/instea/react-native-popup-menu/blob/master/doc/api.md#menuoptions */ interface MenuOptionsProps { optionsContainerStyle?: StyleProp; renderOptionsContainer?: Function; customStyles?: MenuOptionsCustomStyle; } interface MenuOptionsCustomStyle extends MenuOptionCustomStyle { optionsWrapper?: StyleProp; optionsContainer?: StyleProp; } export const MenuOptions: React.ComponentClass; /** * MenuOption * @see https://github.com/instea/react-native-popup-menu/blob/master/doc/api.md#menuoption */ interface MenuOptionProps { value?: any; text?: string; disabled?: boolean; disableTouchable?: boolean; customStyles?: MenuOptionCustomStyle; style?: StyleProp; onSelect?(): any; } interface MenuOptionCustomStyle { optionWrapper?: StyleProp; optionText?: StyleProp; optionTouchable?: {}; } export const MenuOption: React.ComponentClass; /** * Menu renderers * @see https://github.com/instea/react-native-popup-menu/blob/master/doc/api.md#renderers */ export const renderers: Readonly<{ ContextMenu: Function; NotAnimatedContextMenu: Function; SlideInMenu: Function; Popover: Function; }>; }