Skip to main content
zerotal

Documentation


Documentation / @zerotal/core / contracts

contracts

@zerotal/core/contracts — the framework's interface layer.

Every type here is pure surface: zero runtime code, and this subtree imports nothing from the rest of core. Its job is to break the duck-typing at the seams between the kernel and its satellite packages. Core consumes a contract; a package (or a third-party alternative) implements it; neither needs to import the other.

ContractKernel useImplemented by
SessionContractctx.session, ctx.flash() / flashed()@zerotal/session
TransactionContextctx._transaction, RequestContext.transaction()@zerotal/orm
AuthenticatableUserthe current-user identitythe app's User model

A package wires in by implementing the contract and merging into a registry — never by reaching into an untyped side channel on HttpContext.

Contracts