RpcElixir.Codegen (elixir_ts_rpc v0.0.1)

Copy Markdown View Source

Generates TypeScript type definitions directly from an RPC router.

Summary

Functions

Generates TypeScript source from a router module.

Functions

generate(router_mod, opts \\ [])

@spec generate(
  module(),
  keyword()
) :: String.t()

Generates TypeScript source from a router module.

Options:

  • :client_import — the import specifier for the client package (default: "@elixir-ts-rpc/client")
  • :out — path of the output file. When set, handler source links in the generated JSDoc are emitted as absolute file:// URIs (clickable in an editor); otherwise they are repo-root-relative paths.