vercel_rpc_cli/codegen.rs
1//! TypeScript code generation from a [`Manifest`](crate::model::Manifest).
2//!
3//! - [`typescript`] — generates `rpc-types.ts` (interfaces, enum types,
4//! `Procedures` map).
5//! - [`client`] — generates `rpc-client.ts` (`RpcClient` interface,
6//! `createRpcClient` factory, `RpcError` class, `rpcFetch` helper).
7
8/// Shorthand for `let _ = writeln!(...)` when writing to a `String` buffer.
9///
10/// Writing to `String` is infallible, so the result is always safe to discard.
11macro_rules! emit {
12 ($dst:expr, $($arg:tt)*) => {
13 {
14 use ::std::fmt::Write as _;
15 let _ = writeln!($dst, $($arg)*);
16 }
17 };
18}
19
20pub mod client;
21pub mod typescript;