29 lines
618 B
TypeScript
29 lines
618 B
TypeScript
/**
|
|
* DisplayObject 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 DisplayObject {
|
|
/**
|
|
* Format or map the display object
|
|
*
|
|
* @returns Primitive values only (strings, numbers, booleans)
|
|
*/
|
|
format(): unknown;
|
|
|
|
/**
|
|
* Optional: Get multiple display variants
|
|
*
|
|
* Allows a single DisplayObject to expose multiple presentation formats
|
|
*/
|
|
variants?(): Record<string, unknown>;
|
|
} |