Merge pull request #55 from LemmyNet/use_enum_types

Use enum types
This commit is contained in:
Nutomic 2022-05-16 11:51:56 +00:00 committed by GitHub
commit dd615bf484
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 51 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "lemmy-js-client", "name": "lemmy-js-client",
"description": "A javascript / typescript client for Lemmy", "description": "A javascript / typescript client for Lemmy",
"version": "0.16.4-rc.2", "version": "0.17.0-rc.9",
"author": "Dessalines <tyhou13@gmx.com>", "author": "Dessalines <tyhou13@gmx.com>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "./dist/index.js", "main": "./dist/index.js",

View file

@ -1,3 +1,4 @@
import { ListingType, SortType } from "../others";
import { CommentReportView, CommentView } from "../views"; import { CommentReportView, CommentView } from "../views";
export interface CreateComment { export interface CreateComment {
@ -77,14 +78,8 @@ export interface CreateCommentLike {
* To get posts for a federated community by name, use `name@instance.tld` . * To get posts for a federated community by name, use `name@instance.tld` .
*/ */
export interface GetComments { export interface GetComments {
/** type_?: ListingType;
* The [[ListingType]]. sort?: SortType;
*/
type_?: string;
/**
* The [[SortType]].
*/
sort?: string;
page?: number; page?: number;
limit?: number; limit?: number;
community_id?: number; community_id?: number;

View file

@ -1,3 +1,4 @@
import { ListingType, SortType } from "../others";
import { Site } from "../source"; import { Site } from "../source";
import { import {
CommunityModeratorView, CommunityModeratorView,
@ -39,15 +40,8 @@ export interface CommunityResponse {
} }
export interface ListCommunities { export interface ListCommunities {
/** type_?: ListingType;
* The [[ListingType]]. sort?: SortType;
*/
type_?: string;
/**
* The [[SortType]].
*/
sort?: string;
page?: number; page?: number;
limit?: number; limit?: number;
auth?: string; auth?: string;

View file

@ -1,3 +1,4 @@
import { SortType } from "../others";
import { import {
CommentView, CommentView,
CommunityModeratorView, CommunityModeratorView,
@ -127,7 +128,7 @@ export interface GetPersonDetails {
* To get details for a federated user, use `person@instance.tld`. * To get details for a federated user, use `person@instance.tld`.
*/ */
username?: string; username?: string;
sort?: string; sort?: SortType;
page?: number; page?: number;
limit?: number; limit?: number;
community_id?: number; community_id?: number;
@ -186,10 +187,7 @@ export interface BanPersonResponse {
} }
export interface GetReplies { export interface GetReplies {
/** sort?: SortType;
* The [[SortType]].
*/
sort?: string;
page?: number; page?: number;
limit?: number; limit?: number;
unread_only?: boolean; unread_only?: boolean;
@ -197,10 +195,7 @@ export interface GetReplies {
} }
export interface GetPersonMentions { export interface GetPersonMentions {
/** sort?: SortType;
* The [[SortType]].
*/
sort?: string;
page?: number; page?: number;
limit?: number; limit?: number;
unread_only?: boolean; unread_only?: boolean;

View file

@ -1,4 +1,4 @@
import { SiteMetadata } from ".."; import { ListingType, SiteMetadata, SortType } from "../others";
import { import {
CommentView, CommentView,
CommunityModeratorView, CommunityModeratorView,
@ -35,16 +35,8 @@ export interface GetPostResponse {
} }
export interface GetPosts { export interface GetPosts {
/** type_?: ListingType;
* The [[ListingType]]. sort?: SortType;
*
* Post listing types are `All, Subscribed, Community`
*/
type_?: string;
/**
* The [[SortType]].
*/
sort?: string;
page?: number; page?: number;
limit?: number; limit?: number;
community_id?: number; community_id?: number;

View file

@ -1,3 +1,4 @@
import { ListingType, SearchType, SortType } from "../others";
import { import {
CommentView, CommentView,
CommunityBlockView, CommunityBlockView,
@ -30,22 +31,12 @@ export interface Search {
* The search query string. * The search query string.
*/ */
q: string; q: string;
type_?: SearchType;
/**
* The [[SearchType]].
*/
type_?: string;
community_id?: number; community_id?: number;
community_name?: string; community_name?: string;
creator_id?: number; creator_id?: number;
/** sort?: SortType;
* The [[SortType]]. listing_type?: ListingType;
*/
sort?: string;
/**
* The [[ListingType]].
*/
listing_type?: string;
page?: number; page?: number;
limit?: number; limit?: number;
auth?: string; auth?: string;