import { AbortSignalLike } from '@azure/abort-controller';

/**
 * Represents an access token with an expiration time.
 */
export declare interface AccessToken {
    /**
     * The access token returned by the authentication service.
     */
    token: string;
    /**
     * The access token's expiration timestamp in milliseconds, UNIX epoch time.
     */
    expiresOnTimestamp: number;
}

/**
 * A static-key-based credential that supports updating
 * the underlying key value.
 */
export declare class AzureKeyCredential implements KeyCredential {
    private _key;
    /**
     * The value of the key to be used in authentication
     */
    get key(): string;
    /**
     * Create an instance of an AzureKeyCredential for use
     * with a service client.
     *
     * @param key - The initial value of the key to use in authentication
     */
    constructor(key: string);
    /**
     * Change the value of the key.
     *
     * Updates will take effect upon the next request after
     * updating the key value.
     *
     * @param newKey - The new key value to be used
     */
    update(newKey: string): void;
}

/**
 * A static-signature-based credential that supports updating
 * the underlying signature value.
 */
export declare class AzureSASCredential implements SASCredential {
    private _signature;
    /**
     * The value of the shared access signature to be used in authentication
     */
    get signature(): string;
    /**
     * Create an instance of an AzureSASCredential for use
     * with a service client.
     *
     * @param signature - The initial value of the shared access signature to use in authentication
     */
    constructor(signature: string);
    /**
     * Change the value of the signature.
     *
     * Updates will take effect upon the next request after
     * updating the signature value.
     *
     * @param newSignature - The new shared access signature value to be used
     */
    update(newSignature: string): void;
}

/**
 * Defines options for TokenCredential.getToken.
 */
export declare interface GetTokenOptions {
    /**
     * The signal which can be used to abort requests.
     */
    abortSignal?: AbortSignalLike;
    /**
     * Options used when creating and sending HTTP requests for this operation.
     */
    requestOptions?: {
        /**
         * The number of milliseconds a request can take before automatically being terminated.
         */
        timeout?: number;
    };
    /**
     * Options used when tracing is enabled.
     */
    tracingOptions?: {
        /**
         * OpenTelemetry SpanOptions used to create a span when tracing is enabled.
         */
        spanOptions?: SpanOptions;
    };
}

/**
 * Tests an object to determine whether it implements TokenCredential.
 *
 * @param credential - The assumed TokenCredential to be tested.
 */
export declare function isTokenCredential(credential: unknown): credential is TokenCredential;

/**
 * Represents a credential defined by a static API key.
 */
export declare interface KeyCredential {
    /**
     * The value of the API key represented as a string
     */
    readonly key: string;
}

/**
 * Represents a credential defined by a static shared access signature.
 */
export declare interface SASCredential {
    /**
     * The value of the shared access signature represented as a string
     */
    readonly signature: string;
}

/**
 * A light interface that tries to be structurally compatible with OpenTelemetry.
 */
export declare interface SpanContext {
    /**
     * UUID of a trace.
     */
    traceId: string;
    /**
     * UUID of a Span.
     */
    spanId: string;
    /**
     * https://www.w3.org/TR/trace-context/#trace-flags
     */
    traceFlags: number;
}

/**
 * An interface that enables manual propagation of Spans.
 */
export declare interface SpanOptions {
    /**
     * The SpanContext that refers to a parent span, if any.
     * A null value indicates that this should be a new root span,
     * rather than potentially detecting a span via a context manager.
     */
    parent?: SpanContext | null;
    /**
     * Attributes to set on the Span
     */
    attributes?: {
        [key: string]: unknown;
    };
}

/**
 * Represents a credential capable of providing an authentication token.
 */
export declare interface TokenCredential {
    /**
     * Gets the token provided by this credential.
     *
     * This method is called automatically by Azure SDK client libraries. You may call this method
     * directly, but you must also handle token caching and token refreshing.
     *
     * @param scopes - The list of scopes for which the token will have access.
     * @param options - The options used to configure any requests this
     *                TokenCredential implementation might make.
     */
    getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;
}

export { }
