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

Type definitions for TypeScript #10

Closed
1 of 2 tasks
Maxim-Mazurok opened this issue Jun 24, 2022 · 2 comments
Closed
1 of 2 tasks

Type definitions for TypeScript #10

Maxim-Mazurok opened this issue Jun 24, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@Maxim-Mazurok
Copy link
Contributor

Maxim-Mazurok commented Jun 24, 2022

Guidelines

  • Please search other issues to make sure this feature has not already been requested.

Which problem is this feature request solving?

I need to use this with typescript, and it doesn't have type definitions

Describe the solution you'd like

This is what works for me:

declare module "all-node-versions" {
  function DefaultFunction(options?: {
    mirror?: string;
    fetch?: boolean;
  }): Promise<{
    versions: string[];
    majors: { major: number; latest: string; lts?: string }[];
  }>;
  export = DefaultFunction;
}

in typings\all-node-versions\index.d.ts
with "typeRoots": ["./node_modules/@types", "./typings"], in tsconfig.json

Pull request (optional)

  • I can submit a pull request.
@ehmicky
Copy link
Owner

ehmicky commented Jun 24, 2022

Great idea, thanks for suggesting.
I just added them in 10.1.0.

@ehmicky ehmicky closed this as completed Jun 24, 2022
@Maxim-Mazurok
Copy link
Contributor Author

Thanks, can confirm that it works :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants