import { type GetterOrValue } from '../getter/getter'; /** * Registry used to load model services when requested. */ export interface TypedServiceRegistry { /** * Returns the service for the type. If a service is not registered, will throw an exception. * * @param type */ serviceForType(type: T): S; } /** * TypedServiceRegistry implementation. */ export declare class TypedServiceRegistryInstance implements TypedServiceRegistry { private _map; /** * Registers a service (or getter) for the given type key. * * @param type - The type key to register the service under. * @param service - The service instance or a getter function that returns it. */ registerServiceForType(type: T, service: GetterOrValue): void; /** * Returns the service registered for the given type. Throws if no service is registered. * * @param type - The type key to look up. * @returns The registered service instance. * @throws Error if no service is registered for the given type. */ serviceForType(type: T): S; } /** * Configuration for initializing a {@link TypedServiceRegistryInstance} with a set of services. */ export interface TypedServiceRegistrySetupConfig { /** * A record mapping type keys to their service instances. */ services: { [K in T]: S; }; } /** * Creates a new {@link TypedServiceRegistryInstance} and registers all services from the provided config. * * @param config - Configuration containing the services to register. * @returns A new TypedServiceRegistryInstance with all services registered. */ export declare function typedServiceRegistry(config: TypedServiceRegistrySetupConfig): TypedServiceRegistryInstance;