Skip to content

Commit

Permalink
fix: Remove Array constraint from IRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
neet committed Dec 23, 2022
1 parent 68e8ff9 commit ced6608
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/api/v1/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export class Repository {
* @see https://docs.joinmastodon.org/methods/search/
*/
@version({ since: '1.1.0', until: '3.0.0' })
search(params: SearchParams): Paginator<SearchParams, Search> {
search(params: SearchParams): Paginator<Search, SearchParams> {
return new Paginator(this.http, `/api/v1/search`, params);
}
}
2 changes: 1 addition & 1 deletion src/api/v2/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class Repository {
* @see https://docs.joinmastodon.org/methods/search/
*/
@version({ since: '1.1.0', until: '3.0.0' })
search(params: SearchParams): Paginator<SearchParams, Search> {
search(params: SearchParams): Paginator<Search, SearchParams> {
return new Paginator(this.http, `/api/v1/search`, params);
}
}
2 changes: 1 addition & 1 deletion src/paginator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable unicorn/no-thenable */
import type { Http } from './http';

export class Paginator<Entity extends Array<unknown>, Params = never>
export class Paginator<Entity, Params = never>
implements AsyncIterableIterator<Entity>, PromiseLike<Entity>
{
private nextPath?: string;
Expand Down

0 comments on commit ced6608

Please sign in to comment.