UNPKG

@wizecorp/stratusjs

Version:
32 lines 1.08 kB
import React from 'react'; import { ServiceContainer } from './ServiceContainer'; import type { Service, ServiceConstructor } from './types'; interface ServiceProviderProps { children: React.ReactNode; container?: ServiceContainer; services?: Array<{ token: string | symbol | ServiceConstructor; service?: Service | (() => Service | Promise<Service>); options?: { singleton?: boolean; }; }>; } /** * Service provider component */ export declare const ServiceProvider: React.FC<ServiceProviderProps>; /** * Hook to get the service container */ export declare const useServiceContainer: () => import("./types").ServiceContainer; /** * Hook to get a specific service */ export declare const useService: <T extends Service>(token: string | symbol | ServiceConstructor<T>) => T; /** * Hook for optional service (doesn't throw if not found) */ export declare const useOptionalService: <T extends Service>(token: string | symbol | ServiceConstructor<T>) => T | null; export {}; //# sourceMappingURL=ServiceContext.d.ts.map