-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
search-repository.ts
35 lines (31 loc) 路 1.12 KB
/
search-repository.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { type HttpMetaParams } from "../../../interfaces";
import { type Search } from "../../entities/v1";
import { type Paginator } from "../../paginator";
import { type DefaultPaginationParams } from "../../repository";
export type SearchType = "accounts" | "hashtags" | "statuses";
export interface SearchParams extends DefaultPaginationParams {
/** Attempt WebFinger lookup. Defaults to false. */
readonly q: string;
/** Enum(accounts, hashtags, statuses) */
readonly type?: SearchType | null;
/** Attempt WebFinger look-up */
readonly resolve?: boolean | null;
/** If provided, statuses returned will be authored only by this account */
readonly accountId?: string | null;
}
export interface SearchRepository {
/**
* @deprecated Use `list` instead
*/
fetch(params: SearchParams, meta?: HttpMetaParams): Search;
/**
* Search, but hashtags is an array of strings instead of an array of Tag.
* @param params Parameters
* @return Results
* @see https://docs.joinmastodon.org/methods/search/
*/
list(
params: SearchParams,
meta?: HttpMetaParams,
): Paginator<Search, SearchParams>;
}