import { type Signal } from '@angular/core'; import { type Data } from '@angular/router'; import { DefaultValueOptions, InjectorOptions } from 'ngxtension/shared'; type RouteDataTransformFn = (data: Data) => T; /** * The `RouteDataOptions` type defines options for configuring the behavior of the `injectRouteData` function. * * @template ReadT - The expected type of the read value. * @template WriteT - The type of the value to be written. * @template DefaultValueT - The type of the default value. */ export type RouteDataOptions = DefaultValueOptions & InjectorOptions; /** * The `injectRouteData` function allows you to access and manipulate route data from the current route. * * @returns A `Signal` that emits the entire data object. */ export declare function injectRouteData(): Signal; /** * The `injectRouteData` function allows you to access and manipulate route data from the current route. * * @template T - The expected type of the read value. * @param {string} key - The name of the route data to retrieve. * @param {RouteDataOptions} options - Optional configuration options for the route data. * @returns {Signal} A `Signal` that emits the value of the specified route data, or `null` if it's not present. */ export declare function injectRouteData(key: keyof Data, options?: RouteDataOptions): Signal; /** * The `injectRouteData` function allows you to access and manipulate route data from the current route. * It retrieves the value of the route data based on a custom transform function applied to the route data object. * * @template T - The expected type of the read value. * @param {RouteDataTransformFn} fn - A transform function that takes the route data object and returns the desired value. * @param {RouteDataOptions} options - Optional configuration options for the route data. * @returns {Signal} A `Signal` that emits the transformed value based on the provided custom transform function. * * @example * const searchValue = injectRouteData((data) => data['search'] as string); */ export declare function injectRouteData(fn: RouteDataTransformFn, options?: RouteDataOptions): Signal; export declare namespace injectRouteData { var global: (keyOrTransform?: keyof Data | RouteDataTransformFn, options?: RouteDataOptions) => Signal; } export {};