import { EndpointChangeEvent, EndpointDefinition, EndpointHealth } from '../types';
import { getEndpointRegistry } from '../registry/EndpointRegistry';
/**
* Hook to access an endpoint by name.
*
* @param name - The endpoint name
*
* @example
* ```tsx
* function UserList() {
* const endpoint = useEndpoint('users.list');
*
* if (!endpoint) {
* return
Endpoint not found
;
* }
*
* return Path: {endpoint.path}
;
* }
* ```
*/
export declare function useEndpoint(name: string): EndpointDefinition | undefined;
/**
* Hook to get all endpoints.
*/
export declare function useAllEndpoints(): readonly EndpointDefinition[];
/**
* Hook to get endpoints by tag.
*/
export declare function useEndpointsByTag(tag: string): readonly EndpointDefinition[];
/**
* Hook to build an endpoint URL.
*
* @param name - The endpoint name
* @param params - Path parameters
* @param query - Query parameters
*
* @example
* ```tsx
* function UserDetail({ userId }: { userId: string }) {
* const url = useEndpointUrl('users.detail', { id: userId });
* // url = '/users/123'
*
* return URL: {url}
;
* }
* ```
*/
export declare function useEndpointUrl(name: string, params?: Record, query?: Record): string | null;
/**
* Hook to get a URL builder function for an endpoint.
*
* @param name - The endpoint name
*
* @example
* ```tsx
* function UserList() {
* const buildUserUrl = useEndpointUrlBuilder('users.detail');
*
* return (
*
* );
* }
* ```
*/
export declare function useEndpointUrlBuilder(name: string): (params?: Record, query?: Record) => string | null;
/**
* Hook to monitor endpoint health.
*
* @param name - The endpoint name
*
* @example
* ```tsx
* function EndpointStatus({ name }: { name: string }) {
* const health = useEndpointHealth(name);
*
* if (!health) {
* return Unknown;
* }
*
* return (
*
* {health.status} ({health.avgResponseTime}ms)
*
* );
* }
* ```
*/
export declare function useEndpointHealth(name: string): EndpointHealth | undefined;
/**
* Hook to check if an endpoint is healthy.
*/
export declare function useIsEndpointHealthy(name: string): boolean;
/**
* Hook to get all unhealthy endpoints.
*/
export declare function useUnhealthyEndpoints(): readonly string[];
/**
* Hook to get all degraded endpoints.
*/
export declare function useDegradedEndpoints(): readonly string[];
/**
* Hook to get endpoint registry statistics.
*/
export declare function useEndpointStats(): ReturnType['getStats'] extends () => infer R ? R : never;
/**
* Hook to track endpoint changes.
*
* @param onChangeCallback - Callback to invoke when endpoints change
*/
export declare function useEndpointChangeTracking(onChangeCallback: (event: EndpointChangeEvent) => void): void;
/**
* Hook to get the last endpoint change.
*/
export declare function useLastEndpointChange(): EndpointChangeEvent | null;
/**
* Hook to register an endpoint on mount and unregister on unmount.
*
* Useful for dynamic endpoints in feature modules.
*
* @param definition - The endpoint definition
* @param autoRemove - Whether to remove on unmount (default: true)
*
* @example
* ```tsx
* function FeatureModule() {
* // Registers on mount, removes on unmount
* useRegisterEndpoint({
* name: 'feature.custom',
* path: '/feature/custom',
* method: 'GET',
* auth: true,
* });
*
* return Feature Module
;
* }
* ```
*/
export declare function useRegisterEndpoint(definition: EndpointDefinition, autoRemove?: boolean): void;
/**
* Hook to get endpoint management functions.
*/
export declare function useEndpointRegistry(): {
registry: ReturnType;
register: (definition: EndpointDefinition) => void;
update: (name: string, updates: Partial) => void;
remove: (name: string) => void;
markHealthy: (name: string, responseTime?: number) => void;
markUnhealthy: (name: string, reason: string) => void;
};