UNPKG

harperdb

Version:

HarperDB is a distributed database, caching service, streaming broker, and application development platform focused on performance and ease of use.

28 lines (27 loc) 869 B
/** * Single source of truth for Harper status system definitions */ export declare const STATUS_DEFINITIONS: { readonly primary: { readonly allowedValues: any; }; readonly maintenance: { readonly allowedValues: any; }; readonly availability: { readonly allowedValues: readonly ["Available", "Unavailable"]; }; }; export type StatusDefinitions = typeof STATUS_DEFINITIONS; export type StatusId = keyof StatusDefinitions; export type StatusValueMap = { [K in StatusId]: StatusDefinitions[K]['allowedValues'] extends readonly (infer U)[] ? U : string; }; export interface StatusRecord<T extends StatusId = StatusId> { id: T; status: StatusValueMap[T]; __createdtime__?: number; __updatedtime__?: number; } export declare const STATUS_IDS: StatusId[]; export declare const DEFAULT_STATUS_ID: StatusId;