import SnapshotWarpState from '../snapshot/SnapshotWarpState.ts';
import type { PropValue } from '../../types/PropValue.ts';
import type { SnapshotPropValue } from '../snapshot/SnapshotPropValue.ts';
import type VisibleEdgePropertyRecord from '../../graph/VisibleEdgePropertyRecord.ts';
import type VisibleNodePropertyRecord from '../../graph/VisibleNodePropertyRecord.ts';
import WarpState from './WarpState.ts';
export type ContentMeta = {
    oid: string;
    mime: string | null;
    size: number | null;
};
export type NeighborEntry = {
    nodeId: string;
    label: string;
    direction: 'outgoing' | 'incoming';
};
type OutgoingNeighborEntry = {
    nodeId: string;
    label: string;
    direction: 'outgoing';
};
type IncomingNeighborEntry = {
    nodeId: string;
    label: string;
    direction: 'incoming';
};
export type VisibleEdgeRef = {
    from: string;
    to: string;
    label: string;
};
export type VisiblePropertyBag = Readonly<{
    [key: string]: SnapshotPropValue;
}>;
type MutableVisiblePropertyBag = {
    [key: string]: SnapshotPropValue;
};
export type VisibleEdgeView = {
    from: string;
    to: string;
    label: string;
    props: VisiblePropertyBag;
};
export type StateReaderSource = WarpState | SnapshotWarpState;
type VisibleProjectionProp = {
    node: string;
    key: string;
    value: PropValue;
};
export type StateReaderContext = {
    projection: {
        nodes: string[];
        edges: VisibleEdgeRef[];
        props: VisibleProjectionProp[];
    };
    visibleNodeIds: Set<string>;
    nodePropsById: Map<string, MutableVisiblePropertyBag>;
    edgePropsByKey: Map<string, MutableVisiblePropertyBag>;
    edges: VisibleEdgeView[];
    outgoingByNode: Map<string, OutgoingNeighborEntry[]>;
    incomingByNode: Map<string, IncomingNeighborEntry[]>;
    nodeContentMetaById: Map<string, ContentMeta | null>;
    edgeContentMetaByKey: Map<string, ContentMeta | null>;
};
/** Encodes a visible edge reference into a composite key string. */
export declare function edgeKeyFromRef(edge: VisibleEdgeRef): string;
/** Returns a projection-capable state from a live or immutable reader source. */
export declare function createStateReaderProjectionState(state: StateReaderSource): WarpState;
/** Shallow-clones a property bag. */
export declare function cloneBag(bag: VisiblePropertyBag): VisiblePropertyBag;
/** Shallow-clones content metadata or returns null. */
export declare function cloneMeta(meta: ContentMeta | null | undefined): ContentMeta | null;
/** Shallow-clones an array of neighbor entries. */
export declare function cloneNeighbors(entries: NeighborEntry[]): NeighborEntry[];
/** Creates a map of node ID to empty property bags for population. */
export declare function createNodePropIndex(nodeIds: string[]): Map<string, MutableVisiblePropertyBag>;
/** Creates a map of edge key to empty property bags for population. */
export declare function createEdgePropIndex(edges: VisibleEdgeRef[]): Map<string, MutableVisiblePropertyBag>;
/** Builds outgoing and incoming neighbor indexes from visible nodes and edges. */
export declare function createNeighborIndex(nodeIds: string[], edges: VisibleEdgeRef[]): {
    outgoingByNode: StateReaderContext['outgoingByNode'];
    incomingByNode: StateReaderContext['incomingByNode'];
};
/** Builds projection-backed public node property rows from precomputed records. */
export declare function createProjectionProps(records: readonly VisibleNodePropertyRecord[]): VisibleProjectionProp[];
/** Populates node property indexes from projection records. */
export declare function populateVisibleNodeProps(records: readonly VisibleNodePropertyRecord[], nodePropsById: Map<string, MutableVisiblePropertyBag>): void;
/** Populates edge property indexes from projection records. */
export declare function populateVisibleEdgeProps(records: readonly VisibleEdgePropertyRecord[], edgePropsByKey: Map<string, MutableVisiblePropertyBag>): void;
/** Creates visible edge views with cloned property bags. */
export declare function createVisibleEdges(edges: VisibleEdgeRef[], edgePropsByKey: Map<string, MutableVisiblePropertyBag>): VisibleEdgeView[];
/** Builds a content metadata index for all visible nodes. */
export declare function createNodeContentMetaIndex(state: WarpState, nodeIds: string[]): Map<string, ContentMeta | null>;
/** Builds a content metadata index for all visible edges. */
export declare function createEdgeContentMetaIndex(state: WarpState, edges: VisibleEdgeRef[]): Map<string, ContentMeta | null>;
/** Returns projection records for visible node properties. */
export declare function createNodePropertyRecords(state: WarpState): readonly VisibleNodePropertyRecord[];
/** Returns projection records for visible edge properties. */
export declare function createEdgePropertyRecords(state: WarpState): readonly VisibleEdgePropertyRecord[];
export {};
