1 import React from 'react'; 2 import { GestureResponderEvent } from 'react-native'; 3 4 export interface IIconButtonProps { 5 accessibilityLabel?: string; 6 color?: string; 7 disabled?: boolean; 8 onPress?: (e?: GestureResponderEvent) => void; 9 size?: number | string; 10 src: Function; 11 style?: Object | undefined; 12 tapColor?: string; 13 type?: string; 14 } 15 16 /** 17 * Item data for <tt>NavigateSectionList</tt>. 18 */ 19 export type Item = { 20 21 /** 22 * The avatar URL or icon name. 23 */ 24 avatar?: string; 25 26 /** 27 * The color base of the avatar. 28 */ 29 colorBase: string; 30 31 /** 32 * An optional react element to append to the end of the Item. 33 */ 34 elementAfter?: React.ReactNode; 35 36 /** 37 * Unique ID of the item. 38 */ 39 id: string; 40 41 key?: string; 42 43 /** 44 * Lines[0] - date 45 * lines[1] - duration 46 * lines[2] - server name. 47 */ 48 lines: Array<string>; 49 50 /** 51 * Item title. 52 */ 53 title: string; 54 55 type: string; 56 57 /** 58 * Item url. 59 */ 60 url: string; 61 }; 62 63 /** 64 * Web implementation of section data for NavigateSectionList. 65 */ 66 export type Section = { 67 68 /** 69 * Optional properties added only to fix some flow errors thrown by React 70 * SectionList. 71 */ 72 ItemSeparatorComponent?: React.ComponentType<any>; 73 74 /** 75 * Array of items in the section. 76 */ 77 data: ReadonlyArray<Item>; 78 79 /** 80 * Unique key for the section. 81 */ 82 key?: string; 83 84 keyExtractor?: (item: Object) => string; 85 86 renderItem?: (info: Object) => null | React.ReactElement<any>; 87 88 /** 89 * Section title. 90 */ 91 title: string; 92 93 }; 94 95 /** 96 * Native implementation of section data for NavigateSectionList. 97 * 98 * When react-native's SectionList component parses through an array of sections 99 * it passes the section nested within the section property of another object 100 * to the renderSection method (on web for our own implementation of SectionList 101 * this nesting is not implemented as there is no need for nesting). 102 */ 103 export type SectionListSection = { 104 section: Section; 105 };