UNPKG

@solidgrounds/core

Version:
20 lines (19 loc) 842 B
import { SF, USF } from '../Value'; import { ServiceFactoryInfo } from './BuildInfo'; /** * The service glue of the solidgrounds. */ export interface ServiceFactoryReference<S = unknown> extends SF<S> { info: ServiceFactoryInfo<S>; } export declare type SFR<S = unknown> = ServiceFactoryReference<S>; export declare type ServiceFactoryReferences<Services = unknown> = { [K in keyof Services]: SFR<Services[K]>; }; export declare function isServiceFactoryReference<S>(sf: () => S): sf is ServiceFactoryReference<S>; export interface GetServiceFactory<T> { <S>(sf: SF<S>): SFR<S>; <K extends keyof T>(name: K): SFR<T[K]>; } export declare const getServiceFactories: <T>(getService: GetServiceFactory<T>, tags: (USF | keyof T)[]) => SFR<T[keyof T]>[]; export declare const getServiceInstances: (factories: USF[]) => unknown[];