Reference
Classes
| Class | Description |
|---|---|
| ApiError | Thrown when the server returns a non-OK response. |
| FetchError | Thrown when the network request fails. |
| ParseError | Thrown when Zod validation of the response fails. |
Interfaces
| Interface | Description |
|---|---|
| Cache | The ETag cache for GET requests. |
| CacheEntry | A cached response entry. |
| Contract | The API contract. |
| CreateClientOptions | The options for createClient. |
| Endpoint | The API endpoint. |
| RequestOptions | The per-request options. |
Type Aliases
| Type Alias | Description |
|---|---|
| EndpointMethod | The supported HTTP method. |
| KeyFormat | The key format for request serialization or response normalization. |
| Operation | The callable client operation with flat and raw overloads. |
| Result | The result returned when the catch option is set, discriminated on ok. |
Functions
| Function | Description |
|---|---|
| createClient | Creates a typed API client from a contract. |
| createClientFactory | Creates a factory function pre-configured with a contract. |
| defineContract | Defines a contract with full type inference. |
| defineEndpoint | Defines an endpoint with full type inference. |