Refactor conditional types in TypeScript

How can I refactor the types below to use the smallest amount of types possible while maintaining readability?

type GetI18nKeys<T extends keyof I18nNamespace> = T extends T
  ? `${T}:${Extract<keyof I18nNamespace(T), string>}`
  : never;

export function useTranslation<
  T extends keyof I18nNamespace,
  U extends T | T()
>(ns: U) {
  const context = useContext(i18nContext);

  if (!context) {
    throw Error("useTranslation hook must be called within I18nProvider.");
  }

  const t = useCallback(
    (
      key: U extends T
        ? keyof I18nNamespace(U)
        : GetI18nKeys<U extends (infer V)() ? V : T>,
      interpolation?: Interpolation
    ) => {},
    (ns, context)
  );

  return useMemo(() => ({ t, locale: context.locale }), (context, ns));
}