Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PaymentRequest .show method param optional #44560

Closed
dhaigh opened this issue Jun 12, 2021 · 2 comments
Closed

Make PaymentRequest .show method param optional #44560

dhaigh opened this issue Jun 12, 2021 · 2 comments
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this
Milestone

Comments

@dhaigh
Copy link

dhaigh commented Jun 12, 2021

Bug Report

#44423 added types for the promise param on the .show() method on PaymentRequest. The spec states that this parameter is optional

#44559

🔎 Search Terms

show method PaymentRequest

🕗 Version & Regression Information

not present in 4.2.3, present in 4.3.2

⏯ Playground Link

Playground link with relevant code

💻 Code

the type definition just needs to be tweaked slightly

// current
    show(detailsPromise: PaymentDetailsUpdate | Promise<PaymentDetailsUpdate>): Promise<PaymentResponse>;

// should be
    show(detailsPromise?: PaymentDetailsUpdate | Promise<PaymentDetailsUpdate>): Promise<PaymentResponse>;

🙁 Actual behavior

await request.show(); // error: An argument for 'detailsPromise' was not provided

🙂 Expected behavior

await request.show(); // no error
@mayeedwin
Copy link

mayeedwin commented Jul 3, 2021

Getting the same error. Looked at TypeScript-DOM-lib-generator and seems like the bug is fixed. Maybe not published yet. But for now, you can manually edit on your dev environment to keep going as you await for the release.

cc @thunder-coding

@jakebailey
Copy link
Member

This was fixed back in #44684.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this
Projects
None yet
4 participants