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

refactor: support for generic types in interfaces and methods #1981

Merged
merged 1 commit into from
May 28, 2020
Merged

refactor: support for generic types in interfaces and methods #1981

merged 1 commit into from
May 28, 2020

Conversation

rafaelss95
Copy link
Contributor

This PR basically allow us to grab a typed value in SweetAlertResult.


Btw when I was working on this I noticed there are some fixes to be made in this file which may cause breaking changes, like function getContent(): HTMLElement where it should be function getContent(): HTMLElement | null as it could potentially return null (in fact, all classes that consumes elementBySelector could).

export const elementBySelector = (selectorString) => {
const container = getContainer()
return container ? container.querySelector(selectorString) : null
}

What's the policy for breaking changes in this declaration file, @limonte? Once you point me to the right direction I could go ahead and made the necessary changes :)

Copy link
Member

@limonte limonte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @rafaelss95!

@limonte limonte merged commit 146309c into sweetalert2:master May 28, 2020
@limonte
Copy link
Member

limonte commented May 28, 2020

Btw when I was working on this I noticed there are some fixes to be made in this file which may cause breaking changes, like function getContent(): HTMLElement where it should be function getContent(): HTMLElement | null as it could potentially return null (in fact, all classes that consumes elementBySelector could).

What's the policy for breaking changes in this declaration file, @limonte? Once you point me to the right direction I could go ahead and made the necessary changes :)

Thank you for noticing that! Please go ahead with the PR and I'll release that as the patch version, because the change isn't breaking in terms of documented API.

limonte pushed a commit that referenced this pull request May 28, 2020
## [9.13.2](v9.13.1...v9.13.2) (2020-05-28)

### Bug Fixes

* **types:** support for generic types in interfaces and methods ([#1981](#1981)) ([146309c](146309c))
@limonte
Copy link
Member

limonte commented May 28, 2020

🎉 This PR is included in version 9.13.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rafaelss95 rafaelss95 deleted the refactor/generc-sweet-alert-result branch May 28, 2020 16:08
matvejs16 pushed a commit to matvejs16/sweetalert2-fix that referenced this pull request Mar 29, 2023
matvejs16 pushed a commit to matvejs16/sweetalert2-fix that referenced this pull request Mar 29, 2023
## [9.13.2](sweetalert2/sweetalert2@v9.13.1...v9.13.2) (2020-05-28)

### Bug Fixes

* **types:** support for generic types in interfaces and methods ([sweetalert2#1981](sweetalert2#1981)) ([370f8c4](sweetalert2@370f8c4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants