版博士V2.0程序
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

runtime.d.ts 2.4 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import { Router, RouteLocationNormalized, RouteRecordRaw } from 'vue-router';
  2. import { a as DataLoader } from './defineLoader-bde635fd.js';
  3. export { D as DefineLoaderOptions, d as _defineLoader, s as _stopDataFetchingScope } from './defineLoader-bde635fd.js';
  4. import { A as Awaitable } from './options-3030b9f1.js';
  5. import 'vue';
  6. declare const HasDataLoaderMeta: unique symbol;
  7. declare module 'vue-router' {
  8. interface RouteMeta {
  9. /**
  10. * List of lazy imports of modules that might have a loader. We need to extract the exports that are actually
  11. * loaders.
  12. */
  13. [HasDataLoaderMeta]?: Array<() => Promise<Record<string, DataLoader<unknown> | unknown>>>;
  14. }
  15. }
  16. type NavigationResult = any;
  17. interface SetupDataFetchingGuardOptions {
  18. /**
  19. * Initial data to skip the initial data loaders. This is useful for SSR and should be set only on client side.
  20. */
  21. initialData?: Record<string, unknown>;
  22. /**
  23. * Hook that is called before each data loader is called. Can return a promise to delay the data loader call.
  24. */
  25. beforeLoad?: (route: RouteLocationNormalized) => Promise<unknown>;
  26. /**
  27. * Called if any data loader returns a `NavigationResult` with an array of them. Should decide what is the outcome of
  28. * the data fetching guard. Note this isn't called if no data loaders return a `NavigationResult`.
  29. */
  30. selectNavigationResult?: (results: NavigationResult[]) => Awaitable<NavigationResult | undefined | void>;
  31. }
  32. declare function setupDataFetchingGuard(router: Router, { initialData }?: SetupDataFetchingGuardOptions): Record<string, unknown> | null | undefined;
  33. /**
  34. * Defines properties of the route for the current page component.
  35. *
  36. * @param route - route information to be added to this page
  37. */
  38. declare const _definePage: (route: DefinePage) => DefinePage;
  39. /**
  40. * Merges route records.
  41. *
  42. * @internal
  43. *
  44. * @param main - main route record
  45. * @param routeRecords - route records to merge
  46. * @returns merged route record
  47. */
  48. declare function _mergeRouteRecord(main: RouteRecordRaw, ...routeRecords: Partial<RouteRecordRaw>[]): RouteRecordRaw;
  49. /**
  50. * Type to define a page. Can be augmented to add custom properties.
  51. */
  52. interface DefinePage extends Partial<Omit<RouteRecordRaw, 'children' | 'components' | 'component'>> {
  53. }
  54. export { DataLoader, DefinePage, HasDataLoaderMeta as _HasDataLoaderMeta, _definePage, _mergeRouteRecord, setupDataFetchingGuard as _setupDataFetchingGuard };