UNPKG

kotlineum

Version:

React implementation of Kotlin patterns and features, including Flow patterns (SharedFlow and StateFlow) and MVVM architecture with ViewModels

22 lines (21 loc) 835 B
/// <reference types="react" /> import { DIContainer } from './Container'; /** * React hook for using a dependency from the DI container * @param token The token of the dependency to use * @returns The dependency */ export declare function useDependency<T>(token: string): T; /** * React hook for providing a dependency to the DI container * @param token The token to register the dependency under * @param factory Factory function that creates the dependency * @param deps Dependencies array for the factory function * @returns The created dependency */ export declare function useProvider<T>(token: string, factory: () => T, deps?: React.DependencyList): T; /** * React hook for accessing the DI container * @returns The DI container instance */ export declare function useContainer(): DIContainer;