import { DefineDataLoaderOptionsBase_DefinedData } from "./createDataLoader-DviHPCj3.cjs"; import { LocationQuery, RouteLocationNormalizedLoaded, RouteMap } from "vue-router"; import { DataLoaderContextBase, DataLoaderEntryBase, DefineDataLoaderOptionsBase_LaxData, DefineLoaderFn, ErrorDefault, NavigationResult, UseDataLoader, UseDataLoaderResult, _PromiseMerged } from "unplugin-vue-router/data-loaders"; import { ShallowRef } from "vue"; import { EntryKey, UseQueryOptions, UseQueryReturn } from "@pinia/colada"; //#region src/data-loaders/defineColadaLoader.d.ts /** * 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'> { /** * Equivalent to `useQuery().refetch()`. Refetches the data no matter if its stale or not. * @see reload - It also calls `refetch()` but returns an empty promise */ refetch: (to?: RouteLocationNormalizedLoaded) => ReturnType['refetch']>; /** * Equivalent to `useQuery().refresh()`. Refetches the data **only** if it's stale. */ 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 `