import { Position } from '.'; import { Brand } from './brand'; /** @hidden */ export interface WithContext { context: Context; } /** @inline - Not exported as part of the public API */ type NormalizedBaseDelta = { context: Context; $source: SourceRef; /** @deprecated Use $source instead */ source?: Source; path: Path; timestamp: Timestamp; }; /** @hidden */ export type NormalizedMetaDelta = NormalizedBaseDelta & { value: MetaValue; isMeta: true; }; /** @hidden */ export type NormalizedValueDelta = NormalizedBaseDelta & { value: Value; isMeta: false; }; /** @hidden */ export type NormalizedDelta = NormalizedValueDelta | NormalizedMetaDelta; /** @category Server API */ export type SourceRef = Brand; /** @category Server API */ export type Source = any; /** @category Server API */ export type Path = Brand; /** @category Server API */ export type Timestamp = Brand; /** @category Server API */ export type Context = Brand; /** @category Server API */ export type NotificationId = Brand; /** @category Server API */ export type Value = object | number | string | null | Notification | boolean; /** @category Server API */ export interface Delta { context?: Context; updates: Update[]; } /** * @deprecated earlier mistake assumed ValuesDelta and MetaDelta were separate * @hidden */ export type ValuesDelta = Delta; /** * @deprecated earlier mistake assumed ValuesDelta and MetaDelta were separate * @hidden */ export type MetaDelta = Delta; /** @category Server API */ export type Update = { timestamp?: Timestamp; /** @deprecated Use $source (SourceRef) instead for more practical string-based referencing */ source?: Source; $source?: SourceRef; notificationId?: NotificationId; } & ({ values: PathValue[]; } | { meta: Meta[]; }); /** @category Server API */ export declare function hasValues(u: Update): u is Update & { values: PathValue[]; }; /** @category Server API */ export declare function hasMeta(u: Update): u is Update & { meta: Meta[]; }; /** @category Server API */ export interface PathValue { path: Path; value: Value; } /** @category Server API */ export interface Notification { state: ALARM_STATE; method: ALARM_METHOD[]; message: string; status?: AlarmStatus; position?: Position; createdAt?: Timestamp; id?: string; } /** @category Server API */ export interface Meta { path: Path; value: MetaValue; } /** @category Server API */ export interface MetaValue { description?: string; units?: string; example?: string; timeout?: number; displayName?: string; displayScale?: { lower: number; upper: number; }; zones?: Zone[]; supportsPut?: boolean; displayUnits?: { category: string; targetUnit: string; displayFormat?: string; formula: string; inverseFormula: string; symbol: string; }; } /** @category Server API */ export declare enum ALARM_STATE { nominal = "nominal", normal = "normal", alert = "alert", warn = "warn", alarm = "alarm", emergency = "emergency" } /** @category Server API */ export declare enum ALARM_METHOD { visual = "visual", sound = "sound" } /** @category Server API */ export interface AlarmStatus { silenced: boolean; acknowledged: boolean; canSilence: boolean; canAcknowledge: boolean; canClear: boolean; } /** @category Server API */ export interface Zone { lower: number | undefined; upper: number | undefined; state: ALARM_STATE; message: string; } export {}; //# sourceMappingURL=deltas.d.ts.map