Skip to content

Commit

Permalink
fix(ui): QTableColumn['field'] type compatibility (quasarframework#13876
Browse files Browse the repository at this point in the history
)
yusufkandemir authored Jul 7, 2022
1 parent e7dc988 commit 925a8e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ui/types/api/qtable.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Error on "quasar" import shown in IDE is normal, as we only have Components/Directives/Plugins types after the build step
// The import will work correctly at runtime
import { QTable } from "quasar";
import { QTableProps } from "quasar";

export type QTableColumn<
Row extends Record<string, any> = any,
K = Row extends Record<string, any> ? keyof Row : string,
Field = K | ((row: Row) => any)
> = Omit<NonNullable<QTable["columns"]>[0], "field" | "format"> & {
Key = keyof Row extends string ? keyof Row : string,
Field = Key | ((row: Row) => any)
> = Omit<NonNullable<QTableProps["columns"]>[number], "field" | "format"> & {
field: Field;
format?: (val: any, row: Row) => string;
};

0 comments on commit 925a8e0

Please sign in to comment.