Summary
Evaluate and introduce a shared TypeScript utility for deriving a union from an object's values, such as ValueOf<T>.
Rationale
src/platform/assets/components/mediaAssetViewOptions.ts currently derives MediaAssetViewMode inline from MEDIA_ASSET_VIEW_MODE. A shared utility may reduce repeated type expressions, but it should be added only after confirming that other code has concrete consumers.
Affected areas
- TypeScript utility module location to be determined.
src/platform/assets/components/mediaAssetViewOptions.ts
- Other TypeScript modules with equivalent object-value union types, if applicable.
Required changes
- Search the codebase for equivalent object-value union type expressions.
- Decide whether there are sufficient concrete consumers for a shared
ValueOf<T> utility.
- If the utility is justified, add it in an appropriate shared TypeScript utility module.
- Update applicable consumers, including
mediaAssetViewOptions.ts, with minimal scope.
- Keep the utility non-exported unless it has concrete external consumers that require an export.
- If the utility is not justified, remove the TODO from
mediaAssetViewOptions.ts.
Acceptance criteria
- The codebase has a documented decision to add or not add
ValueOf<T>.
- No unused public exports are introduced.
- Any affected TypeScript types remain type-safe.
- Relevant tests and static checks pass.
Backlinks
Summary
Evaluate and introduce a shared TypeScript utility for deriving a union from an object's values, such as
ValueOf<T>.Rationale
src/platform/assets/components/mediaAssetViewOptions.tscurrently derivesMediaAssetViewModeinline fromMEDIA_ASSET_VIEW_MODE. A shared utility may reduce repeated type expressions, but it should be added only after confirming that other code has concrete consumers.Affected areas
src/platform/assets/components/mediaAssetViewOptions.tsRequired changes
ValueOf<T>utility.mediaAssetViewOptions.ts, with minimal scope.mediaAssetViewOptions.ts.Acceptance criteria
ValueOf<T>.Backlinks