import { ComponentType } from 'react';
import { StyleProp, ViewStyle } from 'react-native';
import { RenderersProps } from 'react-native-render-html';
/**
* An object describing how to generate styles. See {@link cssRulesFromSpecs}.
*
*
*
* @public
*/
export interface TableStyleSpecs {
/**
* Will text be selectable.
*/
selectableText: boolean;
/**
* Expand table to HTML width.
*/
fitContainerWidth: boolean;
/**
* Expand table to HTML height.
* **You must une unconstrained height for this to work!**
* See {@link TableConfig.computeContainerHeight}.
*/
fitContainerHeight: boolean;
/**
* Spacing between cells, in em.
*/
cellPaddingEm: number;
/**
* Font size, in pixels.
*
* @remarks This value being applied to root, it will affect rem and em.
*/
fontSizePx: number | null;
/**
* The width of the border between rows.
*/
rowsBorderWidthPx: number;
/**
* The width of the border between columns.
*/
columnsBorderWidthPx: number;
/**
* The border color of the table frame.
*/
outerBorderColor: string;
/**
* The border width for the table frame.
*/
outerBorderWidthPx: number;
/**
* Link of anchors.
*/
linkColor: string;
/**
* Font family.
*
* @remarks
* You will need to do additional work to support non-native fonts.
*/
fontFamily: string;
/**
* Table cell border color.
*/
tdBorderColor: string;
/**
* Table header cell border color.
*/
thBorderColor: string;
/**
* Table even header cell background color.
*/
thOddBackground: string;
/**
* Table odd header cell text color.
*/
thOddColor: string;
/**
* Table even header cell background color.
*/
thEvenBackground: string;
/**
* Table even header cell text color.
*/
thEvenColor: string;
/**
* Table odd row background color.
*/
trOddBackground: string;
/**
* Table odd row text color.
*/
trOddColor: string;
/**
* Table even row background color.
*/
trEvenBackground: string;
/**
* Table even row text color.
*/
trEvenColor: string;
}
/**
* This content height state is available on mount, before the real height is
* known from the DOM.
*
* @remarks
* `heuristicHeight` is an approximated height used to minimize the “flash”
* effect of height transitions, see
* {@link TableConfig.computeHeuristicContentHeight}.
*
* @public
*/
export interface TableHeuristicContentHeightState {
type: 'heuristic';
contentHeight: number;
}
/**
*
* This content height state appears when the real table height is available,
* after the DOM has been mounted in the `WebView`.
*
* @public
*/
export interface TableAccurateContentHeightState {
type: 'accurate';
contentHeight: number;
}
/**
* An object describing the present knowledge of content height.
*
* @public
*/
export type TableContentHeightState =
| TableHeuristicContentHeightState
| TableAccurateContentHeightState;
/**
* This object defines how the table component can be customized.
*
* @public
*/
export interface TableConfig {
/**
* What kind of animation should be used when height is changed?
*
*
* @remarks
* This prop will be ignored when `cssRules` are provided.
*/
tableStyleSpecs?: TableStyleSpecs;
/**
* Any props you'd like to pass to the `WebView` component.
*
* @remarks
* `source` and `javascriptEnabled` will be ignored and overriden.
*/
webViewProps?: any;
/**
* Determine how the width of the table is constrained (or not).
*
* width or maxWidth.
* maxWidth determined by contentWidth and computeEmbeddedMaxWidth.
* width set to maxWidth. This can
* be useful to have a center-aligned table on wide screens.
*