@@ -60,7 +60,7 @@ interface Props {
6060
6161interface ConnectionSchema {
6262 name : string ;
63- schema : z . ZodType ;
63+ schema : z . ZodType < DatabaseConnection > ;
6464 color : string ;
6565 logo : DBLogoName ;
6666 connectionLibraries : {
@@ -237,7 +237,7 @@ const DATA_CATALOGS = [
237237] satisfies ConnectionSchema [ ] ;
238238
239239const DatabaseSchemaSelector : React . FC < {
240- onSelect : ( schema : z . ZodType ) => void ;
240+ onSelect : ( schema : z . ZodType < DatabaseConnection > ) => void ;
241241} > = ( { onSelect } ) => {
242242 const renderItem = ( { name, schema, color, logo } : ConnectionSchema ) => {
243243 return (
@@ -276,13 +276,15 @@ const DatabaseSchemaSelector: React.FC<{
276276const RENDERERS : FormRenderer [ ] = [ ENV_RENDERER ] ;
277277
278278const DatabaseForm : React . FC < {
279- schema : z . ZodType ;
279+ schema : z . ZodType < DatabaseConnection > ;
280280 onSubmit : ( ) => void ;
281281 onBack : ( ) => void ;
282282} > = ( { schema, onSubmit, onBack } ) => {
283283 const form = useForm < DatabaseConnection > ( {
284284 defaultValues : getDefaults ( schema ) ,
285- resolver : zodResolver ( schema ) ,
285+ resolver : zodResolver (
286+ schema as unknown as z . ZodType < unknown , DatabaseConnection > ,
287+ ) ,
286288 reValidateMode : "onChange" ,
287289 } ) ;
288290
@@ -357,7 +359,8 @@ const DatabaseForm: React.FC<{
357359} ;
358360
359361const AddDatabaseForm : React . FC < Props > = ( { onSubmit } ) => {
360- const [ selectedSchema , setSelectedSchema ] = useState < z . ZodType | null > ( null ) ;
362+ const [ selectedSchema , setSelectedSchema ] =
363+ useState < z . ZodType < DatabaseConnection > | null > ( null ) ;
361364
362365 if ( ! selectedSchema ) {
363366 return < DatabaseSchemaSelector onSelect = { setSelectedSchema } /> ;
0 commit comments