Fix mangopay2-nodejs-sdk types

This commit is contained in:
Kévin Baumeyer
2019-01-23 13:54:41 +01:00
parent 600f91ec2b
commit 0933aba41c
2 changed files with 4 additions and 4 deletions

View File

@@ -266,7 +266,7 @@ declare namespace MangoPay {
// Determines the shape of the response
interface ReadResponseHeaders {
readResponseHeaders: true;
resolveWithFullResponse: true;
}
interface PaginationOptions {
@@ -306,11 +306,11 @@ declare namespace MangoPay {
}
interface MethodOptionWithResponse extends MethodOptions {
readResponseHeaders: true;
resolveWithFullResponse: true;
}
interface MethodOptionWithoutResponse extends MethodOptions {
readResponseHeaders?: false;
resolveWithFullResponse?: false;
}
interface DependsObject {

View File

@@ -54,7 +54,7 @@ api.Users.create(legalUser).then(data => {
console.log(`${legalUser.Name} user created at ${legalUser.CreationDate}`);
});
api.Users.create(legalUser, { readResponseHeaders: true }).then(data => {
api.Users.create(legalUser, { resolveWithFullResponse: true }).then(data => {
const d = data; // $ExpectType WithResponse<UserLegalData>
const value = data.body; // $ExpectType UserLegalData
});