UNPKG

@oni-mobile/react-native-action-menu

Version:
302 lines (267 loc) 6.72 kB
/** * Custom type definitions * By Márcio Luís Günther <marcio@marciogunther.com> * * @module \@oni-mobile/react-native-action-menu * */ declare module '@oni-mobile/react-native-action-menu' { import { Component } from 'react'; /** * ActionButtonProps * * @description Properties of the circular ActionMenu component. * @interface ActionButtonProps * @exports */ export interface ActionButtonProps { /** * Action buttons visible or not. * * @default false * @type boolean * @memberof ActionButtonProps */ active?: boolean; /** * Auto hide ActionButtons when ActionButton.Item is pressed. * * @default true * @type boolean * @memberof ActionButtonProps */ autoInactive?: boolean; /** * ActionButton position in the bottom of the parent element. * One of: "left", "center" and "right". * * @default "center" * @type 'left' | 'center' | 'right' * @memberof ActionButtonProps */ position?: 'left' | 'center' | 'right'; /** * Radius of circular menu. * * @default 100 * @type number * @memberof ActionButtonProps */ radius?: number; /** * Color of overlay when ActionButtons are visible. * * @default "transparent" * @type string * @memberof ActionButtonProps */ bgColor?: string; /** * Background color of the + Button **(must be rgba value!)** * * @default "rgba(0,0,0,1)" * @type string * @memberof ActionButtonProps */ buttonColor?: string; /** * Button background color to animate to. * * @default buttonColor property value * @type string * @memberof ActionButtonProps */ btnOutRange: string; /** * Changes size of button during animation * * @default 1 * @type number * @memberof ActionButtonProps */ outRangeScale: number; /** * Fires, when ActionButton is tapped. * * @default null * @type function * @memberof ActionButtonProps */ onPress?: function; /** * Fires, when ActionButton is long pressed * * @default null * @type function * @memberof ActionButtonProps */ onLongPress?: function; /** * Fires, when Overlay is pressed * * @default null * @type function * @memberof ActionButtonProps */ onOverlayPress?: function; /** * Custom component for ActionButton Icon * * @default + * @type object * @memberof ActionButtonProps */ icon?: object; /** * Custom component for use as Backdrop * * @default false * @type boolean | object * @memberof ActionButtonProps */ backdrop?: boolean | object; /** * Degrees to rotate icon * * @default 135 * @type number * @memberof ActionButtonProps */ degrees?: number; /** * Undocumented * * @default null * @type string * @memberof ActionButtonProps */ btnOutRangeTxt?: string; /** * Undocumented * * @default FIXME * @type string * @memberof ActionButtonProps */ btnOutColor?: string; /** * Undocumented * * @default FIXME * @type string * @memberof ActionButtonProps */ buttonTextColor?: string; /** * Undocumented * * @default FIXME * @type number * @memberof ActionButtonProps */ size?: number; /** * Undocumented * * @default FIXME * @type number * @memberof ActionButtonProps */ itemSize?: number; /** * Undocumented * * @default FIXME * @type number * @memberof ActionButtonProps */ startDegree?: number; /** * Undocumented * * @default FIXME * @type number * @memberof ActionButtonProps */ endDegree?: number; /** * Undocumented * * @default FIXME * @type object * @memberof ActionButtonProps */ // children?: object; }; /** * @description Properties of the circular ActionMenuItem component. * @interface ActionButtonItemProps * @exports */ export interface ActionButtonItemProps { /** * Function triggered when a button is tapped **required** * * @default null * @type function * @memberof ActionButtonItemProps */ onPress: function; /** * Background color of the Button. * * @default same as + button * @type string * @memberof ActionButtonItemProps */ buttonColor?: string; /** * Degrees to start the rotation of the Item. * * @default 0 * @type number * @memberof ActionButtonItemProps */ startDegree?: number; /** * Degrees to end the rotation of the Item. * * @default 720 * @type number * @memberof ActionButtonItemProps */ endDegree?: number; /** * ActionMenuItem title. * * @default null * @type string * @memberof ActionButtonItemProps */ title?: string; /** * Children element. * * @default null * @type object * @memberof ActionButtonItemProps */ children: object; }; /** * Renders a circular menu button * * @class ActionButton * */ export class ActionButton extends Component<ActionButtonProps, any> { /** * Renders the individual circular menu buttons. * * @method Item * @param props * @param any */ static Item(props: ActionButtonItemProps, any); }; };