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

Options for Autosuggest Support #253

Closed
maou-shonen opened this issue Oct 29, 2024 · 2 comments
Closed

Options for Autosuggest Support #253

maou-shonen opened this issue Oct 29, 2024 · 2 comments
Labels

Comments

@maou-shonen
Copy link

Hi! I really like the API of Wretch,
but I encountered issue #251 right when I started using it.

It would be fantastic to have autosuggest support.
Being loosely typed shouldn’t prevent the addition of autosuggestions,
here’s a possible example.

type Options = Omit<
  RequestInit,
  "SomeWretchExcludedOptions1" | "SomeWretchExcludedOptions2"
> & {
  SomeWretchOnlyOption1: string
  SomeWretchOnlyOption2: number
  [otherKey: string]: any
}
@elbywan
Copy link
Owner

elbywan commented Oct 29, 2024

Hey @maou-shonen,

Being loosely typed shouldn’t prevent the addition of autosuggestions

No you're right, but to be honest the loose typing is not the only reason why I typed the options this way.
It also caused some issues in the past with conflicting types: #83

But I believe time has passed since then and I can try to reintroduce some form of type narrowing 👍 .

elbywan added a commit that referenced this issue Oct 29, 2024
elbywan added a commit that referenced this issue Oct 29, 2024
elbywan added a commit that referenced this issue Oct 29, 2024
elbywan added a commit that referenced this issue Oct 29, 2024
@elbywan
Copy link
Owner

elbywan commented Oct 29, 2024

:shipit: Released in v2.11.0

@elbywan elbywan closed this as completed Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants