alexa / amazon-pay-alexa-utils-for-nodejs

Apache License 2.0
6 stars 8 forks source link

An accessor cannot be declared in an ambient context. #1

Open AdonousTech opened 4 years ago

AdonousTech commented 4 years ago

I am using @amazonpay/amazon-pay-alexa-utils in an Alexa skill built with TypeScript and receiving the error above for several d.ts files, when attempting to compile.

node_modules/@amazonpay/amazon-pay-alexa-utils/lib/checkout/AbstractDirectiveBuilder.d.ts:8:18 - error TS1086: An accessor cannot be declared in an ambient context.

8     abstract get Token(): string;
                   ~~~~~

node_modules/@amazonpay/amazon-pay-alexa-utils/lib/checkout/AbstractDirectiveBuilder.d.ts:9:18 - error TS1086: An accessor cannot be declared in an ambient context.     

9     abstract get Payload(): V;
                   ~~~~~~~

node_modules/@amazonpay/amazon-pay-alexa-utils/lib/checkout/AbstractDirectiveBuilder.d.ts:10:18 - error TS1086: An accessor cannot be declared in an ambient context.    

10     abstract get PayloadBuilder(): T;
                    ~~~~~~~~~~~~~~

node_modules/@amazonpay/amazon-pay-alexa-utils/lib/checkout/charge/ChargeDirectiveBuilder.d.ts:9:9 - error TS1086: An accessor cannot be declared in an ambient context. 

9     get Token(): string;
          ~~~~~

node_modules/@amazonpay/amazon-pay-alexa-utils/lib/checkout/charge/ChargeDirectiveBuilder.d.ts:10:9 - error TS1086: An accessor cannot be declared in an ambient context.

10     get Payload(): ChargeAmazonPayRequest;
           ~~~~~~~

node_modules/@amazonpay/amazon-pay-alexa-utils/lib/checkout/charge/ChargeDirectiveBuilder.d.ts:11:9 - error TS1086: An accessor cannot be declared in an ambient context.

11     get PayloadBuilder(): ChargePayloadBuilder;
           ~~~~~~~~~~~~~~

node_modules/@amazonpay/amazon-pay-alexa-utils/lib/checkout/setup/SetupDirectiveBuilder.d.ts:9:9 - error TS1086: An accessor cannot be declared in an ambient context.

9     get Token(): string;
          ~~~~~

node_modules/@amazonpay/amazon-pay-alexa-utils/lib/checkout/setup/SetupDirectiveBuilder.d.ts:10:9 - error TS1086: An accessor cannot be declared in an ambient context.

10     get Payload(): SetupAmazonPayRequest;
           ~~~~~~~

node_modules/@amazonpay/amazon-pay-alexa-utils/lib/checkout/setup/SetupDirectiveBuilder.d.ts:11:9 - error TS1086: An accessor cannot be declared in an ambient context.

11     get PayloadBuilder(): SetupPayloadBuilder;
           ~~~~~~~~~~~~~~

node_modules/@amazonpay/amazon-pay-alexa-utils/lib/model/SandboxSetting.d.ts:4:9 - error TS1086: An accessor cannot be declared in an ambient context.

4     get eMail(): string;

Adding the following to the tsconfig.json allows the compilation to succeed (see https://stackoverflow.com/questions/60092642/ts1086-an-accessor-cannot-be-declared-in-ambient-context):

"compilerOptions": {
    "skipLibCheck": true
}

I can use the flag for now, but it would be great to have this issue resolved. Please let me know if more info is required.

danielneu commented 4 years ago

Hi @AdonousTech,

thanks for flagging this and please excuse the delay in coming back to you. Can you confirm the version of TypeScript you are using?

AdonousTech commented 3 years ago

Apologies for the delay @danielneu

"typescript": "^3.5.2"