TypeScript client
Package: @eelden/client (clients/typescript).
Surfaces
| Export | Role |
|---|---|
Money | Immutable money (bigint minors + currency) |
eelden\…`` | Tagged template → EeldenQuery (escape hatch) |
EeldenExecutor | Transport interface (execute / atomic) |
eelden-codegen | CLI for named-query (+ escape-hatch) codegen |
Preferred path — named queries
- Write schemas + named queries as
.eel - Run
eelden-codegen --config eelden.config.json - Import generated functions; pass them to an
EeldenExecutor
ts
import { GetPaid } from "./generated/users.queries";
const rows = await exec.execute(GetPaid({ min_balance: Money.usd(50_00n) }));
// rows typed from the query's select shapeSee Named queries.
Escape hatch
ts
import { eelden } from "@eelden/client";
const q = eelden`users |> select { id, name }`;
// await exec.execute(q)Use for one-offs and tests — not day-to-day app queries. Until a build plugin lands, result types default to unknown[] unless codegen wraps them.
Transport reality
EeldenExecutor is the contract. A shipping HTTP/IPC driver is not in the package yet (Phase 5). Today you:
- drive the engine via
eelden run/ Studio / wasm ABI, or - implement
EeldenExecutoragainsteelden serve's/queryfor experiments.
Money
ts
import { Money } from "@eelden/client";
const price = Money.usd(4999n); // $49.99Cross-currency arithmetic is rejected at the type/runtime boundary — same doctrine as the language.