import { Federation } from "@fedify/fedify/federation"; //#region src/index.d.ts /** * A factory function to create context data for the {@link Federation} object. * * @template TContextData A type of the context data for the {@link Federation} * object. * @template TKoaContext A type of the Koa context. * @param context A Koa context object. * @returns A context data for the {@link Federation} object. * @since 1.9.0 */ type ContextDataFactory = (context: TKoaContext) => TContextData | Promise; /** * Create a Koa middleware to integrate with the {@link Federation} object. * * @template TContextData A type of the context data for the {@link Federation} * object. * @template TKoaContext A type of the Koa context. * @param federation A {@link Federation} object to integrate with Koa. * @param contextDataFactory A function to create a context data for the * {@link Federation} object. * @returns A Koa middleware. * @since 1.9.0 */ declare function createMiddleware(federation: Federation, contextDataFactory: ContextDataFactory): (ctx: TKoaContext, next: () => Promise) => Promise; //#endregion export { ContextDataFactory, createMiddleware };