@scayle/storefront-nuxt
Version:
Nuxt integration for the SCAYLE Commerce Engine and Storefront API
14 lines (13 loc) • 613 B
TypeScript
import type { LocationQuery } from 'vue-router';
/**
* Retrieves the current page number from the Vue Router query object.
*
* This function attempts to extract the 'page' parameter from the provided `query` object.
* It handles cases where the 'page' parameter is a string and parses it as an integer.
* If the 'page' parameter is not a string or not present, it returns undefined.
*
* @param query The Vue Router query object.
*
* @returns The current page number as a number, or undefined if not found or invalid.
*/
export declare const getCurrentPage: (query: LocationQuery) => number | undefined;