import PegaAuth from '../service_broker/embed/auth';
import type { AuthConfig } from './types';
/**
* this function will add the access token to the fetch request headers.
* @param tokenInfo -- object containing token information like access token, refresh token, session index.
*
* @example
Example for setTokens()
* const tokenObject = {
* access_token: 'access_token_value',
* refresh_token: 'refresh_token_value',
* session_index: 'session_index',
* expires_in: 120,
* token_type: 'bearer'
* };
* Example usage - PCore.getAuthUtils().setTokens(tokenObject);
* @function
*/
export declare const setTokens: (tokenInfo: {
token_type: string;
access_token: string;
csrf?: string;
}) => void;
/**
* this function will return the instance of PegaAuth class containing helper functions for OAUTH2.0 registration in constellation apps.
* @param config -- object containing clientId, clientSecret and endpoints.
*
* @returns instance of PegaAuth class.
*
* @example Example for getAuthInstance()
* const config = {
* clientId: 'clientId',
* clientSecret: 'client_secret_value',
* endPoints: {
* token: 'token_endpoint',
* revoke: 'revoke_endpoint',
* authorize: 'authorize_endpoint'
* }
* };
* Example usage - PCore.getAuthUtils().getAuthInstance(config);
* @function
*/
export declare const getAuthInstance: (config: AuthConfig) => PegaAuth;
/**
* this function will revoke the access and refresh tokens.
* @returns Resolves when both the tokens are successfully revoked
*
* @example Example for revokeTokens()
* Example usage - PCore.getAuthUtils().revokeTokens();
* @function
*/
export declare const revokeTokens: () => Promise;
/**
* this function will set the Authorization header in the fetch request headers for API calls.
* @param value header value
*
* @example Example for setAuthorizationHeader()
* Example usage - PCore.getAuthUtils().setAuthorizationHeader('header_value');
* @function
*/
export declare const setAuthorizationHeader: (value: string) => void;
declare const _default: {
setTokens: (tokenInfo: {
token_type: string;
access_token: string;
csrf?: string;
}) => void;
revokeTokens: () => Promise;
getAuthInstance: (config: AuthConfig) => PegaAuth;
setAuthorizationHeader: (value: string) => void;
};
export default _default;