/**
 * Observer - Read-only filtered view of a causal read model.
 *
 * Provides an observer that sees only nodes matching a glob pattern,
 * with property visibility controlled by expose/redact lists.
 * Edges are only visible when both endpoints pass the match filter.
 *
 * @module domain/services/query/Observer
 * @see Paper IV, Section 3 -- Observers as resource-bounded functors
 */
import QueryBuilder from './QueryBuilder.ts';
import LogicalTraversal from './LogicalTraversal.ts';
import ObserverAccumulation from './ObserverAccumulation.ts';
import ObserverBasis from './ObserverBasis.ts';
import ObserverPlan from './ObserverPlan.ts';
import ObserverReadingEnvelope, { type ObserverReadingEnvelopeFields } from './ObserverReadingEnvelope.ts';
import WorldlineSelector from '../../types/WorldlineSelector.ts';
import type { WorldlineSource } from '../../capabilities/QueryCapability.ts';
import type { SnapshotPropValue } from '../snapshot/SnapshotPropValue.ts';
import type { WarpState } from '../JoinReducer.ts';
import type ObserverEmission from './ObserverEmission.ts';
import type { QueryReadModel, QueryReadModelOpenRequest, QueryReadModelProvider } from './QueryReadModelProvider.ts';
type VisibleNodeProps = Readonly<{
    [key: string]: SnapshotPropValue;
}>;
type VisibleEdge = {
    from: string;
    to: string;
    label: string;
    props: VisibleNodeProps;
};
type ObserverSnapshot = {
    state: WarpState;
    stateHash: string;
};
type ObserverReadingEnvelopeOptions = Pick<ObserverReadingEnvelopeFields, 'witnessRef' | 'shellRef' | 'pluralityRef' | 'receiptAnchors'>;
export interface ObserverBacking {
    hasNode: (nodeId: string) => Promise<boolean>;
    getNodes: () => Promise<string[]>;
    getNodeProps: (nodeId: string) => Promise<VisibleNodeProps | null>;
    getEdges: () => Promise<VisibleEdge[]>;
    observer: (name: string, config: ObserverConfig, options: {
        source: WorldlineSource;
    }) => Promise<Observer>;
}
export interface ObserverConfig {
    match: string | string[];
    expose?: string[];
    redact?: string[];
    basis?: string[];
}
interface ObserverOptions {
    name: string;
    config: ObserverConfig;
    graph?: ObserverBacking;
    snapshot?: ObserverSnapshot;
    source?: WorldlineSelector | WorldlineSource;
    readModelProvider?: QueryReadModelProvider;
}
/**
 * Read-only observer view over a live read model or pinned state snapshot.
 */
export default class Observer {
    private _name;
    private _matchPattern;
    private _expose;
    private _redact;
    private _basis;
    private _graph;
    private _snapshot;
    private _source;
    private _stateReader;
    private _readModelProvider;
    traverse: LogicalTraversal;
    constructor({ name, config, graph, snapshot, source, readModelProvider }: ObserverOptions);
    private _initIdentity;
    private _initBacking;
    get name(): string;
    get source(): WorldlineSource | null;
    get stateHash(): string | null;
    get basis(): ObserverBasis;
    private _requireGraph;
    private _buildConfigSnapshot;
    seek(options?: {
        source?: WorldlineSource;
    }): Promise<Observer>;
    queryReadModelProvider(): QueryReadModelProvider;
    openQueryReadModel(request?: QueryReadModelOpenRequest): Promise<QueryReadModel>;
    private _queryVisibility;
    accumulate(): Promise<ObserverAccumulation>;
    emit(): Promise<ObserverEmission>;
    plan(): ObserverPlan;
    readingEnvelope(options?: ObserverReadingEnvelopeOptions): Promise<ObserverReadingEnvelope>;
    hasNode(nodeId: string): Promise<boolean>;
    getNodes(): Promise<string[]>;
    getNodeProps(nodeId: string): Promise<VisibleNodeProps | null>;
    getEdges(): Promise<VisibleEdge[]>;
    query(): QueryBuilder;
}
export {};
