react-obsidian
Version:
Dependency injection framework for React and React Native applications
45 lines • 1.97 kB
TypeScript
import { Constructable } from '../../types';
import { Graph } from '../Graph';
import { Middleware } from './Middleware';
export declare class GraphRegistry {
private readonly constructorToInstance;
private readonly instanceToConstructor;
private readonly injectionTokenToInstance;
private readonly instanceToInjectionToken;
private readonly nameToInstance;
private readonly graphToSubgraphs;
private readonly graphMiddlewares;
private readonly keyToGenerator;
private readonly keyToGraph;
private readonly onClearListeners;
register(constructor: Constructable<Graph>, subgraphs?: Constructable<Graph>[]): void;
registerGraphGenerator(key: string, generator: () => Constructable<Graph>): void;
ensureRegistered(keyOrGraph: string | Graph): void;
isInstantiated(G: Constructable<Graph>): boolean;
getSubgraphs(graph: Graph): Graph[];
getGraphInstance(name: string): Graph;
resolve<T extends Graph>(keyOrGraph: String | Constructable<T>, source?: 'lifecycleOwner' | 'classInjection' | 'serviceLocator', props?: any, injectionToken?: string): T;
private instantiateCustomScopedSubgraphs;
private assertInstantiatingCustomScopedSubgraphFromSameScope;
private getSubgraphsConstructors;
private getGraphConstructorByKey;
private has;
private getFirst;
private getByInjectionToken;
private set;
private isSingleton;
private isBoundToReactLifecycle;
private isComponentScopedLifecycleBound;
private isCustomScopedLifecycleBound;
clearGraphAfterItWasMockedInTests(graphName: string): void;
clear(graph: Graph): void;
private registerOnClearListener;
private invokeOnClearListeners;
private clearGraphsRegisteredByKey;
addGraphMiddleware(middleware: Middleware<Graph>): void;
clearGraphMiddlewares(): void;
clearAll(): void;
}
declare const _default: GraphRegistry;
export default _default;
//# sourceMappingURL=GraphRegistry.d.ts.map