Skip to content

Commit

Permalink
fix: type issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mesqueeb committed Jul 20, 2023
1 parent ce640c4 commit 5048393
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/ui/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export type OPaths<T> = OPathsWithOptional<T>
export type MUIParseLabel<LabelType = any> = (label: LabelType) => string

export type MUIButton<T extends Record<string, any>, Label extends string = string> = {
label: Label | (<Value>(info: { value: Value; data: T }) => Label)
handler: <Value>(info: { value: Value; data: T }) => void | Promise<void>
disabled?: <Value>(info: { value: Value; data: T }) => boolean | undefined
label: Label | ((info: { value: any; data: T }) => Label)
handler: (info: { value: any; data: T }) => void | Promise<void>
disabled?: (info: { value: any; data: T }) => boolean | undefined
}

export type MUIColumn<T extends Record<string, any>, Label extends string = string> = {
Expand All @@ -31,11 +31,11 @@ export type MUIColumn<T extends Record<string, any>, Label extends string = stri
* @example ({ value }) => !!value ? '✅' : '❌'
* @example ({ data }) => data.name.family + ' ' + data.name.given
*/
parseValue?: <Value>(info: { value: Value; data: T }) => string
parseValue?: (info: { value: any; data: T }) => string
/** Applied to `td > div` */
class?: string | (<Value>(info: { value: Value; data: T }) => string)
class?: string | ((info: { value: any; data: T }) => string)
/** Applied to `td > div` */
style?: string | (<Value>(info: { value: Value; data: T }) => string)
style?: string | ((info: { value: any; data: T }) => string)
/** When `true` this column will become sortable as per the Magnetar orderBy feature */
sortable?: boolean | { orderBy: 'asc' | 'desc'; position: number }
/** Shows action buttons next to the cell value */
Expand Down

0 comments on commit 5048393

Please sign in to comment.