mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-01 01:59:55 +00:00
Use enum types in API. Fixes #51
This commit is contained in:
parent
7203e3dce6
commit
a8f4298f06
5 changed files with 17 additions and 50 deletions
|
@ -1,3 +1,4 @@
|
|||
import { ListingType, SortType } from "../others";
|
||||
import { CommentReportView, CommentView } from "../views";
|
||||
|
||||
export interface CreateComment {
|
||||
|
@ -77,14 +78,8 @@ export interface CreateCommentLike {
|
|||
* To get posts for a federated community by name, use `name@instance.tld` .
|
||||
*/
|
||||
export interface GetComments {
|
||||
/**
|
||||
* The [[ListingType]].
|
||||
*/
|
||||
type_?: string;
|
||||
/**
|
||||
* The [[SortType]].
|
||||
*/
|
||||
sort?: string;
|
||||
type_?: ListingType;
|
||||
sort?: SortType;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
community_id?: number;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { ListingType, SortType } from "../others";
|
||||
import { Site } from "../source";
|
||||
import {
|
||||
CommunityModeratorView,
|
||||
|
@ -39,15 +40,8 @@ export interface CommunityResponse {
|
|||
}
|
||||
|
||||
export interface ListCommunities {
|
||||
/**
|
||||
* The [[ListingType]].
|
||||
*/
|
||||
type_?: string;
|
||||
|
||||
/**
|
||||
* The [[SortType]].
|
||||
*/
|
||||
sort?: string;
|
||||
type_?: ListingType;
|
||||
sort?: SortType;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
auth?: string;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { SortType } from "../others";
|
||||
import {
|
||||
CommentView,
|
||||
CommunityModeratorView,
|
||||
|
@ -127,7 +128,7 @@ export interface GetPersonDetails {
|
|||
* To get details for a federated user, use `person@instance.tld`.
|
||||
*/
|
||||
username?: string;
|
||||
sort?: string;
|
||||
sort?: SortType;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
community_id?: number;
|
||||
|
@ -186,10 +187,7 @@ export interface BanPersonResponse {
|
|||
}
|
||||
|
||||
export interface GetReplies {
|
||||
/**
|
||||
* The [[SortType]].
|
||||
*/
|
||||
sort?: string;
|
||||
sort?: SortType;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
unread_only?: boolean;
|
||||
|
@ -197,10 +195,7 @@ export interface GetReplies {
|
|||
}
|
||||
|
||||
export interface GetPersonMentions {
|
||||
/**
|
||||
* The [[SortType]].
|
||||
*/
|
||||
sort?: string;
|
||||
sort?: SortType;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
unread_only?: boolean;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { SiteMetadata } from "..";
|
||||
import { ListingType, SiteMetadata, SortType } from "../others";
|
||||
import {
|
||||
CommentView,
|
||||
CommunityModeratorView,
|
||||
|
@ -35,16 +35,8 @@ export interface GetPostResponse {
|
|||
}
|
||||
|
||||
export interface GetPosts {
|
||||
/**
|
||||
* The [[ListingType]].
|
||||
*
|
||||
* Post listing types are `All, Subscribed, Community`
|
||||
*/
|
||||
type_?: string;
|
||||
/**
|
||||
* The [[SortType]].
|
||||
*/
|
||||
sort?: string;
|
||||
type_?: ListingType;
|
||||
sort?: SortType;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
community_id?: number;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { ListingType, SearchType, SortType } from "../others";
|
||||
import {
|
||||
CommentView,
|
||||
CommunityBlockView,
|
||||
|
@ -30,22 +31,12 @@ export interface Search {
|
|||
* The search query string.
|
||||
*/
|
||||
q: string;
|
||||
|
||||
/**
|
||||
* The [[SearchType]].
|
||||
*/
|
||||
type_?: string;
|
||||
type_?: SearchType;
|
||||
community_id?: number;
|
||||
community_name?: string;
|
||||
creator_id?: number;
|
||||
/**
|
||||
* The [[SortType]].
|
||||
*/
|
||||
sort?: string;
|
||||
/**
|
||||
* The [[ListingType]].
|
||||
*/
|
||||
listing_type?: string;
|
||||
sort?: SortType;
|
||||
listing_type?: ListingType;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
auth?: string;
|
||||
|
|
Loading…
Reference in a new issue