/** * Copyright (c) 2019, salesforce.com, inc. * All rights reserved. * SPDX-License-Identifier: MIT * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT */ import type { RouteCallback, PageReference } from 'lwr/router'; import type { Unsubscriber } from 'lwr/observable'; import type { ContextId } from 'lwr/navigationContext'; import type { NavigateOptions } from '../routerUtils/types.js'; /** * Provides the ability for a given context provider to find its NavigationHelm * provider by just an ID. Having access to the NavigationHelm allows the consumer * to direct navigation. Generally, the Helm is more powerful than the exposed APIs. */ export interface NavigationHelm { navigate: (address: PageReference, replace?: boolean, options?: NavigateOptions) => void; generateUrl: (address: PageReference, options?: NavigateOptions) => string | null; generateUrlAsync: (address: PageReference, options?: NavigateOptions) => Promise; subscribe: (callback: RouteCallback, replay?: boolean) => Unsubscriber; } interface NavigationContextData { id: ContextId; value: NavigationHelm; update: (newValue: NavigationHelm) => void; } /** * Return a navigation context by ID. * Exported API. * * @param {*} id - The ID of a navigation context. * * @return {object} - { navigate(), generateUrl(), subscribe() } */ export declare function getNavigationHelm(id: ContextId): NavigationHelm; /** * Create and return the metadata for this context provider. * Cache the metadata by ID. * * @param {object} contextValue - Context API object * @param {RouteDefinition[]} data - Route data for this context * * @return {object} - The metadata object */ export declare function registerNavigationHelm(contextId: ContextId, contextValue: NavigationHelm): NavigationContextData; export {}; //# sourceMappingURL=navigationApiStore.d.ts.map