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

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./http";
2
2
  export * from "./interfaces";
3
+ export * from "./utils";
3
4
  export * from "./websocket";
package/dist/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -12,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
17
  __exportStar(require("./http"), exports);
14
18
  __exportStar(require("./interfaces"), exports);
19
+ __exportStar(require("./utils"), exports);
15
20
  __exportStar(require("./websocket"), exports);
@@ -1,65 +1,74 @@
1
+ import { Option } from "@sniptt/monads";
2
+ import { ListingType, SortType } from "../others";
1
3
  import { CommentReportView, CommentView } from "../views";
2
- export interface CreateComment {
4
+ export declare class CreateComment {
3
5
  content: string;
4
- parent_id?: number;
6
+ parent_id: Option<number>;
5
7
  post_id: number;
6
8
  /**
7
9
  * An optional front end ID, to tell which is comment is coming back.
8
10
  */
9
- form_id?: string;
11
+ form_id: Option<string>;
10
12
  auth: string;
13
+ constructor(init: CreateComment);
11
14
  }
12
- export interface EditComment {
15
+ export declare class EditComment {
13
16
  content: string;
14
17
  comment_id: number;
15
18
  /**
16
19
  * An optional front end ID, to tell which is comment is coming back.
17
20
  */
18
- form_id?: string;
21
+ form_id: Option<string>;
19
22
  auth: string;
23
+ constructor(init: EditComment);
20
24
  }
21
25
  /**
22
26
  * Only the creator can delete the comment.
23
27
  */
24
- export interface DeleteComment {
28
+ export declare class DeleteComment {
25
29
  comment_id: number;
26
30
  deleted: boolean;
27
31
  auth: string;
32
+ constructor(init: DeleteComment);
28
33
  }
29
34
  /**
30
35
  * Only a mod or admin can remove the comment.
31
36
  */
32
- export interface RemoveComment {
37
+ export declare class RemoveComment {
33
38
  comment_id: number;
34
39
  removed: boolean;
35
- reason?: string;
40
+ reason: Option<string>;
36
41
  auth: string;
42
+ constructor(init: RemoveComment);
37
43
  }
38
44
  /**
39
45
  * Only the recipient can do this.
40
46
  */
41
- export interface MarkCommentAsRead {
47
+ export declare class MarkCommentAsRead {
42
48
  comment_id: number;
43
49
  read: boolean;
44
50
  auth: string;
51
+ constructor(init: MarkCommentAsRead);
45
52
  }
46
- export interface SaveComment {
53
+ export declare class SaveComment {
47
54
  comment_id: number;
48
55
  save: boolean;
49
56
  auth: string;
57
+ constructor(init: SaveComment);
50
58
  }
51
- export interface CommentResponse {
59
+ export declare class CommentResponse {
52
60
  comment_view: CommentView;
53
61
  recipient_ids: number[];
54
62
  /**
55
63
  * An optional front end ID, to tell which is comment is coming back.
56
64
  */
57
- form_id?: string;
65
+ form_id: Option<string>;
58
66
  }
59
- export interface CreateCommentLike {
67
+ export declare class CreateCommentLike {
60
68
  comment_id: number;
61
69
  score: number;
62
70
  auth: string;
71
+ constructor(init: CreateCommentLike);
63
72
  }
64
73
  /**
65
74
  * Comment listing types are `All, Subscribed, Community`
@@ -67,54 +76,52 @@ export interface CreateCommentLike {
67
76
  * You can use either `community_id` or `community_name` as an id.
68
77
  * To get posts for a federated community by name, use `name@instance.tld` .
69
78
  */
70
- export interface GetComments {
71
- /**
72
- * The [[ListingType]].
73
- */
74
- type_?: string;
75
- /**
76
- * The [[SortType]].
77
- */
78
- sort?: string;
79
- page?: number;
80
- limit?: number;
81
- community_id?: number;
82
- community_name?: string;
83
- saved_only?: boolean;
84
- auth?: string;
79
+ export declare class GetComments {
80
+ type_: Option<ListingType>;
81
+ sort: Option<SortType>;
82
+ page: Option<number>;
83
+ limit: Option<number>;
84
+ community_id: Option<number>;
85
+ community_name: Option<string>;
86
+ saved_only: Option<boolean>;
87
+ auth: Option<string>;
88
+ constructor(init: GetComments);
85
89
  }
86
- export interface GetCommentsResponse {
90
+ export declare class GetCommentsResponse {
87
91
  comments: CommentView[];
88
92
  }
89
- export interface CreateCommentReport {
93
+ export declare class CreateCommentReport {
90
94
  comment_id: number;
91
95
  reason: string;
92
96
  auth: string;
97
+ constructor(init: CreateCommentReport);
93
98
  }
94
- export interface CommentReportResponse {
99
+ export declare class CommentReportResponse {
95
100
  comment_report_view: CommentReportView;
96
101
  }
97
- export interface ResolveCommentReport {
102
+ export declare class ResolveCommentReport {
98
103
  report_id: number;
99
104
  /**
100
105
  * Either resolve or unresolve a report.
101
106
  */
102
107
  resolved: boolean;
103
108
  auth: string;
109
+ constructor(init: ResolveCommentReport);
104
110
  }
105
- export interface ListCommentReports {
106
- page?: number;
107
- limit?: number;
111
+ export declare class ListCommentReports {
112
+ page: Option<number>;
113
+ limit: Option<number>;
108
114
  /**
109
115
  * if no community is given, it returns reports for all communities moderated by the auth user.
110
116
  */
111
- community_id?: number;
117
+ community_id: Option<number>;
112
118
  /**
113
119
  * Only shows the unresolved reports.
114
120
  */
115
- unresolved_only?: boolean;
121
+ unresolved_only: Option<boolean>;
116
122
  auth: string;
123
+ constructor(init: ListCommentReports);
117
124
  }
118
- export interface ListCommentReportsResponse {
125
+ export declare class ListCommentReportsResponse {
119
126
  comment_reports: CommentReportView[];
120
127
  }
@@ -1,2 +1,315 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ListCommentReportsResponse = exports.ListCommentReports = exports.ResolveCommentReport = exports.CommentReportResponse = exports.CreateCommentReport = exports.GetCommentsResponse = exports.GetComments = exports.CreateCommentLike = exports.CommentResponse = exports.SaveComment = exports.MarkCommentAsRead = exports.RemoveComment = exports.DeleteComment = exports.EditComment = exports.CreateComment = void 0;
10
+ var monads_1 = require("@sniptt/monads");
11
+ var class_transformer_1 = require("class-transformer");
12
+ var utils_1 = require("../../utils");
13
+ var CreateComment = /** @class */ (function () {
14
+ function CreateComment(init) {
15
+ Object.assign(this, init);
16
+ }
17
+ __decorate([
18
+ (0, class_transformer_1.Transform)(function (_a) {
19
+ var value = _a.value;
20
+ return (0, monads_1.Some)(value);
21
+ }, { toClassOnly: true }),
22
+ (0, class_transformer_1.Transform)(function (_a) {
23
+ var value = _a.value;
24
+ return (0, utils_1.toUndefined)(value);
25
+ }, { toPlainOnly: true }),
26
+ (0, class_transformer_1.Expose)()
27
+ ], CreateComment.prototype, "parent_id", void 0);
28
+ __decorate([
29
+ (0, class_transformer_1.Transform)(function (_a) {
30
+ var value = _a.value;
31
+ return (0, monads_1.Some)(value);
32
+ }, { toClassOnly: true }),
33
+ (0, class_transformer_1.Transform)(function (_a) {
34
+ var value = _a.value;
35
+ return (0, utils_1.toUndefined)(value);
36
+ }, { toPlainOnly: true }),
37
+ (0, class_transformer_1.Expose)()
38
+ ], CreateComment.prototype, "form_id", void 0);
39
+ return CreateComment;
40
+ }());
41
+ exports.CreateComment = CreateComment;
42
+ var EditComment = /** @class */ (function () {
43
+ function EditComment(init) {
44
+ Object.assign(this, init);
45
+ }
46
+ __decorate([
47
+ (0, class_transformer_1.Transform)(function (_a) {
48
+ var value = _a.value;
49
+ return (0, monads_1.Some)(value);
50
+ }, { toClassOnly: true }),
51
+ (0, class_transformer_1.Transform)(function (_a) {
52
+ var value = _a.value;
53
+ return (0, utils_1.toUndefined)(value);
54
+ }, { toPlainOnly: true }),
55
+ (0, class_transformer_1.Expose)()
56
+ ], EditComment.prototype, "form_id", void 0);
57
+ return EditComment;
58
+ }());
59
+ exports.EditComment = EditComment;
60
+ /**
61
+ * Only the creator can delete the comment.
62
+ */
63
+ var DeleteComment = /** @class */ (function () {
64
+ function DeleteComment(init) {
65
+ Object.assign(this, init);
66
+ }
67
+ return DeleteComment;
68
+ }());
69
+ exports.DeleteComment = DeleteComment;
70
+ /**
71
+ * Only a mod or admin can remove the comment.
72
+ */
73
+ var RemoveComment = /** @class */ (function () {
74
+ function RemoveComment(init) {
75
+ Object.assign(this, init);
76
+ }
77
+ __decorate([
78
+ (0, class_transformer_1.Transform)(function (_a) {
79
+ var value = _a.value;
80
+ return (0, monads_1.Some)(value);
81
+ }, { toClassOnly: true }),
82
+ (0, class_transformer_1.Transform)(function (_a) {
83
+ var value = _a.value;
84
+ return (0, utils_1.toUndefined)(value);
85
+ }, { toPlainOnly: true }),
86
+ (0, class_transformer_1.Expose)()
87
+ ], RemoveComment.prototype, "reason", void 0);
88
+ return RemoveComment;
89
+ }());
90
+ exports.RemoveComment = RemoveComment;
91
+ /**
92
+ * Only the recipient can do this.
93
+ */
94
+ var MarkCommentAsRead = /** @class */ (function () {
95
+ function MarkCommentAsRead(init) {
96
+ Object.assign(this, init);
97
+ }
98
+ return MarkCommentAsRead;
99
+ }());
100
+ exports.MarkCommentAsRead = MarkCommentAsRead;
101
+ var SaveComment = /** @class */ (function () {
102
+ function SaveComment(init) {
103
+ Object.assign(this, init);
104
+ }
105
+ return SaveComment;
106
+ }());
107
+ exports.SaveComment = SaveComment;
108
+ var CommentResponse = /** @class */ (function () {
109
+ function CommentResponse() {
110
+ }
111
+ __decorate([
112
+ (0, class_transformer_1.Transform)(function (_a) {
113
+ var value = _a.value;
114
+ return (0, monads_1.Some)(value);
115
+ }, { toClassOnly: true }),
116
+ (0, class_transformer_1.Transform)(function (_a) {
117
+ var value = _a.value;
118
+ return (0, utils_1.toUndefined)(value);
119
+ }, { toPlainOnly: true }),
120
+ (0, class_transformer_1.Expose)()
121
+ ], CommentResponse.prototype, "form_id", void 0);
122
+ return CommentResponse;
123
+ }());
124
+ exports.CommentResponse = CommentResponse;
125
+ var CreateCommentLike = /** @class */ (function () {
126
+ function CreateCommentLike(init) {
127
+ Object.assign(this, init);
128
+ }
129
+ return CreateCommentLike;
130
+ }());
131
+ exports.CreateCommentLike = CreateCommentLike;
132
+ /**
133
+ * Comment listing types are `All, Subscribed, Community`
134
+ *
135
+ * You can use either `community_id` or `community_name` as an id.
136
+ * To get posts for a federated community by name, use `name@instance.tld` .
137
+ */
138
+ var GetComments = /** @class */ (function () {
139
+ function GetComments(init) {
140
+ Object.assign(this, init);
141
+ }
142
+ __decorate([
143
+ (0, class_transformer_1.Transform)(function (_a) {
144
+ var value = _a.value;
145
+ return (0, monads_1.Some)(value);
146
+ }, { toClassOnly: true }),
147
+ (0, class_transformer_1.Transform)(function (_a) {
148
+ var value = _a.value;
149
+ return (0, utils_1.toUndefined)(value);
150
+ }, { toPlainOnly: true }),
151
+ (0, class_transformer_1.Expose)()
152
+ ], GetComments.prototype, "type_", void 0);
153
+ __decorate([
154
+ (0, class_transformer_1.Transform)(function (_a) {
155
+ var value = _a.value;
156
+ return (0, monads_1.Some)(value);
157
+ }, { toClassOnly: true }),
158
+ (0, class_transformer_1.Transform)(function (_a) {
159
+ var value = _a.value;
160
+ return (0, utils_1.toUndefined)(value);
161
+ }, { toPlainOnly: true }),
162
+ (0, class_transformer_1.Expose)()
163
+ ], GetComments.prototype, "sort", void 0);
164
+ __decorate([
165
+ (0, class_transformer_1.Transform)(function (_a) {
166
+ var value = _a.value;
167
+ return (0, monads_1.Some)(value);
168
+ }, { toClassOnly: true }),
169
+ (0, class_transformer_1.Transform)(function (_a) {
170
+ var value = _a.value;
171
+ return (0, utils_1.toUndefined)(value);
172
+ }, { toPlainOnly: true }),
173
+ (0, class_transformer_1.Expose)()
174
+ ], GetComments.prototype, "page", void 0);
175
+ __decorate([
176
+ (0, class_transformer_1.Transform)(function (_a) {
177
+ var value = _a.value;
178
+ return (0, monads_1.Some)(value);
179
+ }, { toClassOnly: true }),
180
+ (0, class_transformer_1.Transform)(function (_a) {
181
+ var value = _a.value;
182
+ return (0, utils_1.toUndefined)(value);
183
+ }, { toPlainOnly: true }),
184
+ (0, class_transformer_1.Expose)()
185
+ ], GetComments.prototype, "limit", void 0);
186
+ __decorate([
187
+ (0, class_transformer_1.Transform)(function (_a) {
188
+ var value = _a.value;
189
+ return (0, monads_1.Some)(value);
190
+ }, { toClassOnly: true }),
191
+ (0, class_transformer_1.Transform)(function (_a) {
192
+ var value = _a.value;
193
+ return (0, utils_1.toUndefined)(value);
194
+ }, { toPlainOnly: true }),
195
+ (0, class_transformer_1.Expose)()
196
+ ], GetComments.prototype, "community_id", void 0);
197
+ __decorate([
198
+ (0, class_transformer_1.Transform)(function (_a) {
199
+ var value = _a.value;
200
+ return (0, monads_1.Some)(value);
201
+ }, { toClassOnly: true }),
202
+ (0, class_transformer_1.Transform)(function (_a) {
203
+ var value = _a.value;
204
+ return (0, utils_1.toUndefined)(value);
205
+ }, { toPlainOnly: true }),
206
+ (0, class_transformer_1.Expose)()
207
+ ], GetComments.prototype, "community_name", void 0);
208
+ __decorate([
209
+ (0, class_transformer_1.Transform)(function (_a) {
210
+ var value = _a.value;
211
+ return (0, monads_1.Some)(value);
212
+ }, { toClassOnly: true }),
213
+ (0, class_transformer_1.Transform)(function (_a) {
214
+ var value = _a.value;
215
+ return (0, utils_1.toUndefined)(value);
216
+ }, { toPlainOnly: true }),
217
+ (0, class_transformer_1.Expose)()
218
+ ], GetComments.prototype, "saved_only", void 0);
219
+ __decorate([
220
+ (0, class_transformer_1.Transform)(function (_a) {
221
+ var value = _a.value;
222
+ return (0, monads_1.Some)(value);
223
+ }, { toClassOnly: true }),
224
+ (0, class_transformer_1.Transform)(function (_a) {
225
+ var value = _a.value;
226
+ return (0, utils_1.toUndefined)(value);
227
+ }, { toPlainOnly: true }),
228
+ (0, class_transformer_1.Expose)()
229
+ ], GetComments.prototype, "auth", void 0);
230
+ return GetComments;
231
+ }());
232
+ exports.GetComments = GetComments;
233
+ var GetCommentsResponse = /** @class */ (function () {
234
+ function GetCommentsResponse() {
235
+ }
236
+ return GetCommentsResponse;
237
+ }());
238
+ exports.GetCommentsResponse = GetCommentsResponse;
239
+ var CreateCommentReport = /** @class */ (function () {
240
+ function CreateCommentReport(init) {
241
+ Object.assign(this, init);
242
+ }
243
+ return CreateCommentReport;
244
+ }());
245
+ exports.CreateCommentReport = CreateCommentReport;
246
+ var CommentReportResponse = /** @class */ (function () {
247
+ function CommentReportResponse() {
248
+ }
249
+ return CommentReportResponse;
250
+ }());
251
+ exports.CommentReportResponse = CommentReportResponse;
252
+ var ResolveCommentReport = /** @class */ (function () {
253
+ function ResolveCommentReport(init) {
254
+ Object.assign(this, init);
255
+ }
256
+ return ResolveCommentReport;
257
+ }());
258
+ exports.ResolveCommentReport = ResolveCommentReport;
259
+ var ListCommentReports = /** @class */ (function () {
260
+ function ListCommentReports(init) {
261
+ Object.assign(this, init);
262
+ }
263
+ __decorate([
264
+ (0, class_transformer_1.Transform)(function (_a) {
265
+ var value = _a.value;
266
+ return (0, monads_1.Some)(value);
267
+ }, { toClassOnly: true }),
268
+ (0, class_transformer_1.Transform)(function (_a) {
269
+ var value = _a.value;
270
+ return (0, utils_1.toUndefined)(value);
271
+ }, { toPlainOnly: true }),
272
+ (0, class_transformer_1.Expose)()
273
+ ], ListCommentReports.prototype, "page", void 0);
274
+ __decorate([
275
+ (0, class_transformer_1.Transform)(function (_a) {
276
+ var value = _a.value;
277
+ return (0, monads_1.Some)(value);
278
+ }, { toClassOnly: true }),
279
+ (0, class_transformer_1.Transform)(function (_a) {
280
+ var value = _a.value;
281
+ return (0, utils_1.toUndefined)(value);
282
+ }, { toPlainOnly: true }),
283
+ (0, class_transformer_1.Expose)()
284
+ ], ListCommentReports.prototype, "limit", void 0);
285
+ __decorate([
286
+ (0, class_transformer_1.Transform)(function (_a) {
287
+ var value = _a.value;
288
+ return (0, monads_1.Some)(value);
289
+ }, { toClassOnly: true }),
290
+ (0, class_transformer_1.Transform)(function (_a) {
291
+ var value = _a.value;
292
+ return (0, utils_1.toUndefined)(value);
293
+ }, { toPlainOnly: true }),
294
+ (0, class_transformer_1.Expose)()
295
+ ], ListCommentReports.prototype, "community_id", void 0);
296
+ __decorate([
297
+ (0, class_transformer_1.Transform)(function (_a) {
298
+ var value = _a.value;
299
+ return (0, monads_1.Some)(value);
300
+ }, { toClassOnly: true }),
301
+ (0, class_transformer_1.Transform)(function (_a) {
302
+ var value = _a.value;
303
+ return (0, utils_1.toUndefined)(value);
304
+ }, { toPlainOnly: true }),
305
+ (0, class_transformer_1.Expose)()
306
+ ], ListCommentReports.prototype, "unresolved_only", void 0);
307
+ return ListCommentReports;
308
+ }());
309
+ exports.ListCommentReports = ListCommentReports;
310
+ var ListCommentReportsResponse = /** @class */ (function () {
311
+ function ListCommentReportsResponse() {
312
+ }
313
+ return ListCommentReportsResponse;
314
+ }());
315
+ exports.ListCommentReportsResponse = ListCommentReportsResponse;
@@ -1,128 +1,133 @@
1
+ import { Option } from "@sniptt/monads";
2
+ import "reflect-metadata";
3
+ import { ListingType, SortType } from "../others";
1
4
  import { Site } from "../source";
2
- import { CommunityFollowerView, CommunityModeratorView, CommunityView, PersonViewSafe } from "../views";
5
+ import { CommunityModeratorView, CommunityView, PersonViewSafe } from "../views";
3
6
  /**
4
7
  * You can use either `id` or `name` as an id.
5
8
  *
6
9
  * To get a federated community by name, use `name@instance.tld` .
7
10
  */
8
- export interface GetCommunity {
9
- id?: number;
10
- name?: string;
11
- auth?: string;
11
+ export declare class GetCommunity {
12
+ id: Option<number>;
13
+ name: Option<string>;
14
+ auth: Option<string>;
15
+ constructor(init: GetCommunity);
12
16
  }
13
- export interface GetCommunityResponse {
17
+ export declare class GetCommunityResponse {
14
18
  community_view: CommunityView;
15
- site?: Site;
19
+ site: Option<Site>;
16
20
  moderators: CommunityModeratorView[];
17
21
  online: number;
18
22
  }
19
- export interface CreateCommunity {
23
+ export declare class CreateCommunity {
20
24
  name: string;
21
25
  title: string;
22
- description?: string;
23
- icon?: string;
24
- banner?: string;
25
- nsfw?: boolean;
26
- posting_restricted_to_mods?: boolean;
26
+ description: Option<string>;
27
+ icon: Option<string>;
28
+ banner: Option<string>;
29
+ nsfw: Option<boolean>;
30
+ posting_restricted_to_mods: Option<boolean>;
27
31
  auth: string;
32
+ constructor(init: CreateCommunity);
28
33
  }
29
- export interface CommunityResponse {
34
+ export declare class CommunityResponse {
30
35
  community_view: CommunityView;
31
36
  }
32
- export interface FollowCommunityResponse {
33
- community_follower_view?: CommunityFollowerView;
37
+ export declare class ListCommunities {
38
+ type_: Option<ListingType>;
39
+ sort: Option<SortType>;
40
+ page: Option<number>;
41
+ limit: Option<number>;
42
+ auth: Option<string>;
43
+ constructor(init: ListCommunities);
34
44
  }
35
- export interface ListCommunities {
36
- /**
37
- * The [[ListingType]].
38
- */
39
- type_?: string;
40
- /**
41
- * The [[SortType]].
42
- */
43
- sort?: string;
44
- page?: number;
45
- limit?: number;
46
- auth?: string;
47
- }
48
- export interface ListCommunitiesResponse {
45
+ export declare class ListCommunitiesResponse {
49
46
  communities: CommunityView[];
50
47
  }
51
- export interface BanFromCommunity {
48
+ export declare class BanFromCommunity {
52
49
  community_id: number;
53
50
  person_id: number;
54
51
  ban: boolean;
55
52
  /**
56
53
  * Removes/Restores their comments and posts for that community.
57
54
  */
58
- remove_data?: boolean;
59
- reason?: string;
55
+ remove_data: Option<boolean>;
56
+ reason: Option<string>;
60
57
  /**
61
58
  * The expire time in Unix seconds
62
59
  */
63
- expires?: number;
60
+ expires: Option<number>;
64
61
  auth: string;
62
+ constructor(init: BanFromCommunity);
65
63
  }
66
- export interface BanFromCommunityResponse {
64
+ export declare class BanFromCommunityResponse {
67
65
  person_view: PersonViewSafe;
68
66
  banned: boolean;
69
67
  }
70
- export interface AddModToCommunity {
68
+ export declare class AddModToCommunity {
71
69
  community_id: number;
72
70
  person_id: number;
73
71
  added: boolean;
74
72
  auth: string;
73
+ constructor(init: AddModToCommunity);
75
74
  }
76
- export interface AddModToCommunityResponse {
75
+ export declare class AddModToCommunityResponse {
77
76
  moderators: CommunityModeratorView[];
78
77
  }
79
78
  /**
80
79
  * Only mods can edit a community.
81
80
  */
82
- export interface EditCommunity {
81
+ export declare class EditCommunity {
83
82
  community_id: number;
84
- title?: string;
85
- description?: string;
86
- icon?: string;
87
- banner?: string;
88
- nsfw?: boolean;
89
- posting_restricted_to_mods?: boolean;
83
+ title: Option<string>;
84
+ description: Option<string>;
85
+ icon: Option<string>;
86
+ banner: Option<string>;
87
+ nsfw: Option<boolean>;
88
+ posting_restricted_to_mods: Option<boolean>;
90
89
  auth: string;
90
+ constructor(init: EditCommunity);
91
91
  }
92
- export interface DeleteCommunity {
92
+ export declare class DeleteCommunity {
93
93
  community_id: number;
94
94
  deleted: boolean;
95
95
  auth: string;
96
+ constructor(init: DeleteCommunity);
96
97
  }
97
98
  /**
98
99
  * Only admins can remove a community.
99
100
  */
100
- export interface RemoveCommunity {
101
+ export declare class RemoveCommunity {
101
102
  community_id: number;
102
103
  removed: boolean;
103
- reason?: string;
104
+ reason: Option<string>;
104
105
  /**
105
106
  * The expire time in Unix seconds
106
107
  */
107
- expires?: number;
108
+ expires: Option<number>;
108
109
  auth: string;
110
+ constructor(init: RemoveCommunity);
109
111
  }
110
- export interface FollowCommunity {
112
+ export declare class FollowCommunity {
111
113
  community_id: number;
112
114
  follow: boolean;
113
115
  auth: string;
116
+ constructor(init: FollowCommunity);
114
117
  }
115
- export interface TransferCommunity {
118
+ export declare class TransferCommunity {
116
119
  community_id: number;
117
120
  person_id: number;
118
121
  auth: string;
122
+ constructor(init: TransferCommunity);
119
123
  }
120
- export interface BlockCommunity {
124
+ export declare class BlockCommunity {
121
125
  community_id: number;
122
126
  block: boolean;
123
127
  auth: string;
128
+ constructor(init: BlockCommunity);
124
129
  }
125
- export interface BlockCommunityResponse {
130
+ export declare class BlockCommunityResponse {
126
131
  community_view: CommunityView;
127
132
  blocked: boolean;
128
133
  }