Skip to content

Commit

Permalink
Fix TS declaration of TraceId to match definition (#520)
Browse files Browse the repository at this point in the history
* Fix TS declaration of TraceId to match definition

* fix lint error
  • Loading branch information
carolabadeer authored Jul 22, 2022
1 parent 915da6a commit bf0f26e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/lib/segments/attributes/trace_id.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ declare class TraceID {
timestamp: string;
id: string;

constructor();
constructor(tsHex?: string, numberhex?: string);

static Invalid(): TraceID;

Expand Down
2 changes: 2 additions & 0 deletions packages/core/test-d/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ expectType<void>(AWSXRay.setDaemonAddress('192.168.0.23:8080'));

const traceId = '1-57fbe041-2c7ad569f5d6ff149137be86';
const traceId2 = new TraceID();
const traceId3 = new TraceID('0', '0');
const segment = new AWSXRay.Segment('test', traceId);

expectType<TraceID>(TraceID.FromString(traceId));
expectType<TraceID>(TraceID.Invalid());
expectType<string>(traceId2.toString());
expectType<string>(traceId3.toString());

expectType<string>(AWSXRay.captureFunc('tracedFcn', () => 'OK', segment));
expectType<void>(AWSXRay.captureFunc('tracedFcn', () => {
Expand Down

0 comments on commit bf0f26e

Please sign in to comment.