import { Attributes, NewResourceObject } from '../types'; export declare class ApiResourceObject { private data; constructor(resourceObject: D); /** * Static helper to build a new ApiResourceObject. * * @param resourceObject */ static of(resourceObject: S): ApiResourceObject; static of(resourceObject: S[]): ApiResourceObject[]; /** * Apply the supplied function to the internal data and * return a new ApiResourceObject containing the result. * * @param f A function that accepts a iResource object and returns another */ map(f: (x: D) => D): ApiResourceObject; /** * Build a new ResourceObject of the given type and attributes * (optionally providing and id) * * @param type * @param attributes * @param id */ static build(type: string, attributes: Attributes, id?: string): ApiResourceObject<{ type: string; id: string | undefined; attributes: Attributes; }>; /** * Return the type */ type(): D["type"]; /** * Return the ID */ id(): D["id"]; /** * Return all Attributes */ attributes(): D["attributes"]; /** * Return a single Attribute value * * @param name */ attribute(name: string): unknown; /** * Return all Relationships */ relationships(): { [x: string]: any; }; /** * Return a single Relationship value * * @param name */ relationship(name: string): any; /** * Update the attributes of the ResourceObject * * @param payload */ update(payload?: Attributes): ApiResourceObject; /** * Add a relationship to the ResourceObject by type and id * * @param relationship * @param typeOrResourceObject * @param id */ addRelationship(relationship: string, typeOrResourceObject: string | ApiResourceObject, id?: string): ApiResourceObject; /** * Removes a relationship from the ResourceObject * * @param type * @param id */ removeRelationship(type: string, id: string): ApiResourceObject; /** * Set a to-one relationship to the given type and id * * @param relationship * @param typeOrResourceObject * @param id */ setRelationship(relationship: string, typeOrResourceObject: string | ApiResourceObject, id?: string): ApiResourceObject; /** * Returns the ResourceObject with the relationships stripped * * @return ResourceObject */ withoutRelationships(): ApiResourceObject>; /** * Output ResourceObject as a JSON-serializable object * * @param includeRelationships */ toJSON(includeRelationships?: boolean): D; }