import { PostEntity } from '../types/index.js'; import { AbstractFetchStrategy, EndpointParams, FetchOptions, FetchResponse, NormalizedDataForCache } from './AbstractFetchStrategy.js'; import { PostParams, SinglePostFetchStrategy } from './SinglePostFetchStrategy.js'; import { PostsArchiveFetchStrategy, PostsArchiveParams } from './PostsArchiveFetchStrategy.js'; /** * The params supported by {@link PostOrPostsFetchStrategy} */ export interface PostOrPostsParams extends EndpointParams { /** * The `single` params corresponds to {@link PostParams} */ single: Partial; /** * The `archive` params corresponds to {@link PostsArchiveParams} */ archive: Partial; /** * The priority indicates which strategy should execute first. */ priority: 'single' | 'archive'; /** * How to handle route matching strategy, the possible values are: * * - `single` will only trigger the single strategy if there's a url match for the single strategy * - `archive` will only trigger the archive strategy if there's a url match for the archive strategy * - `both` requires a route match for both single and archive */ routeMatchStrategy: 'none' | 'single' | 'archive' | 'both'; } export type PostOrPostsFetchStrategyResult = { isSingle: boolean; isArchive: boolean; data: T | T[]; }; /** * This fetch strategy does not support extracting url params from the url * * @category Data Fetching */ export declare class PostOrPostsFetchStrategy = PostOrPostsFetchStrategyResult> extends AbstractFetchStrategy { urlParams: Partial

; postStrategy: SinglePostFetchStrategy; postsStrategy: PostsArchiveFetchStrategy; optimizeYoastPayload: boolean; getDefaultEndpoint(): string; getParamsFromURL(path: string, params?: Partial

): Partial

; isMainQuery(path: string, nonUrlParams: Partial

): boolean; normalizeForCache(data: FetchResponse, params: Partial

): NormalizedDataForCache; fetchSingle(url: string, params: PostParams, options?: Partial): Promise<{ result: R; isCached?: boolean; pageInfo: import("../types/index.js").PageInfo; queriedObject: import("../types/index.js").QueriedObject; }>; fetchArchive(url: string, params: PostsArchiveParams, options?: Partial): Promise<{ result: R; isCached?: boolean; pageInfo: import("../types/index.js").PageInfo; queriedObject: import("../types/index.js").QueriedObject; }>; fetcher(url: string, params: Partial

, options?: Partial): Promise>; }