@nadle/ink-table
Version:
A table component for Ink.
22 lines • 1.04 kB
TypeScript
import React from "react";
type Scalar = string | number | boolean | null | undefined;
type ScalarDict = {
[key: string]: Scalar;
};
export type CellProps = React.PropsWithChildren<{
column: number;
}>;
export type TableProps<T extends ScalarDict> = {
data: T[];
padding?: number;
columns?: (keyof T)[];
cell?: (props: CellProps) => React.JSX.Element;
header?: (props: React.PropsWithChildren<{}>) => React.JSX.Element;
skeleton?: (props: React.PropsWithChildren<{}>) => React.JSX.Element;
};
export declare function Table<T extends ScalarDict>({ data, columns, padding, cell, header, skeleton }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
export declare function Header(props: React.PropsWithChildren<{}>): import("react/jsx-runtime").JSX.Element;
export declare function Cell(props: CellProps): import("react/jsx-runtime").JSX.Element;
export declare function Skeleton(props: React.PropsWithChildren<{}>): import("react/jsx-runtime").JSX.Element;
export {};
//# sourceMappingURL=index.d.ts.map