import { Scope, InjectableMetadata } from "./types.js"; import { MaybeForwardRef } from "./tokens.js"; export type ClassDecorator = (target: TFunction) => TFunction | void; export type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; export type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; export type ParameterDecorator = (target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) => void; /** * Class decorator to mark a class as injectable * @param opts Configuration options for the injectable class */ export declare function Injectable(opts?: InjectableMetadata): ClassDecorator; /** * Parameter or property decorator to inject a specific token * @param token The token to inject * * Usage: * constructor(@Inject(Logger) private logger: Logger) { ... } * @Inject(Logger) logger: Logger; */ export declare function Inject(token: MaybeForwardRef): ParameterDecorator & PropertyDecorator; export declare function InjectParam(token: MaybeForwardRef): ParameterDecorator; export declare function InjectProp(token: MaybeForwardRef): PropertyDecorator; /** * Marks a parameter or property as optional (no error if missing) */ export declare function Optional(): ParameterDecorator & PropertyDecorator; /** * Resolve only from the current container (no parent lookup) */ export declare function Self(): ParameterDecorator; /** * Skip current container and start lookup from parent */ export declare function SkipSelf(): ParameterDecorator; /** * Mark dependency as lazy (resolve only when accessed) */ export declare function Lazy(): ParameterDecorator & PropertyDecorator; /** * Mark dependency as multiple (resolve all providers for token) */ export declare function Multiple(): ParameterDecorator & PropertyDecorator; /** * Transform the injected value * @param transform Function to transform the injected value */ export declare function Transform(transform: (value: any) => any): ParameterDecorator & PropertyDecorator; /** * Convenience class decorator to set scope (alternative to Injectable({scope})) * @param scope The scope for the injectable class */ export declare function Scoped(scope: Scope): ClassDecorator; /** * Mark class as singleton scope */ export declare function Singleton(): ClassDecorator; /** * Mark class as transient scope */ export declare function Transient(): ClassDecorator; /** * Mark class as request scope */ export declare function RequestScoped(): ClassDecorator; /** * Mark class as session scope */ export declare function SessionScoped(): ClassDecorator; /** * Set priority for the injectable class * @param priority Priority value (higher = higher priority) */ export declare function Priority(priority: number): ClassDecorator; /** * Set condition for conditional registration * @param condition Function that returns true if the provider should be registered */ export declare function Conditional(condition: (container: any) => boolean): ClassDecorator; /** * Mark class as auto-registerable (default: true) * @param autoRegister Whether to auto-register this class */ export declare function AutoRegister(autoRegister?: boolean): ClassDecorator; /** * Mark class as a module * @param metadata Module metadata */ export declare function Module(metadata?: any): ClassDecorator; /** * Mark class as a controller */ export declare function Controller(): ClassDecorator; /** * Add validation to the injectable class * @param validator Validation function */ export declare function Validate(validator: (instance: any) => boolean | string): ClassDecorator; /** * Add lifecycle hook to the injectable class * @param hook Hook name * @param handler Hook handler function */ export declare function Hook(hook: string, handler: (instance: any) => void | Promise): ClassDecorator; /** * Mark property as injected with automatic token resolution */ export declare function AutoInject(): PropertyDecorator; /** * Inject configuration value * @param key Configuration key * @param defaultValue Default value if not found */ export declare function Config(key: string, defaultValue?: any): ParameterDecorator & PropertyDecorator; /** * Inject environment variable * @param key Environment variable key * @param defaultValue Default value if not found */ export declare function Env(key: string, defaultValue?: any): ParameterDecorator & PropertyDecorator; //# sourceMappingURL=decorators.d.ts.map