-3

I am working on a small ionic2/Angular2 app, I have generated JS SDK from my AWS APIGateway and trying to import in my project. I need to access the apigClient in my app which is .js file in SDK, how do we import that into .ts (type script) logic ?

var apigClientFactory = {};
apigClientFactory.newClient = function (config) {
var apigClient = { };
if(config === undefined) {
    config = {
        accessKey: '',
        secretKey: '',
        sessionToken: '',
        region: '',
        apiKey: undefined,
        defaultContentType: 'application/json',
        defaultAcceptType: 'application/json'
    };
}
...

I need to create an instance of that apigClientFactory in my app to do the api calls.

Please kindly suggest or state any example references.

Thank you.

Jarvis
  • 163
  • 1
  • 13

1 Answers1

1

Here is an SO post on how to use JavaScript with TypeScript: How to use javascript in typescript

What you're attempting to do is possible with just the JavaScript SDK.

Here is a link to the docs: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html

bejos-aws
  • 79
  • 3