@adonisjs/inertia
Version:
Official Inertia.js adapter for AdonisJS
25 lines (24 loc) • 938 B
TypeScript
import React from 'react';
import type { Tuyau } from '@tuyau/core/client';
import type { TuyauRegistry } from '@tuyau/core/types';
/**
* Provider component that makes the Tuyau client available to child components.
*
* This component should wrap your entire application or the part of your
* application that needs access to type-safe routing functionality.
*
*/
export declare function TuyauProvider<R extends TuyauRegistry>(props: {
children: React.ReactNode;
client: Tuyau<R>;
}): import("react/jsx-runtime").JSX.Element;
/**
* Hook to access the Tuyau client from any component within a TuyauProvider.
*
* Provides type-safe access to route generation and navigation utilities.
* Must be used within a component tree wrapped by TuyauProvider.
*
* @returns The Tuyau client instance with full type safety
* @throws Error if used outside of a TuyauProvider
*/
export declare function useTuyau(): Tuyau<any, any>;