@hapic/oauth2
Version:
A oauth2 api client based on axios.
40 lines (39 loc) • 931 B
TypeScript
import type { ConfigInput } from './config';
import { OAuth2Client } from './module';
/**
* Verify if an oauth2 client singleton instance exists.
*
* @param key
*/
export declare function hasClient(key?: string): boolean;
/**
* Set the oauth2 client singleton instance.
*
* @param client
* @param key
*/
export declare function setClient(client: OAuth2Client, key?: string): OAuth2Client;
/**
* Receive an oauth2 singleton instance.
*
* @param key
*/
export declare function useClient(key?: string): OAuth2Client;
/**
* Unset an oauth2 client singleton instance.
*
* @param key
*/
export declare function unsetClient(key?: string): void;
/**
* Create an oauth2 client.
*
* @param input
*/
export declare function createClient(input?: ConfigInput): OAuth2Client;
/**
* Check if the argument is of instance Client.
*
* @param input
*/
export declare function isClient(input: unknown): input is OAuth2Client;