refactor: simplify update functions

This commit is contained in:
Carlos Valente
2024-12-20 09:36:03 +01:00
committed by Carlos Valente
parent ab6765b332
commit 4cbe25a845
4 changed files with 47 additions and 83 deletions
+16
View File
@@ -6,6 +6,9 @@ declare module '*.scss' {
type ListenerType = (event: 'string', args: unknown[]) => void;
declare global {
/**
* Register the electron properties
*/
interface Window {
ipcRenderer: {
send: (channel: string, args?: string | object) => void;
@@ -17,6 +20,19 @@ declare global {
}
}
/**
* We pass a custom property to the table meta to allow field update
*/
declare module '@tanstack/react-table' {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface TableMeta<TData extends RowData> {
handleUpdate: (rowIndex: number, accessor: string, payload: string, isCustom: boolean) => void;
}
}
/**
* Allow passing CSS Properties
*/
declare module 'react' {
interface CSSProperties {
[key: `--${string}`]: string | number;