Skip to content

Commit

Permalink
add more typings
Browse files Browse the repository at this point in the history
(to write the http methods later)
  • Loading branch information
NCPlayz committed Mar 6, 2021
1 parent 569772e commit 72f07a7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
11 changes: 10 additions & 1 deletion http/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,14 @@ export interface UserEditOptions {
location?: string;
hireable?: string;
bio?: string;
twitter_username?: string;
twitter_username?: string | null;
}

export interface SetPrimaryEmailVisibility {
email: string;
visibility: string;
}

export interface AddOrDeleteAnEmailAddress {
emails: string[];
}
21 changes: 20 additions & 1 deletion http/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,26 @@ export function filterParameters(
}

export interface ListUsersParameters {
accept?: string;
since?: number;
per_page?: number;
}

export interface GetContextualInformationForAUser {
subject_type: string;
subject_id: string;
}

export interface ListEmailAddresses {
per_page?: number;
page?: number;
}

export interface ListFollowers {
per_page?: number;
page?: number;
}

export interface ListFollowing {
per_page?: number;
page?: number;
}
10 changes: 9 additions & 1 deletion http/uri_templates.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
export const BLOCKED_USERS = "/blocks";
export const BLOCKED_USER = "/blocks/{username}";
export const LIST_USERS = "/users{?accept,since,per_page}";
export const LIST_USERS = "/users{?since,per_page}";
export const AUTHENTICATED_PRIMARY_EMAIL_VISIBILITY = "/user/email/visibility";
export const AUTHENTICATED_LIST_EMAIL_ADDRESSES = "{?since,per_page}";
export const AUTHENTICATED_LIST_PUBLIC_EMAILS =
"/user/public_emails{?since,per_page}";
export const AUTHENTICATED_LIST_FOLLOWERS = "{?since,per_page}";
export const LIST_FOLLOWERS = "/users/{username}/followers{?since,per_page}";
export const LIST_FOLLOWING = "/users/{username}/following{?since,per_page}";
export const IS_FOLLOWING = "/users/{username}/following/{target_user}";
2 changes: 1 addition & 1 deletion models/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CurrentUser extends User {
}

isBlockingUser(username: string): Promise<boolean> {
return this.http.checkIfBlocking(username);
return this.http.checkIfBlocking(username);
}

blockUser(username: string): Promise<boolean> {
Expand Down

0 comments on commit 72f07a7

Please sign in to comment.