/** * Content plugin state exported for public API. */ import type { ContentError } from "./content-transform.js"; import "@bluecadet/launchpad-utils/types"; /** * Individual source fetch state with explicit phase tracking. * Each phase has associated metadata that's only valid for that phase. */ export type SourceFetchState = { state: "pending"; } | { state: "fetching"; startTime: Date; } | { state: "success"; startTime: Date; finishedAt: Date; duration: number; } | { state: "error"; error: Error; startTime?: Date; attemptedAt: Date; restored: boolean; }; /** * Overall content system phase with phase-specific metadata. */ export type ContentPhase = { phase: "idle"; } | { phase: "resolving-sources"; } | { phase: "running-transforms"; } | { phase: "backing-up"; } | { phase: "clearing-old-data"; } | { phase: "fetching-sources"; } | { phase: "finalizing"; restored: boolean; } | { phase: "error"; error: ContentError; restored: boolean; } | { phase: "clearing-temp"; }; export type ContentState = ContentPhase & { sources: Record; }; declare module "@bluecadet/launchpad-utils/types" { interface PluginsState { content: ContentState; } } export declare class ContentStateManager { private readonly updateState; constructor(updateState: (producer: (draft: ContentState) => void) => void); setPhase(newPhase: ContentPhase): void; initializeSources(sourceIds: string[]): void; markSourceFetching(sourceId: string): void; markSourceSuccess(sourceId: string): void; markSourceError(sourceId: string, error: Error): void; markSourceRestored(sourceId: string): void; } //# sourceMappingURL=content-state.d.ts.map