import { type Lifecycle } from '../lib/autogen/types.ts'; import type { ParamsObj, Reducer } from '../lib/reducers.ts'; import { type UntypedSchemaDef } from '../lib/schema.ts'; import type { OutboxMetadata, ScheduleTableForParams, UntypedTableSchema } from '../lib/table_schema.ts'; import { RowBuilder, type RowObj } from '../lib/type_builders.ts'; import { type ModuleExport, type SchemaInner } from './schema.ts'; export interface ReducerExport extends Reducer, ModuleExport { } export interface ReducerOpts { name: string; onSchedule?: ScheduleTableForParams; onResult?: UntypedTableSchema & { readonly outbox: OutboxMetadata; }; } export type ReducerOptsWithOptionalName = Omit, 'name'> & { name?: string; }; export declare function makeReducerExport(ctx: SchemaInner, opts: ReducerOptsWithOptionalName | undefined, params: RowObj | RowBuilder, fn: Reducer, lifecycle?: Lifecycle): ReducerExport; /** * internal: pushReducer() helper used by reducer() and lifecycle wrappers * * @param name - The name of the reducer. * @param params - The parameters for the reducer. * @param fn - The reducer function. * @param lifecycle - Optional lifecycle hooks for the reducer. */ export declare function registerReducer(ctx: SchemaInner, exportName: string, params: RowObj | RowBuilder, fn: Reducer, opts?: ReducerOptsWithOptionalName, lifecycle?: Lifecycle): void; export type Reducers = Reducer[]; //# sourceMappingURL=reducers.d.ts.map