Skip to main content
Every type in a Bijection app comes from a declaration. A function’s argument types come from its args, its value from returns or the handler, and its refusal codes from refuses. A table carries its fact and key types, and the app tree types the client.
bijection/messages.ts

Reuse inferred types

Inside a declaration, the value types are t.key(messages) and t.fact(messages). Durations and instants are Temporal values, exact decimals are Decimal, and 64-bit integers (t.int) are bigint. For a client, import the app as a type: api<typeof App>(). See TypeScript clients.

Frontend declarations

The React starters reference the backend through tsconfig.bijection.json. Their type imports still point to bijection/app.ts. TypeScript resolves those imports to the cached declarations in .bijection/type-cache/. Declaration maps let editors navigate back to the source. Keep the cache directory out of version control. bijection dev watches the declaration project using the workspace’s installed TypeScript compiler. The starter’s check and build commands populate the cache on a fresh checkout. A backend edit that leaves its exported types unchanged lets TypeScript reuse the frontend’s prior work. The CLI’s pinned native compiler still checks the backend for publication.

What the types check, and what check checks

The SDK’s types check shapes: that a selection has an index to serve it, that a verb takes the address you pass, that a spec key exists, and that a value fits its type. A misuse reads as a remedy sentence at the call site. Label flow, such as reading above a function’s under, is checked by bijection check and enforced by the host, never by the compiler.

Type-check

bijection dev, bijection deploy and bijection check type-check the backend with the CLI’s pinned native TypeScript compiler. You need neither Node.js nor a project-installed compiler for the backend, and changing your project’s TypeScript dependency does not change the one the CLI uses. Run the same check alone with:
Each check is bounded to two minutes and reports the compiler’s diagnostics on failure. If type-checking is slow, a single explicit annotation often breaks a long inference chain. Find where the compiler spends its time with generateTrace: