Skip to content

Add TypeScript type definitions - #2

Merged
mcmire merged 1 commit into
mainfrom
add-type-definitions
Jul 9, 2023
Merged

mcmire merged 1 commit into
mainfrom
add-type-definitions

Conversation

@mcmire

@mcmire mcmire commented Jul 5, 2023 •

Copy link
Copy Markdown

TypeScript will refuse to build a project that relies on eth-query, as it lacks type definitions. We have previously gotten around this in the extension and in core by supplying those type definitions directly in the project itself, but this is causing issues especially for the Snaps team, who now wish to use @metamask/controller-utils, which names eth-query as a dependency.

This commit copies the type definitions from the core monorepo into this repo. They were previously copied from the extension, so they have been battle-tested pretty well now.

Fixes #1.
Fixes MetaMask/core#1471.

TypeScript will refuse to build a project that relies on `eth-query`,
as it lacks type definitions. We have previously gotten around this in
the extension and in `core` by supplying those type definitions directly
in the project itself, but this is causing issues especially for the
Snaps team, who now wish to use `@metamask/controller-utils`, which
names `eth-query` as a dependency.

This commit copies the type definitions from the `core` monorepo into
this repo. They were previously copied from the extension, so they have
been battle-tested pretty well now.

@Gudahtt Gudahtt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

It'd be nice to convert the whole thing to TypeScript, so that we get proper type definitions for all methods rather than just sendAsync. But this is a good start.

@mcmire
mcmire merged commit 6db71ff into main Jul 9, 2023
@mcmire
mcmire deleted the add-type-definitions branch July 9, 2023 21:15
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.

Publish new version of eth-query with type definitions from this repo Add TypeScript type definitions

2 participants