diff --git a/lib/src/request.ts b/lib/src/request.ts index dc11bf2e..f278b9ac 100644 --- a/lib/src/request.ts +++ b/lib/src/request.ts @@ -6,5 +6,5 @@ export type { ResourceTiming } from './request/ResourceTiming.js'; export type { CommonMediaRequest } from './request/CommonMediaRequest.js'; export type { CommonMediaResponse } from './request/CommonMediaResponse.js'; -export type { RequestPlugin } from './request/RequestPlugin.js'; -export type { ResponsePlugin } from './request/ResponsePlugin.js'; +export type { RequestInterceptor } from './request/RequestInterceptor.js'; +export type { ResponseInterceptor } from './request/ResponseInterceptor.js'; diff --git a/lib/src/request/RequestInterceptor.ts b/lib/src/request/RequestInterceptor.ts new file mode 100644 index 00000000..82165094 --- /dev/null +++ b/lib/src/request/RequestInterceptor.ts @@ -0,0 +1,10 @@ +import { CommonMediaRequest } from './CommonMediaRequest.js'; + +/** + * Request interceptor API. + * @param request - The request to be executed. + * @returns A promise with updated request that is resolved when the interceptor has completed the process of the request. + * + * @group Request + */ +export type RequestInterceptor = (request: CommonMediaRequest) => Promise diff --git a/lib/src/request/RequestPlugin.ts b/lib/src/request/RequestPlugin.ts deleted file mode 100644 index 582e6f09..00000000 --- a/lib/src/request/RequestPlugin.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { CommonMediaRequest } from './CommonMediaRequest.js'; - -/** - * Request plugin API. - * @param request - The request to be executed. - * @returns A promise that is resolved when the plugin has completed the manipulation of the request. - * - * @group Request - */ -export type RequestPlugin = (request: CommonMediaRequest) => Promise diff --git a/lib/src/request/ResponseInterceptor.ts b/lib/src/request/ResponseInterceptor.ts new file mode 100644 index 00000000..22ab8c7f --- /dev/null +++ b/lib/src/request/ResponseInterceptor.ts @@ -0,0 +1,10 @@ +import { CommonMediaResponse } from './CommonMediaResponse.js'; + +/** + * Response interceptor API. + * @param response - The received response. + * @returns A promise with updated response that is resolved when the interceptor has completed the process of the response. + * + * @group Request + */ +export type ResponseInterceptor = (response: CommonMediaResponse) => Promise diff --git a/lib/src/request/ResponsePlugin.ts b/lib/src/request/ResponsePlugin.ts deleted file mode 100644 index cdd5b6f4..00000000 --- a/lib/src/request/ResponsePlugin.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { CommonMediaResponse } from './CommonMediaResponse.js'; - -/** - * Response plugin API. - * @param response - The received response. - * @returns A promise that is resolved when the plugin has completed the manipulation of the response. - * - * @group Request - */ -export type ResponsePlugin = (response: CommonMediaResponse) => Promise