Types: V → TS projection
The Vite plugin reads .v files as text and writes .swelte/types/** +
runtime stubs. V never emits TS; tsc never reads V.
pub struct LoginArgs { pub: payload string }
pub struct Session { pub: id string ... }
@[rpc] pub fn login(args LoginArgs) !Session { ... }export interface Session { id: string; ... }
export type LoginResult = Session;
export function login(args: { payload: string }): Promise<LoginResult>;Type table
| V | TS |
|---|---|
string | string |
bool | boolean |
int / f64 | number |
[]T | T[] |
[]u8 | Blob |
map[string]T | Record<string, unknown> |
time.Time | number (unix epoch) |
?T | T | null |
!T | T + fallible (rejects with SwelteRpcError) |
SwelteResponse | { status, headers, cookies, body } |
Per-route
RouteId + Params types ship in every types/routes/*.d.ts — the $types-lite. Unknown names project unknown + warning.