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

TypeScript type definitions seem to be lacking the prompt classes #448

Open
rrthomas opened this issue Dec 19, 2023 · 2 comments
Open

TypeScript type definitions seem to be lacking the prompt classes #448

rrthomas opened this issue Dec 19, 2023 · 2 comments

Comments

@rrthomas
Copy link

I feel I must be missing something very obvious here, so apologies if I've overlooked something.

When in TypeScript I say:

import {Input} from 'enquirer'

VSCode tells me

Module '"enquirer"' has no exported member 'Input'

and when I look at the type definitions in index.d.ts it seems to be correct: I can't find exports for the prompt classes.

Thanks for enquirer, it looks amazing!

@Fannon
Copy link

Fannon commented May 5, 2024

I ran into the same issue. It looks like some of the PR's would already propose to add those missing types, e.g. I'm missing that one in particular: #219

That makes using it with TypeScript a bit difficult, but otherwise this library looks really nice!

@Fannon
Copy link

Fannon commented May 8, 2024

Btw. I could work around the missing TypeScript interfaces, by selecting the type like this:

await prompt<{value: string}>({
    type: 'autocomplete',
    name: 'value',
    message: 'Which u-he synth to generate presets for?',
    choices: Object.keys(locations)
  })

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