API reference / @evolu/common / Evolu/Internal / receiveTimestamp

Function: receiveTimestamp()

function receiveTimestamp(deps): (
  local,
  remote,
) => Result<
  Readonly<{
    counter: number &
      Brand<"Int"> &
      Brand<"NonNegative"> &
      Brand<"LessThanOrEqualTo65535"> &
      Brand<"Counter">;
    millis: number &
      Brand<"Int"> &
      Brand<"NonNegative"> &
      Brand<`LessThanOrEqualTo${number}`> &
      Brand<"Millis">;
    nodeId: string & Brand<"NodeId">;
  }>,
  | TimestampDriftError
  | TimestampCounterOverflowError
  | TimestampDuplicateNodeError
  | TimestampTimeOutOfRangeError
>;

Defined in: packages/common/src/Evolu/Timestamp.ts:225

Parameters

ParameterType
depsTimeDep & TimestampConfigDep

Returns

(local, remote): Result<Readonly<{
  counter: number & Brand<"Int"> & Brand<"NonNegative"> & Brand<"LessThanOrEqualTo65535"> & Brand<"Counter">;
  millis: number & Brand<"Int"> & Brand<"NonNegative"> & Brand<`LessThanOrEqualTo${number}`> & Brand<"Millis">;
  nodeId: string & Brand<"NodeId">;
}>,
  | TimestampDriftError
  | TimestampCounterOverflowError
  | TimestampDuplicateNodeError
| TimestampTimeOutOfRangeError>;

Parameters

ParameterType
localTimestamp
remoteTimestamp

Returns

Result<Readonly<{ counter: number & Brand<"Int"> & Brand<"NonNegative"> & Brand<"LessThanOrEqualTo65535"> & Brand<"Counter">; millis: number & Brand<"Int"> & Brand<"NonNegative"> & Brand<`LessThanOrEqualTo${number}`> & Brand<"Millis">; nodeId: string & Brand<"NodeId">; }>, | TimestampDriftError | TimestampCounterOverflowError | TimestampDuplicateNodeError | TimestampTimeOutOfRangeError>

Was this page helpful?