import 'reflect-metadata'; import type { PageDelivery } from '@cratis/chronicle.contracts'; /** The bounds an observer declares for the pages the kernel delivers to it. */ export interface BatchSizeOptions { /** The most events in one page. The kernel's own maximum caps it. Defaults to the kernel's default. */ readonly maxEvents?: number; /** The most bytes in one page. The kernel's own maximum caps it. Defaults to the kernel's default. */ readonly maxBytes?: number; /** How long, in milliseconds, the kernel may wait to fill a live page. Defaults to no delay. */ readonly maxDelayMilliseconds?: number; /** * How many event sources of one page a reducer reduces at the same time. Defaults to the number of processors; * `1` reduces them one after another. Reactors call their methods for a page in order and ignore it. */ readonly maxConcurrency?: number; } /** * Declares the bounds of the pages a reactor or reducer receives, the TypeScript equivalent of the C# `[BatchSize]` attribute. * @param options - The {@link BatchSizeOptions}. * @returns A class decorator for legacy and standard TypeScript decorators. */ export declare function batchSize(options: BatchSizeOptions): ClassDecorator & ((value: Function, context: ClassDecoratorContext) => void); /** * Gets the {@link BatchSizeOptions} declared on an observer class. * @param target - The observer class. * @returns The declared options, or an empty object when none are declared. */ export declare function getBatchSize(target: Function): BatchSizeOptions; /** * Gets how many event sources of one page a reducer reduces at the same time. * @param target - The reducer class. * @returns The declared concurrency, or the number of processors. */ export declare function getMaxConcurrency(target: Function): number; /** * Creates the page delivery the client opts in to at registration. A kernel that does not know page delivery ignores it * and keeps delivering one partition at a time. * @param target - The observer class. * @returns The {@link PageDelivery} for the registration. */ export declare function toPageDelivery(target: Function): PageDelivery; //# sourceMappingURL=batchSize.d.ts.map