temporal97

Types

TypeScript types exported by temporal97.

Primitives

type SnapshotId = number;
type EntityId = string;

BaseEdgeData

All edge types must extend BaseEdgeData:

interface BaseEdgeData {
  source: EntityId;
  target: EntityId;
}

Neighbor

Returned by traversal methods:

interface Neighbor<TEdge extends BaseEdgeData> {
  nodeId: EntityId;
  edgeId: EntityId;
  edge: TEdge;
}

Delta

Returned by every write and cursor-move operation:

interface Delta {
  nodes: { added: Set<EntityId>; updated: Set<EntityId>; removed: Set<EntityId> };
  edges: { added: Set<EntityId>; updated: Set<EntityId>; removed: Set<EntityId> };
}

LogEntry

interface LogEntry<TNode, TEdge, TEvent> {
  snapshot: SnapshotId;
  event: TEvent | undefined;
  mutations: Mutation<TNode, TEdge>[];
}

Mutation kind and operation

The kind and op fields on mutations use string literals:

FieldValues
kind"node" | "edge"
op"set" | "delete"

MutationKindEnum and MutationOperationEnum are exported for compatibility with codebases that prefer enums, but string literals are the recommended style.

On this page