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 types for parser services #357

Open
marekdedic opened this issue Jun 19, 2023 · 2 comments
Open

Add types for parser services #357

marekdedic opened this issue Jun 19, 2023 · 2 comments

Comments

@marekdedic
Copy link
Contributor

The parser services are currently typed as Record<string, any> - see

services?: Record<string, any>;

Would it be possible to add stricter types for them?

@ota-meshi
Copy link
Member

ota-meshi commented Jun 19, 2023

Thank you for posting this issue.
Hmm. However we also use another parser within this parser.
We don't know what that parser provides through services. And export it as it is.

resultScript.services = Object.assign(resultScript.services || {}, {

So the current type is correct.
I think it might be nice if only the services that this parser explicitly provides can be correctly typed, and any otherwise.

@marekdedic
Copy link
Contributor Author

Hmm, could we do something like services: typeof existingServices & {ourService: (string) => number}?

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

No branches or pull requests

2 participants