lemmy-js-client 0.17.0-rc.3 → 0.17.0-rc.32

Sign up to get free protection for your applications and to get access to all the features.
@@ -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,124 @@ 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 {
123
- auth: string;
124
- }
125
- export interface GetSiteConfig {
126
- auth: string;
127
- }
128
- export interface GetSiteConfigResponse {
129
- config_hjson: string;
130
- }
131
- export interface SaveSiteConfig {
132
- config_hjson: string;
124
+ export declare class LeaveAdmin {
133
125
  auth: string;
126
+ constructor(init: LeaveAdmin);
134
127
  }
135
- export interface FederatedInstances {
128
+ export declare class FederatedInstances {
136
129
  linked: string[];
137
- allowed?: string[];
138
- blocked?: string[];
130
+ allowed: Option<string[]>;
131
+ blocked: Option<string[]>;
132
+ constructor(init: FederatedInstances);
139
133
  }
140
- export interface ResolveObject {
134
+ export declare class ResolveObject {
141
135
  q: string;
142
- auth?: string;
136
+ auth: Option<string>;
137
+ constructor(init: ResolveObject);
143
138
  }
144
- export interface ResolveObjectResponse {
145
- comment?: CommentView;
146
- post?: PostView;
147
- community?: CommunityView;
148
- person?: PersonViewSafe;
139
+ export declare class ResolveObjectResponse {
140
+ comment: Option<CommentView>;
141
+ post: Option<PostView>;
142
+ community: Option<CommunityView>;
143
+ person: Option<PersonViewSafe>;
149
144
  }
150
- export interface ListRegistrationApplications {
145
+ export declare class ListRegistrationApplications {
151
146
  /**
152
147
  * Only shows the unread applications (IE those without an admin actor)
153
148
  */
154
- unread_only?: boolean;
155
- page?: number;
156
- limit?: number;
149
+ unread_only: Option<boolean>;
150
+ page: Option<number>;
151
+ limit: Option<number>;
157
152
  auth: string;
153
+ constructor(init: ListRegistrationApplications);
158
154
  }
159
- export interface ListRegistrationApplicationsResponse {
155
+ export declare class ListRegistrationApplicationsResponse {
160
156
  registration_applications: RegistrationApplicationView[];
161
157
  }
162
- export interface ApproveRegistrationApplication {
158
+ export declare class ApproveRegistrationApplication {
163
159
  id: number;
164
160
  approve: boolean;
165
- deny_reason?: string;
161
+ deny_reason: Option<string>;
166
162
  auth: string;
163
+ constructor(init: ApproveRegistrationApplication);
167
164
  }
168
- export interface RegistrationApplicationResponse {
165
+ export declare class RegistrationApplicationResponse {
169
166
  registration_application: RegistrationApplicationView;
170
167
  }
171
- export interface GetUnreadRegistrationApplicationCount {
168
+ export declare class GetUnreadRegistrationApplicationCount {
172
169
  auth: string;
170
+ constructor(init: GetUnreadRegistrationApplicationCount);
173
171
  }
174
- export interface GetUnreadRegistrationApplicationCountResponse {
172
+ export declare class GetUnreadRegistrationApplicationCountResponse {
175
173
  registration_applications: number;
176
174
  }