@lwrjs/router 0.10.0-alpha.16 → 0.10.0-alpha.18

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 (123) hide show
  1. package/build/bundle/prod/lwr/navigation/es/modules/lwr/currentView/currentView.d.ts +2 -3
  2. package/build/bundle/prod/lwr/router/es/modules/lwr/currentView/currentView.d.ts +2 -3
  3. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/currentView/currentView.d.ts +2 -3
  4. package/build/es/modules/lwr/currentPageReference/currentPageReference.d.ts +1 -1
  5. package/build/es/modules/lwr/currentView/currentView.d.ts +2 -2
  6. package/build/es/modules/lwr/domRouter/domRouter.d.ts +2 -2
  7. package/build/es/modules/lwr/domRouterUtils/historyUtils.d.ts +1 -1
  8. package/build/es/modules/lwr/domRouterUtils/types.d.ts +1 -1
  9. package/build/es/modules/lwr/navigationContext/navigationContext.d.ts +2 -2
  10. package/build/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +2 -2
  11. package/build/es/modules/lwr/routerUtils/filterUtils.d.ts +1 -1
  12. package/build/es/modules/lwr/routerUtils/pathToRegexp.d.ts +5 -5
  13. package/build/es/modules/lwr/routerUtils/types.d.ts +24 -24
  14. package/build/modules/lwr/outlet/outlet.html +1 -1
  15. package/package.json +5 -6
  16. package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextProvider/contextProvider.d.ts +0 -14
  17. package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextUtils/contextInfo.d.ts +0 -60
  18. package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextUtils/contextUtils.d.ts +0 -24
  19. package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextUtils/navigationApiStore.d.ts +0 -45
  20. package/build/bundle/prod/lwr/navigation/es/modules/lwr/currentPageReference/currentPageReference.d.ts +0 -9
  21. package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouter/domRouter.d.ts +0 -192
  22. package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/domRouterUtils.d.ts +0 -4
  23. package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/historyUtils.d.ts +0 -21
  24. package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/types.d.ts +0 -16
  25. package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/uriUtils.d.ts +0 -30
  26. package/build/bundle/prod/lwr/navigation/es/modules/lwr/historyRouter/historyRouter.d.ts +0 -48
  27. package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigation/navigation.d.ts +0 -16
  28. package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigation/navigationApi.d.ts +0 -22
  29. package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigation/navigationMixin.d.ts +0 -15
  30. package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigationContext/navigationContext.d.ts +0 -5
  31. package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +0 -7
  32. package/build/bundle/prod/lwr/navigation/es/modules/lwr/observable/observable.d.ts +0 -14
  33. package/build/bundle/prod/lwr/navigation/es/modules/lwr/outlet/outlet.d.ts +0 -19
  34. package/build/bundle/prod/lwr/navigation/es/modules/lwr/router/router.d.ts +0 -11
  35. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerBridge/routerBridge.d.ts +0 -13
  36. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerContainer/routerContainer.d.ts +0 -51
  37. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerContainer/utils.d.ts +0 -32
  38. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerErrors/routerErrors.d.ts +0 -13
  39. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/domUtils.d.ts +0 -2
  40. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/filterUtils.d.ts +0 -19
  41. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/parseUtils.d.ts +0 -42
  42. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/pathToRegexp.d.ts +0 -128
  43. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/routeDefUtils.d.ts +0 -43
  44. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/routeUtils.d.ts +0 -39
  45. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/routerUtils.d.ts +0 -22
  46. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/typeUtils.d.ts +0 -38
  47. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/types.d.ts +0 -133
  48. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/uriUtils.d.ts +0 -66
  49. package/build/bundle/prod/lwr/navigation/es/services/index.d.ts +0 -28
  50. package/build/bundle/prod/lwr/navigation/es/services/module-provider/index.d.ts +0 -22
  51. package/build/bundle/prod/lwr/navigation/es/services/module-provider/utils.d.ts +0 -27
  52. package/build/bundle/prod/lwr/router/es/modules/lwr/contextProvider/contextProvider.d.ts +0 -14
  53. package/build/bundle/prod/lwr/router/es/modules/lwr/contextUtils/contextInfo.d.ts +0 -60
  54. package/build/bundle/prod/lwr/router/es/modules/lwr/contextUtils/contextUtils.d.ts +0 -24
  55. package/build/bundle/prod/lwr/router/es/modules/lwr/contextUtils/navigationApiStore.d.ts +0 -45
  56. package/build/bundle/prod/lwr/router/es/modules/lwr/currentPageReference/currentPageReference.d.ts +0 -9
  57. package/build/bundle/prod/lwr/router/es/modules/lwr/domRouter/domRouter.d.ts +0 -192
  58. package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/domRouterUtils.d.ts +0 -4
  59. package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/historyUtils.d.ts +0 -21
  60. package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/types.d.ts +0 -16
  61. package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/uriUtils.d.ts +0 -30
  62. package/build/bundle/prod/lwr/router/es/modules/lwr/historyRouter/historyRouter.d.ts +0 -48
  63. package/build/bundle/prod/lwr/router/es/modules/lwr/navigation/navigation.d.ts +0 -16
  64. package/build/bundle/prod/lwr/router/es/modules/lwr/navigation/navigationApi.d.ts +0 -22
  65. package/build/bundle/prod/lwr/router/es/modules/lwr/navigation/navigationMixin.d.ts +0 -15
  66. package/build/bundle/prod/lwr/router/es/modules/lwr/navigationContext/navigationContext.d.ts +0 -5
  67. package/build/bundle/prod/lwr/router/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +0 -7
  68. package/build/bundle/prod/lwr/router/es/modules/lwr/observable/observable.d.ts +0 -14
  69. package/build/bundle/prod/lwr/router/es/modules/lwr/outlet/outlet.d.ts +0 -19
  70. package/build/bundle/prod/lwr/router/es/modules/lwr/router/router.d.ts +0 -11
  71. package/build/bundle/prod/lwr/router/es/modules/lwr/routerBridge/routerBridge.d.ts +0 -13
  72. package/build/bundle/prod/lwr/router/es/modules/lwr/routerContainer/routerContainer.d.ts +0 -51
  73. package/build/bundle/prod/lwr/router/es/modules/lwr/routerContainer/utils.d.ts +0 -32
  74. package/build/bundle/prod/lwr/router/es/modules/lwr/routerErrors/routerErrors.d.ts +0 -13
  75. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/domUtils.d.ts +0 -2
  76. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/filterUtils.d.ts +0 -19
  77. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/parseUtils.d.ts +0 -42
  78. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/pathToRegexp.d.ts +0 -128
  79. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/routeDefUtils.d.ts +0 -43
  80. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/routeUtils.d.ts +0 -39
  81. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/routerUtils.d.ts +0 -22
  82. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/typeUtils.d.ts +0 -38
  83. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/types.d.ts +0 -133
  84. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/uriUtils.d.ts +0 -66
  85. package/build/bundle/prod/lwr/router/es/services/index.d.ts +0 -28
  86. package/build/bundle/prod/lwr/router/es/services/module-provider/index.d.ts +0 -22
  87. package/build/bundle/prod/lwr/router/es/services/module-provider/utils.d.ts +0 -27
  88. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextProvider/contextProvider.d.ts +0 -14
  89. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextUtils/contextInfo.d.ts +0 -60
  90. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextUtils/contextUtils.d.ts +0 -24
  91. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextUtils/navigationApiStore.d.ts +0 -45
  92. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/currentPageReference/currentPageReference.d.ts +0 -9
  93. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouter/domRouter.d.ts +0 -192
  94. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/domRouterUtils.d.ts +0 -4
  95. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/historyUtils.d.ts +0 -21
  96. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/types.d.ts +0 -16
  97. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/uriUtils.d.ts +0 -30
  98. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/historyRouter/historyRouter.d.ts +0 -48
  99. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigation/navigation.d.ts +0 -16
  100. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigation/navigationApi.d.ts +0 -22
  101. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigation/navigationMixin.d.ts +0 -15
  102. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigationContext/navigationContext.d.ts +0 -5
  103. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +0 -7
  104. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/observable/observable.d.ts +0 -14
  105. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/outlet/outlet.d.ts +0 -19
  106. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/router/router.d.ts +0 -11
  107. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerBridge/routerBridge.d.ts +0 -13
  108. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerContainer/routerContainer.d.ts +0 -51
  109. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerContainer/utils.d.ts +0 -32
  110. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerErrors/routerErrors.d.ts +0 -13
  111. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/domUtils.d.ts +0 -2
  112. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/filterUtils.d.ts +0 -19
  113. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/parseUtils.d.ts +0 -42
  114. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/pathToRegexp.d.ts +0 -128
  115. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/routeDefUtils.d.ts +0 -43
  116. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/routeUtils.d.ts +0 -39
  117. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/routerUtils.d.ts +0 -22
  118. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/typeUtils.d.ts +0 -38
  119. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/types.d.ts +0 -133
  120. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/uriUtils.d.ts +0 -66
  121. package/build/bundle/prod/lwr/routerContainer/es/services/index.d.ts +0 -28
  122. package/build/bundle/prod/lwr/routerContainer/es/services/module-provider/index.d.ts +0 -22
  123. package/build/bundle/prod/lwr/routerContainer/es/services/module-provider/utils.d.ts +0 -27
@@ -1,11 +1,10 @@
1
- /// <reference types="lwc" />
2
1
  import type { ViewSet } from 'lwr/router';
3
2
  import type { Constructable } from 'lwr/routerUtils';
4
- declare type ViewContext = {
3
+ type ViewContext = {
5
4
  viewset: ViewSet;
6
5
  onComplete?: Function;
7
6
  } | undefined;
8
- declare type CurrentViewConfig = {
7
+ type CurrentViewConfig = {
9
8
  viewName?: string;
10
9
  };
11
10
  /**
@@ -1,11 +1,10 @@
1
- /// <reference types="lwc" />
2
1
  import type { ViewSet } from 'lwr/router';
3
2
  import type { Constructable } from 'lwr/routerUtils';
4
- declare type ViewContext = {
3
+ type ViewContext = {
5
4
  viewset: ViewSet;
6
5
  onComplete?: Function;
7
6
  } | undefined;
8
- declare type CurrentViewConfig = {
7
+ type CurrentViewConfig = {
9
8
  viewName?: string;
10
9
  };
11
10
  /**
@@ -1,11 +1,10 @@
1
- /// <reference types="lwc" />
2
1
  import type { ViewSet } from 'lwr/router';
3
2
  import type { Constructable } from 'lwr/routerUtils';
4
- declare type ViewContext = {
3
+ type ViewContext = {
5
4
  viewset: ViewSet;
6
5
  onComplete?: Function;
7
6
  } | undefined;
8
- declare type CurrentViewConfig = {
7
+ type CurrentViewConfig = {
9
8
  viewName?: string;
10
9
  };
11
10
  /**
@@ -1,5 +1,5 @@
1
1
  import type { PageReference } from 'lwr/router';
2
- declare type PageReferenceContext = PageReference | undefined;
2
+ type PageReferenceContext = PageReference | undefined;
3
3
  /**
4
4
  * Services @wire(CurrentPageReference) requests.
5
5
  * Hooks up to an Observable from the current navigation context.
@@ -1,11 +1,11 @@
1
1
  /// <reference types="lwc" />
2
2
  import type { ViewSet } from 'lwr/router';
3
3
  import type { Constructable } from 'lwr/routerUtils';
4
- declare type ViewContext = {
4
+ type ViewContext = {
5
5
  viewset: ViewSet;
6
6
  onComplete?: Function;
7
7
  } | undefined;
8
- declare type CurrentViewConfig = {
8
+ type CurrentViewConfig = {
9
9
  viewName?: string;
10
10
  };
11
11
  /**
@@ -14,8 +14,8 @@ export declare const PARENT_EVENT: string;
14
14
  interface RouterParent {
15
15
  addChild(child: DomRouter): Promise<void>;
16
16
  }
17
- export declare type ParentRouterEvent = CustomEvent<(router: RouterParent) => void>;
18
- declare type DomRoutingMatch = RoutingMatch & {
17
+ export type ParentRouterEvent = CustomEvent<(router: RouterParent) => void>;
18
+ type DomRoutingMatch = RoutingMatch & {
19
19
  url: string;
20
20
  };
21
21
  interface DomRouterNode extends RouterParent {
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: MIT
5
5
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6
6
  */
7
- import { RouteInstance } from '../routerUtils/types';
7
+ import type { RouteInstance } from '../routerUtils/types';
8
8
  /**
9
9
  * Sets a history state.
10
10
 
@@ -3,7 +3,7 @@ export interface RouteChange {
3
3
  current?: RoutingMatch;
4
4
  next: RoutingMatch;
5
5
  }
6
- export declare type NavigationHandler = (address: PageReference, replace?: boolean) => boolean;
6
+ export type NavigationHandler = (address: PageReference, replace?: boolean) => boolean;
7
7
  export interface DomRouterConfig {
8
8
  handleNavigation?: NavigationHandler;
9
9
  }
@@ -1,5 +1,5 @@
1
- export declare type ContextId = () => void;
2
- declare type NavigationContextType = ContextId | undefined;
1
+ export type ContextId = () => void;
2
+ type NavigationContextType = ContextId | undefined;
3
3
  export declare const NavigationContext: import("lwr/contextUtils").ContextualWireAdapter<NavigationContextType, unknown, NavigationContextType>;
4
4
  export {};
5
5
  //# sourceMappingURL=navigationContext.d.ts.map
@@ -1,7 +1,7 @@
1
1
  export declare const CONTEXT_ID_BACKDOOR: string;
2
- export declare type NavigationContextBackdoorEvent = globalThis.CustomEvent<NavigationContextBackdoorEventPayload>;
2
+ export type NavigationContextBackdoorEvent = globalThis.CustomEvent<NavigationContextBackdoorEventPayload>;
3
3
  import type { ContextId } from 'lwr/navigation';
4
- export declare type NavigationContextBackdoorEventPayload = {
4
+ export type NavigationContextBackdoorEventPayload = {
5
5
  callback: (contextId: ContextId) => void;
6
6
  };
7
7
  //# sourceMappingURL=navigationMixinHacks.d.ts.map
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: MIT
5
5
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6
6
  */
7
- export declare type Filter<V> = (v: V) => Promise<boolean> | boolean;
7
+ export type Filter<V> = (v: V) => Promise<boolean> | boolean;
8
8
  export interface FilterChain<V> {
9
9
  add: (f: Filter<V>[] | Filter<V>) => void;
10
10
  compile: (arg: V) => Promise<boolean>;
@@ -26,7 +26,7 @@ export interface TokensToFunctionOptions {
26
26
  */
27
27
  validate?: boolean;
28
28
  }
29
- export declare type PathFunction<P extends object = object> = (data?: P) => string;
29
+ export type PathFunction<P extends object = object> = (data?: P) => string;
30
30
  /**
31
31
  * Expose a method for transforming tokens into the path function.
32
32
  */
@@ -52,11 +52,11 @@ export interface MatchResult<P extends object = object> {
52
52
  /**
53
53
  * A match is either `false` (no match) or a match result.
54
54
  */
55
- export declare type Match<P extends object = object> = false | MatchResult<P>;
55
+ export type Match<P extends object = object> = false | MatchResult<P>;
56
56
  /**
57
57
  * The match function takes a string and returns whether it matched the path.
58
58
  */
59
- export declare type MatchFunction<P extends object = object> = (path: string) => Match<P>;
59
+ export type MatchFunction<P extends object = object> = (path: string) => Match<P>;
60
60
  /**
61
61
  * Create a path match function from `path-to-regexp` output.
62
62
  */
@@ -74,7 +74,7 @@ export interface Key {
74
74
  /**
75
75
  * A token is a string (nothing special) or key metadata (capture group).
76
76
  */
77
- export declare type Token = string | Key;
77
+ export type Token = string | Key;
78
78
  export interface TokensToRegexpOptions {
79
79
  /**
80
80
  * When `true` the regexp will be case sensitive. (default: `false`)
@@ -112,7 +112,7 @@ export declare function tokensToRegexp(tokens: Token[], keys?: Key[], options?:
112
112
  /**
113
113
  * Supported `path-to-regexp` input types.
114
114
  */
115
- export declare type Path = string | RegExp | Array<string | RegExp>;
115
+ export type Path = string | RegExp | Array<string | RegExp>;
116
116
  /**
117
117
  * Normalize the given path string, returning a regular expression.
118
118
  *
@@ -1,40 +1,40 @@
1
1
  import type { Key, PathFunction } from './pathToRegexp';
2
2
  import type { ContextId } from 'lwr/navigationContext';
3
- import { Unsubscriber } from 'lwr/observable';
4
- export declare type Module = Record<string | symbol | number, unknown>;
5
- export declare type Constructor<T = object> = new (...args: any[]) => T;
3
+ import type { Unsubscriber } from 'lwr/observable';
4
+ export type Module = Record<string | symbol | number, unknown>;
5
+ export type Constructor<T = object> = new (...args: any[]) => T;
6
6
  export interface Constructable<T = object> {
7
7
  constructor: Constructor<T>;
8
8
  }
9
- export declare type UrlMapper<TAddress> = {
9
+ export type UrlMapper<TAddress> = {
10
10
  generateUrl(address: TAddress): string | null;
11
11
  parseUrl(url: string): TAddress | null;
12
12
  };
13
- export declare type RouteMatcher<TAddress> = {
13
+ export type RouteMatcher<TAddress> = {
14
14
  matchRoute(address: TAddress): RoutingMatch | null;
15
15
  };
16
- export declare type ViewMapper<TAddress> = {
16
+ export type ViewMapper<TAddress> = {
17
17
  navigate(address: TAddress): void;
18
18
  subscribe(callback: RouteCallback, replay?: boolean): Unsubscriber;
19
19
  resolveView(address: TAddress): Promise<RouteDestination>;
20
20
  contextId?: ContextId;
21
21
  };
22
- export declare type Router<TAddress = string> = ViewMapper<TAddress> & UrlMapper<TAddress> & RouteMatcher<TAddress>;
22
+ export type Router<TAddress = string> = ViewMapper<TAddress> & UrlMapper<TAddress> & RouteMatcher<TAddress>;
23
23
  export interface DEPRECATED_getRouteFromUrl {
24
24
  <TAddress>(url: string, defaultImpl: Function): TAddress | null;
25
25
  }
26
26
  export interface DEPRECATED_getUrlFromRoute {
27
27
  <TAddress>(route: TAddress, defaultImpl: Function): string | null;
28
28
  }
29
- export declare type RouterConfig = {
29
+ export type RouterConfig = {
30
30
  basePath?: string;
31
31
  routes?: RouteDefinition[];
32
32
  caseSensitive?: boolean;
33
33
  DEPRECATED_getRouteFromUrl?: DEPRECATED_getRouteFromUrl;
34
34
  DEPRECATED_getUrlFromRoute?: DEPRECATED_getUrlFromRoute;
35
35
  };
36
- export declare type RouterSerializationConfig<TAddress> = Required<Omit<RouterConfig, 'DEPRECATED_getRouteFromUrl' | 'DEPRECATED_getUrlFromRoute'> & UrlMapper<TAddress>>;
37
- export declare type RouteParameterPatterns = {
36
+ export type RouterSerializationConfig<TAddress> = Required<Omit<RouterConfig, 'DEPRECATED_getRouteFromUrl' | 'DEPRECATED_getUrlFromRoute'> & UrlMapper<TAddress>>;
37
+ export type RouteParameterPatterns = {
38
38
  [paramName: string]: string;
39
39
  };
40
40
  export interface RouteDefinition<TMetadata = Record<string, any>> {
@@ -46,21 +46,21 @@ export interface RouteDefinition<TMetadata = Record<string, any>> {
46
46
  handler: () => Promise<RouteHandlerModule>;
47
47
  metadata?: TMetadata;
48
48
  }
49
- export declare type PageBindings = {
49
+ export type PageBindings = {
50
50
  attributeBindings: NullableStringAttributes;
51
51
  stateBindings: NullableStringAttributes;
52
52
  };
53
- declare type CompiledQueryResult = {
53
+ type CompiledQueryResult = {
54
54
  literalValue?: string | null;
55
55
  routeParamName?: string;
56
56
  };
57
- export declare type CompiledQuery = Record<string, CompiledQueryResult>;
58
- declare type MatchedQueryResult = {
57
+ export type CompiledQuery = Record<string, CompiledQueryResult>;
58
+ type MatchedQueryResult = {
59
59
  value: string | null;
60
60
  routeParamName?: string;
61
61
  };
62
- export declare type MatchedQuery = Record<string, MatchedQueryResult>;
63
- export declare type QueryMatcher = (queryObject: QueryObject) => MatchedQuery | null;
62
+ export type MatchedQuery = Record<string, MatchedQueryResult>;
63
+ export type QueryMatcher = (queryObject: QueryObject) => MatchedQuery | null;
64
64
  export interface CompiledRouteDefinition {
65
65
  original: RouteDefinition;
66
66
  regex: RegExp;
@@ -69,11 +69,11 @@ export interface CompiledRouteDefinition {
69
69
  compiledQuery: CompiledQuery;
70
70
  queryMatcher: QueryMatcher;
71
71
  }
72
- export declare type RouteHandlerCallback = (routeDestination: RouteDestination) => void;
73
- export declare type RouteHandlerClass = {
72
+ export type RouteHandlerCallback = (routeDestination: RouteDestination) => void;
73
+ export type RouteHandlerClass = {
74
74
  new (callback: RouteHandlerCallback): RouteHandler;
75
75
  };
76
- export declare type RouteHandlerModule = {
76
+ export type RouteHandlerModule = {
77
77
  default: RouteHandlerClass;
78
78
  };
79
79
  export interface RouteInstance {
@@ -82,12 +82,12 @@ export interface RouteInstance {
82
82
  state: NullableStringAttributes;
83
83
  pageReference: PageReference;
84
84
  }
85
- export declare type RouteDestination = {
85
+ export type RouteDestination = {
86
86
  status?: 200 | 404 | 500;
87
87
  viewset: ViewSet;
88
88
  error?: Error;
89
89
  };
90
- export declare type RoutingMatch = {
90
+ export type RoutingMatch = {
91
91
  pathMatch: string;
92
92
  route: RouteInstance;
93
93
  routeDefinition: RouteDefinition;
@@ -96,7 +96,7 @@ export interface CompiledRoutingMatch {
96
96
  route: RouteInstance;
97
97
  routeDefinition: CompiledRouteDefinition;
98
98
  }
99
- export declare type RoutingResult = RoutingMatch & RouteDestination;
99
+ export type RoutingResult = RoutingMatch & RouteDestination;
100
100
  export interface ViewSet {
101
101
  [viewName: string]: (() => Promise<Module>) | ViewInfo;
102
102
  }
@@ -104,7 +104,7 @@ export interface ViewInfo {
104
104
  module: () => Promise<Module>;
105
105
  specifier: string;
106
106
  }
107
- export declare type RouteCallback = (result: RoutingResult) => void;
107
+ export type RouteCallback = (result: RoutingResult) => void;
108
108
  export interface RouteHandler {
109
109
  dispose(): void;
110
110
  update(routeInfo: RouteInstance): void;
@@ -122,7 +122,7 @@ export interface MessageObject {
122
122
  url?: string;
123
123
  address?: string;
124
124
  }
125
- export declare type QueryObject = NullableStringAttributes;
125
+ export type QueryObject = NullableStringAttributes;
126
126
  export interface StringAttributes {
127
127
  [key: string]: string;
128
128
  }
@@ -5,6 +5,6 @@
5
5
  </template>
6
6
  </div>
7
7
  <div class="outlet" role="region" tabindex="-1">
8
- <lwc:component lwc:is={viewCtor} class="lwr-dynamic"></lwc:component>
8
+ <lwr-dynamic lwc:dynamic={viewCtor} class="lwr-dynamic"></lwr-dynamic>
9
9
  </div>
10
10
  </template>
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "version": "0.10.0-alpha.16",
8
+ "version": "0.10.0-alpha.18",
9
9
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
10
10
  "repository": {
11
11
  "type": "git",
@@ -53,9 +53,9 @@
53
53
  "test:server": "jest --config ./jest.server.config.cjs"
54
54
  },
55
55
  "dependencies": {
56
- "@lwrjs/client-modules": "0.10.0-alpha.16",
57
- "@lwrjs/diagnostics": "0.10.0-alpha.16",
58
- "@lwrjs/shared-utils": "0.10.0-alpha.16",
56
+ "@lwrjs/client-modules": "0.10.0-alpha.18",
57
+ "@lwrjs/diagnostics": "0.10.0-alpha.18",
58
+ "@lwrjs/shared-utils": "0.10.0-alpha.18",
59
59
  "ajv": "6.12.6"
60
60
  },
61
61
  "devDependencies": {
@@ -64,7 +64,6 @@
64
64
  "jest": "^26.6.3",
65
65
  "rollup": "^2.78.0",
66
66
  "ts-jest": "^26.5.6",
67
- "typescript": "~4.3.5",
68
67
  "utam": "^2.0.2"
69
68
  },
70
69
  "peerDependencies": {
@@ -96,5 +95,5 @@
96
95
  "volta": {
97
96
  "extends": "../../../package.json"
98
97
  },
99
- "gitHead": "c5a13d471330c0f738d0c783fd1b69f456c544bd"
98
+ "gitHead": "15d09e9a17b6b070e162336234434d6800b2f32d"
100
99
  }
@@ -1,14 +0,0 @@
1
- import { Contextualizer } from 'lwc';
2
- import type { ContextualWireAdapter } from 'lwr/contextUtils';
3
- export declare const currentPageReferenceContextualizer: Contextualizer | undefined;
4
- export declare const currentViewContextualizer: Contextualizer | undefined;
5
- export declare const navigationContextContextualizer: Contextualizer | undefined;
6
- /**
7
- *
8
- * @param {TContext} contextValue - Context API object
9
- * @param {EventTarget} providerNode - Context DOM element
10
- * @param {Contextualizer} contextualizer - Function for providing this context to subtree nodes wired to a specific adapter
11
- * @param {ContextualWireAdapter<TContext, TEmit, TConfig>} contextualAdapter - Contextual wire adapter capable of subscribing to context changes
12
- */
13
- export declare function provideContext<TContext, TEmit, TConfig>(contextValue: TContext, providerNode: EventTarget, contextualizer?: Contextualizer, contextualAdapter?: ContextualWireAdapter<TContext, TEmit, TConfig>): void;
14
- //# sourceMappingURL=contextProvider.d.ts.map
@@ -1,60 +0,0 @@
1
- import type { ContextConsumer } from 'lwc';
2
- /**
3
- * Manages context for various providers
4
- */
5
- export declare class ContextInfo<TContext> {
6
- private infoMap;
7
- /**
8
- * The default value to be returned in the absence of a defined context
9
- */
10
- private defaultValue;
11
- constructor(defaultValue: TContext);
12
- /**
13
- * Gets the stored info for a context provider
14
- * @param targetProvider the context provider
15
- */
16
- getInfo(targetProvider: object): {
17
- consumers: Set<ContextConsumer>;
18
- contextValue: TContext;
19
- };
20
- /**
21
- * Set the context value directly associated with the target as a context provider.
22
- *
23
- * @param {Object} targetProvider
24
- * @param {FeatureContext} contextValue
25
- */
26
- setContext(targetProvider: object, contextValue: TContext): void;
27
- /**
28
- * Get the context value directly associated with the target as a context provider.
29
- *
30
- * @param {Object} targetProvider
31
- */
32
- getContext(targetProvider: object): TContext;
33
- /**
34
- * Clear the context value and registered subscribers directly associated with the
35
- * target as a context provider.
36
- *
37
- * @param {Object} targetProvider
38
- */
39
- clearContext(targetProvider: object): void;
40
- /**
41
- * Subscribe a consumer to the context value directly associated with the target as
42
- * a context provider. Calls to #set(targetProvider, contextValue) with the same
43
- * target will invoke the consumer.provide(contextValue) function.
44
- *
45
- * NOTE: Mutations to the contextValue directly do not result in calls to
46
- * consumer.provide(contextValue).
47
- *
48
- * @param {Object} targetProvider
49
- * @param {ContextConsumer} consumer object with a provide(context) function property.
50
- */
51
- subscribeContext(targetProvider: object, consumer: ContextConsumer): void;
52
- /**
53
- * Unsubscribe a previously subscribed consumer from listening to changes on the
54
- * target
55
- * @param {Object} targetProvider
56
- * @param {ContextConsumer} consumer
57
- */
58
- unsubscribeContext(targetProvider: object, consumer: ContextConsumer): void;
59
- }
60
- //# sourceMappingURL=contextInfo.d.ts.map
@@ -1,24 +0,0 @@
1
- import type { ContextConsumer } from 'lwc';
2
- import { ContextInfo } from './contextInfo';
3
- export { ContextInfo };
4
- export type { NavigationHelm } from './navigationApiStore';
5
- export { getNavigationHelm, registerNavigationHelm } from './navigationApiStore';
6
- export interface WireAdapter<TContext, TConfig, TEmit> {
7
- _callback(value: TEmit): void;
8
- update(config: TConfig, context: TContext): void;
9
- connect(): void;
10
- disconnect(): void;
11
- }
12
- /**
13
- * Interface for contextual wire adapters to subscribe to context changes
14
- */
15
- export interface ContextualWireAdapter<TContext, TConfig, TEmit> {
16
- new (callback: (value: TEmit) => void): WireAdapter<TContext, TConfig, TEmit>;
17
- setContext: (targetProvider: globalThis.EventTarget, contextValue: TContext) => void;
18
- getContext: (targetProvider: globalThis.EventTarget) => TContext;
19
- clearContext: (targetProvider: globalThis.EventTarget) => void;
20
- subscribeContext: (targetProvider: globalThis.EventTarget, consumer: ContextConsumer) => void;
21
- unsubscribeContext: (targetProvider: globalThis.EventTarget, consumer: ContextConsumer) => void;
22
- }
23
- export declare function generateContextualWireAdapter<TContext, TConfig = unknown, TEmit = TContext>(contextInstance: ContextInfo<TContext>): ContextualWireAdapter<TContext, TConfig, TEmit>;
24
- //# sourceMappingURL=contextUtils.d.ts.map
@@ -1,45 +0,0 @@
1
- /**
2
- * Copyright (c) 2019, salesforce.com, inc.
3
- * All rights reserved.
4
- * SPDX-License-Identifier: MIT
5
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6
- */
7
- import type { RouteCallback, PageReference } from 'lwr/router';
8
- import type { Unsubscriber } from 'lwr/observable';
9
- import type { ContextId } from 'lwr/navigationContext';
10
- /**
11
- * Provides the ability for a given context provider to find its NavigationHelm
12
- * provider by just an ID. Having access to the NavigationHelm allows the consumer
13
- * to direct navigation. Generally, the Helm is more powerful than the exposed APIs.
14
- */
15
- export interface NavigationHelm {
16
- navigate: (address: PageReference, replace?: boolean) => void;
17
- generateUrl: (address: PageReference) => string | null;
18
- subscribe: (callback: RouteCallback, replay?: boolean) => Unsubscriber;
19
- }
20
- interface NavigationContextData {
21
- id: ContextId;
22
- value: NavigationHelm;
23
- update: (newValue: NavigationHelm) => void;
24
- }
25
- /**
26
- * Return a navigation context by ID.
27
- * Exported API.
28
- *
29
- * @param {*} id - The ID of a navigation context.
30
- *
31
- * @return {object} - { navigate(), generateUrl(), subscribe() }
32
- */
33
- export declare function getNavigationHelm(id: ContextId): NavigationHelm;
34
- /**
35
- * Create and return the metadata for this context provider.
36
- * Cache the metadata by ID.
37
- *
38
- * @param {object} contextValue - Context API object
39
- * @param {RouteDefinition[]} data - Route data for this context
40
- *
41
- * @return {object} - The metadata object
42
- */
43
- export declare function registerNavigationHelm(contextId: ContextId, contextValue: NavigationHelm): NavigationContextData;
44
- export {};
45
- //# sourceMappingURL=navigationApiStore.d.ts.map
@@ -1,9 +0,0 @@
1
- import type { PageReference } from 'lwr/router';
2
- declare type PageReferenceContext = PageReference | undefined;
3
- /**
4
- * Services @wire(CurrentPageReference) requests.
5
- * Hooks up to an Observable from the current navigation context.
6
- */
7
- export declare const CurrentPageReference: import("lwr/contextUtils").ContextualWireAdapter<PageReferenceContext, unknown, PageReferenceContext>;
8
- export {};
9
- //# sourceMappingURL=currentPageReference.d.ts.map