import { type Injector } from '@angular/core'; /** * Options for the `injectAttribute` function. */ export type InjectAttributeOptions = { /** * Custom injector to use for dependency injection. */ injector?: Injector; /** * Transform function to convert the string attribute value to the desired type. * This is useful for type coercion (e.g., string to number or boolean). */ transform?: (value: string) => T; }; /** * Injects the value of a host attribute with a default value if the attribute is not present. * This is a simplified wrapper around Angular's `HostAttributeToken` * * @template T - The type of the attribute value * @param {string} key - The name of the attribute to inject * @param {T} defaultValue - The default value to return if the attribute is not present * @param {InjectAttributeOptions} options - Optional configuration for the injector * @returns {T} The attribute value or the default value * * @example * ```ts * export class Button { * variation = injectAttribute<'primary' | 'secondary'>('variation', 'primary'); * } * ``` * * @example * */ export declare function injectAttribute(key: string, defaultValue: T, options?: InjectAttributeOptions): T; /** * Injects the value of a host attribute that must be present. * Throws an error if the attribute is not provided. * * @template T - The type of the attribute value * @param {string} key - The name of the attribute to inject * @param {InjectAttributeOptions} options - Optional configuration for the injector * @returns {T} The attribute value * @throws {Error} If the attribute is not present in the host element */ export declare namespace injectAttribute { function required(key: string, options?: InjectAttributeOptions): T; }