@lwrjs/router 0.10.0-alpha.12 → 0.10.0-alpha.13
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.
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextProvider/contextProvider.d.ts +14 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextUtils/contextInfo.d.ts +60 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextUtils/contextUtils.d.ts +24 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextUtils/navigationApiStore.d.ts +45 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/currentPageReference/currentPageReference.d.ts +9 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/currentView/currentView.d.ts +3 -2
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouter/domRouter.d.ts +192 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/domRouterUtils.d.ts +4 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/historyUtils.d.ts +21 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/types.d.ts +16 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/uriUtils.d.ts +30 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/historyRouter/historyRouter.d.ts +48 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigation/navigation.d.ts +16 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigation/navigationApi.d.ts +22 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigation/navigationMixin.d.ts +15 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigationContext/navigationContext.d.ts +5 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +7 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/observable/observable.d.ts +14 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/outlet/outlet.d.ts +19 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/router/router.d.ts +11 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerBridge/routerBridge.d.ts +13 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerContainer/routerContainer.d.ts +51 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerContainer/utils.d.ts +32 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerErrors/routerErrors.d.ts +13 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/domUtils.d.ts +2 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/filterUtils.d.ts +19 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/parseUtils.d.ts +42 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/pathToRegexp.d.ts +128 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/routeDefUtils.d.ts +43 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/routeUtils.d.ts +39 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/routerUtils.d.ts +22 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/typeUtils.d.ts +38 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/types.d.ts +133 -0
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/uriUtils.d.ts +66 -0
- package/build/bundle/prod/lwr/navigation/es/services/index.d.ts +28 -0
- package/build/bundle/prod/lwr/navigation/es/services/module-provider/index.d.ts +22 -0
- package/build/bundle/prod/lwr/navigation/es/services/module-provider/utils.d.ts +27 -0
- package/build/bundle/prod/lwr/navigation/navigation.js +1 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/contextProvider/contextProvider.d.ts +14 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/contextUtils/contextInfo.d.ts +60 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/contextUtils/contextUtils.d.ts +24 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/contextUtils/navigationApiStore.d.ts +45 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/currentPageReference/currentPageReference.d.ts +9 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/currentView/currentView.d.ts +3 -2
- package/build/bundle/prod/lwr/router/es/modules/lwr/domRouter/domRouter.d.ts +192 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/domRouterUtils.d.ts +4 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/historyUtils.d.ts +21 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/types.d.ts +16 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/uriUtils.d.ts +30 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/historyRouter/historyRouter.d.ts +48 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/navigation/navigation.d.ts +16 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/navigation/navigationApi.d.ts +22 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/navigation/navigationMixin.d.ts +15 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/navigationContext/navigationContext.d.ts +5 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +7 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/observable/observable.d.ts +14 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/outlet/outlet.d.ts +19 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/router/router.d.ts +11 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerBridge/routerBridge.d.ts +13 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerContainer/routerContainer.d.ts +51 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerContainer/utils.d.ts +32 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerErrors/routerErrors.d.ts +13 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/domUtils.d.ts +2 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/filterUtils.d.ts +19 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/parseUtils.d.ts +42 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/pathToRegexp.d.ts +128 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/routeDefUtils.d.ts +43 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/routeUtils.d.ts +39 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/routerUtils.d.ts +22 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/typeUtils.d.ts +38 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/types.d.ts +133 -0
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/uriUtils.d.ts +66 -0
- package/build/bundle/prod/lwr/router/es/services/index.d.ts +28 -0
- package/build/bundle/prod/lwr/router/es/services/module-provider/index.d.ts +22 -0
- package/build/bundle/prod/lwr/router/es/services/module-provider/utils.d.ts +27 -0
- package/build/bundle/prod/lwr/router/router.js +1 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextProvider/contextProvider.d.ts +14 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextUtils/contextInfo.d.ts +60 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextUtils/contextUtils.d.ts +24 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextUtils/navigationApiStore.d.ts +45 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/currentPageReference/currentPageReference.d.ts +9 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/currentView/currentView.d.ts +3 -2
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouter/domRouter.d.ts +192 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/domRouterUtils.d.ts +4 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/historyUtils.d.ts +21 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/types.d.ts +16 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/uriUtils.d.ts +30 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/historyRouter/historyRouter.d.ts +48 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigation/navigation.d.ts +16 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigation/navigationApi.d.ts +22 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigation/navigationMixin.d.ts +15 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigationContext/navigationContext.d.ts +5 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +7 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/observable/observable.d.ts +14 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/outlet/outlet.d.ts +19 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/router/router.d.ts +11 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerBridge/routerBridge.d.ts +13 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerContainer/routerContainer.d.ts +51 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerContainer/utils.d.ts +32 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerErrors/routerErrors.d.ts +13 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/domUtils.d.ts +2 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/filterUtils.d.ts +19 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/parseUtils.d.ts +42 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/pathToRegexp.d.ts +128 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/routeDefUtils.d.ts +43 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/routeUtils.d.ts +39 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/routerUtils.d.ts +22 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/typeUtils.d.ts +38 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/types.d.ts +133 -0
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/uriUtils.d.ts +66 -0
- package/build/bundle/prod/lwr/routerContainer/es/services/index.d.ts +28 -0
- package/build/bundle/prod/lwr/routerContainer/es/services/module-provider/index.d.ts +22 -0
- package/build/bundle/prod/lwr/routerContainer/es/services/module-provider/utils.d.ts +27 -0
- package/build/bundle/prod/lwr/routerContainer/routerContainer.js +1 -0
- package/build/es/modules/lwr/currentPageReference/currentPageReference.d.ts +1 -1
- package/build/es/modules/lwr/currentView/currentView.d.ts +2 -2
- package/build/es/modules/lwr/domRouter/domRouter.d.ts +2 -2
- package/build/es/modules/lwr/domRouterUtils/types.d.ts +1 -1
- package/build/es/modules/lwr/navigationContext/navigationContext.d.ts +2 -2
- package/build/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +2 -2
- package/build/es/modules/lwr/routerUtils/filterUtils.d.ts +1 -1
- package/build/es/modules/lwr/routerUtils/pathToRegexp.d.ts +5 -5
- package/build/es/modules/lwr/routerUtils/types.d.ts +23 -23
- package/package.json +7 -7
|
@@ -0,0 +1,66 @@
|
|
|
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 { QueryObject, CompiledQuery } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* f("one two &") -> "one%20two%20%26"
|
|
10
|
+
*
|
|
11
|
+
* @param str - String to URI encode
|
|
12
|
+
*
|
|
13
|
+
* @returns {string}
|
|
14
|
+
*/
|
|
15
|
+
export declare function encode(str?: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* f("one%20two%20%26") -> "one two &"
|
|
18
|
+
*
|
|
19
|
+
* @param str - String to URI decode
|
|
20
|
+
*
|
|
21
|
+
* @returns {string}
|
|
22
|
+
*/
|
|
23
|
+
export declare function decode(str?: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* f(url) -> "/some/relative/path"
|
|
26
|
+
* Output will...
|
|
27
|
+
* - always start with '/'
|
|
28
|
+
* - not contain query params or fragment
|
|
29
|
+
* - akin to window.location.pathname
|
|
30
|
+
*
|
|
31
|
+
* @param {string} url - URL string to parse for a path
|
|
32
|
+
*
|
|
33
|
+
* @returns {string}
|
|
34
|
+
*/
|
|
35
|
+
export declare function getPathFromUrl(url: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* f(url) -> { "param1": "one", "param2": "two", param3: "" }
|
|
38
|
+
* Parameters without values get set to an empty string.
|
|
39
|
+
*
|
|
40
|
+
* @param {string} url - URL string to parse for a query object
|
|
41
|
+
*
|
|
42
|
+
* @returns {object}
|
|
43
|
+
*/
|
|
44
|
+
export declare function getQueryFromUrl(url: string): QueryObject;
|
|
45
|
+
/**
|
|
46
|
+
* f({ "param1": "one", "param2": "two", param3: "" }) -> "?param1=one¶m2=two¶m3"
|
|
47
|
+
* Query parameter values, but not keys, get URI encoded.
|
|
48
|
+
*
|
|
49
|
+
* @param {object} queryObject - Query object to turn into a string
|
|
50
|
+
*
|
|
51
|
+
* @returns {string}
|
|
52
|
+
*/
|
|
53
|
+
export declare function getQueryString(queryObj?: QueryObject): string;
|
|
54
|
+
/**
|
|
55
|
+
* Determines if the given string is a paramter name (":paramName")
|
|
56
|
+
* @param str string to test
|
|
57
|
+
* @returns true if string starts with ":"
|
|
58
|
+
*/
|
|
59
|
+
export declare function isParam(str: string | null | undefined): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* @param routeParamName - routeParamName from CompiledQueryResult
|
|
62
|
+
* @returns the paramName without prefix; or undefined
|
|
63
|
+
*/
|
|
64
|
+
export declare function getParamName(routeParamName: string | undefined | null): string | false;
|
|
65
|
+
export declare function getQueryNames(compiledQuery: CompiledQuery): string[];
|
|
66
|
+
//# sourceMappingURL=uriUtils.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const DEFAULT_SCHEMA = "pageReference_v1";
|
|
2
|
+
export interface LwrRouterConfig {
|
|
3
|
+
basePath?: string;
|
|
4
|
+
caseSensitive?: boolean;
|
|
5
|
+
routes: LwrConfigRouteDefinition[];
|
|
6
|
+
}
|
|
7
|
+
export interface LwrConfigRouteDefinition {
|
|
8
|
+
id: string;
|
|
9
|
+
uri: string;
|
|
10
|
+
patterns?: Record<string, string>;
|
|
11
|
+
exact?: boolean;
|
|
12
|
+
page: Partial<PageReference>;
|
|
13
|
+
metadata?: Record<string, any>;
|
|
14
|
+
handler?: string;
|
|
15
|
+
component?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PageReference {
|
|
18
|
+
type: string;
|
|
19
|
+
attributes: Record<string, string | null>;
|
|
20
|
+
state: Record<string, string | null>;
|
|
21
|
+
}
|
|
22
|
+
export declare function deleteRouterConfigJsonCacheEntry(path: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* Given a Routes Config path, return the array of Config Route Definitions
|
|
25
|
+
* @param path - A path to a Route Config files
|
|
26
|
+
*/
|
|
27
|
+
export declare function getClientRoutes(path: string): LwrRouterConfig | undefined;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AbstractModuleId, ModuleCompiled, ModuleEntry, ModuleProvider, ProviderContext } from '@lwrjs/types';
|
|
2
|
+
interface RouterProviderOptions {
|
|
3
|
+
routesDir?: string;
|
|
4
|
+
}
|
|
5
|
+
export default class RouterModuleProvider implements ModuleProvider {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
routesDir: string;
|
|
9
|
+
appBasePath?: string;
|
|
10
|
+
private routerEmitter;
|
|
11
|
+
private routerWatcher?;
|
|
12
|
+
private watchedFileMap;
|
|
13
|
+
private routerModuleCache;
|
|
14
|
+
constructor({ routesDir }: RouterProviderOptions, context: ProviderContext);
|
|
15
|
+
onRouterModuleChange(configPath: string, deleted?: boolean): Promise<void>;
|
|
16
|
+
private watchConfigs;
|
|
17
|
+
private getRouterConfig;
|
|
18
|
+
getModuleEntry({ specifier }: AbstractModuleId): Promise<ModuleEntry | undefined>;
|
|
19
|
+
getModule(moduleId: AbstractModuleId): Promise<ModuleCompiled | undefined>;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Watcher } from '@lwrjs/types';
|
|
2
|
+
import type { LwrRouterConfig } from '../index.js';
|
|
3
|
+
import type { WatcherFactory } from '@lwrjs/types';
|
|
4
|
+
export declare const SPECIFIER_PREFIX = "@lwrjs/router/";
|
|
5
|
+
/**
|
|
6
|
+
* Parse a specifier into its Router Config ID
|
|
7
|
+
* Return undefined if the specifier is invalid
|
|
8
|
+
* @param specifier - The raw specifier to parse
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseSpecifier(specifier: string): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Given a Router Config ID and directory, return the file path to the router metadata
|
|
13
|
+
* @param dir - Path to directory containing Router Config files
|
|
14
|
+
* @param specifier - Specifier for the Router Config module
|
|
15
|
+
*/
|
|
16
|
+
export declare function getRouterConfigPath(dir: string, specifier: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Set up a file system watcher; used to spy on Router Config file changes
|
|
19
|
+
* @param onModuleChange - File change callback function
|
|
20
|
+
*/
|
|
21
|
+
export declare function setUpWatcher(factory: WatcherFactory, onModuleChange: (file: string, deleted?: boolean) => void): Watcher;
|
|
22
|
+
/**
|
|
23
|
+
* Generate a module string which fulfills a router request
|
|
24
|
+
* @param routes - The array of route definitions
|
|
25
|
+
*/
|
|
26
|
+
export declare function generateModule(config?: LwrRouterConfig): string;
|
|
27
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
import{registerDecorators as e}from"lwc";function t(e=""){return e=e||"",decodeURIComponent(e)}function r(e){"/"!==(e=e||"/").charAt(0)&&(e="/"+e);const t=e.match(/^[^#?]+/);if(null!==t){const e=t[0];return"/"===e?"/":e.replace(/\/$/,"")}return"/"}function n(e){const r=(e=e||"").indexOf("#");r>=0&&(e=e.substring(0,r));const n=e.indexOf("?"),o=n>=0?e.substr(n+1):null,i={};return o&&o.split("&").forEach((e=>{if(e.indexOf("=")>=0){const[r,n=""]=e.split("=");i[t(r)]=t(n)}else i[t(e)]=null})),i}function o(e={}){const t=Object.keys(e);return t.length?`?${t.map((t=>{const r=e[t];return null===r?t:`${t}=${function(e=""){return e=e||"",encodeURIComponent(e)}(r)}`})).join("&")}`:""}function i(e){return!!(e&&e.length>1)&&e.startsWith(":")}function s(e){return!!e&&(!!i(e)&&e.substr(1))}function u(e){return Object.values(e).reduce(((e,{routeParamName:t})=>{const r=s(t);return r&&e.push(r),e}),[])}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,r){const{regex:n,params:o}=r,i=n.exec(e);if(i){const[,...e]=i,r={};return o.forEach(((n,o)=>{const{name:i}=n,s=e[o];r[i]=s?t(s):s})),r}return null}function p(e,r){if(e&&r){const{queryMatcher:n}=r,o=n(e);if(o){const e={};return Object.keys(o).forEach((r=>{const n=o[r],{value:i,routeParamName:s}=n,u=s?s.substr(1):r;e[u]=i?t(i):i})),e}}return null}function d(e,t){if(t){const{original:{page:{type:o="",attributes:s={},state:u={}}={}}={}}=t,c=r(e),l=n(e),d=f(c,t),g=p(l,t);if(d&&g){const e=a(a({},d),g),r={};Object.keys(s).forEach((t=>{const n=s[t];let o;if(n&&i(n)){const t=n.substr(1);o=e[t]}else o=n;r[t]=o}));const n={};Object.keys(u).forEach((t=>{const r=u[t];let o;if(r&&i(r)){const t=r.substr(1);o=e[t]}else o=r;n[t]=o}));const c=function(e,t){const{compiledQuery:r}=t,n=Object.keys(r).filter((e=>{const{literalValue:t}=r[e];return!t})),o={};return Object.keys(e).forEach((t=>{const r=e[t];n.indexOf(t)<0&&(o[t]=r)})),o}(l,t);return{type:o,attributes:a({},r),state:a(a({},c),n)}}}return null}function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e,t){const o=r(e),i=n(e),s=t?t.filter((e=>e.regex.test(o))):[],[u]=s.filter((e=>{const{queryMatcher:t}=e;return t(i)&&function(e,t,r){const{original:{patterns:n=null}={}}=r||{};if(n){const o=f(e,r),i=p(t,r),s=b(b({},o),i);return Object.keys(n).every((e=>{const t=n[e],r=new RegExp(t),o=s[e]||"";return r.test(o)}))}return!0}(o,i,e)}));return u||null}function h(e,t,r=""){r&&0===e.indexOf(r)&&(e=e.replace(r,""));const n=y(e,t);let o;if(!n)return null;{const t=d(e,n);if(t){return o={route:{id:n.original.id,attributes:b({},t.attributes),state:b({},t.state),pageReference:{type:t.type,attributes:b({},t.attributes),state:b({},t.state)}},routeDefinition:n},o}}return null}function O(e,t,r=""){const n=function(e,t){if(!e)return null;const{type:r,attributes:n={},state:o={}}=e;if(r){const[e]=t.filter((e=>{const{original:{page:{type:t=null,attributes:s={},state:u={}}={}}}=e,c=t===r,a=Object.keys(s).every((e=>Object.keys(n).indexOf(e)>=0)),l=Object.keys(s).length===Object.keys(n).length,f=Object.keys(u).every((e=>Object.keys(o).indexOf(e)>=0)),p=Object.keys(s).filter((e=>{const t=s[e];return!t||!i(t)})).every((e=>s[e]===n[e])),d=Object.keys(u).filter((e=>{const t=u[e];return null===t||!i(t)})).every((e=>u[e]===o[e]));return c&&a&&l&&p&&f&&d}));return e||null}return null}(e,t);return n?E(e,n,r):null}function v(e,t,r){const{attributeBindings:n,stateBindings:o}=r,{attributes:i,state:u}=t,c={};return e.forEach((e=>{const[t]=Object.keys(n).filter((t=>s(n[t])===e));if(t)c[e]=i[t];else{const[t]=Object.keys(o).filter((t=>s(o[t])===e));t&&(c[e]=u[t])}})),c}function E(e,t,r=""){const{params:n,original:{page:c={}}={},toPath:a,compiledQuery:l}=t,{attributes:f={},state:p={}}=c,d=a(v(n.filter((({name:e})=>"string"==typeof e)).map((({name:e})=>e)),e,{attributeBindings:f,stateBindings:p})),g=function(e,t,r){const{compiledQuery:n,original:{page:{state:o={}}}}=r,{state:u={}}=e||{},c={};Object.keys(u).filter((e=>!i(o[e]))).forEach((e=>c[e]=u[e]));const a={};return Object.keys(t).forEach((e=>{const r=t[e],[o]=Object.keys(n).filter((t=>{const r=n[t],{routeParamName:o}=r;return s(o)===e}));if(o){a[o]=r}})),b(b({},c),a)}(e,v(u(l),e,{attributeBindings:f,stateBindings:p}),t);return`${r}${d}${o(g)}`}function w(e,t=2){if(function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}(e))try{Object.freeze(e),t>0&&Object.keys(e).forEach((r=>{if(function(e,t){return t in e}(e,r)){const n=e[r];n&&"object"==typeof n&&w(n,t-1)}}))}catch(e){}return e}const j="LWR",I=1;function P(e,t){return`${e.code}: ${function(e,t){return Array.isArray(t)?e.replace(/\{([0-9]+)\}/g,((e,r)=>t[r])):e}(e.message,t)}`}function R(e,t,r){if(!e)throw new Error(P(t,r))}const $={INVALID_MIXIN_CMP:{code:`${j}4001`,message:"{0} must be an Element type",level:I},MISSING_CONTEXT:{code:`${j}4002`,message:"Could not find context to perform navigation action.",level:I},INVALID_CONTEXT:{code:`${j}4003`,message:"Cannot register navigation context; it must have this shape: { navigate, generateUrl, subscribe }",level:I},MULTIPLE_ROOTS:{code:`${j}4004`,message:"Router connection failed. There can only be one root router.",level:I},MULTIPLE_CHILDREN:{code:`${j}4005`,message:"Could not add to the navigation hierarchy. There can only be one child per navigation node.",level:I},MISSING_ROUTE:{code:`${j}4006`,message:'A route cannot be created to navigate to URL "{0}"',level:I,address:"{0}"},MISSING_URL:{code:`${j}4007`,message:'A URL cannot be created to navigate to route "{0}"',level:I,address:"{0}"},PRENAV_FAILED:{code:`${j}4008`,message:'A preNavigate hook listener blocked routing to "{0}"',level:2,address:"{0}"},MISSING_ROUTE_TEMPLATE:{code:`${j}4009`,message:'A route definition must contain a "uri" property.',level:I},MISSING_ROUTE_CMP:{code:`${j}4016`,message:"Expected a route view component with a default export.",level:I},MISSING_DATA_CONTEXT:{code:`${j}4018`,message:"Could not find context to retrieve navigation data.",level:I},INVALID_ROUTE_QUERY:{code:`${j}4019`,message:"Invalid query param in route definition.",level:I},MISSING_PAGE_BINDING:{code:`${j}4020`,message:"Route definition must provide page binding",level:I},INVALID_PAGE_BINDING:{code:`${j}4021`,message:"Invalid page binding in route definition",level:I},INVALID_URI_SYNTAX:{code:`${j}4022`,message:"Invalid uri syntax. URI cannot contain *, +, (, ), ",level:I},VIEW_IMPORT_FAILED:{code:`${j}4023`,message:'Error importing view with name "{0}", failure was: {1}',level:I,stack:"{2}"},VIEW_MISSING:{code:`${j}4024`,message:'Expected a view with name "{0}" in the viewset',level:I},VIEW_IMPORT_FAILED_WITH_SPECIFIER:{code:`${j}4025`,message:'Error importing module "{0}" from view with name "{1}", failure was: {2}',level:I,stack:"{3}"},NO_ROUTE_MATCH:{code:`${j}4026`,message:"A routing match cannot be found for: {0}",level:I},INVALID_ROUTE_HANDLER:{code:`${j}4027`,message:'Route definition "{0}" does not have a valid route handler module',level:I},DESTINATION_NOT_FOUND:{code:`${j}4028`,message:"Route handler returned 404: Not Found",level:I},DESTINATION_ERROR:{code:`${j}4029`,message:"Route handler returned error status {0}: {1}",level:I,stack:"{2}"}};function N(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function D(e){return e&&e.sensitive?"":"i"}function A(e,t={}){const r=function(e){const t=[];let r=0;for(;r<e.length;){const n=e[r];if("*"!==n&&"+"!==n&&"?"!==n)if("\\"!==n)if("{"!==n)if("}"!==n)if(":"!==n)if("("!==n)t.push({type:"CHAR",index:r,value:e[r++]});else{let n=1,o="",i=r+1;if("?"===e[i])throw new TypeError(`Pattern cannot start with "?" at ${i}`);for(;i<e.length;)if("\\"!==e[i]){if(")"===e[i]){if(n--,0===n){i++;break}}else if("("===e[i]&&(n++,"?"!==e[i+1]))throw new TypeError(`Capturing groups are not allowed at ${i}`);o+=e[i++]}else o+=e[i++]+e[i++];if(n)throw new TypeError(`Unbalanced pattern at ${r}`);if(!o)throw new TypeError(`Missing pattern at ${r}`);t.push({type:"PATTERN",index:r,value:o}),r=i}else{let n="",o=r+1;for(;o<e.length;){const t=e.charCodeAt(o);if(!(t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||95===t))break;n+=e[o++]}if(!n)throw new TypeError(`Missing parameter name at ${r}`);t.push({type:"NAME",index:r,value:n}),r=o}else t.push({type:"CLOSE",index:r,value:e[r++]});else t.push({type:"OPEN",index:r,value:e[r++]});else t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});else t.push({type:"MODIFIER",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),{prefixes:n="./"}=t,o=`[^${N(t.delimiter||"/#?")}]+?`,i=[];let s=0,u=0,c="";const a=e=>{if(u<r.length&&r[u].type===e)return r[u++].value},l=e=>{const t=a(e);if(void 0!==t)return t;const{type:n,index:o}=r[u];throw new TypeError(`Unexpected ${n} at ${o}, expected ${e}`)},f=()=>{let e,t="";for(;e=a("CHAR")||a("ESCAPED_CHAR");)t+=e;return t};for(;u<r.length;){const e=a("CHAR"),t=a("NAME"),r=a("PATTERN");if(t||r){let u=e||"";-1===n.indexOf(u)&&(c+=u,u=""),c&&(i.push(c),c=""),i.push({name:t||s++,prefix:u,suffix:"",pattern:r||o,modifier:a("MODIFIER")||""});continue}const u=e||a("ESCAPED_CHAR");if(u){c+=u;continue}c&&(i.push(c),c="");if(a("OPEN")){const e=f(),t=a("NAME")||"",r=a("PATTERN")||"",n=f();l("CLOSE"),i.push({name:t||(r?s++:""),pattern:t&&!r?o:r,prefix:e,suffix:n,modifier:a("MODIFIER")||""})}else l("END")}return i}function T(e,t){return function(e,t={}){const r=D(t),{encode:n=(e=>e),validate:o=!0}=t,i=e.map((e=>{if("object"==typeof e)return new RegExp(`^(?:${e.pattern})$`,r)}));return t=>{let r="";for(let s=0;s<e.length;s++){const u=e[s];if("string"==typeof u){r+=u;continue}const c=t?t[u.name]:void 0,a="?"===u.modifier||"*"===u.modifier,l="*"===u.modifier||"+"===u.modifier;if(Array.isArray(c)){if(!l)throw new TypeError(`Expected "${u.name}" to not repeat, but got an array`);if(0===c.length){if(a)continue;throw new TypeError(`Expected "${u.name}" to not be empty`)}for(let e=0;e<c.length;e++){const t=n(c[e],u);if(o&&!i[s].test(t))throw new TypeError(`Expected all "${u.name}" to match "${u.pattern}", but got "${t}"`);r+=u.prefix+t+u.suffix}continue}if("string"==typeof c||"number"==typeof c){const e=n(String(c),u);if(o&&!i[s].test(e))throw new TypeError(`Expected "${u.name}" to match "${u.pattern}", but got "${e}"`);r+=u.prefix+e+u.suffix;continue}if(a)continue;const f=l?"an array":"a string";throw new TypeError(`Expected "${u.name}" to be ${f}`)}return r}}(A(e,t),t)}function _(e,t,r){return function(e,t,r={}){const{strict:n=!1,start:o=!0,end:i=!0,encode:s=(e=>e)}=r,u=`[${N(r.endsWith||"")}]|$`,c=`[${N(r.delimiter||"/#?")}]`;let a=o?"^":"";for(const r of e)if("string"==typeof r)a+=N(s(r));else{const e=N(s(r.prefix)),n=N(s(r.suffix));if(r.pattern)if(t&&t.push(r),e||n)if("+"===r.modifier||"*"===r.modifier){const t="*"===r.modifier?"?":"";a+=`(?:${e}((?:${r.pattern})(?:${n}${e}(?:${r.pattern}))*)${n})${t}`}else a+=`(?:${e}(${r.pattern})${n})${r.modifier}`;else a+=`(${r.pattern})${r.modifier}`;else a+=`(?:${e}${n})${r.modifier}`}if(i)n||(a+=`${c}?`),a+=r.endsWith?`(?=${u})`:"$";else{const t=e[e.length-1],r="string"==typeof t?c.indexOf(t[t.length-1])>-1:void 0===t;n||(a+=`(?:${c}(?=${u}))?`),r||(a+=`(?=${c}|${u})`)}return new RegExp(a,D(r))}(A(e,r),t,r)}function x(e,t,r){return e instanceof RegExp?function(e,t){if(!t)return e;const r=e.source.match(/\((?!\?)/g);if(r)for(let e=0;e<r.length;e++)t.push({name:e,prefix:"",suffix:"",modifier:"",pattern:""});return e}(e,t):Array.isArray(e)?function(e,t,r){const n=e.map((e=>x(e,t,r).source));return new RegExp(`(?:${n.join("|")})`,D(r))}(e,t,r):_(e,t,r)}function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){C(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function C(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{INVALID_ROUTE_QUERY:k,MISSING_ROUTE_TEMPLATE:M,MISSING_PAGE_BINDING:L,INVALID_PAGE_BINDING:V,INVALID_URI_SYNTAX:H}=$;function G(e){const{routes:t,caseSensitive:o}=e;return t.map((e=>function(e,t=!1){const o=[],{uri:c,page:a}=e;R(!!c,M),R(function(e=""){const t=["*","(",")",";"].some((t=>e.indexOf(t)>=0));return!t}(c),H),R(!!a,L);const l=r(c),f=n(c),p=x(l,o,{sensitive:t,end:!1!==e.exact}),d=T(l,{encode:encodeURIComponent}),g=function(e){const t={};return Object.keys(e).forEach((r=>{const n=e[r];R(!i(r)||null===n,k),i(r)?t[r.substr(1)]={routeParamName:r}:n&&i(n)?t[r]={routeParamName:n}:t[r]={literalValue:null===n?null:n}})),t}(f),b=function(e,t=!1){const r=r=>{const n=Object.keys(r),o=Object.keys(e);return o.every((e=>n.indexOf(e)>=0))?o.reduce(((n,o)=>{if(null===n)return null;const{literalValue:i,routeParamName:s}=e[o],u=r[o];let c=!0;return"string"==typeof i?c=t?i===u:i.toUpperCase()===(null==u?u:u.toUpperCase()):null===i&&(c=u===i),n=c?U(U({},n),{},{[o]:{value:u,routeParamName:s}}):null}),{}):null};return r}(g,t),m={original:e,regex:p,params:o,toPath:d,compiledQuery:g,queryMatcher:b};return R(function(e){const{original:{page:t}={},params:r,compiledQuery:n}=e,o=t?t.type:t,c=(t?t.attributes:t)||{},a=(t?t.state:t)||{};if("string"!=typeof o||"object"!=typeof c||"object"!=typeof a)return!1;const l=Object.values(r).map((({name:e})=>e)),f=u(n),p=[...l,...f],d=Object.values(c).filter(i).map(s),g=Object.values(a).filter(i).map(s),b=p.every((e=>"string"==typeof e&&(d.indexOf(e)>=0||g.indexOf(e)>=0))),m=p.length===d.length+g.length;return!!(t&&o&&c&&a&&b&&m)}(m),V),m}(e,o)))}function F(){let e,t,r=[];const n=n=>{r.filter((e=>null!==e)).forEach((e=>e.error&&e.error(n))),e=void 0,t=n};return{next:n=>{r.filter((e=>null!==e)).forEach((e=>e.next&&e.next(n))),e=n,t=void 0},error:n,complete:()=>{r.filter((e=>null!==e)).forEach((e=>e.complete&&e.complete())),r=[],e=void 0,t=void 0},subscribe:(o,i=!0)=>{(e=>{r.push(e)})(o),e&&i&&o.next(e),t&&n(t);const s=r.length-1;return{unsubscribe:()=>(e=>{r=[...r.slice(0,e),...r.slice(e+1)]})(s)}}}}function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(Object(r),!0).forEach((function(t){Q(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Q(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class X{constructor(e){this.deprecatedConfig={},this.routeHandlerId=0,this.compiledRoutes=[],this.routeObservable=F(),this.config={basePath:e.basePath||"",caseSensitive:Boolean(e.caseSensitive),routes:e.routes||[],generateUrl:e=>O(e,this.compiledRoutes,this.config.basePath),parseUrl:e=>function(e,t,r=""){const n=h(e,t,r);return n&&n.route&&n.route.pageReference?n.route.pageReference:null}(e,this.compiledRoutes,this.config.basePath)};const{DEPRECATED_getRouteFromUrl:t,DEPRECATED_getUrlFromRoute:r}=e;t&&(this.deprecatedConfig.DEPRECATED_getRouteFromUrl=t),r&&(this.deprecatedConfig.DEPRECATED_getUrlFromRoute=r),this.compiledRoutes=G(this.config)}generateUrl(e){const{DEPRECATED_getUrlFromRoute:t}=this.deprecatedConfig;return t?t(e,this.config.generateUrl):this.config.generateUrl(e)}parseUrl(e){const{DEPRECATED_getRouteFromUrl:t}=this.deprecatedConfig;return t?t(e,this.config.parseUrl):this.config.parseUrl(e)}matchRoute(e){const t="string"==typeof e?e:this.generateUrl(e);if(null===t)return null;const r=h(t,this.compiledRoutes,this.config.basePath),n=r&&E(r.route.pageReference,r.routeDefinition,this.config.basePath);return r&&n?{pathMatch:n,route:r.route,routeDefinition:r.routeDefinition.original}:null}async resolveView(e){return new Promise(((t,r)=>{const n=this.matchRoute(e);return n?n.routeDefinition.handler().then((e=>{const o=e.default;if(!o)return r(P($.INVALID_ROUTE_HANDLER,[n.routeDefinition.id]));const i=new o(t);i&&i.update(n.route)})):r(P($.NO_ROUTE_MATCH,[JSON.stringify(e)]))}))}navigate(e){const t=this.matchRoute(e);if(!t)throw new Error(P($.MISSING_ROUTE,[JSON.stringify(e)]));this.pendingRoute=W({},t),this._mapView(this.pendingRoute)}subscribe(e,t){return this.routeObservable.subscribe({next:e,error:()=>{},complete:()=>{}},Boolean(t))}async _mapView(e){const t=Math.random();this.routeHandlerId=t;const r=(await e.routeDefinition.handler()).default;if(!r)throw new Error(P($.INVALID_ROUTE_HANDLER,[e.routeDefinition.id]));return this.routeHandler=new r((e=>{this._updateView(t,e)})),this.routeHandler&&this.routeHandler.update(e.route),!0}_updateView(e,t){if(!t||e!==this.routeHandlerId)return;if(!this.pendingRoute)throw new Error("Trying to commit route state without a route");const r=w(t.viewset);this.routeObservable.next(W(W(W({},this.pendingRoute),t),{},{viewset:r}))}}function q(e={}){return new X(e)}e(X,{fields:["deprecatedConfig","routeHandlerId"]});export{q as createRouter};
|
|
2
|
+
//# sourceMappingURL=router.js.map
|
package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextProvider/contextProvider.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
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
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextUtils/navigationApiStore.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
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
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
/// <reference types="lwc" />
|
|
1
2
|
import type { ViewSet } from 'lwr/router';
|
|
2
3
|
import type { Constructable } from 'lwr/routerUtils';
|
|
3
|
-
type ViewContext = {
|
|
4
|
+
declare type ViewContext = {
|
|
4
5
|
viewset: ViewSet;
|
|
5
6
|
onComplete?: Function;
|
|
6
7
|
} | undefined;
|
|
7
|
-
type CurrentViewConfig = {
|
|
8
|
+
declare type CurrentViewConfig = {
|
|
8
9
|
viewName?: string;
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
@@ -0,0 +1,192 @@
|
|
|
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 { RouteChange, DomRouterConfig } from 'lwr/domRouterUtils';
|
|
8
|
+
import type { ContextId } from 'lwr/navigationContext';
|
|
9
|
+
import type { Filter, MessageObject } from 'lwr/routerUtils';
|
|
10
|
+
import type { PageReference, Router, RouteCallback, RoutingMatch, RoutingResult } from 'lwr/router';
|
|
11
|
+
import type { Observable, Unsubscriber } from 'lwr/observable';
|
|
12
|
+
export declare const NAV_EVENT: string;
|
|
13
|
+
export declare const PARENT_EVENT: string;
|
|
14
|
+
interface RouterParent {
|
|
15
|
+
addChild(child: DomRouter): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export declare type ParentRouterEvent = CustomEvent<(router: RouterParent) => void>;
|
|
18
|
+
declare type DomRoutingMatch = RoutingMatch & {
|
|
19
|
+
url: string;
|
|
20
|
+
};
|
|
21
|
+
interface DomRouterNode extends RouterParent {
|
|
22
|
+
root: DomRouter;
|
|
23
|
+
parent?: DomRouter;
|
|
24
|
+
child?: DomRouter;
|
|
25
|
+
connected: boolean;
|
|
26
|
+
process(url: string, replace?: boolean): Promise<boolean>;
|
|
27
|
+
processError(messageObject: MessageObject): void;
|
|
28
|
+
preProcess(url: string): Promise<boolean>;
|
|
29
|
+
}
|
|
30
|
+
export interface DomRouter extends DomRouterNode {
|
|
31
|
+
router: Router<PageReference>;
|
|
32
|
+
pendingRoute: DomRoutingMatch | null;
|
|
33
|
+
committedRoute: DomRoutingMatch | null;
|
|
34
|
+
contextId: ContextId;
|
|
35
|
+
historyDisabled?: boolean;
|
|
36
|
+
connect(): void;
|
|
37
|
+
disconnect(): void;
|
|
38
|
+
addPreNavigate(filters: Filter<RouteChange> | Filter<RouteChange>[]): void;
|
|
39
|
+
addErrorNavigate(filters: Filter<MessageObject> | Filter<MessageObject>[]): void;
|
|
40
|
+
navigate(address: PageReference, replace?: boolean): void;
|
|
41
|
+
generateUrl(address: PageReference): string | null;
|
|
42
|
+
subscribe(callback: RouteCallback, replay?: boolean): Unsubscriber;
|
|
43
|
+
}
|
|
44
|
+
export declare class DomRouterImpl implements DomRouter {
|
|
45
|
+
config: Required<DomRouterConfig>;
|
|
46
|
+
target: EventTarget;
|
|
47
|
+
router: Router<PageReference>;
|
|
48
|
+
pendingRoute: DomRoutingMatch | null;
|
|
49
|
+
committedRoute: DomRoutingMatch | null;
|
|
50
|
+
routeObservable: Observable<RoutingResult>;
|
|
51
|
+
eventId?: string;
|
|
52
|
+
contextId: ContextId;
|
|
53
|
+
connected: boolean;
|
|
54
|
+
parent?: DomRouter;
|
|
55
|
+
child?: DomRouter;
|
|
56
|
+
preNavFilters: import("lwr/routerUtils").FilterChain<RouteChange>;
|
|
57
|
+
errorNavFilters: import("lwr/routerUtils").FilterChain<MessageObject>;
|
|
58
|
+
/**
|
|
59
|
+
* Create and configure the Router.
|
|
60
|
+
*
|
|
61
|
+
* @param {object} config - The domRouter config object, all properties are optional
|
|
62
|
+
* @param {object} router - an optional Router
|
|
63
|
+
* @param {HTMLElement} target - DOM node to attach to
|
|
64
|
+
*/
|
|
65
|
+
constructor(config: DomRouterConfig, router: Router<PageReference>, target?: EventTarget);
|
|
66
|
+
/**
|
|
67
|
+
* Search up the node chain until the root node is hit
|
|
68
|
+
*/
|
|
69
|
+
get root(): DomRouter;
|
|
70
|
+
/**
|
|
71
|
+
* Informs an wire listeners of routing changes/errors
|
|
72
|
+
*
|
|
73
|
+
* @param {RoutingResult} result - result object from navigation event
|
|
74
|
+
* @param {string} url - url from the page reference that triggered the navigation event
|
|
75
|
+
* @param {MessageObject} error - if an error occurred during the navigation
|
|
76
|
+
*/
|
|
77
|
+
updateWires(result: RoutingResult, url: string, error?: MessageObject): void;
|
|
78
|
+
/**
|
|
79
|
+
* Override to provide this router as a navigation context
|
|
80
|
+
*/
|
|
81
|
+
connect(): void;
|
|
82
|
+
disconnect(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Add listeners to this router hook which run BEFORE a new URL is processed (root -> leaf).
|
|
85
|
+
*
|
|
86
|
+
* @param {object | object[]} filters
|
|
87
|
+
*/
|
|
88
|
+
addPreNavigate(filters: Filter<RouteChange> | Filter<RouteChange>[]): void;
|
|
89
|
+
/**
|
|
90
|
+
* Add listeners to this router hook which run when there is an error navigating.
|
|
91
|
+
*
|
|
92
|
+
* @param {object | object[]} filters
|
|
93
|
+
*/
|
|
94
|
+
addErrorNavigate(filters: Filter<MessageObject> | Filter<MessageObject>[]): void;
|
|
95
|
+
/**
|
|
96
|
+
* Override parent implementation.
|
|
97
|
+
* Pass the current state down to a new child.
|
|
98
|
+
*
|
|
99
|
+
* @param {child} child - Child router
|
|
100
|
+
*/
|
|
101
|
+
addChild(child: DomRouter): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Process the current URL passed down by the parent router.
|
|
104
|
+
* Stop propagation of the navigation event if a preNavigate filter returns false.
|
|
105
|
+
*
|
|
106
|
+
* Update the current path and route matches.
|
|
107
|
+
* Update the observable to hold the new route.
|
|
108
|
+
*
|
|
109
|
+
* After processing, delegate to a child router, if it exists.
|
|
110
|
+
*
|
|
111
|
+
* @param {string} url - Relative URL string to process
|
|
112
|
+
* @returns {boolean} - True if the processing was NOT blocked by a preNavigate listener
|
|
113
|
+
*/
|
|
114
|
+
process(url: string, replace?: boolean): Promise<boolean>;
|
|
115
|
+
/**
|
|
116
|
+
* Run the preNavigate filters for this router.
|
|
117
|
+
* After processing, delegate to a child router, if it exists.
|
|
118
|
+
*
|
|
119
|
+
* @param {string} url - Relative URL string to process,
|
|
120
|
+
* cannot use a route since the processing is done in context
|
|
121
|
+
*
|
|
122
|
+
* @returns {Promise<boolean>} - Resolves to true if successful
|
|
123
|
+
*/
|
|
124
|
+
preProcess(url: string): Promise<boolean>;
|
|
125
|
+
/**
|
|
126
|
+
* Run the errorNavigate filters for this router.
|
|
127
|
+
* After processing, delegate to a child router, if it exists.
|
|
128
|
+
*
|
|
129
|
+
* @param {object} e - An error object to pass into the error hook listeners.
|
|
130
|
+
*/
|
|
131
|
+
processError(messageObject: MessageObject): void;
|
|
132
|
+
/**
|
|
133
|
+
* lightning/navigation
|
|
134
|
+
* Fire an event to send the navigation event up the DOM.
|
|
135
|
+
* The root router will be the last to catch the event if it is not stopped.
|
|
136
|
+
*
|
|
137
|
+
* @param {object} address - Address to navigate to
|
|
138
|
+
* @param {*} options - Usually a boolean; when true the previous browser history
|
|
139
|
+
* entry should be replaced by this one
|
|
140
|
+
*/
|
|
141
|
+
navigate(address: PageReference, replace?: boolean): void;
|
|
142
|
+
/**
|
|
143
|
+
* lightning/navigation
|
|
144
|
+
* Generate a URL based on the given route.
|
|
145
|
+
* Return a Promise containing the URL string.
|
|
146
|
+
*
|
|
147
|
+
* @param {object} route - Route to generate a url for
|
|
148
|
+
*
|
|
149
|
+
* @returns {Promise<string>}
|
|
150
|
+
*/
|
|
151
|
+
generateUrl(address: PageReference): string | null;
|
|
152
|
+
/**
|
|
153
|
+
* lightning/navigation
|
|
154
|
+
* Subscribe a callback to the Observable on the current route of this router.
|
|
155
|
+
*
|
|
156
|
+
* @param {function} callback - A callback function invoked when the navigation state changes
|
|
157
|
+
* callback(route, routeDef)
|
|
158
|
+
* @param {boolean} replay - Flag to determine if callback should be called with current route and data immediately
|
|
159
|
+
*/
|
|
160
|
+
subscribe(callback: RouteCallback, replay?: boolean): Unsubscriber;
|
|
161
|
+
/**
|
|
162
|
+
* Inspect a navigation event bubbling up from a descendent component.
|
|
163
|
+
* This node can choose to stop the event by returning false.
|
|
164
|
+
* If propagation is not stopped, and this node is the root (no parent),
|
|
165
|
+
* then begin the root -> leaf processing of this new route.
|
|
166
|
+
* This will update the navigation event subscribers in each DomRouter, top down.
|
|
167
|
+
*
|
|
168
|
+
* @param {Event} event - With detail: { url, options }
|
|
169
|
+
*/
|
|
170
|
+
private _handleNavigationEvent;
|
|
171
|
+
/**
|
|
172
|
+
* Be discovered as a parent for descendent components.
|
|
173
|
+
* Stop immediate propagation because we only want 1 parent to be found.
|
|
174
|
+
*
|
|
175
|
+
* @param {Event} event - With detail: callback
|
|
176
|
+
*/
|
|
177
|
+
private _handleParentEvent;
|
|
178
|
+
private _sendEvent;
|
|
179
|
+
private _stripUrlForChild;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Create a new root Router, attach to the Window.
|
|
183
|
+
* This is the public, programmatic API for root router creation.
|
|
184
|
+
* An application can only have ONE root router.
|
|
185
|
+
*
|
|
186
|
+
* @param {object} config - The router config object
|
|
187
|
+
*
|
|
188
|
+
* @returns {object} - { addPreNavigate, addErrorNavigate, connect, disconnect }
|
|
189
|
+
*/
|
|
190
|
+
export declare function createDomRouter(config: DomRouterConfig, router: Router<PageReference>, target?: EventTarget): DomRouter;
|
|
191
|
+
export {};
|
|
192
|
+
//# sourceMappingURL=domRouter.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { RouteInstance } from '../routerUtils/types';
|
|
8
|
+
/**
|
|
9
|
+
* Sets a history state.
|
|
10
|
+
|
|
11
|
+
* @param {string} path - query to set
|
|
12
|
+
* @param {object} route - history state object
|
|
13
|
+
*/
|
|
14
|
+
export declare function set(path: string, route?: RouteInstance): void;
|
|
15
|
+
/**
|
|
16
|
+
* Replaces the current history state.
|
|
17
|
+
* @param {string} path - query to use as a replacement
|
|
18
|
+
* @param {object} route - history state object
|
|
19
|
+
*/
|
|
20
|
+
export declare function replace(path: string, route?: RouteInstance): void;
|
|
21
|
+
//# sourceMappingURL=historyUtils.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RoutingMatch, PageReference, StringAttributes } from 'lwr/router';
|
|
2
|
+
export interface RouteChange {
|
|
3
|
+
current?: RoutingMatch;
|
|
4
|
+
next: RoutingMatch;
|
|
5
|
+
}
|
|
6
|
+
export declare type NavigationHandler = (address: PageReference, replace?: boolean) => boolean;
|
|
7
|
+
export interface DomRouterConfig {
|
|
8
|
+
handleNavigation?: NavigationHandler;
|
|
9
|
+
}
|
|
10
|
+
export interface UrlObject {
|
|
11
|
+
href: string;
|
|
12
|
+
origin: string;
|
|
13
|
+
pathname: string;
|
|
14
|
+
searchParams: StringAttributes;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { UrlObject } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* helper: f(url) -> new URL
|
|
4
|
+
* Query parameter values are URI decoded.
|
|
5
|
+
|
|
6
|
+
* @param {string} url - URL string to turn into a URL object
|
|
7
|
+
|
|
8
|
+
* @returns {object} { href, pathname, searchParams }
|
|
9
|
+
|
|
10
|
+
* @example
|
|
11
|
+
* {
|
|
12
|
+
* href: 'http://localhost:3001/products?lwr.mode=prod&lwr.locale=es#section',
|
|
13
|
+
* origin: 'http://localhost:3001',
|
|
14
|
+
* pathname: '/products',
|
|
15
|
+
* searchParams: {
|
|
16
|
+
* 'lwr.mode': 'prod',
|
|
17
|
+
* 'lwr.locale': 'es'
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
export declare function getUrlObject(url?: string): UrlObject;
|
|
22
|
+
/**
|
|
23
|
+
* f(url) -> "/some/relative/path?param1=one¶m2=two¶m3"
|
|
24
|
+
|
|
25
|
+
* @param {string} url - URL string to make relative, may be a no-op
|
|
26
|
+
|
|
27
|
+
* @return {string}
|
|
28
|
+
*/
|
|
29
|
+
export declare function getRelativeUrl(url: string): string;
|
|
30
|
+
//# sourceMappingURL=uriUtils.d.ts.map
|