import { APITrait, StoreTrait } from "./interfaces"; import { Resource } from "../resource"; import { Response } from "src/server"; export declare class Trait extends Resource { /** * The trait's name. */ name: string; /** * The trait's slug. */ slug: string; /** * The trait's text. */ text: string; /** * ID of the report this trait belongs to. */ reportId: string; constructor(name: string, slug: string, text: string, reportId: string); /** * The name of the trait resource on the API server. */ static get resourceName(): string; /** * The name of the service containing the trait resource. */ static get serviceName(): string; /** * Convert the trait into a JSON serializable object for the API server. */ serializeAPI(): APITrait; /** * Deserialize the data from the API server. * * @param data The trait data from the API server. */ deserializeAPI(data: APITrait): void; /** * Serialize the trait into a format for storing in the Redux store. */ serializeRedux(): StoreTrait; /** * Handle any http errors. * * @param response The response. * * @returns `null`. */ protected static handleError(response: Response): null; /** * Create a trait from the API server data. * * @param data Data from the api server. * * @returns The trait object. */ static apiFactory(data: APITrait): Trait; /** * Create a trait from the Redux store data. * * @param data Data from the api server. * * @returns The trait object. */ static reduxFactory(data: StoreTrait): Trait; }