Standardize file naming and improve typings export

Renamed functions files to follow consistent camelCase convention. Added a missing type export for ITSInjex interface in the main index file, enabling better TypeScript type support and ensuring interfaces are available for external modules.
This commit is contained in:
2024-08-14 21:39:59 +02:00
parent c1a4dc7bd0
commit 3c308635dd
3 changed files with 1 additions and 2 deletions

35
src/functions/register.ts Normal file
View File

@@ -0,0 +1,35 @@
import { TSInjex } from 'src/TSInjex';
/**
* Register a dependency.
* @param identifier The identifier of the dependency.
* @param dependency The dependency to register.
*/
export function register<T>(identifier: string, dependency: T): void;
/**
* Register a dependency.
* @param identifier The identifier of the dependency.
* @param dependency The dependency to register.
* @param deprecated A warning is logged when the dependency is resolved.
*/
export function register<T>(
identifier: string,
dependency: T,
deprecated?: true,
): void;
/**
* Register a dependency.
* @param identifier The identifier of the dependency.
* @param dependency The dependency to register.
* @param deprecated If true, the dependency is deprecated => a warning
* is logged when the dependency is resolved.
*/
export function register<T>(
identifier: string,
dependency: T,
deprecated?: boolean,
): void {
TSInjex.getInstance().register(identifier, dependency, deprecated);
}