import { IkasBlogList } from "../../../storefront-models/src"; /** * Calculates the total number of pages in a blog list based on item count and page limit. * * @ai-category BlogList, Pagination * @ai-related hasBlogListPrevPage, hasBlogListNextPage, getBlogListPage * * @param list - The blog list instance to calculate page count for. * @returns The total number of pages, rounded up to the nearest integer. * * @example * ```typescript * import { getBlogListPageCount } from "@ikas/bp-storefront"; * * const totalPages = getBlogListPageCount(blogList); * console.log(`There are ${totalPages} pages of blog posts.`); * ``` */ export declare function getBlogListPageCount(list: IkasBlogList): number; /** * Checks whether the blog list is configured as a static list with manually selected blog posts. * * @ai-category BlogList, Listing * @ai-related getBlogListInitialData, getBlogListPageCount * * @param list - The blog list instance to check. * @returns True if the list type is "STATIC", false otherwise. * * @example * ```typescript * import { isBlogListStatic } from "@ikas/bp-storefront"; * * if (isBlogListStatic(blogList)) { * console.log("This list uses statically selected blog posts."); * } * ``` */ export declare function isBlogListStatic(list: IkasBlogList): boolean; /** * Determines whether a previous page of blog posts is available for loading. * * @ai-category BlogList, Pagination * @ai-related hasBlogListNextPage, getBlogListPrevPage, getBlogListPageCount * * @param list - The blog list instance to check. * @returns True if there is a previous page available, false if the list is static or already at the first page. * * @example * ```typescript * import { hasBlogListPrevPage } from "@ikas/bp-storefront"; * * if (hasBlogListPrevPage(blogList)) { * console.log("Previous page of blog posts is available."); * } * ``` */ export declare function hasBlogListPrevPage(list: IkasBlogList): boolean; /** * Determines whether a next page of blog posts is available for loading. * * @ai-category BlogList, Pagination * @ai-related hasBlogListPrevPage, getBlogListNextPage, getBlogListPageCount * * @param list - The blog list instance to check. * @returns True if there are more pages of blog posts beyond the current page, false if the list is static or at the last page. * * @example * ```typescript * import { hasBlogListNextPage } from "@ikas/bp-storefront"; * * if (hasBlogListNextPage(blogList)) { * console.log("More blog posts are available on the next page."); * } * ``` */ export declare function hasBlogListNextPage(list: IkasBlogList): boolean; /** * Fetches and populates the initial data for a blog list, handling both static and dynamic list types. * * @ai-category BlogList, Listing * @ai-related isBlogListStatic, getBlogListPageCount, getBlogListPage * * @param list - The blog list instance to initialize with data from the API. * @returns A promise that resolves when the initial data has been loaded and assigned to the list. * * @example * ```typescript * import { getBlogListInitialData } from "@ikas/bp-storefront"; * * await getBlogListInitialData(blogList); * console.log("Blog list initialized:", blogList.data); * ``` */ export declare function getBlogListInitialData(list: IkasBlogList): Promise; /** * Loads the previous page of blog posts and prepends the results to the existing list data. * * @ai-category BlogList, Pagination * @ai-related getBlogListNextPage, hasBlogListPrevPage, getBlogListPage * * @param list - The blog list instance to load the previous page for. * @returns A promise that resolves when the previous page data has been prepended, or returns immediately if the list is static, already loading, or has no previous page. * * @example * ```typescript * import { getBlogListPrevPage } from "@ikas/bp-storefront"; * * await getBlogListPrevPage(blogList); * console.log("Previous page loaded:", blogList.data); * ``` */ export declare function getBlogListPrevPage(list: IkasBlogList): Promise; /** * Loads the next page of blog posts and appends the results to the existing list data. * * @ai-category BlogList, Pagination * @ai-related getBlogListPrevPage, hasBlogListNextPage, getBlogListPage * * @param list - The blog list instance to load the next page for. * @returns A promise that resolves when the next page data has been appended, or returns immediately if the list is static, already loading, or has no next page. * * @example * ```typescript * import { getBlogListNextPage } from "@ikas/bp-storefront"; * * await getBlogListNextPage(blogList); * console.log("Next page loaded:", blogList.data); * ``` */ export declare function getBlogListNextPage(list: IkasBlogList): Promise; /** * Navigates to a specific page of blog posts, replacing the current list data with the requested page. * * @ai-category BlogList, Pagination * @ai-related getBlogListPrevPage, getBlogListNextPage, getBlogListPageCount * * @param list - The blog list instance to navigate. * @param page - The page number to load. * @returns A promise that resolves when the specified page data has been loaded, or returns immediately if the list is static or already loading. * * @example * ```typescript * import { getBlogListPage } from "@ikas/bp-storefront"; * * await getBlogListPage(blogList, 3); * console.log("Page 3 loaded:", blogList.data); * ``` */ export declare function getBlogListPage(list: IkasBlogList, page: number): Promise;