lemmy-js-client 0.17.0-rc.2 → 0.17.0-rc.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,27 @@
1
+ import { Option } from "@sniptt/monads";
2
+ import "reflect-metadata";
3
+ import { ListingType, SearchType, SortType } from "../others";
1
4
  import { CommentView, CommunityBlockView, CommunityFollowerView, CommunityModeratorView, CommunityView, LocalUserSettingsView, ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView, ModRemovePostView, ModStickyPostView, ModTransferCommunityView, PersonBlockView, PersonViewSafe, PostView, RegistrationApplicationView, SiteView } from "../views";
2
5
  /**
3
6
  * Search lemmy for different types of data.
4
7
  */
5
- export interface Search {
8
+ export declare class Search {
6
9
  /**
7
10
  * The search query string.
8
11
  */
9
12
  q: string;
10
- /**
11
- * The [[SearchType]].
12
- */
13
- type_?: string;
14
- community_id?: number;
15
- community_name?: string;
16
- creator_id?: number;
17
- /**
18
- * The [[SortType]].
19
- */
20
- sort?: string;
21
- /**
22
- * The [[ListingType]].
23
- */
24
- listing_type?: string;
25
- page?: number;
26
- limit?: number;
27
- auth?: string;
28
- }
29
- export interface SearchResponse {
13
+ type_: Option<SearchType>;
14
+ community_id: Option<number>;
15
+ community_name: Option<string>;
16
+ creator_id: Option<number>;
17
+ sort: Option<SortType>;
18
+ listing_type: Option<ListingType>;
19
+ page: Option<number>;
20
+ limit: Option<number>;
21
+ auth: Option<string>;
22
+ constructor(init: Search);
23
+ }
24
+ export declare class SearchResponse {
30
25
  /**
31
26
  * The [[SearchType]].
32
27
  */
@@ -36,14 +31,15 @@ export interface SearchResponse {
36
31
  communities: CommunityView[];
37
32
  users: PersonViewSafe[];
38
33
  }
39
- export interface GetModlog {
40
- mod_person_id?: number;
41
- community_id?: number;
42
- page?: number;
43
- limit?: number;
44
- auth?: string;
34
+ export declare class GetModlog {
35
+ mod_person_id: Option<number>;
36
+ community_id: Option<number>;
37
+ page: Option<number>;
38
+ limit: Option<number>;
39
+ auth: Option<string>;
40
+ constructor(init: GetModlog);
45
41
  }
46
- export interface GetModlogResponse {
42
+ export declare class GetModlogResponse {
47
43
  removed_posts: ModRemovePostView[];
48
44
  locked_posts: ModLockPostView[];
49
45
  stickied_posts: ModStickyPostView[];
@@ -55,122 +51,136 @@ export interface GetModlogResponse {
55
51
  transferred_to_community: ModTransferCommunityView[];
56
52
  added: ModAddView[];
57
53
  }
58
- export interface CreateSite {
54
+ export declare class CreateSite {
59
55
  name: string;
60
- sidebar?: string;
61
- description?: string;
62
- icon?: string;
63
- banner?: string;
64
- enable_downvotes?: boolean;
65
- open_registration?: boolean;
66
- enable_nsfw?: boolean;
67
- community_creation_admin_only?: boolean;
68
- require_email_verification?: boolean;
69
- require_application?: boolean;
70
- application_question?: string;
71
- private_instance?: boolean;
72
- default_theme?: string;
56
+ sidebar: Option<string>;
57
+ description: Option<string>;
58
+ icon: Option<string>;
59
+ banner: Option<string>;
60
+ enable_downvotes: Option<boolean>;
61
+ open_registration: Option<boolean>;
62
+ enable_nsfw: Option<boolean>;
63
+ community_creation_admin_only: Option<boolean>;
64
+ require_email_verification: Option<boolean>;
65
+ require_application: Option<boolean>;
66
+ application_question: Option<string>;
67
+ private_instance: Option<boolean>;
68
+ default_theme: Option<string>;
69
+ default_post_listing_type: Option<string>;
73
70
  auth: string;
74
- }
75
- export interface EditSite {
76
- name?: string;
77
- sidebar?: string;
78
- description?: string;
79
- icon?: string;
80
- banner?: string;
81
- enable_downvotes?: boolean;
82
- open_registration?: boolean;
83
- enable_nsfw?: boolean;
84
- community_creation_admin_only?: boolean;
85
- require_email_verification?: boolean;
86
- require_application?: boolean;
87
- application_question?: string;
88
- private_instance?: boolean;
89
- default_theme?: string;
71
+ constructor(init: CreateSite);
72
+ }
73
+ export declare class EditSite {
74
+ name: Option<string>;
75
+ sidebar: Option<string>;
76
+ description: Option<string>;
77
+ icon: Option<string>;
78
+ banner: Option<string>;
79
+ enable_downvotes: Option<boolean>;
80
+ open_registration: Option<boolean>;
81
+ enable_nsfw: Option<boolean>;
82
+ community_creation_admin_only: Option<boolean>;
83
+ require_email_verification: Option<boolean>;
84
+ require_application: Option<boolean>;
85
+ application_question: Option<string>;
86
+ private_instance: Option<boolean>;
87
+ default_theme: Option<string>;
88
+ legal_information: Option<string>;
89
+ default_post_listing_type: Option<string>;
90
90
  auth: string;
91
+ constructor(init: EditSite);
91
92
  }
92
- export interface GetSite {
93
- auth?: string;
93
+ export declare class GetSite {
94
+ auth: Option<string>;
95
+ constructor(init: GetSite);
94
96
  }
95
- export interface SiteResponse {
97
+ export declare class SiteResponse {
96
98
  site_view: SiteView;
97
99
  }
98
- export interface GetSiteResponse {
100
+ export declare class GetSiteResponse {
99
101
  /**
100
102
  * Optional, because the site might not be set up yet.
101
103
  */
102
- site_view?: SiteView;
104
+ site_view: Option<SiteView>;
103
105
  admins: PersonViewSafe[];
104
106
  online: number;
105
107
  version: string;
106
108
  /**
107
109
  * If you're logged in, you'll get back extra user info.
108
110
  */
109
- my_user?: MyUserInfo;
110
- federated_instances?: FederatedInstances;
111
+ my_user: Option<MyUserInfo>;
112
+ federated_instances: Option<FederatedInstances>;
111
113
  }
112
114
  /**
113
115
  * Your user info, such as blocks, follows, etc.
114
116
  */
115
- export interface MyUserInfo {
117
+ export declare class MyUserInfo {
116
118
  local_user_view: LocalUserSettingsView;
117
119
  follows: CommunityFollowerView[];
118
120
  moderates: CommunityModeratorView[];
119
121
  community_blocks: CommunityBlockView[];
120
122
  person_blocks: PersonBlockView[];
121
123
  }
122
- export interface LeaveAdmin {
124
+ export declare class LeaveAdmin {
123
125
  auth: string;
126
+ constructor(init: LeaveAdmin);
124
127
  }
125
- export interface GetSiteConfig {
128
+ export declare class GetSiteConfig {
126
129
  auth: string;
130
+ constructor(init: GetSiteConfig);
127
131
  }
128
- export interface GetSiteConfigResponse {
132
+ export declare class GetSiteConfigResponse {
129
133
  config_hjson: string;
130
134
  }
131
- export interface SaveSiteConfig {
135
+ export declare class SaveSiteConfig {
132
136
  config_hjson: string;
133
137
  auth: string;
138
+ constructor(init: SaveSiteConfig);
134
139
  }
135
- export interface FederatedInstances {
140
+ export declare class FederatedInstances {
136
141
  linked: string[];
137
- allowed?: string[];
138
- blocked?: string[];
142
+ allowed: Option<string[]>;
143
+ blocked: Option<string[]>;
144
+ constructor(init: FederatedInstances);
139
145
  }
140
- export interface ResolveObject {
146
+ export declare class ResolveObject {
141
147
  q: string;
142
- auth?: string;
148
+ auth: Option<string>;
149
+ constructor(init: ResolveObject);
143
150
  }
144
- export interface ResolveObjectResponse {
145
- comment?: CommentView;
146
- post?: PostView;
147
- community?: CommunityView;
148
- person?: PersonViewSafe;
151
+ export declare class ResolveObjectResponse {
152
+ comment: Option<CommentView>;
153
+ post: Option<PostView>;
154
+ community: Option<CommunityView>;
155
+ person: Option<PersonViewSafe>;
149
156
  }
150
- export interface ListRegistrationApplications {
157
+ export declare class ListRegistrationApplications {
151
158
  /**
152
159
  * Only shows the unread applications (IE those without an admin actor)
153
160
  */
154
- unread_only?: boolean;
155
- page?: number;
156
- limit?: number;
161
+ unread_only: Option<boolean>;
162
+ page: Option<number>;
163
+ limit: Option<number>;
157
164
  auth: string;
165
+ constructor(init: ListRegistrationApplications);
158
166
  }
159
- export interface ListRegistrationApplicationsResponse {
167
+ export declare class ListRegistrationApplicationsResponse {
160
168
  registration_applications: RegistrationApplicationView[];
161
169
  }
162
- export interface ApproveRegistrationApplication {
170
+ export declare class ApproveRegistrationApplication {
163
171
  id: number;
164
172
  approve: boolean;
165
- deny_reason?: string;
173
+ deny_reason: Option<string>;
166
174
  auth: string;
175
+ constructor(init: ApproveRegistrationApplication);
167
176
  }
168
- export interface RegistrationApplicationResponse {
177
+ export declare class RegistrationApplicationResponse {
169
178
  registration_application: RegistrationApplicationView;
170
179
  }
171
- export interface GetUnreadRegistrationApplicationCount {
180
+ export declare class GetUnreadRegistrationApplicationCount {
172
181
  auth: string;
182
+ constructor(init: GetUnreadRegistrationApplicationCount);
173
183
  }
174
- export interface GetUnreadRegistrationApplicationCountResponse {
184
+ export declare class GetUnreadRegistrationApplicationCountResponse {
175
185
  registration_applications: number;
176
186
  }