/** * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ import type { StrictReactNode, SingleOrMany } from "@k8slens/utilities"; export interface ItemObject { getId: () => string; getName: () => string; } export type TableSortBy = string; export type TableOrderBy = "asc" | "desc"; export interface TableSortParams { sortBy: TableSortBy; orderBy: TableOrderBy; } export type TableSortCallback = (data: Item) => undefined | string | number | (string | number)[]; export type TableSortCallbacks = Record>; export type SearchFilter = (item: I) => SingleOrMany; export interface TableCellProps extends React.DOMAttributes { /** * used for configuration visibility of columns */ id?: string; /** * Any css class names for this table cell. Only used if `title` is a "simple" react node */ className?: string; /** * The actual value of the cell */ title?: StrictReactNode; /** * content inside could be scrolled */ scrollable?: boolean; /** * render cell with a checkbox */ checkbox?: boolean; /** * mark checkbox as checked or not */ isChecked?: boolean; /** * column name, must be same as key in sortable object `
` */ sortBy?: TableSortBy; /** * id of the column which follow same visibility rules */ showWithColumn?: string; /** * @internal */ _sorting?: Partial; /** * @internal */ _sort?(sortBy: TableSortBy): void; /** * @internal * indicator, might come from parent , don't use this prop outside (!) */ _nowrap?: boolean; /** * For passing in the testid */ "data-testid"?: string; }