/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
import { Host, h } from "@stencil/core";
import { focusElements } from "../../utils/focus-visible";
import { config } from "../../global/config";
import { getIonTheme } from "../../global/ionic-global";
/**
 * @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
 * @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
 */
export class App {
    /**
     * Used to set focus on an element that uses `ion-focusable`.
     * Do not use this if focusing the element as a result of a keyboard
     * event as the focus utility should handle this for us. This method
     * should be used when we want to programmatically focus an element as
     * a result of another user action. (Ex: We focus the first element
     * inside of a popover when the user presents it, but the popover is not always
     * presented as a result of keyboard action.)
     *
     * @param elements An array of HTML elements to set focus on.
     */
    async setFocus(elements) {
        /**
         * The focus-visible utility is used to set focus on an
         * element that uses `ion-focusable`.
         */
        focusElements(elements);
    }
    render() {
        const theme = getIonTheme(this);
        return (h(Host, { key: '3b7e84c7c4187287123413f90838cda89136b2a4', class: {
                [theme]: true,
                'ion-page': true,
                'force-statusbar-padding': config.getBoolean('_forceStatusbarPadding'),
            } }));
    }
    static get is() { return "ion-app"; }
    static get originalStyleUrls() {
        return {
            "$": ["app.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["app.css"]
        };
    }
    static get methods() {
        return {
            "setFocus": {
                "complexType": {
                    "signature": "(elements: HTMLElement[]) => Promise<void>",
                    "parameters": [{
                            "name": "elements",
                            "type": "HTMLElement[]",
                            "docs": "An array of HTML elements to set focus on."
                        }],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        },
                        "HTMLElement": {
                            "location": "global",
                            "id": "global::HTMLElement"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "Used to set focus on an element that uses `ion-focusable`.\nDo not use this if focusing the element as a result of a keyboard\nevent as the focus utility should handle this for us. This method\nshould be used when we want to programmatically focus an element as\na result of another user action. (Ex: We focus the first element\ninside of a popover when the user presents it, but the popover is not always\npresented as a result of keyboard action.)",
                    "tags": [{
                            "name": "param",
                            "text": "elements An array of HTML elements to set focus on."
                        }]
                }
            }
        };
    }
    static get elementRef() { return "el"; }
}
