We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi! I realise this is a fairly old project, but still. I decided to add a typescript definition file 🗡
declare module 'wallhaven-api' { type SearchCategory = 'general' | 'anime' | 'people' type SearchCategoryUC = 'General' | 'Anime' | 'People' type SearchSorting = 'relevance' | 'random' | 'date_added' | 'views' | 'favorites' type SearchOptions = { categories?: SearchCategory[] page?: number sorting?: SearchSorting nsfw?: boolean sketchy?: boolean } type Tag = { id: number text: string } type SearchResultItem = { id: number width: number height: number thumb: string } type SearchResult = { end: boolean totalPages: number images: SearchResultItem[] } type DetailResult = { fullImage: string tags: Tag[] category: SearchCategoryUC size: string views: number width: number height: number colors: string[] } export default class Wallhaven { search(keyword: string, options?: SearchOptions): Promise<SearchResult> details(id: number): Promise<DetailResult> } }
The text was updated successfully, but these errors were encountered:
Also, the package name is wallhaven-api not wallhaven like it shows in the README.md
wallhaven-api
wallhaven
Sorry, something went wrong.
No branches or pull requests
Hi! I realise this is a fairly old project, but still. I decided to add a typescript definition file 🗡
The text was updated successfully, but these errors were encountered: