import type { AccessUser, OperationRule, ResolvedAccess, ResolvedTableAccess } from '../access.js'; import type { RealtimeChange } from './publisher.js'; type GetSession = () => Promise<{ user: AccessUser | null; activeOrganizationId: string | null; }>; export interface FilterRealtimeChangesOptions { subscriptions: readonly string[]; access: ResolvedAccess; request: Request; getSession: GetSession; } export interface FilterTableChangesOptions { /** Events arrive under this name — the schema key they were published with. */ tableName: string; entry: ResolvedTableAccess; /** * The operation right this stream reads under: `get` for a subscription to * rows, `list` for a live view of a query. */ rule: OperationRule; request: Request; getSession: GetSession; } /** * Whether one change may reach this subscriber: the given right plus the read * scope of the row, evaluated against the caller's session. The session * resolves at most once per stream. */ export declare function createChangeGuard(entry: ResolvedTableAccess, options: { rule: OperationRule; request: Request; getSession: GetSession; }): (change: RealtimeChange) => Promise; export declare function filterRealtimeChanges(source: AsyncIterable, options: FilterRealtimeChangesOptions): AsyncGenerator; /** * The same stream narrowed to one table with its access entry known up front — * what a live view (`GET /{table}:live`) consumes. */ export declare function filterTableChanges(source: AsyncIterable, options: FilterTableChangesOptions): AsyncGenerator; export {}; //# sourceMappingURL=filter.d.ts.map