import * as Context from "effect/Context"; export const GenericService = < Fn extends (T: { Type: string }) => Context.Service = ( ...args: any[] ) => Context.Service, >() => (Kind: Kind): ReturnType & Fn => { // Tag key is a runtime `Kind`, so it can't be a class declaration. // oxlint-disable-next-line effecttsgo/service-not-as-class const service = Context.Service(Kind); const make = (Type: string) => Context.Service(`${Kind}<${Type}>`); return Object.assign(Object.setPrototypeOf(make, service), service) as ReturnType & Fn; };