import type { ApiErrorCode } from "./common/envelope";
import type { ApiAuthRequirement, ApiResponseKind, HTTPMethod } from "./common/types";
/**
 * Shared endpoint-shape primitives live here so extracted endpoint families can stay
 * out of `types.ts` without reintroducing circular imports through the aggregate layer.
 */
export type APIEndpoint<TBody = unknown, TQuery = unknown, TResponse = unknown> = {
    path: string;
    method: HTTPMethod;
    body?: TBody;
    query?: TQuery;
    response?: TResponse;
    /**
     * Optional list of error codes this endpoint expects callers to handle explicitly.
     *
     * Intentionally non-exhaustive: endpoints may still return other ApiErrorCode values.
     * Use this for “bespoke UX” handling (e.g. `auth:sudo_required`, plan limits, etc).
     */
    errors?: readonly ApiErrorCode[];
    revalidate?: number;
    tags?: string[];
    responseKind?: ApiResponseKind;
    auth?: ApiAuthRequirement;
};
