Skip to content

chore: fix contract type#59

Merged
legobeat merged 1 commit intoMetaMask:mainfrom
legobeat:type-fixes
Feb 7, 2024
Merged

chore: fix contract type#59
legobeat merged 1 commit intoMetaMask:mainfrom
legobeat:type-fixes

Conversation

@legobeat
Copy link
Copy Markdown
Contributor

@legobeat legobeat commented Feb 2, 2024

  • fix: entries function is actually a Promise
  • remove type duplication

- fix: entries function is actually a Promise
- remove type duplication
Comment thread types/ethjs/index.d.ts
@@ -1,14 +1,18 @@
declare module '@metamask/ethjs-types' {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note that usually type augmentations aren't a good idea because they will only be present locally and will not be included in the type declaration files, so they could cause type errors in another project that uses this package. This seems to be okay for right now because registry is private, so DeployedRegistryContract gets erased from the built type declaration files, but something to keep in mind in case this does cause problems later.

Copy link
Copy Markdown
Contributor Author

@legobeat legobeat Feb 6, 2024

Choose a reason for hiding this comment

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

I don't see how it would cause type-errors? But in any case yes, this "synthetic module" is for internal use only. If reuse elsewhere becomes relevant I guess it also becomes relevant to consider exposing these (for example generated from jsdoc comments) from ethjs-contract and ethjs-query packages themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants