import { ChainedNamespace } from "./protocol"; export type ClientMode = "popup" | "iframe"; export type WindowHandling = "keep" | "close"; export type AbstractRequest = { id: number; namespace: NS | ChainedNamespace; method: string; params: Params; metadata?: unknown; }; export type AbstractSuccessResponse = { id: number; namespace: NS | ChainedNamespace; method: string; windowHandling: WindowHandling; result: Result; }; export type AbstractErrorResponse = { id: number; namespace: NS | ChainedNamespace; method: string; windowHandling: WindowHandling; error: { code: number; message: string }; }; export type AbstractResponse = | AbstractSuccessResponse | AbstractErrorResponse;