@kitbag/router 0.25.0 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/components/routerLink.d.ts +3 -3
  2. package/dist/compositions/useHasSuspenseBoundary.browser.spec.d.ts +1 -0
  3. package/dist/compositions/useHasSuspenseBoundary.d.ts +4 -0
  4. package/dist/compositions/useIsServerRendering.browser.spec.d.ts +1 -0
  5. package/dist/compositions/useIsServerRendering.d.ts +5 -0
  6. package/dist/compositions/useIsServerRendering.spec.d.ts +1 -0
  7. package/dist/errors/contextRedirectError.d.ts +7 -0
  8. package/dist/errors/navigationAbandonedError.d.ts +1 -0
  9. package/dist/errors/payloadValueError.d.ts +9 -0
  10. package/dist/errors/ssrOptionRequiredError.d.ts +7 -0
  11. package/dist/errors/unsupportedSchemaVendorError.d.ts +7 -0
  12. package/dist/errors/updateWithoutRouteError.d.ts +7 -0
  13. package/dist/kitbag-router.d.ts +1 -1
  14. package/dist/kitbag-router.js +6647 -6429
  15. package/dist/kitbag-router.umd.cjs +5 -5
  16. package/dist/main.d.ts +2 -0
  17. package/dist/services/addLoader.d.ts +4 -1
  18. package/dist/services/addView.d.ts +4 -1
  19. package/dist/services/arktype.spec-d.d.ts +1 -0
  20. package/dist/services/arktype.spec.d.ts +1 -0
  21. package/dist/services/createActivityTracker.d.ts +6 -0
  22. package/dist/services/createActivityTracker.spec.d.ts +1 -0
  23. package/dist/services/createCurrentRejection.d.ts +0 -3
  24. package/dist/services/createNavigationIds.d.ts +6 -0
  25. package/dist/services/createNavigationIds.spec.d.ts +1 -0
  26. package/dist/services/createNavigationStores.d.ts +10 -5
  27. package/dist/services/createRejection.d.ts +2 -6
  28. package/dist/services/createRejection.spec-d.d.ts +1 -0
  29. package/dist/services/createRejection.spec.d.ts +1 -0
  30. package/dist/services/createRouteHooks.d.ts +1 -1
  31. package/dist/services/createRouteValueStore.d.ts +44 -12
  32. package/dist/services/createRouteValueStore.spec.d.ts +1 -0
  33. package/dist/services/createRouterCallbackContext.d.ts +1 -1
  34. package/dist/services/createRouterHistory.spec.d.ts +1 -0
  35. package/dist/services/createServerRedirect.d.ts +14 -0
  36. package/dist/services/createServerRedirect.spec.d.ts +1 -0
  37. package/dist/services/getComputations.d.ts +40 -0
  38. package/dist/services/getGlobalRouteHooks.d.ts +2 -2
  39. package/dist/services/getInitialUrl.d.ts +2 -1
  40. package/dist/services/getRouteHooks.d.ts +2 -2
  41. package/dist/services/getRoutesForRouter.d.ts +3 -1
  42. package/dist/services/hooks.d.ts +1 -1
  43. package/dist/services/payload.d.ts +86 -0
  44. package/dist/services/payload.spec.d.ts +1 -0
  45. package/dist/services/standardSchema.d.ts +21 -0
  46. package/dist/services/urlParser.d.ts +5 -0
  47. package/dist/tests/hydration.browser.spec.d.ts +1 -0
  48. package/dist/tests/render.spec.d.ts +1 -0
  49. package/dist/types/addLoader.d.ts +3 -2
  50. package/dist/types/addView.d.ts +7 -2
  51. package/dist/types/callbackContext.d.ts +9 -0
  52. package/dist/types/hooks.d.ts +14 -15
  53. package/dist/types/paramTypes.d.ts +2 -3
  54. package/dist/types/params.d.ts +1 -1
  55. package/dist/types/redirects.d.ts +11 -3
  56. package/dist/types/rejection.d.ts +24 -4
  57. package/dist/types/resolved.d.ts +4 -2
  58. package/dist/types/routeLoaders.d.ts +2 -0
  59. package/dist/types/routeTitle.d.ts +2 -1
  60. package/dist/types/routeViews.d.ts +2 -0
  61. package/dist/types/router.d.ts +95 -3
  62. package/dist/types/routerPlugin.d.ts +7 -3
  63. package/dist/types/routerReject.d.ts +13 -0
  64. package/dist/types/routerRoute.d.ts +1 -1
  65. package/dist/types/serverRenderResponse.spec-d.d.ts +1 -0
  66. package/dist/utilities/components.d.ts +13 -1
  67. package/dist/utilities/setDocumentTitle.d.ts +1 -2
  68. package/package.json +10 -15
  69. package/dist/services/valibot.d.ts +0 -7
  70. package/dist/services/zod.d.ts +0 -11
@@ -14,7 +14,7 @@ type RouterLinkSlots = {
14
14
  }) => VNode[];
15
15
  };
16
16
  export declare function createRouterLink<TRouter extends Router>(routerKey: InjectionKey<TRouter>): import('vue').DefineSetupFnComponent<RouterLinkProps<TRouter>, EmitsOptions, SlotsType<RouterLinkSlots>, import('../main').RouterPushOptions & {
17
- to: UrlString | Readonly<{
17
+ to: Readonly<{
18
18
  id: string;
19
19
  matched: import('../main').CreatedRouteOptions;
20
20
  matches: import('../main').CreatedRouteOptions[];
@@ -26,8 +26,8 @@ export declare function createRouterLink<TRouter extends Router>(routerKey: Inje
26
26
  href: UrlString;
27
27
  query: URLSearchParams;
28
28
  hash: string;
29
- title: Promise<string | undefined>;
30
- }> | ToCallback<TRouter>;
29
+ getTitle: import('../types/routeTitle').GetTitleCallback;
30
+ }> | UrlString | ToCallback<TRouter>;
31
31
  prefetch?: import('../main').PrefetchConfig;
32
32
  target?: string;
33
33
  } & ({
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Whether the component is inside a Suspense boundary. Must be called during setup.
3
+ */
4
+ export declare function useHasSuspenseBoundary(): boolean;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * True under `renderToString`, false on the client including while hydrating through `createSSRApp`.
3
+ * Must be called during setup.
4
+ */
5
+ export declare function useIsServerRendering(): boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { CallbackContextRedirect } from '../types/callbackContext';
2
+ import { ContextError } from './contextError';
3
+ import { RedirectStatus } from '../types/router';
4
+ export declare class ContextRedirectError extends ContextError {
5
+ response: CallbackContextRedirect;
6
+ constructor(to: unknown[], redirectStatus: RedirectStatus | undefined);
7
+ }
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Thrown when data a getter is waiting on is discarded because navigation moved elsewhere.
3
+ * @group Errors
3
4
  */
4
5
  export declare class NavigationAbandonedError extends Error {
5
6
  constructor();
@@ -0,0 +1,9 @@
1
+ import { DataKind } from '../services/createNavigationStores';
2
+ /**
3
+ * A payload value that could not be written into the payload or read back out. Reported rather than
4
+ * thrown: the value is left out and its getter runs again on the client.
5
+ * @group Errors
6
+ */
7
+ export declare class PayloadValueError extends Error {
8
+ constructor(action: 'stringify' | 'parse', kind: DataKind, name: string, cause: unknown);
9
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * An error thrown when `render` is called on a router that was not created with the `ssr` option.
3
+ * @group Errors
4
+ */
5
+ export declare class SsrOptionRequiredError extends Error {
6
+ constructor();
7
+ }
@@ -0,0 +1,7 @@
1
+ import { StandardSchemaV1 } from '@standard-schema/spec';
2
+ /**
3
+ * An error thrown when a param is a standard schema from a vendor the router does not support.
4
+ */
5
+ export declare class UnsupportedSchemaVendorError extends Error {
6
+ constructor(schema: StandardSchemaV1);
7
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * An error thrown when `update` is called without a route to update. Only hooks with a destination
3
+ * are given `update`, so this is only reachable by ignoring TypeScript.
4
+ */
5
+ export declare class UpdateWithoutRouteError extends Error {
6
+ constructor();
7
+ }
@@ -1,2 +1,2 @@
1
- export * from './main'
1
+ export * from './main.js'
2
2
  export {}