Reformat files

This commit is contained in:
Roj Serbest 2021-10-29 11:08:21 +03:00
parent ac75a8c210
commit d7cd8ac6f9
35 changed files with 1563 additions and 1557 deletions

View File

@ -4,7 +4,6 @@
"include": ["socialvoid", "examples", "generators"]
},
"options": {
"indentWidth": 4,
"lineWidth": 100
}
}

View File

@ -18,9 +18,7 @@ export class Network extends MethodBase {
getProfile(peer?: string | Peer): Promise<Profile> {
return this.client.invokeRequest(
new Request("network.get_profile", {
peer: typeof peer !== "undefined"
? typeof peer == "string" ? peer : peer.id
: undefined,
peer: typeof peer !== "undefined" ? typeof peer == "string" ? peer : peer.id : undefined,
}),
true,
);
@ -35,9 +33,7 @@ export class Network extends MethodBase {
getFollowing(peer?: string | Peer, page?: number): Promise<Peer[]> {
return this.client.invokeRequest(
new Request("network.get_following", {
peer: typeof peer !== "undefined"
? typeof peer == "string" ? peer : peer.id
: undefined,
peer: typeof peer !== "undefined" ? typeof peer == "string" ? peer : peer.id : undefined,
page,
}),
true,
@ -53,9 +49,7 @@ export class Network extends MethodBase {
getFollowers(peer?: string | Peer, page?: number): Promise<Peer[]> {
return this.client.invokeRequest(
new Request("network.get_followers", {
peer: typeof peer !== "undefined"
? typeof peer == "string" ? peer : peer.id
: undefined,
peer: typeof peer !== "undefined" ? typeof peer == "string" ? peer : peer.id : undefined,
page,
}),
true,

View File

@ -34,7 +34,9 @@ export class Timeline extends MethodBase {
*/
delete(post: string | Post): Promise<Post> {
return this.client.invokeRequest(
new Request("timeline.delete", { post: typeof post === "string" ? post : post.id }),
new Request("timeline.delete", {
post: typeof post === "string" ? post : post.id,
}),
true,
);
}
@ -124,7 +126,9 @@ export class Timeline extends MethodBase {
*/
like(post: string | Post): Promise<Post> {
return this.client.invokeRequest(
new Request("timeline.like", { post: typeof post === "string" ? post : post.id }),
new Request("timeline.like", {
post: typeof post === "string" ? post : post.id,
}),
true,
);
}
@ -135,6 +139,9 @@ export class Timeline extends MethodBase {
* @param page The requested page number, by default the value is 1.
*/
retrieveFeed(page?: number): Promise<Post[]> {
return this.client.invokeRequest(new Request("timeline.retrieve_feed", { page }), true);
return this.client.invokeRequest(
new Request("timeline.retrieve_feed", { page }),
true,
);
}
}

View File

@ -12,7 +12,13 @@ export type TextEntityType =
| "MENTION"
| "HASHTAG";
export type PostType = "UNKNOWN" | "DELETED" | "POST" | "REPLY" | "QUOTE" | "REPOST";
export type PostType =
| "UNKNOWN"
| "DELETED"
| "POST"
| "REPLY"
| "QUOTE"
| "REPOST";
export type RelationshipType =
| "NONE"