/** * BaseOperator — the REST CRUD boilerplate that every domain operator in * Nexior and PlatformFrontend had re-typed by hand (getAll/get/create/update/ * delete against `httpClient`). The apps inject their own axios instance and * the resource `key`; subclasses add domain-specific methods on top. * * Only the byte-identical convention is captured here — `/${key}/` for the * collection (trailing slash) and `/${key}/${id}` for the item. The two genuine * variations are config, not forks: `updateMethod` (PUT vs PATCH) and * `detailTrailingSlash` (`/${key}/${id}` vs `/${key}/${id}/`). Operators whose * routing differs further (custom base paths, missing verbs, action dispatch) * keep their own code and simply don't extend this. * * `axios` is a peer dependency — the consumer's installed version is used. */ import type { AxiosInstance, AxiosResponse } from 'axios'; export interface ListQuery { limit?: number; offset?: number; ordering?: string; [key: string]: unknown; } export interface BaseOperatorOptions { /** HTTP verb used by `update()`. Default `'put'`. */ updateMethod?: 'put' | 'patch'; /** Trailing slash on item URLs (get/update/delete by id). Default `false` → `/${key}/${id}`. */ detailTrailingSlash?: boolean; } export declare class BaseOperator { protected http: AxiosInstance; key: string; protected updateMethod: 'put' | 'patch'; protected detailTrailingSlash: boolean; constructor(http: AxiosInstance, key: string, options?: BaseOperatorOptions); /** Collection URL: `/${key}/`. */ protected listUrl(): string; /** Item URL: `/${key}/${id}` (or with trailing slash when configured). */ protected detailUrl(id: string): string; getAll(query?: ListQuery): Promise>; get(id: string): Promise>; create(data: TModel): Promise>; update(id: string, data: TModel): Promise>; delete(id: string): Promise>; } //# sourceMappingURL=index.d.ts.map