UNPKG

1.46 kBTypeScriptView Raw
1import { ResponseDataAccessor } from '../../odata-common';
2/**
3 * Methods to extract the data from OData v4 responses.
4 */
5/**
6 * Extract the collection data from the response.
7 * If the data does not contain a collection an empty array is returned.
8 * @param data - Response of the OData v4 service.
9 * @returns Collection extracted from the response.
10 */
11export declare function getCollectionResult(data: any): any[];
12/**
13 * Checks if the data contains a collection result.
14 * @param data - Response of the OData v4 service
15 * @returns `true`, if the data is a collection result
16 */
17export declare function isCollectionResult(data: any): boolean;
18/**
19 * Extract the collection data from the one to many link response.
20 * If the data does not contain a collection an empty array is returned.
21 * @param data - Response of the one to many link.
22 * @returns Collection extracted from the response.
23 */
24export declare function getLinkedCollectionResult(data: any): any[];
25/**
26 * Extract the single entry data from the response.
27 * If the data does not contain a single object an empty object is returned.
28 * @param data - Response of the OData v4 service.
29 * @returns A single object extracted from the response.
30 */
31export declare function getSingleResult(data: any): Record<string, any>;
32export declare const responseDataAccessor: ResponseDataAccessor;
33export { responseDataAccessor as responseDataAccessorV4 };
34//# sourceMappingURL=response-data-accessor.d.ts.map
\No newline at end of file