import "reflect-metadata";
import { INJECTABLE_METADATA_KEY } from "../constants";
import type { InjectableOptions } from "../interfaces/provider.interface";

/**
 * Decorator that marks a class as available to be provided and injected as a dependency.
 *
 * @param options Options for the injectable (e.g., scope)
 */
export function Injectable(options?: InjectableOptions): ClassDecorator {
	return (target: object) => {
		Reflect.defineMetadata(INJECTABLE_METADATA_KEY, options || {}, target);
	};
}
