quria
Version:
A user-friendly Destiny 2 API Wrapper written with TypeScript and approved by -Axis Minds- Oryx.
64 lines (61 loc) • 4.41 kB
TypeScript
import { ITokens, APIResponse, GeneralUser, BungieCredentialType, GetCredentialTypesForAccountResponse, UserTheme, BungieMembershipType, UserMembershipData, HardLinkedUserMembership, UserSearchResponse } from "../../types";
export declare class User {
private url;
private headers;
constructor(url: string, headers: Record<string, string>);
/**
* Loads a bungienet user by membership id.
* @param id The requested Bungie.net membership id.
* @returns Loads a bungienet user by membership id.
*/
GetBungieNetUserById(id: string, tokens?: ITokens): Promise<APIResponse<GeneralUser>>;
/**
* Gets a list of all display names linked to this membership id but sanitized (profanity filtered). Obeys all visibility rules of calling user and is heavily cached.
* @param membershipId The requested membership id to load.
* @returns Gets a list of all display names linked to this membership id but sanitized (profanity filtered). Obeys all visibility rules of calling user and is heavily cached.
*/
GetSanitizedPlatformDisplayNames(membershipId: string, tokens?: ITokens): Promise<APIResponse<Record<BungieCredentialType, string>>>;
/**
* Returns a list of credential types attached to the requested account
* @param membershipId The user's membership id
* @returns Returns a list of credential types attached to the requested account
*/
GetCredentialTypesForTargetAccount(membershipId: string, tokens?: ITokens): Promise<APIResponse<GetCredentialTypesForAccountResponse[]>>;
/**
* Returns a list of all available user themes.
* @returns Returns a list of all available user themes.
*/
GetAvailableThemes(tokens?: ITokens): Promise<APIResponse<UserTheme[]>>;
/**
* Returns a list of accounts associated with the supplied membership ID and membership type. This will include all linked accounts (even when hidden) if supplied credentials permit it.
* @param membershipId The membership ID of the target user.
* @param membershipType Type of the supplied membership ID.
* @returns Returns a list of accounts associated with the supplied membership ID and membership type. This will include all linked accounts (even when hidden) if supplied credentials permit it.
*/
GetMembershipDataById(membershipId: string, membershipType: BungieMembershipType, tokens?: ITokens): Promise<APIResponse<UserMembershipData>>;
/**
* Returns a list of accounts associated with signed in user. This is useful for OAuth implementations that do not give you access to the token response.
* @returns Returns a list of accounts associated with signed in user. This is useful for OAuth implementations that do not give you access to the token response.
*/
GetMembershipDataForCurrentUser(tokens?: ITokens): Promise<APIResponse<UserMembershipData>>;
/**
* Gets any hard linked membership given a credential. Only works for credentials that are public (just SteamID64 right now). Cross Save aware.
* @param credential The credential to look up. Must be a valid SteamID64.
* @param crType The credential type. 'SteamId' is the only valid value at present.
* @returns Gets any hard linked membership given a credential. Only works for credentials that are public (just SteamID64 right now). Cross Save aware.
*/
GetMembershipFromHardLinkedCredential(credential: string, crType: BungieCredentialType, tokens?: ITokens): Promise<APIResponse<HardLinkedUserMembership>>;
/**
* [OBSOLETE] Do not use this to search users, use SearchByGlobalNamePost instead.
* @param displayNamePrefix The display name prefix you're looking for.
* @param page The zero-based page of results you desire.
* @returns [OBSOLETE] Do not use this to search users, use SearchByGlobalNamePost instead.
*/
SearchByGlobalNamePrefix(displayNamePrefix: string, page: number, tokens?: ITokens): Promise<APIResponse<UserSearchResponse>>;
/**
* Given the prefix of a global display name, returns all users who share that name.
* @param page The zero-based page of results you desire.
* @returns Given the prefix of a global display name, returns all users who share that name.
*/
SearchByGlobalNamePost(page: number, displayNamePrefix: string, tokens?: ITokens): Promise<APIResponse<UserSearchResponse>>;
}