import { ComponentType } from 'react'; import { HttpMethod, OpenAPICallbackData } from '../../types/openapi'; /** * An operation's `callbacks`: requests the API sends back out to the caller * after this operation runs. Each callback's leaf is an ordinary Operation * Object, so it renders through PathOperation itself rather than a lesser * parallel rendering that would drift from it. * * The direction is inverted from everything else in the panel, though. Here * the API is the sender and the reader is the server, so the set is framed * with who calls what before the reused operation view (whose own wording * assumes the reader is the caller) appears. * * The spec nests these two deep (callback name, then URL expression, then * method), but that hierarchy isn't worth making a reader navigate: it's * flattened to one card per operation, each titled with all three parts, so * every request body has its own labelled home. */ /** Injected to avoid an import cycle: PathOperation renders this file, and this file renders PathOperation back. */ type OperationRenderer = ComponentType<{ method: HttpMethod; path: string; op: OpenAPICallbackData[string][HttpMethod] & object; id: string | null; idPrefix?: string; depth?: number; }>; interface OperationCallbacksProps { callbacks: Record; /** Parent operation's anchor id, used to keep nested anchors unique. */ id: string | null; renderOperation: OperationRenderer; /** Nesting level of the parent operation, so a callback's own callbacks don't recurse without end. */ depth: number; } export default function OperationCallbacks({ callbacks, id, renderOperation: RenderOperation, depth, }: OperationCallbacksProps): import("react").JSX.Element | null; export {};