//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// TypeScript helpers (universal micro-lib.) | Author: Sergei Y.Kitaev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Helpers for HTML element accessed by its identifier (static class):
class HById {
    static ElementOf(id, tagName = null) {
        let elem = document.getElementById(id);
        if (!elem)
            throw new Error('Element not found by id: "' + id + '".');
        let element = elem;
        if (!element || tagName && element.tagName != tagName)
            throw new Error('Element "' + id + '" is not of "' + HObject.TypeName(elem) + '"-type.');
        return element;
    }
    static GetElementOf(id, tagName = null) {
        return HElement.GetById(id, tagName);
    }
    static Exists(id, tagName = null) {
        let element = document.getElementById(id);
        return tagName ?
            element != null && element.tagName == tagName :
            element != null;
    }
    static InputElement(id, tagName = null) {
        return HById.ElementOf(id, tagName);
    }
    static GetInputElement(id, tagName = null) {
        return HById.GetElementOf(id, tagName);
    }
} // HById
//# sourceMappingURL=HById.js.map