From 7e92f33d4f2f9f189f78d8d4da3b6c4ab0974dbd Mon Sep 17 00:00:00 2001 From: Carol Abadeer <60774943+carolabadeer@users.noreply.github.com> Date: Thu, 9 Mar 2023 13:50:36 -0800 Subject: [PATCH] Updated type declaration of captureAWSv3Client to fix TS errors (#575) --- packages/core/lib/patchers/aws3_p.d.ts | 3 +-- packages/core/lib/patchers/aws3_p.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/core/lib/patchers/aws3_p.d.ts b/packages/core/lib/patchers/aws3_p.d.ts index 6a5d5b94..fe9f1817 100644 --- a/packages/core/lib/patchers/aws3_p.d.ts +++ b/packages/core/lib/patchers/aws3_p.d.ts @@ -1,4 +1,3 @@ -import { Client } from '@aws-sdk/types'; import { SegmentLike } from '../aws-xray'; /** * Instruments AWS SDK V3 clients with X-Ray via middleware. @@ -7,4 +6,4 @@ import { SegmentLike } from '../aws-xray'; * @param manualSegment - Parent segment or subsegment that is passed in for manual mode users * @returns - the client with the X-Ray instrumentation middleware added to its middleware stack */ -export declare function captureAWSClient>(client: T, manualSegment?: SegmentLike): T +export declare function captureAWSClient(client: T, manualSegment?: SegmentLike): T diff --git a/packages/core/lib/patchers/aws3_p.ts b/packages/core/lib/patchers/aws3_p.ts index 98ef33fa..5ca868dc 100644 --- a/packages/core/lib/patchers/aws3_p.ts +++ b/packages/core/lib/patchers/aws3_p.ts @@ -1,6 +1,5 @@ import { Pluggable, - Client, BuildMiddleware, MiddlewareStack, BuildHandlerOptions, @@ -189,7 +188,7 @@ const getXRayPlugin = (config: RegionResolvedConfig, manualSegment?: SegmentLike * @param manualSegment - Parent segment or subsegment that is passed in for manual mode users * @returns - the client with the X-Ray instrumentation middleware added to its middleware stack */ -export function captureAWSClient>(client: T, manualSegment?: SegmentLike): T { +export function captureAWSClient(client: T, manualSegment?: SegmentLike): T { // Remove existing middleware to ensure operation is idempotent client.middlewareStack.remove(XRAY_PLUGIN_NAME); client.middlewareStack.use(getXRayPlugin(client.config, manualSegment));