UNPKG

@scayle/storefront-core

Version:

Collection of essential utilities to work with the Storefront API

54 lines (53 loc) 1.92 kB
/** * Calculates the row index for an item given its overall index and pagination options. * * @param index The overall index of the item. * @param options Pagination options. Defaults to 2 columns, page 1, and 24 items per page. * @param options.columns * @param options.page * @param options.perPage * * @returns The calculated row index. * * @deprecated Row Disruption and associated functionality should be handled within the Storefront project itself. */ export declare const getRowByIndex: (index: number, options?: { columns: number; page: number; perPage: number; }) => number; /** * Filters disruptors for a specific row. * * @param row The row number. * @param disruptors An array of disruptor objects. * * @returns An array of disruptors belonging to the specified row. * * @deprecated Row Disruption and associated functionality should be handled within the Storefront project itself. */ export declare const getDisruptorsForRow: (row: number, disruptors: { insert_in_row: string; }[]) => object[]; /** * Checks if the given index is the first index of a row. * * @param index The index to check. * @param columns The number of columns. * * @returns True if the index is the first of a row, false otherwise. * * @deprecated Row Disruption and associated functionality should be handled within the Storefront project itself. */ export declare const isFirstIndexOfRow: (index: number, columns: number) => boolean; /** * Checks if a disruptor exists at a specific row. * * @param row The row number. * @param disruptorRows An array of disruptor row numbers as strings. * * @returns True if a disruptor exists at the specified row, false otherwise. * * @deprecated Row Disruption and associated functionality should be handled within the Storefront project itself. */ export declare const hasDisruptorAtRow: (row: number, disruptorRows: string[]) => boolean;