23 lines
464 B
TypeScript
23 lines
464 B
TypeScript
/**
|
|
* Base interface for ViewData objects
|
|
*
|
|
* All ViewData must be JSON-serializable.
|
|
* This type ensures no class instances or functions are included.
|
|
*/
|
|
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; |