import { createContext } from 'svelte'; export interface AppContext { config: MonitorConfig; } export interface FeedConfig { label: string; hostname: string; uri: string; } export interface EntrywayConfig { hostname: string; dids: string[]; } export interface ConstellationConfig { subject: string; source: string; limit: number; } export interface CDNImageConfig { did: string; cid: string; } export interface NetworkCheckConfig { label: string; url: string; validator: 'json-object' | 'dns-answer' | 'plain-text'; } export interface MonitorConfig { pdses: string[]; appViews: string[]; relays: string[]; entryway: EntrywayConfig; feeds: FeedConfig[]; constellationHosts: string[]; constellationBacklinks: ConstellationConfig[]; cdnHosts: string[]; cdnImages: CDNImageConfig[]; getAuthorFeedDIDs: string[]; getProfileDIDs: string[]; resolvedHandles: string[]; networkChecks: NetworkCheckConfig[]; } export const [getAppContext, setAppContext] = createContext(); export function getConfig(): MonitorConfig { return getAppContext().config; }