@sheldom/core-contracts
v0.1.0
Published
Contracts of core system package of the sheldom library.
Downloads
16
Readme
@sheldom/core-contracts
The shared vocabulary that lets Sheldom's packages talk to each other.
Pure TypeScript interfaces, zero runtime code. @sheldom/core-contracts defines the small set of contracts that @sheldom/core and the rest of the Sheldom toolkit agree on, so every package can be swapped, extended, or reimplemented independently — without depending on each other's internals.
✨ Why it exists
🧩 Decoupling
Packages depend on interfaces, not on each other's implementations.
🪶 Zero weight
Types are erased at build time — this package ships nothing to the browser.
🔌 Extensible
Implement these contracts yourself to plug custom behavior into the Sheldom pipeline, from a devtools panel to a custom state manager.
📦 Install
npm install @sheldom/core-contracts🧾 What's inside
interface AppContext {}
interface ContextHolder {
$context: AppContext;
}
interface Updatable {
requestUpdate(): void;
}
interface ComponentInternals {}Updatable— anything that can be asked to re-render.Componentimplements it;@sheldom/state's decorators call it whenever a piece of state changes.ContextHolder— anything that carries an$context, propagated down a component tree.AppContext— an empty, open interface. Augment it with TypeScript's declaration merging to type your own app-wide context.ComponentInternals— a marker interface reserved forComponent's own internal bookkeeping.
🌱 Part of the Sheldom toolkit
Most projects never install this package directly — it travels along with sheldom. Reach for it on its own only when you're authoring something that needs to speak the same contracts as @sheldom/core.
📄 License
MIT — see LICENSE.
