UNPKG

@withjoy/sdk-js

Version:
43 lines (42 loc) 1.46 kB
/** * * Manages a refresh token, it saving and loading and the associated Access tokens and their renewals * Also manages continual refreshing of the access token * @param refreshToken string * @param options * @constructor */ export declare class ActiveAuth { private refreshTokenObj; private options?; private joinWithReply; private accessTokenObj; constructor(refreshTokenObj: any, options?: any); /** * Generate a OfflineAuth object from the saved refresh token * @returns {OfflineAuth} */ static fromSavedData(options?: any): ActiveAuth; /** * Generate a OfflineAuth object from a refreshToken * @param refreshToken * @returns {exports.OfflineAuth} */ static fromRefreshToken(refreshToken: any, options?: any): ActiveAuth; /** * Makes it so that the same token will be used the next time auth.OfflineAuth.fromSavedData is called. */ save(): Promise<[{}, [{}, {}], {}]>; /** * Gets the refreshTokenObj * @returns {auth.RefreshToken|*} */ refreshToken(): any; _generateNewAccessTokenObj(callback: any): any; getAccessToken(callback: any): any; } export declare function activeAuthKey(activeAuth: ActiveAuth): any; export declare function activeAuthIsNull(activeAuth: ActiveAuth): boolean; export declare class ActiveAuthMissingError extends Error { constructor(message?: string); }