import { type ActivationRef, type EntryOptions, type MessageToken, type Participant } from '@pkishorez/flow'; import { Effect } from 'effect'; import { type PartitionValue } from '../../domain/identity/index.js'; export type ActivationOutcome = Parameters[0]; export type FlowEntryOptions = EntryOptions; /** What a Strategy or a narrator may record: Events and named spans. */ export type StrategyFlow = { event: (name: string, options?: FlowEntryOptions) => Effect.Effect; withSpan: (name: string, options?: { readonly attributes?: Readonly>; }) => (effect: Effect.Effect) => Effect.Effect; }; /** One Sync lane: a Flow Participant plus a span helper that names the lane. */ export type FlowParticipant = StrategyFlow & { readonly name: string; send: (participantName: string, name: string, options?: FlowEntryOptions) => Effect.Effect; reply: (token: MessageToken, name: string, options?: FlowEntryOptions) => Effect.Effect; activation: { start: (name: string, options?: FlowEntryOptions) => Effect.Effect; }; activated: (name: string) => (effect: Effect.Effect) => Effect.Effect; }; export type OutboxFlow = { readonly collection: FlowParticipant; readonly outbox: FlowParticipant; readonly drainer: FlowParticipant; }; export type CollectionFlow = { readonly id: string; readonly collection: FlowParticipant; readonly outbox: OutboxFlow; participant: (name: string) => FlowParticipant; }; export type FlowPlacement = { readonly id: string; readonly participantPrefix: string; }; export type FlowLane = Participant; export type SyncFlow = { readonly id: string; readonly sync: FlowParticipant; readonly outbox: FlowParticipant; readonly drainer: FlowParticipant; collection: (localName: string) => CollectionFlow; action: (name: string) => CollectionFlow; participant: (name: string) => FlowLane; }; export declare const makeSyncFlow: (placement: FlowPlacement) => SyncFlow; export declare const narrateHydration: (narrator: StrategyFlow | undefined, collection: string) => { load: (from: string | null, effect: Effect.Effect) => Effect.Effect; project: (rows: number, effect: Effect.Effect) => Effect.Effect; }; export declare const narrateReplicaWrite: (narrator: StrategyFlow | undefined, collection: string) => { write: (received: number, effect: Effect.Effect) => Effect.Effect; broadcast: (rows: number, effect: Effect.Effect) => Effect.Effect; }; export declare const globalParticipantName: (strategyName: string) => import("../../domain/identity/sync-address.js").SyncAddress; export declare const partitionParticipantName: (partition: { field: string; value: PartitionValue; }, strategyName: string) => import("../../domain/identity/sync-address.js").SyncAddress; export declare const cadenceParticipantName: (strategyParticipantName: string) => string; //# sourceMappingURL=sync-flow.d.ts.map