mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-20 09:01:19 +00:00
Context keys are now tuples instead of strings, inspired by
React Query's query keys. This prevents context collisions
when multiple instances of the same source type are registered.
Sources write to structured keys like
["aris.google-calendar", "nextEvent", { account: "work" }]
and consumers can query by prefix via context.find().
Co-authored-by: Ona <no-reply@ona.com>
28 lines
649 B
TypeScript
28 lines
649 B
TypeScript
import type { ContextKey } from "@aris/core"
|
|
|
|
import { contextKey } from "@aris/core"
|
|
|
|
import type { ConditionCode } from "./weatherkit"
|
|
|
|
/**
|
|
* Simplified weather context for downstream sources.
|
|
*/
|
|
export interface Weather {
|
|
/** Current temperature */
|
|
temperature: number
|
|
/** Feels-like temperature */
|
|
temperatureApparent: number
|
|
/** Weather condition */
|
|
condition: ConditionCode
|
|
/** Relative humidity (0-1) */
|
|
humidity: number
|
|
/** UV index */
|
|
uvIndex: number
|
|
/** Wind speed */
|
|
windSpeed: number
|
|
/** Is it currently daytime */
|
|
daylight: boolean
|
|
}
|
|
|
|
export const WeatherKey: ContextKey<Weather> = contextKey("aris.weather", "weather")
|