import { Result, URI } from "@adviser/cement"; import type { NotFoundError, SuperThis } from "@fireproof/core-types-base"; import type { UnsubscribeResult, VoidResult } from "./serde-gateway.js"; export interface GatewayOpts { readonly gateway: Gateway; } export type GetResult = Result; export interface Gateway { buildUrl(baseUrl: URI, key: string, sthis: SuperThis): Promise>; start(baseUrl: URI, sthis: SuperThis): Promise>; close(baseUrl: URI, sthis: SuperThis): Promise; destroy(baseUrl: URI, sthis: SuperThis): Promise; put(url: URI, body: Uint8Array, sthis: SuperThis): Promise; get(url: URI, sthis: SuperThis): Promise; delete(url: URI, sthis: SuperThis): Promise; subscribe?(url: URI, callback: (meta: Uint8Array) => void, sthis: SuperThis): Promise; getPlain(url: URI, key: string, sthis: SuperThis): Promise>; }