import React from 'react'; import { type StyleProp, type ViewStyle } from 'react-native'; import type { TreeMetrics } from './treeSizes'; import type { TreeCheckState, TreeNode, TreeProps, TreeRow as TreeRowMeta } from './types'; /** Every color a row can paint, resolved once by the tree and shared by all rows. */ export interface TreeRowColors { selectedBg: string; hoverBg: string; pressedBg: string; stripeBg: string; selectedBorder: string; focusRing: string; label: string; selectedLabel: string; chevron: string; disabled: string; guide: string; } export interface TreeRowProps { row: TreeRowMeta; metrics: TreeMetrics; indent: number; colors: TreeRowColors; isRTL: boolean; selected: boolean; /** Current-location row. Paints like a selection without consuming one. */ active: boolean; focused: boolean; loading: boolean; checkState: TreeCheckState; showCheckbox: boolean; showDisclosure: boolean; showGuides: boolean; striped: boolean; domId?: string; filterQuery: string; multiSelectable: boolean; selectable: boolean; /** Roving focus is on, so link rows stay out of the tab order. */ keyboardNavigation: boolean; /** * The tree has somewhere to route a link press. When it does not, an `href` * row is left as a plain anchor and the browser handles it. */ interceptLinks: boolean; rowStyle?: StyleProp; renderLabel?: TreeProps['renderLabel']; renderEndSection?: TreeProps['renderEndSection']; highlight?: TreeProps['highlight']; onPress: (node: TreeNode, isBranch: boolean, event?: any) => void; onToggle: (node: TreeNode) => void; onCheck: (node: TreeNode) => void; } /** * One row of the tree. Memoized: the flattened row list only changes when the * data, filter or expansion changes, so selecting a node re-renders the two * rows whose selected flag flipped instead of the whole tree. */ export declare const TreeRow: React.MemoExoticComponent<({ row, metrics, indent, colors, isRTL, selected, active, focused, loading, checkState, showCheckbox, showDisclosure, showGuides, striped, domId, filterQuery, multiSelectable, selectable, keyboardNavigation, interceptLinks, rowStyle, renderLabel, renderEndSection, highlight, onPress, onToggle, onCheck, }: TreeRowProps) => React.JSX.Element>;