import { HttpMethod } from '../../types/request.types'; import { EndpointDefinition } from './AbstractEndpoint.types'; interface EndpointOptions { headers?: AbstractEndpoint['definition']['headers']; parameters?: AbstractEndpoint['definition']['parameters']; } export declare abstract class AbstractEndpoint { /** * HTTP method. */ readonly method: HttpMethod; /** * Name of the endpoint. */ abstract readonly name: string; /** * URL path of the API endpoint. Can contain path variables like `:variable`. */ abstract readonly path: string; /** * The property in the request body and response body. If the response body * property differs, set responseProperty alongside property. * If the property is undefined, the endpoint will be called without a namespace. */ readonly property: string | undefined; /** * Property used in the response. Falls back to `this.property` if it's not * set. */ readonly responseProperty: string | undefined; /** * Timeout in milliseconds. * This is used to override the default timeout of the client. */ readonly timeout: number | undefined; /** * Whether to wrap the request body in a `{ data: ... }` envelope and unwrap * `response.data` from the response. Set to `false` for endpoints whose API * does not use the data envelope; `property` and `responseProperty` are then * also ignored, and the body is sent and returned as-is. */ readonly useDataEnvelope: boolean; /** * Used to expose EndpointDefinition type. */ readonly definition: D; /** * Headers to include when calling this endpoint. */ private readonly headers; /** * Parameters to include in the endpoint url. */ private readonly parameters; constructor(options?: EndpointOptions); getHeaders(): AbstractEndpoint['definition']['headers']; getParameters(): AbstractEndpoint['definition']['parameters']; getPath(): AbstractEndpoint['path']; getProperty(): AbstractEndpoint['property']; getResponseProperty(): AbstractEndpoint['responseProperty']; getTimeout(): AbstractEndpoint['timeout']; getUseDataEnvelope(): AbstractEndpoint['useDataEnvelope']; } export {};