From ef742ea9b2f246f74eae74169675a331679ad41c Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Fri, 26 Mar 2021 01:56:04 +0300
Subject: feat: add strong typing where possible

---
 src/lib/ServiceContext.tsx | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

(limited to 'src/lib/ServiceContext.tsx')

diff --git a/src/lib/ServiceContext.tsx b/src/lib/ServiceContext.tsx
index 93cac4e..f7170d1 100644
--- a/src/lib/ServiceContext.tsx
+++ b/src/lib/ServiceContext.tsx
@@ -7,22 +7,22 @@ export interface Action extends ButtonProps {
   name: string;
 }
 
-export interface PanelProps {
-  item: any;
-  mutate: (item: any) => void;
+export interface PanelProps<T> {
+  item: T;
+  mutate: (item: T) => void;
 }
 
-export interface ServiceParams {
+export interface ServiceParams<T = any> {
   route: string;
   name: string;
   tableFields: Field[];
   nameSingular?: string;
-  default?: Record<string, any>;
+  default?: Partial<T>;
   routes?: Record<string, React.FC>;
   actions?: Action[];
-  rowLink?: (item: any) => string;
-  Form?: React.FC<FormikProps<any>>;
-  Panel?: React.FC<PanelProps>;
+  rowLink?: (item: T) => string;
+  Form?: React.FC<FormikProps<T>>;
+  Panel?: React.FC<PanelProps<T>>;
 }
 
 const ServiceContext = React.createContext<ServiceParams>({
-- 
cgit v1.2.3

