Aws-xray-sdk-node: Typescript Definitions

Created on 6 Jan 2018  路  12Comments  路  Source: aws/aws-xray-sdk-node

Hi,

Are there anywhere typescript definitions for this project?
If not, do you have any plans to provide typescript definitions in the future?

thanks,

Guy

enhancement

Most helpful comment

Lacking Typescript and Node 8+ support isn't great for a non-beta AWS product. This is where modern JS is heading.

All 12 comments

Hi, the SDK currently doesn't have typescript definitions available yet. We will looking into providing the definitions but we cannot guarantee such offering nor a timeline. Please stay tuned.

Lacking Typescript and Node 8+ support isn't great for a non-beta AWS product. This is where modern JS is heading.

I also would love to see typescript definitions soon as our company is dependent on aws and typescript.

Definitions are getting increasingly common among projects and since Typescript at least nowadays can also be used to lint pure js I think it's a very good suggestion.

However: Anyone can contribute type definitions for this package to the @DefinitelyTyped project: https://github.com/DefinitelyTyped/DefinitelyTyped#create-a-new-package

This would be very nice to have, as it's very frustrating how the AWSXRay.captureAWS(...) call obscures the valuable .d.ts declarations provided by the AWS sdk.

As a workaround, generics can help. Creating a aws-xray-sdk.d.ts types file with something like the following will satisfy the compiler without obscuring AWS sdk declarations:

declare module "aws-xray-sdk" {
  export function captureAWSClient<T>(client: T): T;
  ...
}

Definitions are getting increasingly common among projects and since Typescript at least nowadays can also be used to lint pure js I think it's a very good suggestion.

However: Anyone can contribute type definitions for this package to the @DefinitelyTyped project: https://github.com/DefinitelyTyped/DefinitelyTyped#create-a-new-package

Somebody created a basic definition here:
https://github.com/mziyabo-aws/aws-xray-typings

Not perfect though...

I would really like to see this done as well.

Where are the type definitions?

Hi everyone, I've just opened #207 馃檪

TypeScript definitions have been released in v2.5.0!

I think it's correct for it to be a dependency, because the Namespace type is imported from that package and exported as the return type of the public getNamespace() function -- that said, since #227 was merged this should probably be updated to use @types/cls-hooked -- I can open a PR for that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thomasmichaelwallace picture thomasmichaelwallace  路  5Comments

ivanmartos picture ivanmartos  路  6Comments

hariharasudhan-nineleaps picture hariharasudhan-nineleaps  路  4Comments

JeremieDoctrine picture JeremieDoctrine  路  7Comments

bryanjcof picture bryanjcof  路  4Comments