11import { getMainCarrier , Hub } from '@sentry/hub' ;
22import {
3+ ClientOptions ,
34 CustomSamplingContext ,
45 Integration ,
56 IntegrationClass ,
6- Options ,
77 SamplingContext ,
88 TransactionContext ,
99} from '@sentry/types' ;
@@ -41,7 +41,7 @@ function traceHeaders(this: Hub): { [key: string]: string } {
4141 *
4242 * @returns The given transaction with its `sampled` value set
4343 */
44- function sample < T extends Transaction > ( transaction : T , options : Options , samplingContext : SamplingContext ) : T {
44+ function sample < T extends Transaction > ( transaction : T , options : ClientOptions , samplingContext : SamplingContext ) : T {
4545 // nothing to do if tracing is not enabled
4646 if ( ! hasTracingEnabled ( options ) ) {
4747 transaction . sampled = false ;
@@ -171,10 +171,10 @@ function _startTransaction(
171171 customSamplingContext ?: CustomSamplingContext ,
172172) : Transaction {
173173 const client = this . getClient ( ) ;
174- const options = ( client && client . getOptions ( ) ) || { } ;
174+ const options : Partial < ClientOptions > = ( client && client . getOptions ( ) ) || { } ;
175175
176176 let transaction = new Transaction ( transactionContext , this ) ;
177- transaction = sample ( transaction , options , {
177+ transaction = sample ( transaction , options as ClientOptions , {
178178 parentSampled : transactionContext . parentSampled ,
179179 transactionContext,
180180 ...customSamplingContext ,
@@ -196,10 +196,10 @@ export function startIdleTransaction(
196196 customSamplingContext ?: CustomSamplingContext ,
197197) : IdleTransaction {
198198 const client = hub . getClient ( ) ;
199- const options = ( client && client . getOptions ( ) ) || { } ;
199+ const options : Partial < ClientOptions > = ( client && client . getOptions ( ) ) || { } ;
200200
201201 let transaction = new IdleTransaction ( transactionContext , hub , idleTimeout , onScope ) ;
202- transaction = sample ( transaction , options , {
202+ transaction = sample ( transaction , options as ClientOptions , {
203203 parentSampled : transactionContext . parentSampled ,
204204 transactionContext,
205205 ...customSamplingContext ,
0 commit comments