/** * Copyright (c) Microsoft Corporation. All rights reserved. */ import type { IDisposable } from '@microsoft/sp-core-library'; import type { IPrefetchOptions } from './IPrefetchData'; /** * IPrefetchDataProvider is the contract to be met by prefetch data providers * * @internal */ export interface IPrefetchDataProvider extends IDisposable { /** * Initializes tracking and retreival of prefetch data. * To access the data, call methods getData or getDataAsync */ initialize(): void; /** * Gets data from the prefetch provider for the given prefetch Key * * @param prefetchKey - The key to retrieve the prefetch entry * @param prefetchOptions - The options to retrieve prefetch data */ getData(prefetchKey: string, prefetchOptions: IPrefetchOptions): TData | undefined; /** * Gets prefetched data from the prefetch provider for the given prefetch Key async * * @param prefetchKey - The key to retrieve the prefetch entry * @param prefetchOptions - The options to retrieve prefetch data */ getDataAsync(prefetchKey: string, prefetchOptions: IPrefetchOptions): Promise; /** * Re-initializes tracking and retreival of prefetch data. * It stops tracking existing data and starts tracking new data. * This is helpful on in-place-nav scenarios */ resetPrefetchData(): void; /** * Sets prefetch data as available for the application. * * @param prefetchKey - The key to set the Prefetch Data * @param prefetchData - The Prefetch data */ setData(prefetchKey: string, prefetchData: TData): void; /** * Listens to changes on a specific prefetched variable * * @param key - The key of the prefetch entry * @param prefetchOptions - The options to configure prefetch updates * @param loadedName - The name of the 'loaded' function called for this prefetch variable (usally `{key}Loaded`) * * @returns - The function to unsubscribe from changes */ trackPrefetchDataUpdated(key: string, prefetchOptions: IPrefetchOptions, loadedName: string): () => void; } //# sourceMappingURL=IPrefetchDataProvider.d.ts.map