import type { ViewProps, HostComponent } from 'react-native'; import type { DirectEventHandler, Double, WithDefault, } from 'react-native/Libraries/Types/CodegenTypes'; import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; export interface CellContentStyle { borderColor?: string; borderStyle?: string; borderWidth?: string; color?: string; fontFamily?: string; fontSize?: Double; hoverBackgroundColor?: string; hoverFontColor?: string; rowHeight?: Double; wrap?: boolean; } export interface Representation { imageLabel?: string; imagePosition?: string; imageSetting?: string; imageSize?: string; imageUrl?: string; linkUrl?: string; type?: string; urlLabel?: string; urlPosition?: string; } export interface ColumnHeader { id?: string; active?: boolean; align?: string; dataColIdx?: Double; isDim?: boolean; label?: string; representation?: Representation; sortDirection?: string; stylingInfo?: ReadonlyArray; totalInfo?: string; width?: Double; } export interface GrandTotalCell { qText?: string; qNum?: Double; qElemNumber?: Double; qState?: string; qIsTotalCell?: boolean; } export interface Totals { label?: string; position?: string; rows?: ReadonlyArray; show?: boolean; values?: ReadonlyArray; } export interface Cols { header?: ReadonlyArray; footer?: ReadonlyArray; totals?: Totals; } export interface HeaderContentStyle { backgroundColor?: string; borderColor?: string; borderStyle?: string; borderWidth?: string; color?: string; cursor?: string; fontFamily?: string; fontSize?: Double; sortLabelColor?: string; wrap?: boolean; } // Note: Row cells are passed as dynamic col-* keys (col-0, col-1, etc.) // Codegen cannot handle dynamic keys, so we serialize rows as JSON export interface Rows { reset?: boolean; rowsJSON?: string; // JSON stringified array of rows with dynamic col-* keys } export interface Size { qcx?: Double; qcy?: Double; } export interface Theme { backgroundColor?: string; borderBackgroundColor?: string; borderRadius?: Double; borderSelectedColor?: string; even?: string; headerBackgroundColor?: string; headerHeight?: Double; headerTextColor?: string; rowHeight?: Double; selectedBackground?: string; } export interface MenuTranslations { copy?: string; expand?: string; share?: string; } export interface MiscTranslations { of?: string; } export interface Translations { menu?: MenuTranslations; misc?: MiscTranslations; headerValues?: ReadonlyArray; } export interface NativeProps extends ViewProps { cellContentStyle?: CellContentStyle; clearSelections?: WithDefault; cols?: Cols; containerWidth?: Double; freezeFirstColumn?: boolean; headerContentStyle?: HeaderContentStyle; isDataView?: boolean; name?: string; rows?: Rows; size?: Size; theme?: Theme; translations?: Translations; onConfirmSelections?: DirectEventHandler<{}>; onDragBox?: DirectEventHandler<{ dragging: boolean; }>; onEndReached?: DirectEventHandler<{ target: Double; }>; onExpandCell?: DirectEventHandler<{ row: string; col: string; }>; onHeaderPressed?: DirectEventHandler<{ target: Double; column: string; // JSON stringified column object }>; onSearchColumn?: DirectEventHandler<{ target: Double; column: string; // JSON stringified column object }>; onSelectionsChanged?: DirectEventHandler<{ selections: string; }>; } export default codegenNativeComponent( 'ReactNativeStraightTableView' ) as HostComponent;