# elixir_ts_rpc v0.0.1 - Table of Contents

Foundation for typed RPC procedures with TypeScript-compatible type resolution from @spec

## Pages

- [rpc_elixir](readme.md)
- [Changelog](changelog.md)
- [Supported types](supported-types.md)

## Modules

- [RpcElixir](RpcElixir.md): Elixir server-side library for [elixir-ts-rpc](https://github.com/ostatni5/elixir-ts-rpc) —
a typed RPC layer between Elixir servers and TypeScript clients.
- [RpcElixir.Codegen](RpcElixir.Codegen.md): Generates TypeScript type definitions directly from an RPC router.

- [RpcElixir.Context](RpcElixir.Context.md): Request-scoped context threaded through middleware and into handlers.
- [RpcElixir.CustomType](RpcElixir.CustomType.md): Escape hatch for teaching elixir-ts-rpc how to handle custom or third-party types.
- [RpcElixir.Dispatcher](RpcElixir.Dispatcher.md): Core dispatch pipeline: lookup → middleware → validate input → invoke handler →
validate output → serialize.
- [RpcElixir.Handler](RpcElixir.Handler.md): Captures `@spec` and `@type` ASTs at handler-compile time and exposes them
via `__rpc_specs__/0` / `__rpc_types__/0` accessors.
- [RpcElixir.Middleware](RpcElixir.Middleware.md): Behaviour for procedure middleware.
- [RpcElixir.Middleware.Assign](RpcElixir.Middleware.Assign.md): Built-in middleware that puts static values into `ctx.assigns`.
- [RpcElixir.Plug](RpcElixir.Plug.md): HTTP transport adapter for `RpcElixir` implemented as a `Plug`.
- [RpcElixir.Resolution](RpcElixir.Resolution.md): Envelope threaded through the middleware pipeline for a single procedure
invocation. Middleware receive and return a `%Resolution{}`.
- [RpcElixir.Router](RpcElixir.Router.md): Macro-based DSL for defining RPC procedures in a router module.
- [RpcElixir.RpcError](RpcElixir.RpcError.md): Structured error returned from the dispatcher pipeline.
- [RpcElixir.Types](RpcElixir.Types.md): Type system for RPC procedure input/output specs.
- [RpcElixir.Types.FromInferred](RpcElixir.Types.FromInferred.md): EXPERIMENTAL backend that reads signatures inferred by Elixir's set-theoretic
type system from the `ExCk` BEAM chunk, instead of user-written `@spec`.
- [RpcElixir.Types.FromSpec](RpcElixir.Types.FromSpec.md): Reads classic `@spec` declarations from a compiled module's BEAM debug info
(via `Code.Typespec`) and translates them into the internal `%{kind: ...}`
representation used by handlers, routers, and codegen.
- [RpcElixir.UnixMillis](RpcElixir.UnixMillis.md): Built-in branded-number custom type: a `DateTime` crossing the wire as epoch
milliseconds. Emits the TypeScript brand `EpochMillis`
(a `number & { readonly __brand: "EpochMillis" }`), so callers can't
accidentally pass a bare number where an instant is expected.
- [RpcElixir.Watcher](RpcElixir.Watcher.md): Dev-only GenServer that watches every source file contributing to an RPC
router — the router module itself and every handler module — and triggers
recompilation when one of them changes.

## Mix Tasks

- [mix compile.elixir_ts_rpc](Mix.Tasks.Compile.ElixirTsRpc.md): Mix compiler that regenerates the TypeScript client after Elixir recompiles.
- [mix rpc.gen.ts](Mix.Tasks.Rpc.Gen.Ts.md): Generates a TypeScript client file directly from an RPC router module.
- [mix rpc.gen.ts.watch](Mix.Tasks.Rpc.Gen.Ts.Watch.md): Watches Elixir sources and regenerates the TypeScript client on every change.

