UNPKG

tiny-essentials

Version:

Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.

54 lines 2.24 kB
export default TinyHtmlHiddenInput; /** * TinyHtmlHiddenInput is a helper class for managing * <input type="hidden"> elements. It provides validation * and structured getters/setters for common attributes. * * @example * const hidden = new TinyHtmlHiddenInput({ * name: 'csrf_token', * value: '12345', * required: true * }); * * @extends TinyHtmlInput */ declare class TinyHtmlHiddenInput extends TinyHtmlInput { /** * Creates a new TinyHtmlHiddenInput instance. * @param {Object} config - Configuration object. * @param {string|number} [config.value] - Initial value of the input. * @param {string} [config.name] - The name of the control. * @param {string} [config.autocomplete] - Autocomplete hint (e.g., "on", "off", "email"). * @param {string} [config.dirname] - Directionality field name (for text-based inputs). * @param {boolean} [config.readonly=false] - Whether the input is read-only. * @param {boolean} [config.required=false] - Whether the input is required. * @param {string|string[]|Set<string>} [config.tags=[]] - Initial CSS classes. * @param {string} [config.mainClass=''] - Main CSS class. * @throws {TypeError} If any attribute is of the wrong type. */ constructor({ name, value, dirname, autocomplete, readonly, required, tags, mainClass, }?: { value?: string | number | undefined; name?: string | undefined; autocomplete?: string | undefined; dirname?: string | undefined; readonly?: boolean | undefined; required?: boolean | undefined; tags?: string | string[] | Set<string> | undefined; mainClass?: string | undefined; }); /** @param {string|number} value */ set value(value: string | number); /** @returns {string|null} */ get value(): string | null; /** @param {string} autocomplete */ set autocomplete(autocomplete: string); /** @returns {string|null} */ get autocomplete(): string | null; /** @param {string} dirname */ set dirname(dirname: string); /** @returns {string|null} */ get dirname(): string | null; } import TinyHtmlInput from '../TinyHtmlInput.mjs'; //# sourceMappingURL=TinyHtmlHiddenInput.d.mts.map