diff --git a/lib/index.ts b/lib/index.ts index d36b1f6..789b030 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -225,11 +225,17 @@ export type UseGetNull = { type InternalValue any> = Parameters[0] -export type Instance> = InternalInstance< - A['type'], - A['definition'], - keyof A['definition'] -> +export type Instance = + A extends CoreAPI + ? InternalInstance< + A['type'], + A['definition'], + keyof A['definition'] + > + // constructor + : A extends (x:any) => any + ? ReturnType + : never export function either( name: Name,