import type { Lifetime, guid } from "../models/index.js"; import { type InjectableFunction } from "./injectable.js"; export declare class SubscriptionHandler { private unsubs; add(unsub: () => void): void; unsubscribe(): void; } export interface SetupFactoryContext { onDeactivated(fn: () => void): void; subscriptions: SubscriptionHandler; overrideDispose(onDispose: (fn: () => void) => void): void; } /** * A parameterized factory use-function: callable with the setup's params and * carrying the provide metadata so it works with defineProvide/app.defineProvide. */ export type FactoryFunction = ((...args: TArgs) => TInstance) & { _factory: () => TInstance; _token: symbol; }; export declare function defineFactory(setup: (ctx: SetupFactoryContext, ...args: unknown[]) => InferReturnSetup, lifetime: Lifetime, typeIdentifier?: guid): InjectableFunction void; }>; export declare function defineFactory(setup: (ctx: SetupFactoryContext, param1: T1) => InferReturnSetup, lifetime: Lifetime, typeIdentifier?: guid): FactoryFunction<[T1], InferReturnSetup & { dispose: () => void; }>; export declare function defineFactory(setup: (ctx: SetupFactoryContext, param1: T1, param2: T2) => InferReturnSetup, lifetime: Lifetime, typeIdentifier?: guid): FactoryFunction<[T1, T2], InferReturnSetup & { dispose: () => void; }>; export declare function defineFactory(setup: (ctx: SetupFactoryContext, param1: T1, param2: T2, param3: T3) => InferReturnSetup, lifetime: Lifetime, typeIdentifier?: guid): FactoryFunction<[T1, T2, T3], InferReturnSetup & { dispose: () => void; }>; export declare function defineFactory(setup: (ctx: SetupFactoryContext, param1: T1, param2: T2, param3: T3, param4: T4) => InferReturnSetup, lifetime: Lifetime, typeIdentifier?: guid): FactoryFunction<[T1, T2, T3, T4], InferReturnSetup & { dispose: () => void; }>; export declare function defineFactory(setup: (ctx: SetupFactoryContext, param1: T1, param2: T2, param3: T3, param4: T4, param5: T5) => InferReturnSetup, lifetime: Lifetime, typeIdentifier?: guid): FactoryFunction<[T1, T2, T3, T4, T5], InferReturnSetup & { dispose: () => void; }>; //# sourceMappingURL=factory.d.ts.map