import { type Color, type CellStyle, type FontSize } from './style'; import { type FontStack } from './font-stack'; /** * composite styling for tables. * * @privateRemarks * * we used to have a "footer", now removed. use borders on rows. */ export interface TableTheme { /** the first row in a table, showing column titles. */ header?: CellStyle; /** * odd rows in the table. we count the title row as zero, so * the first row in the table containing data is 1, hence odd. */ odd?: CellStyle; /** * even rows in the table. */ even?: CellStyle; /** * styling for the totals row, if included. this will be the last * row in the table. */ total?: CellStyle; } /** theme options - colors and fonts */ export interface Theme { /** grid headers (composite) */ headers?: CellStyle; /** grid cell defaults (composite: size, font face, color, background) */ grid_cell?: CellStyle; /** * base font size for grid cell. we try to specify things in ems, but * we do need to know this in order to measure */ grid_cell_font_size: FontSize; /** gridlines color */ grid_color: string; /** * new: gridlines color for headers. should default to the regular grid * color unless it's explicitly set. */ headers_grid_color?: string; /** color of grid lines */ /** color of in-cell note marker */ note_marker_color: string; /** theme colors */ theme_colors?: string[]; /** as RGB, so we can adjust them */ theme_colors_rgb?: [number, number, number][]; /** * cache tinted colors. the way this works is we index by the * theme color first, then by the tint value. * * TODO: we could reduce the tint space... the values look like * they are fairly regular (todo) * * what we are doing now is rounding to 2 decimal places on import, that * cleans up the super precise values we get from excel to more reasonable * values for keys, and I don't think most people can tell the difference * between tinting 25% vs 24.99999872% */ tint_cache?: Record[]; /** * cache for offset colors */ offset_cache?: Record; /** * this is now default, but you can set explicitly per-table */ table?: TableTheme; /** * this is for tinting. we're experimenting with tinting towards black * or white, as opposed to lightening/darkening colors. this should improve * swapping themed colors. * * how to derive this value? @see DeriveColorScheme */ mode: 'light' | 'dark'; /** light color for offset (against dark background) */ offset_light: string; /** dark color for offset (against light background) */ offset_dark: string; /** precalculated font stacks */ font_stacks: Record; } /** * @internal */ export declare const DefaultTheme: Theme; /** * this includes an implicit check for valid color, if a color * can't be resolved it returns ''. now supports offset colors. * offset returns a light color against a dark background, and * vice versa. what constitutes a dark background is not entirely * clear; atm using lightness = .65. * * @internal */ export declare const ResolveThemeColor: (theme: Theme, color?: Color, default_index?: number) => string; /** * this is a shortcut for creating table formats based on theme colors. * TODO: we might want to swap styles based on light/dark mode? * * @internal */ export declare const ThemeColorTable: (theme_color: number, tint?: number) => TableTheme; /** * for stuff that's painted, we wamt to get the corresponding CSS value. * we now set everything via CSS variables, but using the node structure * allows us to read calculated values, especially when there are cascades. * * I keep trying to change this to just read CSS variables, but that does * not do the same thing. * * @internal */ export declare const LoadThemeProperties: (container: HTMLElement, use_font_stacks?: boolean) => Theme;