import * as React from 'react' ; import { useKeycloak } from './useKeycloak' ; import type { SSRAuthClient } from './types' ; type InjectedProps < ACT > = { keycloakInitialized : boolean ; keycloak : ACT ; } ; deprecated export function withKeycloak < P extends InjectedProps < ACT > , ACT extends SSRAuthClient = SSRAuthClient > ( Component ) { return function WrappedComponent ( props ) { const { keycloak , initialized } = useKeycloak ( ) ; return ( < Component { ... ( props as P ) } keycloakInitialized = { initialized } keycloak = { keycloak } / > ) ; } ; } desc example type SetDifference < A , B > = A extends B ? never : A ; desc example type SetComplement < A , A1 extends A > = SetDifference < A , A1 > ; desc example type Subtract < T extends T1 , T1 extends object > = Pick < T , SetComplement < keyof T , keyof T1 > > ;