{"version":3,"file":"HttpInterface.mjs","sources":["../../src/HttpInterface.ts"],"sourcesContent":["import { InterfaceImplementationMissingError } from './errors';\nimport { HttpRequest } from './HttpRequest';\nimport { HttpResponse } from './HttpResponse';\n\n/**\n * Defines the interface for an HTTP client.\n *\n * @category Context and Interfaces\n */\nexport interface HttpInterface {\n  /** Sends a HTTP request and returns its response. */\n  send: <ResponseData, RequestData = any>(\n    request: HttpRequest<RequestData>\n  ) => Promise<HttpResponse<ResponseData>>;\n}\n\n/**\n * An implementation of the {@link HttpInterface} that throws an error when called.\n * @category Http\n */\nexport function createNullHttp(): HttpInterface {\n  const errorHandler = () => {\n    throw new InterfaceImplementationMissingError('HttpInterface', 'http');\n  };\n  return { send: errorHandler };\n}\n"],"names":["createNullHttp","errorHandler","InterfaceImplementationMissingError","send"],"mappings":";;AAgBA;AACA;AACA;AACA;AACO,SAASA,cAAc,GAAkB;EAC9C,MAAMC,YAAY,GAAG,MAAM;AACzB,IAAA,MAAM,IAAIC,mCAAmC,CAAC,eAAe,EAAE,MAAM,CAAC,CAAA;GACvE,CAAA;EACD,OAAO;AAAEC,IAAAA,IAAI,EAAEF,YAAAA;GAAc,CAAA;AAC/B;;;;"}