FerryDocs
ContributingWeb client

Add an endpoint

The TypeScript types copy the Rust types by hand. When the API changes, update four files in order.

Edit on GitHub

types.ts. The copy of the Rust types.

1 / 5

Update the types

Update src/lib/api/types.ts. This file is the mirror of dto.rs, models.rs and logs.rs in ferry-core.

Add the call

Add the call to src/lib/api/endpoints.ts. For new data in the cache, add a key to src/lib/api/keys.ts.

Add the hooks

Add or extend the hooks and the hooks in src/lib/api/queries/.

Refresh the data on a change

Some data must refresh by itself. Add its query keys to the of the correct change kind in src/lib/api/events.ts.

Regenerate the API reference

In docs/
npm run generate

See Generated references.

On this page