UNPKG

emr-types

Version:

Comprehensive TypeScript Types Library for Electronic Medical Record (EMR) Applications - Domain-Driven Design with Zod Validation

63 lines 1.63 kB
/** * Timestamp Value Object * * Represents a point in time with validation and formatting * * @interface Timestamp * @description Timestamp value object for domain entities */ export interface Timestamp { /** The timestamp value in milliseconds since epoch */ value: number; /** The ISO string representation */ isoString: string; /** The date object */ date: Date; /** Whether the timestamp is valid */ isValid: boolean; /** Timezone information */ timezone?: string; } /** * Timestamp Factory Functions */ export declare const TimestampFactory: { /** * Create a timestamp from current time */ now: () => Timestamp; /** * Create a timestamp from a Date object */ fromDate: (date: Date) => Timestamp; /** * Create a timestamp from milliseconds */ fromMilliseconds: (milliseconds: number) => Timestamp; /** * Create a timestamp from ISO string */ fromISOString: (isoString: string) => Timestamp; }; /** * Timestamp Utility Functions */ export declare const TimestampUtils: { /** * Check if a timestamp is in the past */ isPast: (timestamp: Timestamp) => boolean; /** * Check if a timestamp is in the future */ isFuture: (timestamp: Timestamp) => boolean; /** * Get the difference between two timestamps in milliseconds */ difference: (timestamp1: Timestamp, timestamp2: Timestamp) => number; /** * Format a timestamp for display */ format: (timestamp: Timestamp, locale?: string) => string; }; //# sourceMappingURL=Timestamp.d.ts.map