Status Types
openstatus/status-typesFreeUtility
TypeScript type definitions for status components
Install it
npx shadcn@latest add https://openstatus.dev/r/status-types.jsonSource
1export type StatusType = "success" | "degraded" | "error" | "info" | "empty";2export type StatusEventType = "incident" | "report" | "maintenance";3export type StatusReportUpdateType =4 | "investigating"5 | "identified"6 | "monitoring"7 | "resolved";89// mirrors openstatus's `pageComponentImpact` taxonomy (this package doesn't depend on the db)10export type StatusReportImpact =11 | "operational"12 | "degraded_performance"13 | "partial_outage"14 | "major_outage";1516export const THEME_VALUES = ["light", "dark", "system"] as const;17export type ThemeValue = (typeof THEME_VALUES)[number];1819export interface StatusReportUpdate {20 date: Date;21 message: string;22 status: StatusReportUpdateType;23 /** Per-component impact changes this update set. */24 impactChanges?: { name: string; impact: StatusReportImpact }[];25}2627export interface StatusReport {28 id: number;29 title: string;30 affected: string[];31 updates: StatusReportUpdate[];32}3334export interface Maintenance {35 id: number;36 title: string;37 affected: string[];38 message: string;39 from: Date;40 to: Date;41}4243// Discriminated union for status events44export type StatusEventData =45 | { type: "report"; data: StatusReport }46 | { type: "maintenance"; data: Maintenance };4748export type StatusBarData = {49 day: string;50 bar: {51 status: StatusType;52 // NOTE: is in percentage! should sum up to 100%53 height: number;54 }[];55 card: {56 status: StatusType;57 value: string;58 /** Worst report impact of the day — refines the generic status label. */59 impact?: StatusReportImpact;60 }[];61 events: {62 id: number | string;63 name: string;64 type: StatusEventType;65 from: Date | null;66 to: Date | null;67 isAggregated?: boolean;68 /** Overrides the type-derived dot color (e.g. the day's worst report impact). */69 status?: Exclude<StatusType, "empty">;70 /** External link for the event (e.g. an upstream incident page). */71 shortlink?: string;72 }[];73};
Files it writes
More from openstatus
All 26 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Status Utilitiesstatus-utils | openstatus | Utilities | Free | 1 dep |
