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

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