honestjs
Version:
HonestJS - a modern web framework built on top of Hono
11 lines (10 loc) • 627 B
TypeScript
import type { ComponentType, ComponentTypeMap } from '../registries';
import type { Constructor } from '../types';
/**
* Generic decorator that applies components of a specific type to a controller class or method
* @template T - The type of component being applied
* @param type - The component type identifier
* @param components - Array of components to apply
* @returns A decorator function that can be used at class or method level
*/
export declare function UseComponent<T extends ComponentType>(type: T, ...components: ComponentTypeMap[T][]): (target: Constructor | object, propertyKey?: string | symbol) => void;