/**
 * Context type constraint for upsertNodeDatum.
 * The context must have incremental update tracking fields.
 */
export interface IncrementalUpdateContext<TDatum> {
    canIncrementallyUpdate: boolean;
    nodes: TDatum[];
    nodeIndex: number;
}
/**
 * Generic upsert pattern for node datum arrays.
 *
 * Reuses existing nodes when possible (incremental updates), creates new ones when needed.
 * This centralizes the common create-vs-update decision logic used across series.
 *
 * @example
 * ```typescript
 * for (let i = start; i < end; i++) {
 *     upsertNodeDatum(
 *         ctx,
 *         params,
 *         (ctx, params) => this.createNodeDatum(ctx, params),
 *         (ctx, node, params) => this.updateNodeDatum(ctx, node, params)
 *     );
 * }
 * ```
 *
 * @param ctx - Context with canIncrementallyUpdate, nodes, and nodeIndex
 * @param params - Parameters for creating/updating the node
 * @param createNode - Factory function to create a new node (returns undefined to skip)
 * @param updateNode - Function to update an existing node in-place
 * @returns The created or updated node, or undefined if skipped
 */
export declare function upsertNodeDatum<TContext extends IncrementalUpdateContext<TDatum>, TDatum, TParams>(ctx: TContext, params: TParams, createNode: (ctx: TContext, params: TParams) => TDatum | undefined, updateNode: (ctx: TContext, node: TDatum, params: TParams) => void): TDatum | undefined;
