toolmark-monorepo / @toolmark/inertia / RouterLike
Interface: RouterLike
Defined in: packages/inertia/src/router-like.ts:63
The subset of @inertiajs/react's router Toolmark needs, structurally compatible with the Inertia 2 and Inertia 3 routers (pass router from @inertiajs/react directly). Declared locally so Toolmark's emitted types never import @inertiajs/*.
Methods
on()
on(
event,cb): () =>void
Defined in: packages/inertia/src/router-like.ts:71
Subscribes to a global router event.
Parameters
event
An event both majors dispatch; inertiaPages listens to navigate (whose detail.page.props holds the new page's props).
cb
(e) => void
Receives the DOM CustomEvent Inertia dispatches.
Returns
An unsubscribe function.
() => void
visit()
visit(
url,opts?):void
Defined in: packages/inertia/src/router-like.ts:77
Starts a visit.
Parameters
url
string
Target URL.
opts?
Method, data, preserveState and per-visit callbacks.
Returns
void