@jss-rule-engine/nextjs
Version:
43 lines (42 loc) • 2.12 kB
TypeScript
import { BasePersonalizeGraphQLSitemapService, BaseGraphQLSitemapServiceConfig, RouteListQueryResult, StaticPath } from './base-personalize-graphql-sitemap-service';
export declare const sitesError = "The list of sites cannot be empty";
/**
* Configuration options for @see GraphQLSitemapService instances
*/
export interface MultisiteGraphQLSitemapServiceConfig extends BaseGraphQLSitemapServiceConfig {
/**
* Names of the configured sites
*/
sites: string[];
}
/**
* Service that fetches the list of site pages using Sitecore's GraphQL API.
* Used to handle multiple sites
* This list is used for SSG and Export functionality.
* @mixes SearchQueryService<PageListQueryResult>
*/
export declare class MultisitePersonalizeGraphQLSitemapService extends BasePersonalizeGraphQLSitemapService {
options: MultisiteGraphQLSitemapServiceConfig;
/**
* Creates an instance of graphQL sitemap service with the provided options
* @param {MultisiteGraphQLSitemapServiceConfig} options instance
*/
constructor(options: MultisiteGraphQLSitemapServiceConfig);
/**
* Fetch a flat list of all pages that belong to all the requested sites and have a
* version in the specified language(s).
* @param {string[]} languages Fetch pages that have versions in this language(s).
* @param {Function} formatStaticPath Function for transforming the raw search results into (@see StaticPath) types.
* @returns list of pages
* @throws {RangeError} if the list of languages is empty.
* @throws {RangeError} if the any of the languages is an empty string.
*/
protected fetchSitemap(languages: string[], formatStaticPath: (path: string[], language: string, isStaticRender: boolean) => StaticPath): Promise<StaticPath[]>;
/**
* Fetch and return site paths for multisite implementation, with prefixes included
* @param {string} language path language
* @param {string} siteName site name
* @returns modified paths
*/
protected fetchLanguageSitePaths(language: string, siteName: string): Promise<RouteListQueryResult[]>;
}