import { RouteMap, RouteLocationNormalizedLoaded, LocationQuery } from 'vue-router'; import { ErrorDefault, DefineLoaderFn, DataLoaderContextBase, UseDataLoader, _PromiseMerged, NavigationResult, UseDataLoaderResult, DefineDataLoaderOptionsBase_LaxData, DataLoaderEntryBase } from 'unplugin-vue-router/data-loaders'; import { ShallowRef } from 'vue'; import { UseQueryOptions, EntryKey, UseQueryReturn } from '@pinia/colada'; import { DefineDataLoaderOptionsBase_DefinedData } from './index.cjs'; /** * Creates a Pinia Colada data loader with `data` is always defined. * * @param name - name of the route to have typed routes * @param options - options to configure the data loader */ declare function defineColadaLoader(name: Name, options: DefineDataColadaLoaderOptions_DefinedData): UseDataLoaderColada_DefinedData; /** * Creates a Pinia Colada data loader with `data` is possibly `undefined`. * * @param name - name of the route to have typed routes * @param options - options to configure the data loader */ declare function defineColadaLoader(name: Name, options: DefineDataColadaLoaderOptions_LaxData): UseDataLoaderColada_LaxData; /** * Creates a Pinia Colada data loader with `data` is always defined. * @param options - options to configure the data loader */ declare function defineColadaLoader(options: DefineDataColadaLoaderOptions_DefinedData): UseDataLoaderColada_DefinedData; /** * Creates a Pinia Colada data loader with `data` is possibly `undefined`. * @param options - options to configure the data loader */ declare function defineColadaLoader(options: DefineDataColadaLoaderOptions_LaxData): UseDataLoaderColada_LaxData; /** * Base type with docs for the options of `defineColadaLoader`. * @internal */ interface _DefineDataColadaLoaderOptions_Common extends Omit, 'query' | 'key'> { /** * Key associated with the data and passed to pinia colada * @param to - Route to load the data */ key: EntryKey | ((to: RouteLocationNormalizedLoaded) => EntryKey); /** * Function that returns a promise with the data. */ query: DefineLoaderFn>; } /** * Options for `defineColadaLoader` when the data is possibly `undefined`. */ interface DefineDataColadaLoaderOptions_LaxData extends _DefineDataColadaLoaderOptions_Common, DefineDataLoaderOptionsBase_LaxData { } /** * Options for `defineColadaLoader` when the data is always defined. */ interface DefineDataColadaLoaderOptions_DefinedData extends _DefineDataColadaLoaderOptions_Common, DefineDataLoaderOptionsBase_DefinedData { } /** * @deprecated Use {@link `DefineDataColadaLoaderOptions_LaxData`} instead. */ type DefineDataColadaLoaderOptions = DefineDataColadaLoaderOptions_LaxData; /** * @internal */ interface DataColadaLoaderContext extends DataLoaderContextBase { } interface UseDataLoaderColadaResult extends UseDataLoaderResult, Pick, 'isPending' | 'status' | 'asyncStatus' | 'state'> { refetch: (to?: RouteLocationNormalizedLoaded) => ReturnType['refetch']>; refresh: (to?: RouteLocationNormalizedLoaded) => ReturnType['refetch']>; } /** * Data Loader composable returned by `defineColadaLoader()`. */ interface UseDataLoaderColada_LaxData extends UseDataLoader { /** * Data Loader composable returned by `defineColadaLoader()`. * * @example * Returns the Data loader data, isLoading, error etc. Meant to be used in `setup()` or ` * ``` * * @example * It also returns a promise of the data when used in nested loaders. Note this `data` is **not a ref**. This is not meant to be used in `setup()` or ` * ``` * * @example * It also returns a promise of the data when used in nested loaders. Note this `data` is **not a ref**. This is not meant to be used in `setup()` or `