"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.workerApi = workerApi;
const APINotImplementedError_1 = require("../../../exception/APINotImplementedError");
const DisplayMediaAPINotSupported_1 = require("../../../exception/DisplayMediaAPINotSupported");
const MediaDeviceAPINotSupported_1 = require("../../../exception/MediaDeviceAPINotSupported");
const MethodNotImplementedError_1 = require("../../../exception/MethodNotImplementedError");
function workerApi() {
    const api = {
        selection: {
            containsSelection: () => {
                throw new APINotImplementedError_1.APINotSupportedError('Selection');
            },
            removeSelection: () => {
                throw new APINotImplementedError_1.APINotSupportedError('Selection');
            },
        },
        file: {
            isSaveFilePickerSupported: () => false,
            isOpenFilePickerSupported: () => false,
            showOpenFilePicker: () => {
                throw new APINotImplementedError_1.APINotSupportedError('File System');
            },
            showSaveFilePicker: () => {
                throw new APINotImplementedError_1.APINotSupportedError('File System');
            },
            fallbackShowOpenFilePicker: () => {
                throw new APINotImplementedError_1.APINotSupportedError('File System');
            },
            downloadText: (opt) => {
                throw new APINotImplementedError_1.APINotSupportedError('Download');
            },
            downloadURL: (opt) => {
                throw new APINotImplementedError_1.APINotSupportedError('Download');
            },
            FileReader: undefined,
        },
        animation: {
            requestAnimationFrame: () => {
                throw new APINotImplementedError_1.APINotSupportedError('Animation Frame');
            },
            cancelAnimationFrame: () => {
                throw new APINotImplementedError_1.APINotSupportedError('Animation Frame');
            },
        },
        device: {
            vibrate: () => {
                throw new APINotImplementedError_1.APINotSupportedError('Vibrate');
            },
        },
        geolocation: {
            getCurrentPosition: () => {
                throw new APINotImplementedError_1.APINotSupportedError('Geolocation');
            },
        },
        input: {
            keyboard: {},
            gamepad: {
                getGamepad: () => {
                    throw new APINotImplementedError_1.APINotSupportedError('Gamepad');
                },
                addEventListener: (type, listener, options) => {
                    throw new APINotImplementedError_1.APINotSupportedError('Gamepad');
                },
            },
            pointer: {
                getPointerPosition(pointerId) {
                    throw new APINotImplementedError_1.APINotSupportedError('Pointer');
                },
                setPointerCapture(element, pointerId) {
                    throw new APINotImplementedError_1.APINotSupportedError('Pointer Capture');
                },
            },
        },
        media: {
            getUserMedia: () => {
                throw new MediaDeviceAPINotSupported_1.MediaDevicesAPINotSupported();
            },
            getDisplayMedia: () => {
                throw new DisplayMediaAPINotSupported_1.DisplayMediaAPINotSupported();
            },
            enumerateDevices: () => {
                throw new APINotImplementedError_1.APINotSupportedError('Enumerate Media Devices');
            },
            image: {
                createImageBitmap: () => {
                    throw new APINotImplementedError_1.APINotSupportedError('Image Bitmap');
                },
            },
        },
        screen: {
            wakeLock: {
                request: () => {
                    throw new APINotImplementedError_1.APINotSupportedError('Screen Wake Lock');
                },
            },
        },
        bluetooth: {
            requestDevice: () => {
                throw new APINotImplementedError_1.APINotSupportedError('Bluetooth');
            },
        },
        clipboard: {
            read: () => {
                throw new APINotImplementedError_1.APINotSupportedError('Clipboard');
            },
            readText: () => {
                throw new APINotImplementedError_1.APINotSupportedError('Clipboard');
            },
            writeText: () => {
                throw new APINotImplementedError_1.APINotSupportedError('Clipboard');
            },
        },
        http: {
            fetch: () => {
                throw new APINotImplementedError_1.APINotSupportedError('Fetch');
            },
            EventSource: undefined,
            listen: function (port, handler) {
                throw new APINotImplementedError_1.APINotSupportedError('HTTP Server');
            },
        },
        channel: {
            local: function (opt) {
                throw new APINotImplementedError_1.APINotSupportedError('Local Channel');
            },
        },
        speech: {
            SpeechGrammarList: undefined,
            SpeechRecognition: undefined,
            SpeechSynthesis: undefined,
            SpeechSynthesisUtterance: undefined,
        },
        document: {
            createElement(tagName, options) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            createElementNS(namespaceURI, qualifiedName) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            createTextNode(text) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            elementFromPoint(x, y) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            elementsFromPoint(x, y) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            getSelection() {
                // @ts-ignore
                return root.shadowRoot.getSelection() || document.getSelection();
            },
            createRange() {
                return document.createRange();
            },
            exitPictureInPicture() {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            MutationObserver: null,
            PositionObserver: null,
            ResizeObserver: null,
            IntersectionObserver: null,
            pictureInPictureElement: undefined,
        },
        querystring: {
            stringify: function (obj) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            parse: function (str) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
        },
        text: {
            measureText: (text) => {
                throw new APINotImplementedError_1.APINotSupportedError('Measure Text');
            },
            TextEncoder: undefined,
            TextDecoder: undefined,
        },
        worker: {
            start: () => {
                throw new APINotImplementedError_1.APINotSupportedError('Worker');
            },
        },
        db: undefined,
        url: {
            createObjectURL: function (object) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
        },
        uri: {
            encodeURI: function (str) {
                throw new APINotImplementedError_1.APINotSupportedError('URI');
            },
        },
        alert: {
            alert: function (message) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            prompt: function (message) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
        },
        location: {
            toString: function () {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
        },
        window: {
            HTMLElement: undefined,
            SVGElement: undefined,
            SVGSVGElement: undefined,
            Text: undefined,
            localStorage: globalThis.localStorage,
            sessionStorage: globalThis.sessionStorage,
            AudioContext: globalThis.AudioContext,
            OscillatorNode: globalThis.OscillatorNode,
            MediaStreamAudioSourceNode: globalThis.MediaStreamAudioSourceNode,
            AnalyserNode: globalThis.AnalyserNode,
            GainNode: globalThis.GainNode,
            DelayNode: globalThis.DelayNode,
            ImageCapture: globalThis.ImageCapture,
            CompressionStream: globalThis.CompressionStream,
            DecompressionStream: globalThis.DecompressionStream,
            ReadableStream: globalThis.ReadableStream,
            Notification: globalThis.Notification,
            Image: globalThis.Image,
            Audio: globalThis.Audio,
            OffscreenCanvas: globalThis.OffscreenCanvas,
            open: function (url, target, features) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            getComputedStyle: function (element) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            setTimeout: function (callback, ms) {
                return globalThis.setTimeout(callback, ms);
            },
            setInterval: function (callback, ms) {
                return globalThis.setInterval(callback, ms);
            },
            clearTimeout: function (timer) {
                return globalThis.clearTimeout(timer);
            },
            clearInterval: function (timer) {
                return globalThis.clearInterval(timer);
            },
            nextTick: function (callback) {
                return setTimeout(callback, 0);
            },
        },
        navigator: {
            share: function (data) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
        },
        layout: {
            reflectChildrenTrait: function (parentTrait, parentStyle, children, path, expandChild) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
        },
        history: {
            pushState: function (data, title, url) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            replaceState: function (data, title, url) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
        },
        theme: {
            setTheme: function (theme) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
        },
        crypto: {
            generateKey: function (algorithm, extractable, keyUsages) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            exportKey: function (format, key) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            importKey: function (format, keyData, algorithm, extractable, keyUsages) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            encrypt: function (algorithm, key, data) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            decrypt: function (algorithm, key, data) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            sign: function (algorithm, key, data) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
            verify: function (algorithm, key, signature, data) {
                throw new MethodNotImplementedError_1.MethodNotImplementedError();
            },
        },
    };
    return api;
}
//# sourceMappingURL=boot.js.map