async function tryGetAccessToken() {
        if (Date.now() < refreshTimeout) {
            try {
                return await getAccessToken();
            }
            catch (_a) {
                return null;
            }
        }
        else {
            const finalToken = await getAccessToken();
            // Timeout is up, so throw if it's still null
            if (finalToken === null) {
                throw new Error("Failed to refresh access token.");
            }
            return finalToken;
        }
    }
Creates a token cycler from a credential, scopes, and optional settings.

A token cycler represents a way to reliably retrieve a valid access token
from a TokenCredential. It will handle initializing the token, refreshing it
when it nears expiration, and synchronizes refresh attempts to avoid
concurrency hazards.

@param credential - the underlying TokenCredential that provides the access
token
@param tokenCyclerOptions - optionally override default settings for the cycler

@returns - a function that reliably produces a valid access token