import { alert } from '../../../base/browser/ui/aria/aria.js';
const AccessibleViewRegistry = new class AccessibleViewRegistry {
    constructor() {
        this._implementations = [];
    }
    register(implementation) {
        this._implementations.push(implementation);
        return {
            dispose: () => {
                const idx = this._implementations.indexOf(implementation);
                if (idx !== -1) {
                    this._implementations.splice(idx, 1);
                }
                implementation.dispose();
            }
        };
    }
    getImplementations() {
        return this._implementations;
    }
};
function alertAccessibleViewFocusChange(index, length, type) {
    if (index === undefined || length === undefined) {
        return;
    }
    const number = index + 1;
    if (type === 'next' && number + 1 <= length) {
        alert(`Focused ${number + 1} of ${length}`);
    }
    else if (type === 'previous' && number - 1 > 0) {
        alert(`Focused ${number - 1} of ${length}`);
    }
    return;
}
export { AccessibleViewRegistry, alertAccessibleViewFocusChange };
