"use strict";
// Mock IndexedDB for testing
const mockIndexedDB = {
    open: jest.fn().mockReturnValue({
        onupgradeneeded: null,
        onsuccess: null,
        onerror: null,
        result: {
            createObjectStore: jest.fn(),
            transaction: jest.fn().mockReturnValue({
                objectStore: jest.fn().mockReturnValue({
                    add: jest.fn(),
                    get: jest.fn(),
                    put: jest.fn(),
                    delete: jest.fn(),
                    getAllKeys: jest.fn()
                })
            })
        }
    }),
    deleteDatabase: jest.fn()
};
// Mock browser globals
Object.defineProperty(window, 'indexedDB', {
    value: mockIndexedDB,
    writable: true
});
Object.defineProperty(global, 'indexedDB', {
    value: mockIndexedDB,
    writable: true
});
// Mock IntersectionObserver
global.IntersectionObserver = class IntersectionObserver {
    constructor() { }
    observe() { }
    unobserve() { }
    disconnect() { }
};
// Mock Canvas for text measurement
HTMLCanvasElement.prototype.getContext = jest.fn().mockReturnValue({
    measureText: jest.fn().mockReturnValue({ width: 100 }),
    font: ''
});
// Mock WebSocket for Y.js
global.WebSocket = jest.fn().mockImplementation(() => ({
    addEventListener: jest.fn(),
    removeEventListener: jest.fn(),
    send: jest.fn(),
    close: jest.fn(),
    readyState: 1
}));
//# sourceMappingURL=setup.js.map