Skip to content

basalt / sdk/src / Endpoint

Interface: Endpoint<B, Q, P, R> ​

Defined in: sdk/src/endpoint.ts:10

A typed API endpoint — the single source of truth shared by the client (and, later, the server route + OpenAPI). Schemas are Zod, so the input and output types are inferred, not hand-written.

Type Parameters ​

B ​

B extends ZodType | undefined = ZodType | undefined

Q ​

Q extends ZodType | undefined = ZodType | undefined

P ​

P extends ZodType | undefined = ZodType | undefined

R ​

R extends ZodType | undefined = ZodType | undefined

Properties ​

body? ​

> optional body?: B

Defined in: sdk/src/endpoint.ts:19


method ​

> method: HttpMethod

Defined in: sdk/src/endpoint.ts:16


params? ​

> optional params?: P

Defined in: sdk/src/endpoint.ts:21


path ​

> path: string

Defined in: sdk/src/endpoint.ts:18

Path with :param placeholders, e.g. /projects/:id.


query? ​

> optional query?: Q

Defined in: sdk/src/endpoint.ts:20


result? ​

> optional result?: R

Defined in: sdk/src/endpoint.ts:23

Success response schema — validated client-side to catch drift.

Released under the MIT License.