Skip to content

ts: Add strong type support for addEventListener#2627

Merged
acheroncrypto merged 3 commits into
otter-sec:masterfrom
acheroncrypto:ts-add-event-type-support
Sep 12, 2023
Merged

ts: Add strong type support for addEventListener#2627
acheroncrypto merged 3 commits into
otter-sec:masterfrom
acheroncrypto:ts-add-event-type-support

Conversation

@acheroncrypto

Copy link
Copy Markdown
Collaborator

Problem

Program.addEventListener method is not strongly typed.

https://github.com/coral-xyz/anchor/blob/cec9946111a1c651fd21235c2a554eda05c3ffa3/ts/packages/anchor/src/program/index.ts#L360-L363

eventName is a string, and event is any.

Summary of Changes

  • Add strong type support for addEventListener method. Both eventName and event is now strongly typed.
  • Convert and refactor the event tests from JavaScript to TypeScript to test types properly.

@vercel

vercel Bot commented Sep 12, 2023

Copy link
Copy Markdown

@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto merged commit fdda604 into otter-sec:master Sep 12, 2023
Otter-0x4ka5h pushed a commit to Otter-0x4ka5h/anchor that referenced this pull request Mar 25, 2026
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.

1 participant