mirror of
https://github.com/kennethnym/aris.git
synced 2026-02-02 05:01:17 +00:00
Adds orchestration for feed reconciliation with context-driven updates: - FeedController: holds context, debounces updates, reconciles sources - ContextBridge: bridges context providers to controller - ContextProvider: reactive + on-demand context value interface - Branded ContextKey<T> for type-safe context keys Moves source files to src/ directory and consolidates tests into integration test. Co-authored-by: Ona <no-reply@ona.com>
32 lines
733 B
TypeScript
32 lines
733 B
TypeScript
/**
|
|
* A single item in the feed.
|
|
*
|
|
* @example
|
|
* ```ts
|
|
* type WeatherItem = FeedItem<"weather", { temp: number; condition: string }>
|
|
*
|
|
* const item: WeatherItem = {
|
|
* id: "weather-123",
|
|
* type: "weather",
|
|
* priority: 0.5,
|
|
* timestamp: new Date(),
|
|
* data: { temp: 18, condition: "cloudy" },
|
|
* }
|
|
* ```
|
|
*/
|
|
export interface FeedItem<
|
|
TType extends string = string,
|
|
TData extends Record<string, unknown> = Record<string, unknown>,
|
|
> {
|
|
/** Unique identifier */
|
|
id: string
|
|
/** Item type, matches the data source type */
|
|
type: TType
|
|
/** Sort priority (higher = more important, shown first) */
|
|
priority: number
|
|
/** When this item was generated */
|
|
timestamp: Date
|
|
/** Type-specific payload */
|
|
data: TData
|
|
}
|