import { Response } from '../types'; import { ApiError } from './ApiError'; import { ApiResourceObject } from './ApiResourceObject'; export declare class ApiResponse { private response; constructor(response: D); static of(response: S): ApiResponse; map(f: (x: D) => D): ApiResponse; /** * Retrieve the data from the response * as an ApiResourceObject or array of ApiResourceObjects */ data(): ApiResourceObject | ApiResourceObject[] | undefined; /** * Retrieve all errors as an array of ApiErrors */ errors(): ApiError[]; /** * Does the JsonApi response have an error? */ hasError(): boolean; /** * Retrieves all includes an array of ApiResourceObjects */ included(): ApiResourceObject[]; /** * Expand a partial ApiResourceObject to the version in the includes. This is * useful for retrieving the full data from a relationships. * * @param entity An partial ApiResourceObject with only `id` and `type` fields */ expandInclude(entity: ApiResourceObject): ApiResourceObject | undefined; meta(name: string): any; /** * Map to the original JSON object */ toJSON(): D; }