blob: 84b4c925539f70da5042607402b3a444388a0d2f [file] [log] [blame]
Adrià Vilanova Martínez9c418ab2024-12-05 15:34:40 +01001import { ProtobufObject } from "../common/protojs.types";
2
3export interface ResponseModifierPort {
4 intercept(interception: InterceptedResponse): Promise<Result>;
5}
6
7/**
8 * Represents an intercepted response.
9 */
10export interface InterceptedResponse {
11 /**
12 * URL of the original request.
13 */
14 url: string;
15
16 /**
17 * Object with the response as intercepted without any modification.
18 */
19 originalResponse: ProtobufObject;
20}
21
22export type Result =
23 | { wasModified: false }
24 | {
25 wasModified: true;
26 modifiedResponse: ProtobufObject;
27 };