import { ServiceUpdate } from "./watch.mjs"; import { Operation, Stream, WithResolvers } from "effection"; //#region src/service-graph.d.ts /** * Context key for the Simulacrum gateway listening port. * * When `useServiceGraph` starts the optional simulacrum gateway (via the * `globalData` option) it sets this context value to the listening port so * operations in the graph (including `useSimulation`) can discover and fetch the `/data` payload. */ declare const SimulacrumEndpoint: import("effection").Context; type ServiceDefinition = { operation: Operation; watch?: string[]; watchDebounce?: number; dependsOn?: { startup: readonly S[]; restart?: readonly S[]; }; options?: {}; }; type ServiceMap = Record>; type ServiceGraph = { services: S; serviceUpdates: Stream | undefined; serviceChanges: Stream | undefined; status: Map; }; type ServiceGraphStatus = { cwd: string; services: Record; }; type ServiceInfo = { port?: number | undefined; pid?: number | undefined; }; type ServiceStatus = { startup: WithResolvers; running: WithResolvers; port?: number | undefined; pid?: number | undefined; }; type ServiceGraphRunOptions = { watch?: boolean; watchDebounce?: number; controlPort?: number | undefined; exclude?: string[] | undefined; requestStop?: (() => void) | undefined; requestRestart?: ((service?: string) => void) | undefined; }; type ServiceGraphRunner = (subset?: Array, runOptions?: ServiceGraphRunOptions) => Operation>; type ServiceGraphFor> = R extends ServiceGraphRunner ? ServiceGraph : never; /** * Start a graph of services with dependency ordering and optional file * watching/restart behavior. * * Each service is defined as a `ServiceDefinition` that includes an * `operation: Operation` which should return once the service is ready. The * returned runner function yields the graph resource directly for Effection * callers. * * @param services - a map of service names to definitions * @param options - optional configuration: `{ globalData?, watch?, watchDebounce? }` * @returns a runner function returning the graph operation */ declare function useServiceGraph(services: S, options?: { globalData?: Record; watch?: boolean; watchDebounce?: number; controlPort?: number; }): ServiceGraphRunner; //#endregion export { ServiceDefinition, ServiceGraph, ServiceGraphFor, ServiceGraphRunOptions, ServiceGraphRunner, ServiceGraphStatus, ServiceInfo, ServiceStatus, SimulacrumEndpoint, useServiceGraph };