import { getCurrentHub } from '@sentry/hub' ; import { Client , Options } from '@sentry/types' ; import { logger } from '@sentry/utils' ; /** A class object that can instantiate Client objects. */ export type ClientClass < F extends Client , O extends Options > = new ( options ) => F ; param clientClass param options export function initAndBind < F extends Client , O extends Options > ( clientClass , options ) { if ( options . debug === true ) { logger . enable ( ) ; } const hub = getCurrentHub ( ) ; const scope = hub . getScope ( ) ; if ( scope ) { scope . update ( options . initialScope ) ; } const client = new clientClass ( options ) ; hub . bindClient ( client ) ; }