import { SerializerProtocol } from "./serde/base.js";
import { CheckpointMetadata, DeltaChannelHistory, PendingWrite } from "./types.js";
import { BaseCheckpointSaver, Checkpoint, CheckpointListOptions, CheckpointTuple } from "./base.js";
import { RunnableConfig } from "@langchain/core/runnables";

//#region src/memory.d.ts
declare class MemorySaver extends BaseCheckpointSaver {
  storage: Record<string, Record<string, Record<string, [Uint8Array, Uint8Array, string | undefined]>>>;
  writes: Record<string, Record<string, [string, string, Uint8Array]>>;
  constructor(serde?: SerializerProtocol);
  /** @internal */
  _migratePendingSends(mutableCheckpoint: Checkpoint, threadId: string, checkpointNs: string, parentCheckpointId: string): Promise<void>;
  getTuple(config: RunnableConfig): Promise<CheckpointTuple | undefined>;
  list(config: RunnableConfig, options?: CheckpointListOptions): AsyncGenerator<CheckpointTuple>;
  put(config: RunnableConfig, checkpoint: Checkpoint, metadata: CheckpointMetadata): Promise<RunnableConfig>;
  putWrites(config: RunnableConfig, writes: PendingWrite[], taskId: string): Promise<void>;
  deleteThread(threadId: string): Promise<void>;
  /**
   * Override: walk the parent chain ONCE for all requested channels using
   * direct storage access.
   *
   * Each channel terminates independently at the nearest ancestor whose
   * stored `channel_values[ch]` is populated. Other channels keep walking
   * until they find their own terminator or hit the root.
   *
   * The seed value (whether a `DeltaSnapshot` or a plain pre-delta migration
   * blob) is the value AT that ancestor, prior to its own pending writes that
   * produce the child. Those on-path writes — including the ones stored on the
   * terminating ancestor — are always collected and replayed on top of the
   * seed, so a thread migrated from a pre-delta channel does not drop the
   * writes saved under the migration boundary checkpoint.
   *
   * @remarks Beta. See {@link BaseCheckpointSaver.getDeltaChannelHistory}.
   */
  getDeltaChannelHistory(options: {
    config: RunnableConfig;
    channels: string[];
  }): Promise<Record<string, DeltaChannelHistory>>;
}
//#endregion
export { MemorySaver };
//# sourceMappingURL=memory.d.ts.map