diff --git a/packages/taler-util/src/time.ts b/packages/taler-util/src/time.ts index 8b4f4cac3..6ada13e25 100644 --- a/packages/taler-util/src/time.ts +++ b/packages/taler-util/src/time.ts @@ -23,15 +23,40 @@ */ import { Codec, renderContext, Context } from "./codec.js"; +declare const flavor_AbsoluteTime: unique symbol; +declare const flavor_TalerProtocolTimestamp: unique symbol; +declare const flavor_TalerWalletDbTimestamp: unique symbol; + export interface AbsoluteTime { /** * Timestamp in milliseconds. */ readonly t_ms: number | "never"; + + readonly _flavor?: typeof flavor_AbsoluteTime; } export interface TalerProtocolTimestamp { + /** + * Seconds (as integer) since epoch. + */ readonly t_s: number | "never"; + + readonly _flavor?: typeof flavor_TalerProtocolTimestamp; +} + +export interface TalerWalletDbTimestamp { + /** + * Seconds (as integer) since epoch. + */ + readonly t_s: number | "never"; + + /** + * Optional microsecond offset (non-negative integer). + */ + readonly off_us?: number; + + readonly _flavor?: typeof flavor_TalerWalletDbTimestamp; } export namespace TalerProtocolTimestamp {