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

Add TypeScript type definitions #85

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

HeyItsBATMAN
Copy link

This PR adds TypeScript type definitions, which:

  • Cover all public API methods and their parameters
  • Include detailed return types for all operations
  • Provide proper typing for configuration objects
  • Don't change any runtime behavior

Some complex value types are typed as any where the type depends on the property datatype.

I'm open to suggestions on how to further improve this.

Basic examples

Screenshot From 2024-11-05 14-35-28
Screenshot From 2024-11-05 14-35-09
Screenshot From 2024-11-05 14-34-35

@maxlath
Copy link
Owner

maxlath commented Nov 8, 2024

Nice work! I think some of those types or anys could be replaced with types imported from wikibase-sdk, in particular SnakDataValue, which already tries to cover all the datatypes. Do you want to give it a try?

@HeyItsBATMAN
Copy link
Author

That makes sense, I'll go and align it with wikibase-sdk then

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