ID:WORK-120Status:donePriority:mediumComplexity:moderateMilestone:v1.0.0
Export generic type interfaces for rune component overrides
Summary
Export generic TypeScript interfaces from rune packages that describe the component override contract — scalar property types derived from schema attributes and renderable slot names parameterized over a generic type. Component authors use these as RecipeProps<Snippet> (Svelte), RecipeProps<ReactNode> (React), etc.
Acceptance Criteria
- Core runes with component renderables export generic prop interfaces from
@refrakt-md/runes - Community package runes with component renderables export generic prop interfaces from their respective packages (e.g.,
RecipePropsfrom@refrakt-md/learning) - Property types match schema attribute types (String →
string, Number →stringsince meta content is always string, enum matches → union literal) - Slot names (from top-level refs) typed as
R | undefinedwhereRis the generic renderable type parameter childrenandtagincluded in every interface (childrenasR | undefined,tagasSerializedTag)- Interfaces default the generic parameter to
unknown(Props<R = unknown>) - Example usage documented in at least one community package README or doc page
- Exported types build cleanly with no circular dependencies
Approach
- For each rune that uses
createComponentRenderable, create a correspondingProps<R>interface - Property types derived from the schema's
attributesdefinition - Slot names derived from the
refskeys increateComponentRenderable - Export from the package's public API alongside the schema
Resolution
Completed: 2026-04-04
Branch: claude/adr-008-implementation-nBN9K
What was done
- Created
packages/types/src/component-props.tswith BaseComponentProps<R>, PageSectionSlots<R>, SplitLayoutProperties - Created
packages/runes/src/props.tswith 37+ core rune interfaces - Created props.ts for all 8 community packages (learning, marketing, docs, design, places, media, business, storytelling)
- Exported types from each package's index.ts
- Full build passes with no type errors or circular dependencies
Notes
- Used Approach B from ADR-008 (generic interface with renderable type parameter)
- Common base types reduce duplication across interfaces
- Example usage documented in themes/components.md