async function resolveBackend(hint) {
    if (!hint) {
        return resolveBackend(['webgl']);
    }
    else {
        const hints = typeof hint === 'string' ? [hint] : hint;
        for (const backendHint of hints) {
            const cache = backendsCache.get(backendHint);
            if (cache) {
                return cache;
            }
            const backend = await tryLoadBackend(backendHint);
            if (backend) {
                return backend;
            }
        }
    }
    throw new Error('no available backend to use');
}
/**
 * Resolve a reference to the backend. If a hint is specified, the corresponding
 * backend will be used.
 */
Resolve a reference to the backend. If a hint is specified, the corresponding
backend will be used.
Resolve a reference to the backend . If a hint is specified the corresponding backend will be used .
async function resolveBackend(hint) {
    if (!hint) {
        return resolveBackend(['webgl']);
    }
    else {
        const hints = typeof hint === 'string' ? [hint] : hint;
        for (const backendHint of hints) {
            const cache = backendsCache.get(backendHint);
            if (cache) {
                return cache;
            }
            const backend = await tryLoadBackend(backendHint);
            if (backend) {
                return backend;
            }
        }
    }
    throw new Error('no available backend to use');
}
async function resolveBackend ( hint ) { if ( ! hint ) { return resolveBackend ( [ 'webgl' ] ) ; } else { const hints = typeof hint === 'string' ? [ hint ] : hint ; for ( const backendHint of hints ) { const cache = backendsCache . get ( backendHint ) ; if ( cache ) { return cache ; } const backend = await tryLoadBackend ( backendHint ) ; if ( backend ) { return backend ; } } } throw new Error ( 'no available backend to use' ) ; }
Resolve a reference to the backend.
Resolve a reference to the backend .