/** * @bunkor/crypto — BaseClient * * Abstract base class providing authenticated HTTP transport for all Bunkor * domain clients. Uses the native `fetch` API — zero framework dependencies. * * Design pattern: Template Method * - Subclasses call `this.get()`, `this.post()`, etc. * - Auth injection, error normalisation and debug logging live here. * * Licensed under the Apache License, Version 2.0 */ import { BunkorConfig } from '../config'; /** A resolved, fully-configured Bunkor config (no optional fields). */ export type ResolvedConfig = Required> & Pick; /** Error thrown when the Bunkor server returns a non-2xx status. */ export declare class BunkorApiError extends Error { readonly status: number; readonly endpoint: string; constructor(status: number, endpoint: string, message: string); } export declare abstract class BaseClient { protected readonly config: ResolvedConfig; constructor(config: BunkorConfig); protected get(endpoint: string, params?: Record): Promise; protected post(endpoint: string, body?: unknown): Promise; protected postForm(endpoint: string, form: FormData): Promise; protected put(endpoint: string, body?: unknown): Promise; protected patch(endpoint: string, body?: unknown): Promise; protected delete(endpoint: string): Promise; /** * Execute an authenticated fetch against the Bunkor API. * * @param endpoint Path relative to `config.apiUrl` (must start with `/`). * @param init Standard `RequestInit` — the method, body, and extra headers. */ protected request(endpoint: string, init?: RequestInit): Promise; private stringifyParams; } //# sourceMappingURL=base.client.d.ts.map