UNPKG

servido

Version:

Versatile services for React ⚗️

14 lines (13 loc) 798 B
import { Service, ServiceQuery } from "./service"; import { ServiceDependent } from "./service-dependent"; export declare class ServiceAgent extends ServiceDependent { constructor(dependent: ServiceDependent); /** Require a service using `this` as the dependent. */ require<S extends Service, QA extends any[]>(service: ServiceQuery<S, [], QA>): S; require<S extends Service, A extends any[], QA extends any[]>(service: ServiceQuery<S, A, QA>, ...arguments_: A): S; /** Forgo service that has previously been required using the `require` method. */ forgo<S extends Service>(service: S): any; static use(): ServiceAgent; protected toString(): string; } export declare function useAgent(dependent?: ServiceDependent, deps?: readonly any[]): ServiceAgent;