quria
Version:
A user-friendly Destiny 2 API Wrapper written with TypeScript and approved by -Axis Minds- Oryx.
23 lines (22 loc) • 905 B
TypeScript
import { TokenError, TokenResponse } from "../../types";
export declare class OAuth {
private authUrl;
private tokenUrl;
private headers;
private client_id?;
private client_secret?;
private get environment();
constructor(authUrl: string, tokenUrl: string, headers: {
[key: string]: string;
}, client_id?: string | undefined, client_secret?: string | undefined);
private btoa;
private encodeCredentials;
/**
* Generate authorization url with default client id and state.
* @param {string} state OPTIONAL: String containing some information, particulary for avoid cross site scripting.
* @returns Authorization url.
*/
GenerateAuthorizationURL(state?: string): string;
GetOAuthAccessToken(code: string): Promise<TokenResponse | TokenError>;
RefreshAccessToken(refresh_token: string): Promise<TokenResponse | TokenError>;
}