UNPKG

@woocommerce/data

Version:
26 lines 1.16 kB
/** * Internal dependencies */ import { BaseQueryParams } from './types/query-params'; export declare function getResourceName(prefix: string, ...identifier: unknown[]): string; /** * Generate a resource name for order totals count. * * It omits query parameters from the identifier that don't affect * totals values like pagination and response field filtering. * * @param {string} prefix Resource name prefix. * @param {Object} query Query for order totals count. * @return {string} Resource name for order totals. */ export declare function getTotalCountResourceName(prefix: string, query: Record<string, unknown>): string; export declare function getResourcePrefix(resourceName: string): string; export declare function isResourcePrefix(resourceName: string, prefix: string): boolean; export declare function getResourceIdentifier(resourceName: string): any; export declare function request<Query extends BaseQueryParams, DataType>(namespace: string, query: Partial<Query>): Generator<unknown, { items: DataType[]; totalCount: number; } | undefined, DataType[] | ({ data: DataType[]; } & Response)>; //# sourceMappingURL=utils.d.ts.map