import { LogLevel } from '../Logging/Logger' ; export interface BlazorOptions { configureSignalR : ( builder : signalR . HubConnectionBuilder ) => void ; logLevel : LogLevel ; reconnectionOptions : ReconnectionOptions ; reconnectionHandler ? : ReconnectionHandler ; } export function resolveOptions ( userOptions ? ) { const result = { ... defaultOptions , ... userOptions } ; if ( userOptions && userOptions . reconnectionOptions ) { result . reconnectionOptions = { ... defaultOptions . reconnectionOptions , ... userOptions . reconnectionOptions } ; } return result ; } export interface ReconnectionOptions { maxRetries : number ; retryIntervalMilliseconds : number ; dialogId : string ; } export interface ReconnectionHandler { onConnectionDown ( options , error ? ) : void ; onConnectionUp ( ) : void ; } const defaultOptions = { configureSignalR : ( _ ) => { } , logLevel : LogLevel . Warning , reconnectionOptions : { maxRetries : 5 , retryIntervalMilliseconds : 3000 , dialogId : 'components-reconnect-modal' , } , } ;