Skip to content

Commit

Permalink
fix: Delta typing
Browse files Browse the repository at this point in the history
Fix Delta typing to allow meta and values in updates at the
same time.
  • Loading branch information
tkurki committed Aug 30, 2024
1 parent cf2e365 commit 3150aad
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/server-api/src/deltas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,22 @@ export interface DeltaSubscription {
}>
}

// "Classic" Delta with values
export interface ValuesDelta {
export interface Delta {
context?: Context
updates: Update[]
}

export interface MetaDelta {
metas: Array<{ values: Meta[] }>
}

// Delta Message
export type Delta = ValuesDelta | MetaDelta
/**
* @deprecated earlier mistake assumed ValuesDelta and MetaDelta were separate
*/
export type ValuesDelta = Delta

export interface Update {
timestamp?: Timestamp
source?: Source
$source?: SourceRef
values: PathValue[]
meta: Meta[]
}

// Update delta
Expand Down

0 comments on commit 3150aad

Please sign in to comment.