Files
gridpilot.gg/apps/website/lib/contracts/view-data/ViewData.ts
2026-01-23 15:30:23 +01:00

26 lines
605 B
TypeScript

/**
* Base interface for ViewData objects
*
* All ViewData must be JSON-serializable for SSR.
* This type ensures no class instances or functions are included.
*
* Note: We use 'any' here to allow complex DTO structures, but the
* architectural rule is that these must be plain JSON objects.
*/
export interface ViewData {
[key: string]: any;
}
/**
* Helper type to ensure a type is ViewData-compatible
*
* Usage:
* ```typescript
* type MyViewData = ViewData & {
* title: string;
* count: number;
* items: string[];
* };
* ```
*/
export type ViewDataOf<T extends ViewData> = T;