import 'reflect-metadata'; import type { ChronicleClassDecorator } from '../types/standardDecoratorMetadata.js'; import type { ConcurrencyDimensionFlags } from './ConcurrencyDimensions.js'; /** Optional settings for {@link eventSource}. */ export interface EventSourceOptions { /** The stable name. Defaults to the class name without a trailing `EventSource`. */ name?: string; /** The description of the event source. */ description?: string; /** The default dimensions that take part in concurrency checks; combine {@link ConcurrencyDimensions} values with `|`. */ concurrency?: ConcurrencyDimensionFlags; } /** Optional settings for {@link eventStream}. */ export interface EventStreamOptions { /** The description of the stream. */ description?: string; /** The dimensions that take part in concurrency checks for the stream. Falls back to the event source when omitted or none. */ concurrency?: ConcurrencyDimensionFlags; } /** Metadata recorded by {@link eventSource}. */ export interface EventSourceMetadata { readonly name: string; readonly description: string; readonly concurrency: ConcurrencyDimensionFlags; } /** Metadata recorded by {@link eventStream}. */ export interface EventStreamMetadata { readonly name: string; readonly description: string; readonly concurrency: ConcurrencyDimensionFlags; } /** * Declares a class as an event source definition, discovered and registered with the Kernel at startup. * The definition is not tied to event types; an append routes through it with `AppendOptions.eventSource`. * Supports legacy and standard class decorators. * @param options - Optional name (defaults to the class name without a trailing `EventSource`), description and concurrency. * @returns A class decorator. */ export declare function eventSource(options?: EventSourceOptions): ChronicleClassDecorator; /** * Declares a stream of an event source. Repeat the decorator for several streams. * Only takes effect on a class that is also decorated with {@link eventSource}. * @param name - The stable name of the stream, which is the event stream type of appended events. * @param options - Optional description and concurrency dimensions. * @returns A class decorator. */ export declare function eventStream(name: string, options?: EventStreamOptions): ChronicleClassDecorator; /** * Gets the event source metadata declared on a class. * @param target - The class constructor. * @returns The metadata, or undefined when the class is not an event source. */ export declare function getEventSourceMetadata(target: Function): EventSourceMetadata | undefined; /** * Gets the streams declared on a class, in declaration order (duplicates are preserved so they can be rejected). * @param target - The class constructor. * @returns The declared streams. */ export declare function getEventStreamsFor(target: Function): ReadonlyArray; //# sourceMappingURL=eventSource.d.ts.map