API reference@evolu/commonlocal‑first/Storage › getTimestampInsertStrategy

function getTimestampInsertStrategy(
  timestamp: Uint8Array<ArrayBufferLike> &
    Brand<"Length16"> &
    Brand<"TimestampBytes">,
  firstTimestamp: Uint8Array<ArrayBufferLike> &
    Brand<"Length16"> &
    Brand<"TimestampBytes">,
  lastTimestamp: Uint8Array<ArrayBufferLike> &
    Brand<"Length16"> &
    Brand<"TimestampBytes">,
): [
  StorageInsertTimestampStrategy,
  Uint8Array<ArrayBufferLike> & Brand<"Length16"> & Brand<"TimestampBytes">,
  Uint8Array<ArrayBufferLike> & Brand<"Length16"> & Brand<"TimestampBytes">,
];

Defined in: packages/common/src/local-first/Storage.ts:554

Determines the insertion strategy for a timestamp based on its position relative to the current first and last timestamps.

Returns a tuple with the strategy and updated timestamp bounds.