Skip to content

IHeaderCellConfig type does not match implementation #69

@tomatrow

Description

@tomatrow

The IHeaderCellConfig doesn't seem to match the implementation.

export interface IHeaderCellConfig extends IHeaderCell {
cell?: Component<
ICellProps & {
cell: Omit<IHeaderCell, "cell">;
}
>;
}

e.g. the implementation hasgetRowIndex on the header cell api and getState/getReactiveState do not return the full table api.

I'm using the following patch in my project to match types to implementation:

diff --git a/types/index.d.ts b/types/index.d.ts
index fa9ca873165746354be8a452494abd73f09a9827..125afb45cc08dc391babee221a71cf5b8bfd7e8b 100644
--- a/types/index.d.ts
+++ b/types/index.d.ts
@@ -41,12 +41,24 @@ export interface ICellProps {
 	onaction: (ev: { action?: any; data?: { [key: string]: any } }) => void;
 }
 
+export interface IHeaderCellApi {
+	exec: IApi["exec"];
+	getState: IApi["getState"];
+	getReactiveState: IApi["getReactiveState"];
+	getRow: IApi["getRow"];
+	getRowIndex: (id: number | string, data?: unknown[]) => number;
+}
+
+export interface IHeaderCellProps {
+	api: IHeaderCellApi;
+	row: number;
+	column: IColumn;
+	cell: Omit<IHeaderCell, "cell">;
+	onaction: (ev: { action?: any; data?: { [key: string]: any } }) => void;
+}
+
 export interface IHeaderCellConfig extends IHeaderCell {
-	cell?: Component<
-		ICellProps & {
-			cell: Omit<IHeaderCell, "cell">;
-		}
-	>;
+	cell?: Component<IHeaderCellProps>;
 }
 
 export type TColumnHeaderConfig =

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions