mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-01 10:09:55 +00:00
Adding some comments.
This commit is contained in:
parent
c4e66821c6
commit
9bd5dab517
7 changed files with 491 additions and 482 deletions
|
@ -103,6 +103,11 @@ export class LemmyHttp {
|
||||||
private baseUrl: string;
|
private baseUrl: string;
|
||||||
private headers: { [key: string]: string } = {};
|
private headers: { [key: string]: string } = {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates a new instance of LemmyHttp
|
||||||
|
* @param baseUrl the full base url: https://lemmy.ml/api/v2
|
||||||
|
* @param headers optional headers. Should contain x-real-ip and x-forwarded-for
|
||||||
|
*/
|
||||||
constructor(baseUrl: string, headers?: { [key: string]: string }) {
|
constructor(baseUrl: string, headers?: { [key: string]: string }) {
|
||||||
this.baseUrl = baseUrl;
|
this.baseUrl = baseUrl;
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ export interface ResolveCommentReportResponse {
|
||||||
export interface ListCommentReports {
|
export interface ListCommentReports {
|
||||||
page?: number;
|
page?: number;
|
||||||
limit?: number;
|
limit?: number;
|
||||||
/// if no community is given, it returns reports for all communities moderated by the auth user
|
// if no community is given, it returns reports for all communities moderated by the auth user
|
||||||
community?: number;
|
community?: number;
|
||||||
auth: string;
|
auth: string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,7 @@ export interface SiteResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GetSiteResponse {
|
export interface GetSiteResponse {
|
||||||
site_view?: SiteView; // Because the site might not be set up y,
|
site_view?: SiteView; // Because the site might not be set up yet
|
||||||
admins: UserViewSafe[];
|
admins: UserViewSafe[];
|
||||||
banned: UserViewSafe[];
|
banned: UserViewSafe[];
|
||||||
online: number;
|
online: number;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
/**
|
||||||
|
* All of the websocket operations available
|
||||||
|
*/
|
||||||
export enum UserOperation {
|
export enum UserOperation {
|
||||||
Login,
|
Login,
|
||||||
Register,
|
Register,
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import { ListingType, SortType } from './others';
|
|
||||||
|
|
||||||
export interface UserSafe {
|
export interface UserSafe {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
@ -66,6 +66,9 @@ import {
|
||||||
import { UserJoin, PostJoin, CommunityJoin } from './interfaces/api/websocket';
|
import { UserJoin, PostJoin, CommunityJoin } from './interfaces/api/websocket';
|
||||||
import { UserOperation } from './interfaces/others';
|
import { UserOperation } from './interfaces/others';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helps build lemmy websocket message requests, that you can use in your Websocket sends
|
||||||
|
*/
|
||||||
export class LemmyWebsocket {
|
export class LemmyWebsocket {
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue