Skip to content

Commit

Permalink
fix broken theme typings
Browse files Browse the repository at this point in the history
  • Loading branch information
jbetancur committed Jan 5, 2020
1 parent 9819165 commit 1877260
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 9 deletions.
51 changes: 43 additions & 8 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import * as React from 'react';
import { CSSProperties } from 'styled-components';
import { createTheme, defaultThemes } from './src/DataTable/themes';

export { defaultThemes, createTheme };

export interface IDataTableProps<T> {
title?: React.ReactNode;
Expand Down Expand Up @@ -65,7 +62,9 @@ export interface IDataTableProps<T> {
expandableRowExpanded?: (row: T) => boolean;
expandableRowDisabled?: (row: T) => boolean;
expandableIcon?: IExpandableIcon;
expandableInheritConditionalStyles?: boolean;
selectableRows?: boolean;
selectableRowsHighlight?: boolean;
selectableRowSelected?: (row: T) => boolean;
selectableRowDisabled?: (row: T) => boolean;
clearSelectedRows?: boolean;
Expand Down Expand Up @@ -142,6 +141,7 @@ export interface IDataTableStyles {
};
rows: {
style: CSSProperties;
selectedHighlighStyle: CSSProperties;
denseStyle: CSSProperties;
highlightOnHoverStyle: CSSProperties;
stripedStyle: CSSProperties;
Expand Down Expand Up @@ -185,20 +185,55 @@ export interface IExpandableIcon {
expanded: React.ReactNode;
}

export interface IContextMessage<T> {
export interface IContextMessage {
singular: string;
plural: string;
message: string;
}

export interface ICreateTheme {
createTheme?: T;
export interface ITheme {
text: {
primary: string;
secondary: string;
disabled: string;
};
background: {
default: string;
};
context: {
background: string;
text: string;
};
divider: {
default: string;
};
action: {
button: string;
hover: string;
disabled: string;
};
selected: {
default: string;
text: string;
};
highlightOnHover: {
default: string;
text: string;
};
striped: {
default: string;
text: string;
};
}

export interface IDefaultThemes {
defaultThemes?: T;
interface IDefaultThemes {
default: ITheme;
dark: ITheme;
}

export function createTheme<T>(name: string, customTheme: T): ITheme;
export const defaultThemes: IDefaultThemes;

export default function DataTable<T>(
props: IDataTableProps<T>
): React.ReactElement;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-data-table-component",
"version": "6.1.1",
"version": "6.1.2",
"description": "A declarative react based data table",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
Expand Down

0 comments on commit 1877260

Please sign in to comment.