interface IConnectionCredentialsState { authModelId : string | null ; networkHandlers : string [ ] ; } interface IConnectionCredentialsStateContext extends IConnectionCredentialsState { requireAuthModel : ( id : string ) => void ; requireNetworkHandler : ( id : string ) => void ; } export function connectionCredentialsStateContext ( ) { return { authModelId : null , networkHandlers : [ ] , requireAuthModel ( id ) { this . authModelId = id ; } , requireNetworkHandler ( id ) { this . networkHandlers . push ( id ) ; } , } ; }