UNPKG

emr-types

Version:

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

133 lines 3.44 kB
import { Id } from '../../shared/value-objects/Id'; /** * Branded type for Appointment ID to ensure type safety */ export type AppointmentId = Id & { readonly __brand: 'AppointmentId'; }; /** * Factory for creating AppointmentId instances */ export declare const AppointmentIdFactory: { /** * Create a new AppointmentId with a random UUID */ create(): AppointmentId; /** * Create an AppointmentId from a string value */ fromString(value: string): AppointmentId; /** * Create an AppointmentId from a UUID string */ fromUuid(uuid: string): AppointmentId; /** * Create an AppointmentId from a ULID string */ fromUlid(ulid: string): AppointmentId; /** * Create a custom AppointmentId with specific format */ createCustom(value: string, format?: string): AppointmentId; }; /** * Validator for AppointmentId instances */ export declare const AppointmentIdValidator: { /** * Check if an AppointmentId is valid */ isValid(id: AppointmentId): boolean; /** * Validate the format of an AppointmentId string */ validateFormat(value: string): boolean; /** * Check if an AppointmentId is empty */ isEmpty(id: AppointmentId): boolean; /** * Compare two AppointmentId instances for equality */ areEqual(id1: AppointmentId, id2: AppointmentId): boolean; }; /** * Utility functions for AppointmentId */ export declare const AppointmentIdUtils: { /** * Convert AppointmentId to string */ toString(id: AppointmentId): string; /** * Get the type of AppointmentId */ getType(id: AppointmentId): string; /** * Check if AppointmentId is a UUID */ isUuid(id: AppointmentId): boolean; /** * Check if AppointmentId is a ULID */ isUlid(id: AppointmentId): boolean; /** * Check if AppointmentId is a custom ID */ isCustom(id: AppointmentId): boolean; /** * Check if AppointmentId is an auto-increment ID */ isAutoIncrement(id: AppointmentId): boolean; }; /** * Type guard to check if a value is an AppointmentId */ export declare function isAppointmentId(value: unknown): value is AppointmentId; /** * Type guard to check if a string can be converted to an AppointmentId */ export declare function isValidAppointmentIdString(value: string): boolean; /** * Common AppointmentId formats */ export declare const APPOINTMENT_ID_FORMATS: { readonly UUID: "uuid"; readonly ULID: "ulid"; readonly CUSTOM: "custom"; readonly AUTO_INCREMENT: "auto-increment"; }; /** * Default AppointmentId format */ export declare const DEFAULT_APPOINTMENT_ID_FORMAT: "uuid"; /** * Example usage of AppointmentId */ export declare const AppointmentIdExamples: { /** * Create a new AppointmentId */ createNew: () => AppointmentId; /** * Create from UUID string */ fromUuid: (uuid: string) => AppointmentId; /** * Create from ULID string */ fromUlid: (ulid: string) => AppointmentId; /** * Create custom AppointmentId */ createCustom: (value: string, format?: string) => AppointmentId; /** * Validate AppointmentId */ validate: (id: AppointmentId) => boolean; /** * Convert to string */ toString: (id: AppointmentId) => string; }; //# sourceMappingURL=AppointmentId.d.ts.map