/** * Pull: incremental commit delivery, cursors, bootstrap segments * (SPEC.md §4, §5). */ import { type PullHeaderFrame, type ResponseFrame, type ScopeMap, type SubscriptionFrame } from '@syncular/core'; import type { SyncRequestContext } from './context.js'; import type { PullSegmentSummary } from './events.js'; import type { CompiledSchema, CompiledTable } from './schema.js'; /** §4.2 accept bitmask. */ export declare const ACCEPT_INLINE_ROWS: number; export declare const ACCEPT_EXTERNAL_ROWS: number; export declare const ACCEPT_SQLITE: number; export declare const ACCEPT_SIGNED_URLS: number; export interface PullLimits { readonly limitCommits: number; readonly limitSnapshotRows: number; readonly maxSnapshotPages: number; readonly accept: number; } /** §4.2 defaults and silent clamps (the v1 values). */ export declare function clampPullLimits(header: PullHeaderFrame): PullLimits; export interface SubscriptionPlan { readonly frame: SubscriptionFrame; readonly table: CompiledTable; readonly status: 'active' | 'revoked'; readonly effective: ScopeMap; } export interface SubscriptionResult { readonly nextCursor: number; readonly active: boolean; } /** * Mutable per-section collector for the `pull.served` event. Only created * when an events sink is configured — with `trace` undefined the pull path * does zero extra work (`trace?.…` short-circuits argument evaluation). */ export interface PullSectionTrace { readonly segments: PullSegmentSummary[]; } /** * Produce the `SUB_START … SUB_END` section for one subscription (§1.6), * returning the cursor recorded for the retention watermark (§4.5). */ export declare function subscriptionSection(ctx: SyncRequestContext, schema: CompiledSchema, limits: PullLimits, plan: SubscriptionPlan, maxSeq: number, horizonSeq: number, trace?: PullSectionTrace, logEpoch?: string): AsyncGenerator;