/** * API reference. * * @public */ export type ApiRef = { id: string; T: T; }; /** * Catch-all {@link ApiRef} type. * * @public */ export type AnyApiRef = ApiRef; /** * Wraps a type with API properties into a type holding their respective {@link ApiRef}s. * * @public */ export type TypesToApiRefs = { [key in keyof T]: ApiRef; }; /** * Provides lookup of APIs through their {@link ApiRef}s. * * @public */ export type ApiHolder = { get(api: ApiRef): T | undefined; }; /** * Describes type returning API implementations. * * @public */ export type ApiFactory = { api: ApiRef; deps: TypesToApiRefs; factory(deps: Deps): Impl; }; /** * Catch-all {@link ApiFactory} type. * * @public */ export type AnyApiFactory = ApiFactory;