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 structure of an API contract. |
| CreateClientOptions | Options for createClient. |
| Endpoint | A single API endpoint. |
| RequestOptions | The per-request options. |
Type Aliases
| Type Alias | Description |
|---|---|
| Client | The typed client matching the contract's endpoint tree. |
| EndpointMethod | The HTTP methods supported by endpoints. |
| InferError | The inferred error type from a contract's error schema. |
| KeyFormat | The key format for request serialization or response normalization. |
| Result | The return type when using catch. Discriminated on ok. |
Functions
| Function | Description |
|---|---|
| createClient | Creates a typed API client from a contract. |
| defineContract | Defines a contract with full type inference. |
| defineEndpoint | Defines an endpoint with full type inference. |