import { AllEndpoints } from '../internal/utils';
export interface BaseEndpointOverride {
    baseEndpoint: string;
    endpointPrefix?: string;
    secureConnection?: boolean;
}
export type EndpointOverrides = BaseEndpointOverride | AllEndpoints;
/**
 * Encapsulates arguments for instantiating an EnvMomentoTokenProvider
 */
interface CredentialProviderProps {
    endpointOverrides?: EndpointOverrides;
}
/**
 * Provides information that the CacheClient needs in order to establish a connection to and authenticate with
 * the Momento service.
 * @export
 * @interface CredentialProvider
 */
export declare abstract class CredentialProvider {
    /**
     * @returns {string} Auth token provided by user, required to authenticate with the service
     */
    abstract getAuthToken(): string;
    /**
     * @returns {string} The host which the Momento client will connect to for Momento control plane operations
     */
    abstract getControlEndpoint(): string;
    /**
     * @deprecated use isEndpointSecure() instead
     */
    abstract isControlEndpointSecure(): boolean;
    /**
     * @returns {string} The host which the Momento client will connect to for Momento data plane operations
     */
    abstract getCacheEndpoint(): string;
    /**
     * @deprecated use isEndpointSecure() instead
     */
    abstract isCacheEndpointSecure(): boolean;
    /**
     * @returns {string} The host which the Momento client will connect to for Momento token operations
     */
    abstract getTokenEndpoint(): string;
    /**
     * @deprecated use isEndpointSecure() instead
     */
    abstract isTokenEndpointSecure(): boolean;
    /**
     * @deprecated - use the static method forMomentoLocal instead
     *
     * Modifies the instance of the credential provider to override endpoints to
     * allow insecure connections to the momento-local service for testing purposes
     */
    abstract withMomentoLocal(): CredentialProvider;
    /**
     * @returns {boolean} true if the endpoints were manually overridden at construction time; false otherwise
     */
    abstract areEndpointsOverridden(): boolean;
    /**
     * @returns {boolean} true if connecting to the endpoint connection with TLS; false if not using TLS
     */
    abstract isEndpointSecure(): boolean;
    /**
     * @deprecated use fromEnvVarV2() instead
     */
    static fromEnvironmentVariable(props: EnvMomentoTokenProviderProps | string): CredentialProvider;
    /**
     * @deprecated use fromEnvVarV2() instead
     */
    static fromEnvVar(props: EnvMomentoTokenProviderProps | string): CredentialProvider;
    /**
     * @deprecated use fromApiKeyV2() or fromDisposableToken() instead
     */
    static fromString(props: StringMomentoTokenProviderProps | string): CredentialProvider;
    static fromDisposableToken(props: StringMomentoTokenProviderProps | string): CredentialProvider;
    static fromEnvVarV2(props?: EnvMomentoV2TokenProviderProps): CredentialProvider;
    static fromApiKeyV2(props: ApiKeyV2TokenProviderProps): CredentialProvider;
    /**
     * Allow insecure connections to momento-local service for testing purposes.
     * Does not require a Momento API key.
     * @param props configuration options for connecting to momento-local
     * @returns CredentialProvider
     */
    static forMomentoLocal(props: MomentoLocalProviderProps): CredentialProvider;
}
declare abstract class CredentialProviderBase implements CredentialProvider {
    abstract getAuthToken(): string;
    abstract getCacheEndpoint(): string;
    abstract isCacheEndpointSecure(): boolean;
    abstract getControlEndpoint(): string;
    abstract isControlEndpointSecure(): boolean;
    abstract getTokenEndpoint(): string;
    abstract isTokenEndpointSecure(): boolean;
    abstract areEndpointsOverridden(): boolean;
    abstract isEndpointSecure(): boolean;
    abstract withMomentoLocal(): CredentialProvider;
    valueOf(): object;
}
export interface StringMomentoApiKeyProviderProps extends CredentialProviderProps {
    /**
     * apiKey the momento API key
     */
    apiKey: string;
}
export interface StringMomentoAuthTokenProviderProps extends CredentialProviderProps {
    /**
     * authToken the momento auth token
     */
    authToken: string;
}
export type StringMomentoTokenProviderProps = StringMomentoApiKeyProviderProps | StringMomentoAuthTokenProviderProps;
export type ApiKeyV2TokenProviderProps = StringMomentoTokenProviderProps & {
    endpoint: string;
};
export interface EnvMomentoV2TokenProviderProps {
    apiKeyEnvVar?: string;
    endpointEnvVar?: string;
}
/**
 * Reads and parses a momento auth token stored in a String
 * @export
 * @class StringMomentoTokenProvider
 * @deprecated use ApiKeyV2TokenProvider instead
 */
export declare class StringMomentoTokenProvider extends CredentialProviderBase {
    private readonly apiKey;
    private readonly allEndpoints;
    private readonly endpointsOverridden;
    /**
     * @param {StringMomentoTokenProviderProps} props configuration options for the token provider
     */
    constructor(props: StringMomentoTokenProviderProps | string);
    getAuthToken(): string;
    getCacheEndpoint(): string;
    isCacheEndpointSecure(): boolean;
    getControlEndpoint(): string;
    isControlEndpointSecure(): boolean;
    getTokenEndpoint(): string;
    isTokenEndpointSecure(): boolean;
    isStorageEndpointSecure(): boolean;
    areEndpointsOverridden(): boolean;
    isEndpointSecure(): boolean;
    withMomentoLocal(): CredentialProvider;
}
export interface EnvMomentoTokenProviderProps extends CredentialProviderProps {
    /**
     * the name of the environment variable from which the auth token will be read
     */
    environmentVariableName: string;
}
/**
 * Reads and parses a momento auth token stored as an environment variable.
 * @export
 * @class EnvMomentoTokenProvider
 * @deprecated use EnvMomentoV2TokenProvider instead
 */
export declare class EnvMomentoTokenProvider extends StringMomentoTokenProvider {
    environmentVariableName: string;
    /**
     * @param {EnvMomentoTokenProviderProps} props configuration options for the token provider
     */
    constructor(props: EnvMomentoTokenProviderProps | string);
}
/**
 * Provides the default credential provider based on which key was provided (v2 or legacy).
 * @export
 * @returns {CredentialProvider} the default credential provider
 */
export declare function getDefaultCredentialProvider(): CredentialProvider;
export interface MomentoLocalProviderProps extends CredentialProviderProps {
    /**
     * The hostname of the momento-local service
     */
    hostname?: string;
    /**
     * The port of the momento-local service
     */
    port?: number;
}
export declare class MomentoLocalProvider implements CredentialProvider {
    private readonly allEndpoints;
    private readonly endpointsOverridden;
    /**
     * @param {MomentoLocalProviderProps} props configuration options for connecting to momento-local
     */
    constructor(props?: MomentoLocalProviderProps);
    getAuthToken(): string;
    getCacheEndpoint(): string;
    isCacheEndpointSecure(): boolean;
    getControlEndpoint(): string;
    isControlEndpointSecure(): boolean;
    getTokenEndpoint(): string;
    isTokenEndpointSecure(): boolean;
    areEndpointsOverridden(): boolean;
    isEndpointSecure(): boolean;
    withMomentoLocal(): CredentialProvider;
}
export declare class ApiKeyV2TokenProvider extends CredentialProviderBase {
    private readonly apiKey;
    private readonly allEndpoints;
    /**
     * @param {ApiKeyV2TokenProviderProps} props configuration options for the token provider
     */
    constructor(props: ApiKeyV2TokenProviderProps);
    getAuthToken(): string;
    getCacheEndpoint(): string;
    isCacheEndpointSecure(): boolean;
    getControlEndpoint(): string;
    isControlEndpointSecure(): boolean;
    getTokenEndpoint(): string;
    isTokenEndpointSecure(): boolean;
    isStorageEndpointSecure(): boolean;
    areEndpointsOverridden(): boolean;
    isEndpointSecure(): boolean;
    withMomentoLocal(): CredentialProvider;
}
export declare class EnvMomentoV2TokenProvider extends ApiKeyV2TokenProvider {
    /**
     * @param {EnvMomentoV2TokenProviderProps} props configuration options for the token provider
     */
    constructor(props?: EnvMomentoV2TokenProviderProps);
}
export {};
