do to formatters
This commit is contained in:
22
apps/website/lib/contracts/formatters/Formatter.ts
Normal file
22
apps/website/lib/contracts/formatters/Formatter.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Formatter contract
|
||||
*
|
||||
* Deterministic, reusable, UI-only formatting/mapping logic.
|
||||
*
|
||||
* Based on DISPLAY_OBJECTS.md:
|
||||
* - Class-based
|
||||
* - Immutable
|
||||
* - Deterministic
|
||||
* - Side-effect free
|
||||
* - No Intl.* or toLocale*
|
||||
* - No business rules
|
||||
*/
|
||||
|
||||
export interface Formatter {
|
||||
/**
|
||||
* Format or map the display object
|
||||
*
|
||||
* @returns Primitive values only (strings, numbers, booleans)
|
||||
*/
|
||||
format(): unknown;
|
||||
}
|
||||
Reference in New Issue
Block a user