website refactor
This commit is contained in:
21
apps/website/lib/contracts/presenters/Presenter.ts
Normal file
21
apps/website/lib/contracts/presenters/Presenter.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Presenter contract
|
||||
*
|
||||
* Pure, deterministic transformation between presentation models.
|
||||
*
|
||||
* Based on PRESENTERS.md:
|
||||
* - Deterministic
|
||||
* - Side-effect free
|
||||
* - No HTTP/API calls
|
||||
* - Maps between Page DTO, ViewModel, and ViewData
|
||||
*/
|
||||
|
||||
export interface Presenter<TInput, TOutput> {
|
||||
/**
|
||||
* Transform input to output
|
||||
*
|
||||
* @param input - The input presentation model (Page DTO, ViewModel, etc.)
|
||||
* @returns The output presentation model (ViewModel, ViewData, etc.)
|
||||
*/
|
||||
present(input: TInput): TOutput;
|
||||
}
|
||||
Reference in New Issue
Block a user